From 0beea7fd96cc32965a4e8bcc3c7de9608694accb Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Wed, 14 Apr 2010 16:24:41 +1000 Subject: Gstreamer media backend: seek to media start on end of stream. To ensure the sequential play() calls work without setMedia(). Since in many case new media is assigned to playback after EOS, seeking is delayed and performed just before playing the same media. Task-number: QTBUG-9798 Reviewed-by: Andrew den Exter --- .../mediaplayer/qgstreamerplayercontrol.cpp | 98 ++++++++++++++++------ .../mediaplayer/qgstreamerplayercontrol.h | 2 + 2 files changed, 76 insertions(+), 24 deletions(-) diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp index e646693..6dd914a 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp @@ -62,6 +62,7 @@ QGstreamerPlayerControl::QGstreamerPlayerControl(QGstreamerPlayerSession *sessio , m_state(QMediaPlayer::StoppedState) , m_mediaStatus(QMediaPlayer::NoMedia) , m_bufferProgress(-1) + , m_seekToStartPending(false) , m_stream(0) , m_fifoNotifier(0) , m_fifoCanWrite(false) @@ -107,7 +108,7 @@ QGstreamerPlayerControl::~QGstreamerPlayerControl() qint64 QGstreamerPlayerControl::position() const { - return m_session->position(); + return m_seekToStartPending ? 0 : m_session->position(); } qint64 QGstreamerPlayerControl::duration() const @@ -170,37 +171,77 @@ void QGstreamerPlayerControl::setPlaybackRate(qreal rate) void QGstreamerPlayerControl::setPosition(qint64 pos) { - m_session->seek(pos); + if (m_mediaStatus == QMediaPlayer::EndOfMedia) { + m_mediaStatus = QMediaPlayer::LoadedMedia; + emit mediaStatusChanged(m_mediaStatus); + } + + if (m_session->seek(pos)) + m_seekToStartPending = false; } void QGstreamerPlayerControl::play() { - if (m_session->play()) { - if (m_state != QMediaPlayer::PlayingState) - emit stateChanged(m_state = QMediaPlayer::PlayingState); - } + playOrPause(QMediaPlayer::PlayingState); } void QGstreamerPlayerControl::pause() { - if (m_session->pause()) { - if (m_state != QMediaPlayer::PausedState) - emit stateChanged(m_state = QMediaPlayer::PausedState); - } + playOrPause(QMediaPlayer::PausedState); } -void QGstreamerPlayerControl::stop() +void QGstreamerPlayerControl::playOrPause(QMediaPlayer::State newState) { - if (m_state != QMediaPlayer::StoppedState) { + QMediaPlayer::State oldState = m_state; + QMediaPlayer::MediaStatus oldMediaStatus = m_mediaStatus; + + if (m_mediaStatus == QMediaPlayer::EndOfMedia) + m_mediaStatus = QMediaPlayer::BufferedMedia; + + if (m_seekToStartPending) { m_session->pause(); if (!m_session->seek(0)) { m_bufferProgress = -1; m_session->stop(); - m_session->pause(); + m_mediaStatus = QMediaPlayer::LoadingMedia; } + m_seekToStartPending = false; + } + + bool ok = false; + if (newState == QMediaPlayer::PlayingState) + ok = m_session->play(); + else + ok = m_session->pause(); + + if (!ok) + return; + + m_state = newState; + + if (m_mediaStatus == QMediaPlayer::EndOfMedia || m_mediaStatus == QMediaPlayer::LoadedMedia) { + if (m_bufferProgress == -1 || m_bufferProgress == 100) + m_mediaStatus = QMediaPlayer::BufferedMedia; + else + m_mediaStatus = QMediaPlayer::BufferingMedia; + } + + if (m_state != oldState) + emit stateChanged(m_state); + if (m_mediaStatus != oldMediaStatus) + emit mediaStatusChanged(m_mediaStatus); + +} + +void QGstreamerPlayerControl::stop() +{ + if (m_state != QMediaPlayer::StoppedState) { + m_state = QMediaPlayer::StoppedState; + m_session->pause(); + m_seekToStartPending = true; + updateState(m_session->state()); emit positionChanged(0); - if (m_state != QMediaPlayer::StoppedState) - emit stateChanged(m_state = QMediaPlayer::StoppedState); + emit stateChanged(m_state); } } @@ -244,6 +285,7 @@ void QGstreamerPlayerControl::setMedia(const QMediaContent &content, QIODevice * m_currentResource = content; m_stream = stream; + m_seekToStartPending = false; QUrl url; @@ -255,7 +297,7 @@ void QGstreamerPlayerControl::setMedia(const QMediaContent &content, QIODevice * url = content.canonicalUrl(); } - m_session->load(url); + m_session->load(url); if (m_fifoFd[1] >= 0) { m_fifoCanWrite = true; @@ -296,24 +338,34 @@ bool QGstreamerPlayerControl::isVideoAvailable() const void QGstreamerPlayerControl::updateState(QMediaPlayer::State state) { QMediaPlayer::MediaStatus oldStatus = m_mediaStatus; + QMediaPlayer::State oldState = m_state; switch (state) { case QMediaPlayer::StoppedState: - if (m_state != QMediaPlayer::StoppedState) - emit stateChanged(m_state = QMediaPlayer::StoppedState); + m_state = QMediaPlayer::StoppedState; + if (m_currentResource.isNull()) + m_mediaStatus = QMediaPlayer::NoMedia; + else + m_mediaStatus = QMediaPlayer::LoadingMedia; break; case QMediaPlayer::PlayingState: case QMediaPlayer::PausedState: - if (m_state == QMediaPlayer::StoppedState) + if (m_state == QMediaPlayer::StoppedState) { m_mediaStatus = QMediaPlayer::LoadedMedia; - else { - if (m_bufferProgress == -1) + } else { + if (m_bufferProgress == -1 || m_bufferProgress == 100) m_mediaStatus = QMediaPlayer::BufferedMedia; } break; } + //EndOfMedia status should be kept, until reset by pause, play or setMedia + if (oldStatus == QMediaPlayer::EndOfMedia) + m_mediaStatus = QMediaPlayer::EndOfMedia; + + if (m_state != oldState) + emit stateChanged(m_state); if (m_mediaStatus != oldStatus) emit mediaStatusChanged(m_mediaStatus); } @@ -321,9 +373,7 @@ void QGstreamerPlayerControl::updateState(QMediaPlayer::State state) void QGstreamerPlayerControl::processEOS() { m_mediaStatus = QMediaPlayer::EndOfMedia; - m_state = QMediaPlayer::StoppedState; - - emit stateChanged(m_state); + stop(); emit mediaStatusChanged(m_mediaStatus); } diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h index 0c53945..1764eb0 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h @@ -114,11 +114,13 @@ private Q_SLOTS: private: bool openFifo(); void closeFifo(); + void playOrPause(QMediaPlayer::State state); QGstreamerPlayerSession *m_session; QMediaPlayer::State m_state; QMediaPlayer::MediaStatus m_mediaStatus; int m_bufferProgress; + bool m_seekToStartPending; QMediaContent m_currentResource; QIODevice *m_stream; QSocketNotifier *m_fifoNotifier; -- cgit v0.12 From e85223d233c0e1d6beca748332b8fbaba3ebbf2d Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 15 Apr 2010 19:08:00 +1000 Subject: Create Mediaservices lib, separate from Multimedia. --- bin/syncqt | 3 +- configure | 55 +- demos/multimedia/player/player.cpp | 12 +- demos/multimedia/player/player.pro | 2 +- demos/multimedia/player/playercontrols.h | 2 +- demos/multimedia/player/videowidget.h | 2 +- mkspecs/features/qt.prf | 3 +- src/3rdparty/webkit/WebCore/WebCore.pro | 4 +- src/imports/multimedia/multimedia.cpp | 2 +- src/imports/multimedia/multimedia.pro | 2 +- src/imports/multimedia/qdeclarativeaudio.cpp | 2 +- src/imports/multimedia/qdeclarativemediabase.cpp | 8 +- src/imports/multimedia/qdeclarativemediabase_p.h | 2 +- src/imports/multimedia/qdeclarativevideo.cpp | 152 +- src/imports/multimedia/qdeclarativevideo_p.h | 2 +- .../multimedia/qmetadatacontrolmetaobject.cpp | 152 +- .../multimedia/qmetadatacontrolmetaobject_p.h | 2 +- src/multimedia/audio/audio.pri | 73 - src/multimedia/audio/qaudio.cpp | 104 -- src/multimedia/audio/qaudio.h | 71 - src/multimedia/audio/qaudio_mac.cpp | 142 -- src/multimedia/audio/qaudio_mac_p.h | 144 -- src/multimedia/audio/qaudio_symbian_p.cpp | 395 ----- src/multimedia/audio/qaudio_symbian_p.h | 156 -- src/multimedia/audio/qaudiodevicefactory.cpp | 257 ---- src/multimedia/audio/qaudiodevicefactory_p.h | 97 -- src/multimedia/audio/qaudiodeviceinfo.cpp | 400 ----- src/multimedia/audio/qaudiodeviceinfo.h | 114 -- src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 486 ------ src/multimedia/audio/qaudiodeviceinfo_alsa_p.h | 117 -- src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp | 357 ----- src/multimedia/audio/qaudiodeviceinfo_mac_p.h | 97 -- .../audio/qaudiodeviceinfo_symbian_p.cpp | 200 --- src/multimedia/audio/qaudiodeviceinfo_symbian_p.h | 107 -- src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp | 433 ------ src/multimedia/audio/qaudiodeviceinfo_win32_p.h | 112 -- src/multimedia/audio/qaudioengine.cpp | 343 ----- src/multimedia/audio/qaudioengine.h | 131 -- src/multimedia/audio/qaudioengineplugin.cpp | 54 - src/multimedia/audio/qaudioengineplugin.h | 93 -- src/multimedia/audio/qaudioformat.cpp | 407 ----- src/multimedia/audio/qaudioformat.h | 107 -- src/multimedia/audio/qaudioinput.cpp | 432 ------ src/multimedia/audio/qaudioinput.h | 111 -- src/multimedia/audio/qaudioinput_alsa_p.cpp | 706 --------- src/multimedia/audio/qaudioinput_alsa_p.h | 158 -- src/multimedia/audio/qaudioinput_mac_p.cpp | 956 ------------ src/multimedia/audio/qaudioinput_mac_p.h | 169 --- src/multimedia/audio/qaudioinput_symbian_p.cpp | 594 -------- src/multimedia/audio/qaudioinput_symbian_p.h | 188 --- src/multimedia/audio/qaudioinput_win32_p.cpp | 613 -------- src/multimedia/audio/qaudioinput_win32_p.h | 159 -- src/multimedia/audio/qaudiooutput.cpp | 411 ----- src/multimedia/audio/qaudiooutput.h | 111 -- src/multimedia/audio/qaudiooutput_alsa_p.cpp | 780 ---------- src/multimedia/audio/qaudiooutput_alsa_p.h | 166 --- src/multimedia/audio/qaudiooutput_mac_p.cpp | 712 --------- src/multimedia/audio/qaudiooutput_mac_p.h | 167 --- src/multimedia/audio/qaudiooutput_symbian_p.cpp | 697 --------- src/multimedia/audio/qaudiooutput_symbian_p.h | 210 --- src/multimedia/audio/qaudiooutput_win32_p.cpp | 606 -------- src/multimedia/audio/qaudiooutput_win32_p.h | 156 -- src/multimedia/base/base.pri | 69 - src/multimedia/base/qgraphicsvideoitem.cpp | 437 ------ src/multimedia/base/qgraphicsvideoitem.h | 112 -- .../base/qlocalmediaplaylistprovider.cpp | 196 --- src/multimedia/base/qlocalmediaplaylistprovider.h | 87 -- src/multimedia/base/qmediacontent.cpp | 242 --- src/multimedia/base/qmediacontent.h | 93 -- src/multimedia/base/qmediacontrol.cpp | 140 -- src/multimedia/base/qmediacontrol.h | 82 - src/multimedia/base/qmediacontrol_p.h | 74 - src/multimedia/base/qmediaobject.cpp | 419 ------ src/multimedia/base/qmediaobject.h | 121 -- src/multimedia/base/qmediaobject_p.h | 95 -- src/multimedia/base/qmediaplaylist.cpp | 724 --------- src/multimedia/base/qmediaplaylist.h | 147 -- src/multimedia/base/qmediaplaylist_p.h | 172 --- src/multimedia/base/qmediaplaylistcontrol.cpp | 204 --- src/multimedia/base/qmediaplaylistcontrol.h | 97 -- src/multimedia/base/qmediaplaylistioplugin.cpp | 192 --- src/multimedia/base/qmediaplaylistioplugin.h | 126 -- src/multimedia/base/qmediaplaylistnavigator.cpp | 545 ------- src/multimedia/base/qmediaplaylistnavigator.h | 116 -- src/multimedia/base/qmediaplaylistprovider.cpp | 308 ---- src/multimedia/base/qmediaplaylistprovider.h | 114 -- src/multimedia/base/qmediaplaylistprovider_p.h | 75 - src/multimedia/base/qmediapluginloader.cpp | 135 -- src/multimedia/base/qmediapluginloader_p.h | 92 -- src/multimedia/base/qmediaresource.cpp | 399 ----- src/multimedia/base/qmediaresource.h | 134 -- src/multimedia/base/qmediaservice.cpp | 140 -- src/multimedia/base/qmediaservice.h | 90 -- src/multimedia/base/qmediaservice_p.h | 75 - src/multimedia/base/qmediaserviceprovider.cpp | 738 --------- src/multimedia/base/qmediaserviceprovider.h | 174 --- src/multimedia/base/qmediaserviceproviderplugin.h | 125 -- src/multimedia/base/qmediatimerange.cpp | 708 --------- src/multimedia/base/qmediatimerange.h | 135 -- src/multimedia/base/qmetadatacontrol.cpp | 185 --- src/multimedia/base/qmetadatacontrol.h | 92 -- src/multimedia/base/qpaintervideosurface.cpp | 1565 -------------------- src/multimedia/base/qpaintervideosurface_mac.mm | 283 ---- src/multimedia/base/qpaintervideosurface_mac_p.h | 100 -- src/multimedia/base/qpaintervideosurface_p.h | 178 --- src/multimedia/base/qtmedianamespace.h | 194 --- src/multimedia/base/qtmedianamespace.qdoc | 214 --- src/multimedia/base/qvideodevicecontrol.cpp | 155 -- src/multimedia/base/qvideodevicecontrol.h | 90 -- src/multimedia/base/qvideooutputcontrol.cpp | 135 -- src/multimedia/base/qvideooutputcontrol.h | 91 -- src/multimedia/base/qvideorenderercontrol.cpp | 124 -- src/multimedia/base/qvideorenderercontrol.h | 77 - src/multimedia/base/qvideowidget.cpp | 944 ------------ src/multimedia/base/qvideowidget.h | 131 -- src/multimedia/base/qvideowidget_p.h | 271 ---- src/multimedia/base/qvideowidgetcontrol.cpp | 235 --- src/multimedia/base/qvideowidgetcontrol.h | 105 -- src/multimedia/base/qvideowindowcontrol.cpp | 275 ---- src/multimedia/base/qvideowindowcontrol.h | 111 -- src/multimedia/effects/effects.pri | 26 - src/multimedia/effects/qsoundeffect.cpp | 207 --- src/multimedia/effects/qsoundeffect_p.h | 109 -- src/multimedia/effects/qsoundeffect_pulse_p.cpp | 499 ------- src/multimedia/effects/qsoundeffect_pulse_p.h | 137 -- src/multimedia/effects/qsoundeffect_qmedia_p.cpp | 132 -- src/multimedia/effects/qsoundeffect_qmedia_p.h | 103 -- src/multimedia/effects/qsoundeffect_qsound_p.cpp | 131 -- src/multimedia/effects/qsoundeffect_qsound_p.h | 102 -- src/multimedia/effects/wavedecoder_p.cpp | 151 -- src/multimedia/effects/wavedecoder_p.h | 133 -- src/multimedia/mediaservices/base/base.pri | 69 + .../mediaservices/base/qgraphicsvideoitem.cpp | 437 ++++++ .../mediaservices/base/qgraphicsvideoitem.h | 112 ++ .../base/qlocalmediaplaylistprovider.cpp | 196 +++ .../base/qlocalmediaplaylistprovider.h | 87 ++ .../mediaservices/base/qmediacontent.cpp | 242 +++ src/multimedia/mediaservices/base/qmediacontent.h | 93 ++ .../mediaservices/base/qmediacontrol.cpp | 140 ++ src/multimedia/mediaservices/base/qmediacontrol.h | 82 + .../mediaservices/base/qmediacontrol_p.h | 74 + src/multimedia/mediaservices/base/qmediaobject.cpp | 419 ++++++ src/multimedia/mediaservices/base/qmediaobject.h | 121 ++ src/multimedia/mediaservices/base/qmediaobject_p.h | 95 ++ .../mediaservices/base/qmediaplaylist.cpp | 724 +++++++++ src/multimedia/mediaservices/base/qmediaplaylist.h | 147 ++ .../mediaservices/base/qmediaplaylist_p.h | 172 +++ .../mediaservices/base/qmediaplaylistcontrol.cpp | 204 +++ .../mediaservices/base/qmediaplaylistcontrol.h | 97 ++ .../mediaservices/base/qmediaplaylistioplugin.cpp | 192 +++ .../mediaservices/base/qmediaplaylistioplugin.h | 126 ++ .../mediaservices/base/qmediaplaylistnavigator.cpp | 545 +++++++ .../mediaservices/base/qmediaplaylistnavigator.h | 116 ++ .../mediaservices/base/qmediaplaylistprovider.cpp | 308 ++++ .../mediaservices/base/qmediaplaylistprovider.h | 114 ++ .../mediaservices/base/qmediaplaylistprovider_p.h | 75 + .../mediaservices/base/qmediapluginloader.cpp | 135 ++ .../mediaservices/base/qmediapluginloader_p.h | 92 ++ .../mediaservices/base/qmediaresource.cpp | 399 +++++ src/multimedia/mediaservices/base/qmediaresource.h | 134 ++ .../mediaservices/base/qmediaservice.cpp | 140 ++ src/multimedia/mediaservices/base/qmediaservice.h | 90 ++ .../mediaservices/base/qmediaservice_p.h | 75 + .../mediaservices/base/qmediaserviceprovider.cpp | 738 +++++++++ .../mediaservices/base/qmediaserviceprovider.h | 174 +++ .../base/qmediaserviceproviderplugin.h | 125 ++ .../mediaservices/base/qmediatimerange.cpp | 708 +++++++++ .../mediaservices/base/qmediatimerange.h | 135 ++ .../mediaservices/base/qmetadatacontrol.cpp | 185 +++ .../mediaservices/base/qmetadatacontrol.h | 92 ++ .../mediaservices/base/qpaintervideosurface.cpp | 1565 ++++++++++++++++++++ .../mediaservices/base/qpaintervideosurface_mac.mm | 283 ++++ .../base/qpaintervideosurface_mac_p.h | 100 ++ .../mediaservices/base/qpaintervideosurface_p.h | 178 +++ .../mediaservices/base/qtmedianamespace.h | 194 +++ .../mediaservices/base/qtmedianamespace.qdoc | 214 +++ .../mediaservices/base/qvideodevicecontrol.cpp | 155 ++ .../mediaservices/base/qvideodevicecontrol.h | 90 ++ .../mediaservices/base/qvideooutputcontrol.cpp | 135 ++ .../mediaservices/base/qvideooutputcontrol.h | 91 ++ .../mediaservices/base/qvideorenderercontrol.cpp | 124 ++ .../mediaservices/base/qvideorenderercontrol.h | 77 + src/multimedia/mediaservices/base/qvideowidget.cpp | 944 ++++++++++++ src/multimedia/mediaservices/base/qvideowidget.h | 131 ++ src/multimedia/mediaservices/base/qvideowidget_p.h | 271 ++++ .../mediaservices/base/qvideowidgetcontrol.cpp | 235 +++ .../mediaservices/base/qvideowidgetcontrol.h | 105 ++ .../mediaservices/base/qvideowindowcontrol.cpp | 275 ++++ .../mediaservices/base/qvideowindowcontrol.h | 111 ++ src/multimedia/mediaservices/effects/effects.pri | 26 + .../mediaservices/effects/qsoundeffect.cpp | 207 +++ .../mediaservices/effects/qsoundeffect_p.h | 109 ++ .../mediaservices/effects/qsoundeffect_pulse_p.cpp | 499 +++++++ .../mediaservices/effects/qsoundeffect_pulse_p.h | 137 ++ .../effects/qsoundeffect_qmedia_p.cpp | 132 ++ .../mediaservices/effects/qsoundeffect_qmedia_p.h | 103 ++ .../effects/qsoundeffect_qsound_p.cpp | 131 ++ .../mediaservices/effects/qsoundeffect_qsound_p.h | 102 ++ .../mediaservices/effects/wavedecoder_p.cpp | 151 ++ .../mediaservices/effects/wavedecoder_p.h | 133 ++ src/multimedia/mediaservices/mediaservices.pro | 16 + src/multimedia/mediaservices/playback/playback.pri | 11 + .../mediaservices/playback/qmediaplayer.cpp | 982 ++++++++++++ .../mediaservices/playback/qmediaplayer.h | 203 +++ .../mediaservices/playback/qmediaplayercontrol.cpp | 378 +++++ .../mediaservices/playback/qmediaplayercontrol.h | 131 ++ src/multimedia/multimedia.pro | 19 +- src/multimedia/multimedia/audio/audio.pri | 73 + src/multimedia/multimedia/audio/qaudio.cpp | 104 ++ src/multimedia/multimedia/audio/qaudio.h | 71 + src/multimedia/multimedia/audio/qaudio_mac.cpp | 142 ++ src/multimedia/multimedia/audio/qaudio_mac_p.h | 144 ++ .../multimedia/audio/qaudio_symbian_p.cpp | 395 +++++ src/multimedia/multimedia/audio/qaudio_symbian_p.h | 156 ++ .../multimedia/audio/qaudiodevicefactory.cpp | 257 ++++ .../multimedia/audio/qaudiodevicefactory_p.h | 97 ++ .../multimedia/audio/qaudiodeviceinfo.cpp | 400 +++++ src/multimedia/multimedia/audio/qaudiodeviceinfo.h | 114 ++ .../multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 486 ++++++ .../multimedia/audio/qaudiodeviceinfo_alsa_p.h | 117 ++ .../multimedia/audio/qaudiodeviceinfo_mac_p.cpp | 357 +++++ .../multimedia/audio/qaudiodeviceinfo_mac_p.h | 97 ++ .../audio/qaudiodeviceinfo_symbian_p.cpp | 200 +++ .../multimedia/audio/qaudiodeviceinfo_symbian_p.h | 107 ++ .../multimedia/audio/qaudiodeviceinfo_win32_p.cpp | 433 ++++++ .../multimedia/audio/qaudiodeviceinfo_win32_p.h | 112 ++ src/multimedia/multimedia/audio/qaudioengine.cpp | 343 +++++ src/multimedia/multimedia/audio/qaudioengine.h | 131 ++ .../multimedia/audio/qaudioengineplugin.cpp | 54 + .../multimedia/audio/qaudioengineplugin.h | 93 ++ src/multimedia/multimedia/audio/qaudioformat.cpp | 407 +++++ src/multimedia/multimedia/audio/qaudioformat.h | 107 ++ src/multimedia/multimedia/audio/qaudioinput.cpp | 432 ++++++ src/multimedia/multimedia/audio/qaudioinput.h | 111 ++ .../multimedia/audio/qaudioinput_alsa_p.cpp | 706 +++++++++ .../multimedia/audio/qaudioinput_alsa_p.h | 158 ++ .../multimedia/audio/qaudioinput_mac_p.cpp | 956 ++++++++++++ .../multimedia/audio/qaudioinput_mac_p.h | 169 +++ .../multimedia/audio/qaudioinput_symbian_p.cpp | 594 ++++++++ .../multimedia/audio/qaudioinput_symbian_p.h | 188 +++ .../multimedia/audio/qaudioinput_win32_p.cpp | 613 ++++++++ .../multimedia/audio/qaudioinput_win32_p.h | 159 ++ src/multimedia/multimedia/audio/qaudiooutput.cpp | 411 +++++ src/multimedia/multimedia/audio/qaudiooutput.h | 111 ++ .../multimedia/audio/qaudiooutput_alsa_p.cpp | 780 ++++++++++ .../multimedia/audio/qaudiooutput_alsa_p.h | 166 +++ .../multimedia/audio/qaudiooutput_mac_p.cpp | 712 +++++++++ .../multimedia/audio/qaudiooutput_mac_p.h | 167 +++ .../multimedia/audio/qaudiooutput_symbian_p.cpp | 697 +++++++++ .../multimedia/audio/qaudiooutput_symbian_p.h | 210 +++ .../multimedia/audio/qaudiooutput_win32_p.cpp | 606 ++++++++ .../multimedia/audio/qaudiooutput_win32_p.h | 156 ++ src/multimedia/multimedia/multimedia.pro | 14 + .../multimedia/video/qabstractvideobuffer.cpp | 200 +++ .../multimedia/video/qabstractvideobuffer.h | 106 ++ .../multimedia/video/qabstractvideobuffer_p.h | 73 + .../multimedia/video/qabstractvideosurface.cpp | 283 ++++ .../multimedia/video/qabstractvideosurface.h | 110 ++ .../multimedia/video/qabstractvideosurface_p.h | 78 + .../multimedia/video/qimagevideobuffer.cpp | 106 ++ .../multimedia/video/qimagevideobuffer_p.h | 79 + .../multimedia/video/qmemoryvideobuffer.cpp | 129 ++ .../multimedia/video/qmemoryvideobuffer_p.h | 83 ++ src/multimedia/multimedia/video/qvideoframe.cpp | 741 +++++++++ src/multimedia/multimedia/video/qvideoframe.h | 169 +++ .../multimedia/video/qvideosurfaceformat.cpp | 704 +++++++++ .../multimedia/video/qvideosurfaceformat.h | 147 ++ src/multimedia/multimedia/video/video.pri | 21 + src/multimedia/playback/playback.pri | 11 - src/multimedia/playback/qmediaplayer.cpp | 982 ------------ src/multimedia/playback/qmediaplayer.h | 203 --- src/multimedia/playback/qmediaplayercontrol.cpp | 378 ----- src/multimedia/playback/qmediaplayercontrol.h | 131 -- src/multimedia/video/qabstractvideobuffer.cpp | 200 --- src/multimedia/video/qabstractvideobuffer.h | 106 -- src/multimedia/video/qabstractvideobuffer_p.h | 73 - src/multimedia/video/qabstractvideosurface.cpp | 283 ---- src/multimedia/video/qabstractvideosurface.h | 110 -- src/multimedia/video/qabstractvideosurface_p.h | 78 - src/multimedia/video/qimagevideobuffer.cpp | 106 -- src/multimedia/video/qimagevideobuffer_p.h | 79 - src/multimedia/video/qmemoryvideobuffer.cpp | 129 -- src/multimedia/video/qmemoryvideobuffer_p.h | 83 -- src/multimedia/video/qvideoframe.cpp | 741 --------- src/multimedia/video/qvideoframe.h | 169 --- src/multimedia/video/qvideosurfaceformat.cpp | 704 --------- src/multimedia/video/qvideosurfaceformat.h | 147 -- src/multimedia/video/video.pri | 21 - .../mediaservices/directshow/directshow.pro | 4 +- .../mediaplayer/directshowaudioendpointcontrol.h | 2 +- .../mediaplayer/directshowmetadatacontrol.cpp | 116 +- .../mediaplayer/directshowmetadatacontrol.h | 8 +- .../directshow/mediaplayer/directshowpinenum.cpp | 2 +- .../mediaplayer/directshowplayercontrol.h | 4 +- .../mediaplayer/directshowplayerservice.cpp | 2 +- .../mediaplayer/directshowplayerservice.h | 8 +- .../mediaplayer/directshowvideooutputcontrol.h | 2 +- .../mediaplayer/directshowvideorenderercontrol.h | 2 +- .../mediaplayer/mediasamplevideobuffer.h | 2 +- .../mediaplayer/vmr9videowindowcontrol.h | 2 +- src/plugins/mediaservices/gstreamer/gstreamer.pro | 4 +- .../mediaplayer/qgstreamermetadataprovider.cpp | 108 +- .../mediaplayer/qgstreamermetadataprovider.h | 8 +- .../mediaplayer/qgstreamerplayercontrol.h | 4 +- .../mediaplayer/qgstreamerplayersession.cpp | 8 +- .../mediaplayer/qgstreamerplayersession.h | 6 +- .../gstreamer/qgstreamerserviceplugin.cpp | 2 +- .../gstreamer/qgstreamerserviceplugin.h | 2 +- .../gstreamer/qgstreamervideoinputdevicecontrol.h | 2 +- .../gstreamer/qgstreamervideooutputcontrol.h | 2 +- .../gstreamer/qgstreamervideooverlay.h | 2 +- .../gstreamer/qgstreamervideorenderer.h | 2 +- .../gstreamer/qgstreamervideowidget.h | 2 +- src/plugins/mediaservices/mediaservices.pro | 2 +- .../qt7/mediaplayer/qt7playercontrol.h | 4 +- .../qt7/mediaplayer/qt7playercontrol.mm | 2 +- .../qt7/mediaplayer/qt7playermetadata.h | 10 +- .../qt7/mediaplayer/qt7playermetadata.mm | 20 +- .../qt7/mediaplayer/qt7playerservice.h | 2 +- .../qt7/mediaplayer/qt7playerservice.mm | 4 +- .../qt7/mediaplayer/qt7playersession.h | 4 +- .../qt7/mediaplayer/qt7playersession.mm | 2 +- src/plugins/mediaservices/qt7/qt7.pro | 4 +- src/plugins/mediaservices/qt7/qt7movieviewoutput.h | 4 +- .../mediaservices/qt7/qt7movieviewrenderer.h | 4 +- src/plugins/mediaservices/qt7/qt7serviceplugin.h | 2 +- src/plugins/mediaservices/qt7/qt7serviceplugin.mm | 2 +- .../mediaservices/qt7/qt7videooutputcontrol.h | 10 +- src/src.pro | 8 +- tests/auto/auto.pro | 1 + tests/auto/mediaservices.pro | 19 + tests/auto/multimedia.pro | 16 +- tests/auto/qdeclarativeaudio/qdeclarativeaudio.pro | 2 +- tests/auto/qdeclarativevideo/qdeclarativevideo.pro | 2 +- .../auto/qgraphicsvideoitem/qgraphicsvideoitem.pro | 4 +- tests/auto/qmediacontent/qmediacontent.pro | 2 +- tests/auto/qmediaobject/qmediaobject.pro | 2 +- tests/auto/qmediaplayer/qmediaplayer.pro | 2 +- tests/auto/qmediaplaylist/qmediaplaylist.pro | 2 +- .../qmediaplaylistnavigator.pro | 2 +- .../auto/qmediapluginloader/qmediapluginloader.pro | 2 +- tests/auto/qmediaresource/qmediaresource.pro | 2 +- tests/auto/qmediaservice/qmediaservice.pro | 2 +- .../qmediaserviceprovider.pro | 2 +- tests/auto/qmediatimerange/qmediatimerange.pro | 2 +- tests/auto/qsoundeffect/qsoundeffect.pro | 2 +- tests/auto/qvideowidget/qvideowidget.pro | 2 +- tools/configure/configureapp.cpp | 42 +- 348 files changed, 33560 insertions(+), 33496 deletions(-) delete mode 100644 src/multimedia/audio/audio.pri delete mode 100644 src/multimedia/audio/qaudio.cpp delete mode 100644 src/multimedia/audio/qaudio.h delete mode 100644 src/multimedia/audio/qaudio_mac.cpp delete mode 100644 src/multimedia/audio/qaudio_mac_p.h delete mode 100644 src/multimedia/audio/qaudio_symbian_p.cpp delete mode 100644 src/multimedia/audio/qaudio_symbian_p.h delete mode 100644 src/multimedia/audio/qaudiodevicefactory.cpp delete mode 100644 src/multimedia/audio/qaudiodevicefactory_p.h delete mode 100644 src/multimedia/audio/qaudiodeviceinfo.cpp delete mode 100644 src/multimedia/audio/qaudiodeviceinfo.h delete mode 100644 src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp delete mode 100644 src/multimedia/audio/qaudiodeviceinfo_alsa_p.h delete mode 100644 src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp delete mode 100644 src/multimedia/audio/qaudiodeviceinfo_mac_p.h delete mode 100644 src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp delete mode 100644 src/multimedia/audio/qaudiodeviceinfo_symbian_p.h delete mode 100644 src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp delete mode 100644 src/multimedia/audio/qaudiodeviceinfo_win32_p.h delete mode 100644 src/multimedia/audio/qaudioengine.cpp delete mode 100644 src/multimedia/audio/qaudioengine.h delete mode 100644 src/multimedia/audio/qaudioengineplugin.cpp delete mode 100644 src/multimedia/audio/qaudioengineplugin.h delete mode 100644 src/multimedia/audio/qaudioformat.cpp delete mode 100644 src/multimedia/audio/qaudioformat.h delete mode 100644 src/multimedia/audio/qaudioinput.cpp delete mode 100644 src/multimedia/audio/qaudioinput.h delete mode 100644 src/multimedia/audio/qaudioinput_alsa_p.cpp delete mode 100644 src/multimedia/audio/qaudioinput_alsa_p.h delete mode 100644 src/multimedia/audio/qaudioinput_mac_p.cpp delete mode 100644 src/multimedia/audio/qaudioinput_mac_p.h delete mode 100644 src/multimedia/audio/qaudioinput_symbian_p.cpp delete mode 100644 src/multimedia/audio/qaudioinput_symbian_p.h delete mode 100644 src/multimedia/audio/qaudioinput_win32_p.cpp delete mode 100644 src/multimedia/audio/qaudioinput_win32_p.h delete mode 100644 src/multimedia/audio/qaudiooutput.cpp delete mode 100644 src/multimedia/audio/qaudiooutput.h delete mode 100644 src/multimedia/audio/qaudiooutput_alsa_p.cpp delete mode 100644 src/multimedia/audio/qaudiooutput_alsa_p.h delete mode 100644 src/multimedia/audio/qaudiooutput_mac_p.cpp delete mode 100644 src/multimedia/audio/qaudiooutput_mac_p.h delete mode 100644 src/multimedia/audio/qaudiooutput_symbian_p.cpp delete mode 100644 src/multimedia/audio/qaudiooutput_symbian_p.h delete mode 100644 src/multimedia/audio/qaudiooutput_win32_p.cpp delete mode 100644 src/multimedia/audio/qaudiooutput_win32_p.h delete mode 100644 src/multimedia/base/base.pri delete mode 100644 src/multimedia/base/qgraphicsvideoitem.cpp delete mode 100644 src/multimedia/base/qgraphicsvideoitem.h delete mode 100644 src/multimedia/base/qlocalmediaplaylistprovider.cpp delete mode 100644 src/multimedia/base/qlocalmediaplaylistprovider.h delete mode 100644 src/multimedia/base/qmediacontent.cpp delete mode 100644 src/multimedia/base/qmediacontent.h delete mode 100644 src/multimedia/base/qmediacontrol.cpp delete mode 100644 src/multimedia/base/qmediacontrol.h delete mode 100644 src/multimedia/base/qmediacontrol_p.h delete mode 100644 src/multimedia/base/qmediaobject.cpp delete mode 100644 src/multimedia/base/qmediaobject.h delete mode 100644 src/multimedia/base/qmediaobject_p.h delete mode 100644 src/multimedia/base/qmediaplaylist.cpp delete mode 100644 src/multimedia/base/qmediaplaylist.h delete mode 100644 src/multimedia/base/qmediaplaylist_p.h delete mode 100644 src/multimedia/base/qmediaplaylistcontrol.cpp delete mode 100644 src/multimedia/base/qmediaplaylistcontrol.h delete mode 100644 src/multimedia/base/qmediaplaylistioplugin.cpp delete mode 100644 src/multimedia/base/qmediaplaylistioplugin.h delete mode 100644 src/multimedia/base/qmediaplaylistnavigator.cpp delete mode 100644 src/multimedia/base/qmediaplaylistnavigator.h delete mode 100644 src/multimedia/base/qmediaplaylistprovider.cpp delete mode 100644 src/multimedia/base/qmediaplaylistprovider.h delete mode 100644 src/multimedia/base/qmediaplaylistprovider_p.h delete mode 100644 src/multimedia/base/qmediapluginloader.cpp delete mode 100644 src/multimedia/base/qmediapluginloader_p.h delete mode 100644 src/multimedia/base/qmediaresource.cpp delete mode 100644 src/multimedia/base/qmediaresource.h delete mode 100644 src/multimedia/base/qmediaservice.cpp delete mode 100644 src/multimedia/base/qmediaservice.h delete mode 100644 src/multimedia/base/qmediaservice_p.h delete mode 100644 src/multimedia/base/qmediaserviceprovider.cpp delete mode 100644 src/multimedia/base/qmediaserviceprovider.h delete mode 100644 src/multimedia/base/qmediaserviceproviderplugin.h delete mode 100644 src/multimedia/base/qmediatimerange.cpp delete mode 100644 src/multimedia/base/qmediatimerange.h delete mode 100644 src/multimedia/base/qmetadatacontrol.cpp delete mode 100644 src/multimedia/base/qmetadatacontrol.h delete mode 100644 src/multimedia/base/qpaintervideosurface.cpp delete mode 100644 src/multimedia/base/qpaintervideosurface_mac.mm delete mode 100644 src/multimedia/base/qpaintervideosurface_mac_p.h delete mode 100644 src/multimedia/base/qpaintervideosurface_p.h delete mode 100644 src/multimedia/base/qtmedianamespace.h delete mode 100644 src/multimedia/base/qtmedianamespace.qdoc delete mode 100644 src/multimedia/base/qvideodevicecontrol.cpp delete mode 100644 src/multimedia/base/qvideodevicecontrol.h delete mode 100644 src/multimedia/base/qvideooutputcontrol.cpp delete mode 100644 src/multimedia/base/qvideooutputcontrol.h delete mode 100644 src/multimedia/base/qvideorenderercontrol.cpp delete mode 100644 src/multimedia/base/qvideorenderercontrol.h delete mode 100644 src/multimedia/base/qvideowidget.cpp delete mode 100644 src/multimedia/base/qvideowidget.h delete mode 100644 src/multimedia/base/qvideowidget_p.h delete mode 100644 src/multimedia/base/qvideowidgetcontrol.cpp delete mode 100644 src/multimedia/base/qvideowidgetcontrol.h delete mode 100644 src/multimedia/base/qvideowindowcontrol.cpp delete mode 100644 src/multimedia/base/qvideowindowcontrol.h delete mode 100644 src/multimedia/effects/effects.pri delete mode 100644 src/multimedia/effects/qsoundeffect.cpp delete mode 100644 src/multimedia/effects/qsoundeffect_p.h delete mode 100644 src/multimedia/effects/qsoundeffect_pulse_p.cpp delete mode 100644 src/multimedia/effects/qsoundeffect_pulse_p.h delete mode 100644 src/multimedia/effects/qsoundeffect_qmedia_p.cpp delete mode 100644 src/multimedia/effects/qsoundeffect_qmedia_p.h delete mode 100644 src/multimedia/effects/qsoundeffect_qsound_p.cpp delete mode 100644 src/multimedia/effects/qsoundeffect_qsound_p.h delete mode 100644 src/multimedia/effects/wavedecoder_p.cpp delete mode 100644 src/multimedia/effects/wavedecoder_p.h create mode 100644 src/multimedia/mediaservices/base/base.pri create mode 100644 src/multimedia/mediaservices/base/qgraphicsvideoitem.cpp create mode 100644 src/multimedia/mediaservices/base/qgraphicsvideoitem.h create mode 100644 src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.cpp create mode 100644 src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h create mode 100644 src/multimedia/mediaservices/base/qmediacontent.cpp create mode 100644 src/multimedia/mediaservices/base/qmediacontent.h create mode 100644 src/multimedia/mediaservices/base/qmediacontrol.cpp create mode 100644 src/multimedia/mediaservices/base/qmediacontrol.h create mode 100644 src/multimedia/mediaservices/base/qmediacontrol_p.h create mode 100644 src/multimedia/mediaservices/base/qmediaobject.cpp create mode 100644 src/multimedia/mediaservices/base/qmediaobject.h create mode 100644 src/multimedia/mediaservices/base/qmediaobject_p.h create mode 100644 src/multimedia/mediaservices/base/qmediaplaylist.cpp create mode 100644 src/multimedia/mediaservices/base/qmediaplaylist.h create mode 100644 src/multimedia/mediaservices/base/qmediaplaylist_p.h create mode 100644 src/multimedia/mediaservices/base/qmediaplaylistcontrol.cpp create mode 100644 src/multimedia/mediaservices/base/qmediaplaylistcontrol.h create mode 100644 src/multimedia/mediaservices/base/qmediaplaylistioplugin.cpp create mode 100644 src/multimedia/mediaservices/base/qmediaplaylistioplugin.h create mode 100644 src/multimedia/mediaservices/base/qmediaplaylistnavigator.cpp create mode 100644 src/multimedia/mediaservices/base/qmediaplaylistnavigator.h create mode 100644 src/multimedia/mediaservices/base/qmediaplaylistprovider.cpp create mode 100644 src/multimedia/mediaservices/base/qmediaplaylistprovider.h create mode 100644 src/multimedia/mediaservices/base/qmediaplaylistprovider_p.h create mode 100644 src/multimedia/mediaservices/base/qmediapluginloader.cpp create mode 100644 src/multimedia/mediaservices/base/qmediapluginloader_p.h create mode 100644 src/multimedia/mediaservices/base/qmediaresource.cpp create mode 100644 src/multimedia/mediaservices/base/qmediaresource.h create mode 100644 src/multimedia/mediaservices/base/qmediaservice.cpp create mode 100644 src/multimedia/mediaservices/base/qmediaservice.h create mode 100644 src/multimedia/mediaservices/base/qmediaservice_p.h create mode 100644 src/multimedia/mediaservices/base/qmediaserviceprovider.cpp create mode 100644 src/multimedia/mediaservices/base/qmediaserviceprovider.h create mode 100644 src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h create mode 100644 src/multimedia/mediaservices/base/qmediatimerange.cpp create mode 100644 src/multimedia/mediaservices/base/qmediatimerange.h create mode 100644 src/multimedia/mediaservices/base/qmetadatacontrol.cpp create mode 100644 src/multimedia/mediaservices/base/qmetadatacontrol.h create mode 100644 src/multimedia/mediaservices/base/qpaintervideosurface.cpp create mode 100644 src/multimedia/mediaservices/base/qpaintervideosurface_mac.mm create mode 100644 src/multimedia/mediaservices/base/qpaintervideosurface_mac_p.h create mode 100644 src/multimedia/mediaservices/base/qpaintervideosurface_p.h create mode 100644 src/multimedia/mediaservices/base/qtmedianamespace.h create mode 100644 src/multimedia/mediaservices/base/qtmedianamespace.qdoc create mode 100644 src/multimedia/mediaservices/base/qvideodevicecontrol.cpp create mode 100644 src/multimedia/mediaservices/base/qvideodevicecontrol.h create mode 100644 src/multimedia/mediaservices/base/qvideooutputcontrol.cpp create mode 100644 src/multimedia/mediaservices/base/qvideooutputcontrol.h create mode 100644 src/multimedia/mediaservices/base/qvideorenderercontrol.cpp create mode 100644 src/multimedia/mediaservices/base/qvideorenderercontrol.h create mode 100644 src/multimedia/mediaservices/base/qvideowidget.cpp create mode 100644 src/multimedia/mediaservices/base/qvideowidget.h create mode 100644 src/multimedia/mediaservices/base/qvideowidget_p.h create mode 100644 src/multimedia/mediaservices/base/qvideowidgetcontrol.cpp create mode 100644 src/multimedia/mediaservices/base/qvideowidgetcontrol.h create mode 100644 src/multimedia/mediaservices/base/qvideowindowcontrol.cpp create mode 100644 src/multimedia/mediaservices/base/qvideowindowcontrol.h create mode 100644 src/multimedia/mediaservices/effects/effects.pri create mode 100644 src/multimedia/mediaservices/effects/qsoundeffect.cpp create mode 100644 src/multimedia/mediaservices/effects/qsoundeffect_p.h create mode 100644 src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp create mode 100644 src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.h create mode 100644 src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.cpp create mode 100644 src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.h create mode 100644 src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.cpp create mode 100644 src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.h create mode 100644 src/multimedia/mediaservices/effects/wavedecoder_p.cpp create mode 100644 src/multimedia/mediaservices/effects/wavedecoder_p.h create mode 100644 src/multimedia/mediaservices/mediaservices.pro create mode 100644 src/multimedia/mediaservices/playback/playback.pri create mode 100644 src/multimedia/mediaservices/playback/qmediaplayer.cpp create mode 100644 src/multimedia/mediaservices/playback/qmediaplayer.h create mode 100644 src/multimedia/mediaservices/playback/qmediaplayercontrol.cpp create mode 100644 src/multimedia/mediaservices/playback/qmediaplayercontrol.h create mode 100644 src/multimedia/multimedia/audio/audio.pri create mode 100644 src/multimedia/multimedia/audio/qaudio.cpp create mode 100644 src/multimedia/multimedia/audio/qaudio.h create mode 100644 src/multimedia/multimedia/audio/qaudio_mac.cpp create mode 100644 src/multimedia/multimedia/audio/qaudio_mac_p.h create mode 100644 src/multimedia/multimedia/audio/qaudio_symbian_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudio_symbian_p.h create mode 100644 src/multimedia/multimedia/audio/qaudiodevicefactory.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiodevicefactory_p.h create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo.h create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo_alsa_p.h create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo_mac_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo_mac_p.h create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo_symbian_p.h create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo_win32_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiodeviceinfo_win32_p.h create mode 100644 src/multimedia/multimedia/audio/qaudioengine.cpp create mode 100644 src/multimedia/multimedia/audio/qaudioengine.h create mode 100644 src/multimedia/multimedia/audio/qaudioengineplugin.cpp create mode 100644 src/multimedia/multimedia/audio/qaudioengineplugin.h create mode 100644 src/multimedia/multimedia/audio/qaudioformat.cpp create mode 100644 src/multimedia/multimedia/audio/qaudioformat.h create mode 100644 src/multimedia/multimedia/audio/qaudioinput.cpp create mode 100644 src/multimedia/multimedia/audio/qaudioinput.h create mode 100644 src/multimedia/multimedia/audio/qaudioinput_alsa_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudioinput_alsa_p.h create mode 100644 src/multimedia/multimedia/audio/qaudioinput_mac_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudioinput_mac_p.h create mode 100644 src/multimedia/multimedia/audio/qaudioinput_symbian_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudioinput_symbian_p.h create mode 100644 src/multimedia/multimedia/audio/qaudioinput_win32_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudioinput_win32_p.h create mode 100644 src/multimedia/multimedia/audio/qaudiooutput.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiooutput.h create mode 100644 src/multimedia/multimedia/audio/qaudiooutput_alsa_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiooutput_alsa_p.h create mode 100644 src/multimedia/multimedia/audio/qaudiooutput_mac_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiooutput_mac_p.h create mode 100644 src/multimedia/multimedia/audio/qaudiooutput_symbian_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiooutput_symbian_p.h create mode 100644 src/multimedia/multimedia/audio/qaudiooutput_win32_p.cpp create mode 100644 src/multimedia/multimedia/audio/qaudiooutput_win32_p.h create mode 100644 src/multimedia/multimedia/multimedia.pro create mode 100644 src/multimedia/multimedia/video/qabstractvideobuffer.cpp create mode 100644 src/multimedia/multimedia/video/qabstractvideobuffer.h create mode 100644 src/multimedia/multimedia/video/qabstractvideobuffer_p.h create mode 100644 src/multimedia/multimedia/video/qabstractvideosurface.cpp create mode 100644 src/multimedia/multimedia/video/qabstractvideosurface.h create mode 100644 src/multimedia/multimedia/video/qabstractvideosurface_p.h create mode 100644 src/multimedia/multimedia/video/qimagevideobuffer.cpp create mode 100644 src/multimedia/multimedia/video/qimagevideobuffer_p.h create mode 100644 src/multimedia/multimedia/video/qmemoryvideobuffer.cpp create mode 100644 src/multimedia/multimedia/video/qmemoryvideobuffer_p.h create mode 100644 src/multimedia/multimedia/video/qvideoframe.cpp create mode 100644 src/multimedia/multimedia/video/qvideoframe.h create mode 100644 src/multimedia/multimedia/video/qvideosurfaceformat.cpp create mode 100644 src/multimedia/multimedia/video/qvideosurfaceformat.h create mode 100644 src/multimedia/multimedia/video/video.pri delete mode 100644 src/multimedia/playback/playback.pri delete mode 100644 src/multimedia/playback/qmediaplayer.cpp delete mode 100644 src/multimedia/playback/qmediaplayer.h delete mode 100644 src/multimedia/playback/qmediaplayercontrol.cpp delete mode 100644 src/multimedia/playback/qmediaplayercontrol.h delete mode 100644 src/multimedia/video/qabstractvideobuffer.cpp delete mode 100644 src/multimedia/video/qabstractvideobuffer.h delete mode 100644 src/multimedia/video/qabstractvideobuffer_p.h delete mode 100644 src/multimedia/video/qabstractvideosurface.cpp delete mode 100644 src/multimedia/video/qabstractvideosurface.h delete mode 100644 src/multimedia/video/qabstractvideosurface_p.h delete mode 100644 src/multimedia/video/qimagevideobuffer.cpp delete mode 100644 src/multimedia/video/qimagevideobuffer_p.h delete mode 100644 src/multimedia/video/qmemoryvideobuffer.cpp delete mode 100644 src/multimedia/video/qmemoryvideobuffer_p.h delete mode 100644 src/multimedia/video/qvideoframe.cpp delete mode 100644 src/multimedia/video/qvideoframe.h delete mode 100644 src/multimedia/video/qvideosurfaceformat.cpp delete mode 100644 src/multimedia/video/qvideosurfaceformat.h delete mode 100644 src/multimedia/video/video.pri create mode 100644 tests/auto/mediaservices.pro diff --git a/bin/syncqt b/bin/syncqt index 71f2eab..9fe0009 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -50,7 +50,8 @@ my %modules = ( # path to module name map "QtDBus" => "$basedir/src/dbus", "QtWebKit" => "$basedir/src/3rdparty/webkit/WebCore", "phonon" => "$basedir/src/phonon", - "QtMultimedia" => "$basedir/src/multimedia", + "QtMultimedia" => "$basedir/src/multimedia/multimedia", + "QtMediaservices" => "$basedir/src/multimedia/mediaservices", ); my %moduleheaders = ( # restrict the module headers to those found in relative path "QtWebKit" => "../WebKit/qt/Api", diff --git a/configure b/configure index 5478d06..11b33f6 100755 --- a/configure +++ b/configure @@ -682,7 +682,8 @@ CFG_RELEASE_QMAKE=no CFG_PHONON=auto CFG_PHONON_BACKEND=yes CFG_MULTIMEDIA=auto -CFG_MEDIASERVICE=auto +CFG_MEDIASERVICES=auto +CFG_MEDIA_BACKEND=auto CFG_AUDIO_BACKEND=auto CFG_SVG=auto CFG_DECLARATIVE=auto @@ -937,7 +938,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|-mediaservice|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles) + -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|-mediaservices|-media-backend|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -2153,9 +2154,16 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; - mediaservice) + mediaservices) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then - CFG_MEDIASERVICE="$VAL" + CFG_MEDIASERVICES="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; + media-backend) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_MEDIA_BACKEND="$VAL" else UNKNOWN_OPT=yes fi @@ -3390,8 +3398,9 @@ Usage: $relconf [-h] [-prefix ] [-prefix-install] [-bindir ] [-libdir [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2] [-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-mediaservice] [-mediaservice] [-no-audio-backend] [-audio-backend] + [-no-multimedia] [-multimedia] [-no-mediaservices] [-mediaservices] + [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend] + [-no-media-backend] [-medias-backend] [-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] @@ -3532,12 +3541,15 @@ 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. + -no-mediaservices... Do not build the QtMediaservices module. + + -mediaservices...... Build the QtMediaservices module. + + -no-media-backend... Do not build platform mediaservices plugin. + + -media-backend..... Build the platform mediaservices plugin. + -no-phonon ......... Do not build the Phonon module. + -phonon ............ Build the Phonon module. Phonon is built if a decent C++ compiler is used. @@ -5176,16 +5188,16 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then fi if [ "$CFG_GUI" = "no" ]; then - if [ "$CFG_MEDIASERVICE" = "auto" ]; then - CFG_MEDIASERVICE=no + if [ "$CFG_MEDIA_BACKEND" = "auto" ]; then + CFG_MEDIA_BACKEND=no fi - if [ "$CFG_MEDIASERVICE" != "no" ]; then - echo "Mediaservice enabled, but GUI disabled." - echo " You might need to either enable the GUI or disable Mediaservice" + if [ "$CFG_MEDIA_BACKEND" != "no" ]; then + echo "Medias backend enabled, but GUI disabled." + echo " You might need to either enable the GUI or disable the media backend" exit 1 fi - elif [ "$CFG_MEDIASERVICE" = "auto" ]; then - CFG_MEDIASERVICE=yes + elif [ "$CFG_MEDIA_BACKEND" = "auto" ]; then + CFG_MEDIA_BACKEND=yes fi # Auto-detect GStreamer support (needed for both Phonon & QtMultimedia) @@ -6820,8 +6832,14 @@ 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 + +if [ "$CFG_MEDIASERVICES" = "no" ]; then + QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MEDIASERVICES" +else + QT_CONFIG="$QT_CONFIG mediaservices" + if [ "$CFG_MEDIA_BACKEND" = "yes" ]; then + QT_CONFIG="$QT_CONFIG media-backend" fi fi @@ -7782,6 +7800,7 @@ echo "QtScriptTools module ... $CFG_SCRIPTTOOLS" echo "QtXmlPatterns module ... $CFG_XMLPATTERNS" echo "Phonon module .......... $CFG_PHONON" echo "Multimedia module ...... $CFG_MULTIMEDIA" +echo "Mediaservices module ... $CFG_MEDIASERVICES" echo "SVG module ............. $CFG_SVG" echo "WebKit module .......... $CFG_WEBKIT" if [ "$CFG_WEBKIT" = "yes" ]; then diff --git a/demos/multimedia/player/player.cpp b/demos/multimedia/player/player.cpp index af30a97..20341bc 100644 --- a/demos/multimedia/player/player.cpp +++ b/demos/multimedia/player/player.cpp @@ -45,8 +45,8 @@ #include "playlistmodel.h" #include "videowidget.h" -#include -#include +#include +#include #include @@ -204,14 +204,14 @@ void Player::positionChanged(qint64 progress) void Player::metaDataChanged() { - //qDebug() << "update metadata" << player->metaData(QtMultimedia::Title).toString(); + //qDebug() << "update metadata" << player->metaData(QtMediaservices::Title).toString(); if (player->isMetaDataAvailable()) { setTrackInfo(QString("%1 - %2") - .arg(player->metaData(QtMultimedia::AlbumArtist).toString()) - .arg(player->metaData(QtMultimedia::Title).toString())); + .arg(player->metaData(QtMediaservices::AlbumArtist).toString()) + .arg(player->metaData(QtMediaservices::Title).toString())); if (coverLabel) { - QUrl url = player->metaData(QtMultimedia::CoverArtUrlLarge).value(); + QUrl url = player->metaData(QtMediaservices::CoverArtUrlLarge).value(); coverLabel->setPixmap(!url.isEmpty() ? QPixmap(url.toString()) diff --git a/demos/multimedia/player/player.pro b/demos/multimedia/player/player.pro index dc731e4..fb93416 100644 --- a/demos/multimedia/player/player.pro +++ b/demos/multimedia/player/player.pro @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = player -QT += gui multimedia +QT += gui mediaservices HEADERS = \ diff --git a/demos/multimedia/player/playercontrols.h b/demos/multimedia/player/playercontrols.h index 99894ff..0b0b0e6 100644 --- a/demos/multimedia/player/playercontrols.h +++ b/demos/multimedia/player/playercontrols.h @@ -42,7 +42,7 @@ #ifndef PLAYERCONTROLS_H #define PLAYERCONTROLS_H -#include +#include #include diff --git a/demos/multimedia/player/videowidget.h b/demos/multimedia/player/videowidget.h index 543e1e0..0251bfe 100644 --- a/demos/multimedia/player/videowidget.h +++ b/demos/multimedia/player/videowidget.h @@ -41,7 +41,7 @@ #ifndef VIDEOWIDGET_H #define VIDEOWIDGET_H -#include +#include QT_BEGIN_HEADER diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 62cce62..ff4e986 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -36,7 +36,7 @@ INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picki win32:INCLUDEPATH += $$QMAKE_INCDIR_QT/ActiveQt # As order does matter for static libs, we reorder the QT variable here -TMPLIBS = declarative webkit phonon multimedia dbus testlib script scripttools svg qt3support sql xmlpatterns xml egl opengl openvg gui network core +TMPLIBS = declarative webkit phonon mediaservices multimedia dbus testlib script scripttools svg qt3support sql xmlpatterns xml egl opengl openvg gui network core for(QTLIB, $$list($$TMPLIBS)) { contains(QT, $$QTLIB): QT_ORDERED += $$QTLIB } @@ -175,6 +175,7 @@ for(QTLIB, $$list($$lower($$unique(QT)))) { } } else:isEqual(QTLIB, declarative):qlib = QtDeclarative else:isEqual(QTLIB, multimedia):qlib = QtMultimedia + else:isEqual(QTLIB, mediaservices):qlib = QtMediaservices else:message("Unknown QT: $$QTLIB"):qlib = !isEmpty(qlib) { target_qt:isEqual(TARGET, qlib) { diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index bdb3f83..22c39b6 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -142,7 +142,7 @@ addJavaScriptCoreLib(../JavaScriptCore) DEFINES -= ENABLE_VIDEO=0 DEFINES += ENABLE_VIDEO=1 } - !lessThan(QT_MINOR_VERSION, 7):contains(QT_CONFIG, multimedia) { + !lessThan(QT_MINOR_VERSION, 7):contains(QT_CONFIG, mediaservices) { DEFINES -= ENABLE_VIDEO=0 DEFINES += ENABLE_VIDEO=1 } @@ -2370,7 +2370,7 @@ contains(DEFINES, ENABLE_VIDEO=1) { HEADERS += platform/graphics/qt/MediaPlayerPrivateQt.h SOURCES += platform/graphics/qt/MediaPlayerPrivateQt.cpp - tobe|!tobe: QT += multimedia + tobe|!tobe: QT += mediaservices } else { HEADERS += \ platform/graphics/qt/MediaPlayerPrivatePhonon.h diff --git a/src/imports/multimedia/multimedia.cpp b/src/imports/multimedia/multimedia.cpp index a2e74f4..46ceb34 100644 --- a/src/imports/multimedia/multimedia.cpp +++ b/src/imports/multimedia/multimedia.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include #include "qdeclarativevideo_p.h" #include "qdeclarativeaudio_p.h" diff --git a/src/imports/multimedia/multimedia.pro b/src/imports/multimedia/multimedia.pro index 92f7ec4..c1933a3 100644 --- a/src/imports/multimedia/multimedia.pro +++ b/src/imports/multimedia/multimedia.pro @@ -2,7 +2,7 @@ TARGET = multimedia TARGETPATH = Qt/multimedia include(../qimportbase.pri) -QT += multimedia declarative +QT += mediaservices declarative HEADERS += \ qdeclarativeaudio_p.h \ diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp index 8d2dc61..4e75099 100644 --- a/src/imports/multimedia/qdeclarativeaudio.cpp +++ b/src/imports/multimedia/qdeclarativeaudio.cpp @@ -41,7 +41,7 @@ #include "qdeclarativeaudio_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/imports/multimedia/qdeclarativemediabase.cpp b/src/imports/multimedia/qdeclarativemediabase.cpp index bbd5901..5ed602a 100644 --- a/src/imports/multimedia/qdeclarativemediabase.cpp +++ b/src/imports/multimedia/qdeclarativemediabase.cpp @@ -44,10 +44,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "qmetadatacontrolmetaobject_p.h" diff --git a/src/imports/multimedia/qdeclarativemediabase_p.h b/src/imports/multimedia/qdeclarativemediabase_p.h index 7d262e0..e5115de 100644 --- a/src/imports/multimedia/qdeclarativemediabase_p.h +++ b/src/imports/multimedia/qdeclarativemediabase_p.h @@ -54,7 +54,7 @@ // #include -#include +#include QT_BEGIN_HEADER diff --git a/src/imports/multimedia/qdeclarativevideo.cpp b/src/imports/multimedia/qdeclarativevideo.cpp index bf112be..734bd96 100644 --- a/src/imports/multimedia/qdeclarativevideo.cpp +++ b/src/imports/multimedia/qdeclarativevideo.cpp @@ -41,11 +41,11 @@ #include "qdeclarativevideo_p.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE @@ -435,7 +435,7 @@ QT_END_NAMESPACE This property holds the tile of the media. - \sa {QtMultimedia::Title} + \sa {QtMediaservices::Title} */ /*! @@ -443,7 +443,7 @@ QT_END_NAMESPACE This property holds the sub-title of the media. - \sa {QtMultimedia::SubTitle} + \sa {QtMediaservices::SubTitle} */ /*! @@ -451,7 +451,7 @@ QT_END_NAMESPACE This property holds the author of the media. - \sa {QtMultimedia::Author} + \sa {QtMediaservices::Author} */ /*! @@ -459,7 +459,7 @@ QT_END_NAMESPACE This property holds a user comment about the media. - \sa {QtMultimedia::Comment} + \sa {QtMediaservices::Comment} */ /*! @@ -467,7 +467,7 @@ QT_END_NAMESPACE This property holds a description of the media. - \sa {QtMultimedia::Description} + \sa {QtMediaservices::Description} */ /*! @@ -475,7 +475,7 @@ QT_END_NAMESPACE This property holds the category of the media - \sa {QtMultimedia::Category} + \sa {QtMediaservices::Category} */ /*! @@ -483,7 +483,7 @@ QT_END_NAMESPACE This property holds the genre of the media. - \sa {QtMultimedia::Genre} + \sa {QtMediaservices::Genre} */ /*! @@ -491,7 +491,7 @@ QT_END_NAMESPACE This property holds the year of release of the media. - \sa {QtMultimedia::Year} + \sa {QtMediaservices::Year} */ /*! @@ -499,7 +499,7 @@ QT_END_NAMESPACE This property holds the date of the media. - \sa {QtMultimedia::Date} + \sa {QtMediaservices::Date} */ /*! @@ -507,7 +507,7 @@ QT_END_NAMESPACE This property holds a user rating of the media in the range of 0 to 100. - \sa {QtMultimedia::UserRating} + \sa {QtMediaservices::UserRating} */ /*! @@ -515,7 +515,7 @@ QT_END_NAMESPACE This property holds a list of keywords describing the media. - \sa {QtMultimedia::Keywords} + \sa {QtMediaservices::Keywords} */ /*! @@ -523,7 +523,7 @@ QT_END_NAMESPACE This property holds the language of the media, as an ISO 639-2 code. - \sa {QtMultimedia::Language} + \sa {QtMediaservices::Language} */ /*! @@ -531,7 +531,7 @@ QT_END_NAMESPACE This property holds the publisher of the media. - \sa {QtMultimedia::Publisher} + \sa {QtMediaservices::Publisher} */ /*! @@ -539,7 +539,7 @@ QT_END_NAMESPACE This property holds the media's copyright notice. - \sa {QtMultimedia::Copyright} + \sa {QtMediaservices::Copyright} */ /*! @@ -547,7 +547,7 @@ QT_END_NAMESPACE This property holds the parental rating of the media. - \sa {QtMultimedia::ParentalRating} + \sa {QtMediaservices::ParentalRating} */ /*! @@ -556,7 +556,7 @@ QT_END_NAMESPACE This property holds the name of the rating organisation responsible for the parental rating of the media. - \sa {QtMultimedia::RatingOrganisation} + \sa {QtMediaservices::RatingOrganisation} */ /*! @@ -564,7 +564,7 @@ QT_END_NAMESPACE This property property holds the size of the media in bytes. - \sa {QtMultimedia::Size} + \sa {QtMediaservices::Size} */ /*! @@ -572,7 +572,7 @@ QT_END_NAMESPACE This property holds the type of the media. - \sa {QtMultimedia::MediaType} + \sa {QtMediaservices::MediaType} */ /*! @@ -581,7 +581,7 @@ QT_END_NAMESPACE This property holds the bit rate of the media's audio stream ni bits per second. - \sa {QtMultimedia::AudioBitRate} + \sa {QtMediaservices::AudioBitRate} */ /*! @@ -589,7 +589,7 @@ QT_END_NAMESPACE This property holds the encoding of the media audio stream. - \sa {QtMultimedia::AudioCodec} + \sa {QtMediaservices::AudioCodec} */ /*! @@ -597,7 +597,7 @@ QT_END_NAMESPACE This property holds the average volume level of the media. - \sa {QtMultimedia::AverageLevel} + \sa {QtMediaservices::AverageLevel} */ /*! @@ -605,7 +605,7 @@ QT_END_NAMESPACE This property holds the number of channels in the media's audio stream. - \sa {QtMultimedia::ChannelCount} + \sa {QtMediaservices::ChannelCount} */ /*! @@ -613,7 +613,7 @@ QT_END_NAMESPACE This property holds the peak volume of media's audio stream. - \sa {QtMultimedia::PeakValue} + \sa {QtMediaservices::PeakValue} */ /*! @@ -621,7 +621,7 @@ QT_END_NAMESPACE This property holds the sample rate of the media's audio stream in hertz. - \sa {QtMultimedia::SampleRate} + \sa {QtMediaservices::SampleRate} */ /*! @@ -629,7 +629,7 @@ QT_END_NAMESPACE This property holds the title of the album the media belongs to. - \sa {QtMultimedia::AlbumTitle} + \sa {QtMediaservices::AlbumTitle} */ /*! @@ -638,7 +638,7 @@ QT_END_NAMESPACE This property holds the name of the principal artist of the album the media belongs to. - \sa {QtMultimedia::AlbumArtist} + \sa {QtMediaservices::AlbumArtist} */ /*! @@ -646,7 +646,7 @@ QT_END_NAMESPACE This property holds the names of artists contributing to the media. - \sa {QtMultimedia::ContributingArtist} + \sa {QtMediaservices::ContributingArtist} */ /*! @@ -654,7 +654,7 @@ QT_END_NAMESPACE This property holds the composer of the media. - \sa {QtMultimedia::Composer} + \sa {QtMediaservices::Composer} */ /*! @@ -662,7 +662,7 @@ QT_END_NAMESPACE This property holds the conductor of the media. - \sa {QtMultimedia::Conductor} + \sa {QtMediaservices::Conductor} */ /*! @@ -670,7 +670,7 @@ QT_END_NAMESPACE This property holds the lyrics to the media. - \sa {QtMultimedia::Lyrics} + \sa {QtMediaservices::Lyrics} */ /*! @@ -678,7 +678,7 @@ QT_END_NAMESPACE This property holds the mood of the media. - \sa {QtMultimedia::Mood} + \sa {QtMediaservices::Mood} */ /*! @@ -686,7 +686,7 @@ QT_END_NAMESPACE This property holds the track number of the media. - \sa {QtMultimedia::TrackNumber} + \sa {QtMediaservices::TrackNumber} */ /*! @@ -694,7 +694,7 @@ QT_END_NAMESPACE This property holds the number of track on the album containing the media. - \sa {QtMultimedia::TrackNumber} + \sa {QtMediaservices::TrackNumber} */ /*! @@ -702,7 +702,7 @@ QT_END_NAMESPACE This property holds the URL of a small cover art image. - \sa {QtMultimedia::CoverArtUrlSmall} + \sa {QtMediaservices::CoverArtUrlSmall} */ /*! @@ -710,7 +710,7 @@ QT_END_NAMESPACE This property holds the URL of a large cover art image. - \sa {QtMultimedia::CoverArtUrlLarge} + \sa {QtMediaservices::CoverArtUrlLarge} */ /*! @@ -718,7 +718,7 @@ QT_END_NAMESPACE This property holds the dimension of an image or video. - \sa {QtMultimedia::Resolution} + \sa {QtMediaservices::Resolution} */ /*! @@ -726,7 +726,7 @@ QT_END_NAMESPACE This property holds the pixel aspect ratio of an image or video. - \sa {QtMultimedia::PixelAspectRatio} + \sa {QtMediaservices::PixelAspectRatio} */ /*! @@ -734,7 +734,7 @@ QT_END_NAMESPACE This property holds the frame rate of the media's video stream. - \sa {QtMultimedia::VideoFrameRate} + \sa {QtMediaservices::VideoFrameRate} */ /*! @@ -743,7 +743,7 @@ QT_END_NAMESPACE This property holds the bit rate of the media's video stream in bits per second. - \sa {QtMultimedia::VideoBitRate} + \sa {QtMediaservices::VideoBitRate} */ /*! @@ -751,7 +751,7 @@ QT_END_NAMESPACE This property holds the encoding of the media's video stream. - \sa {QtMultimedia::VideoCodec} + \sa {QtMediaservices::VideoCodec} */ /*! @@ -759,7 +759,7 @@ QT_END_NAMESPACE This property holds the URL of a poster image. - \sa {QtMultimedia::PosterUrl} + \sa {QtMediaservices::PosterUrl} */ /*! @@ -767,7 +767,7 @@ QT_END_NAMESPACE This property holds the chapter number of the media. - \sa {QtMultimedia::ChapterNumber} + \sa {QtMediaservices::ChapterNumber} */ /*! @@ -775,7 +775,7 @@ QT_END_NAMESPACE This property holds the director of the media. - \sa {QtMultimedia::Director} + \sa {QtMediaservices::Director} */ /*! @@ -783,7 +783,7 @@ QT_END_NAMESPACE This property holds the lead performer in the media. - \sa {QtMultimedia::LeadPerformer} + \sa {QtMediaservices::LeadPerformer} */ /*! @@ -791,7 +791,7 @@ QT_END_NAMESPACE This property holds the writer of the media. - \sa {QtMultimedia::Writer} + \sa {QtMediaservices::Writer} */ // The remaining properties are related to photos, and are technically @@ -801,157 +801,157 @@ QT_END_NAMESPACE /*! \qmlproperty variant Video::cameraManufacturer - \sa {QtMultimedia::CameraManufacturer} + \sa {QtMediaservices::CameraManufacturer} */ /*! \qmlproperty variant Video::cameraModel - \sa {QtMultimedia::CameraModel} + \sa {QtMediaservices::CameraModel} */ /*! \qmlproperty variant Video::event - \sa {QtMultimedia::Event} + \sa {QtMediaservices::Event} */ /*! \qmlproperty variant Video::subject - \sa {QtMultimedia::Subject} + \sa {QtMediaservices::Subject} */ /*! \qmlproperty variant Video::orientation - \sa {QtMultimedia::Orientation} + \sa {QtMediaservices::Orientation} */ /*! \qmlproperty variant Video::exposureTime - \sa {QtMultimedia::ExposureTime} + \sa {QtMediaservices::ExposureTime} */ /*! \qmlproperty variant Video::fNumber - \sa {QtMultimedia::FNumber} + \sa {QtMediaservices::FNumber} */ /*! \qmlproperty variant Video::exposureProgram - \sa {QtMultimedia::ExposureProgram} + \sa {QtMediaservices::ExposureProgram} */ /*! \qmlproperty variant Video::isoSpeedRatings - \sa {QtMultimedia::ISOSpeedRatings} + \sa {QtMediaservices::ISOSpeedRatings} */ /*! \qmlproperty variant Video::exposureBiasValue - \sa {QtMultimedia::ExposureBiasValue} + \sa {QtMediaservices::ExposureBiasValue} */ /*! \qmlproperty variant Video::dateTimeDigitized - \sa {QtMultimedia::DateTimeDigitized} + \sa {QtMediaservices::DateTimeDigitized} */ /*! \qmlproperty variant Video::subjectDistance - \sa {QtMultimedia::SubjectDistance} + \sa {QtMediaservices::SubjectDistance} */ /*! \qmlproperty variant Video::meteringMode - \sa {QtMultimedia::MeteringMode} + \sa {QtMediaservices::MeteringMode} */ /*! \qmlproperty variant Video::lightSource - \sa {QtMultimedia::LightSource} + \sa {QtMediaservices::LightSource} */ /*! \qmlproperty variant Video::flash - \sa {QtMultimedia::Flash} + \sa {QtMediaservices::Flash} */ /*! \qmlproperty variant Video::focalLength - \sa {QtMultimedia::FocalLength} + \sa {QtMediaservices::FocalLength} */ /*! \qmlproperty variant Video::exposureMode - \sa {QtMultimedia::ExposureMode} + \sa {QtMediaservices::ExposureMode} */ /*! \qmlproperty variant Video::whiteBalance - \sa {QtMultimedia::WhiteBalance} + \sa {QtMediaservices::WhiteBalance} */ /*! \qmlproperty variant Video::DigitalZoomRatio - \sa {QtMultimedia::DigitalZoomRatio} + \sa {QtMediaservices::DigitalZoomRatio} */ /*! \qmlproperty variant Video::focalLengthIn35mmFilm - \sa {QtMultimedia::FocalLengthIn35mmFile} + \sa {QtMediaservices::FocalLengthIn35mmFile} */ /*! \qmlproperty variant Video::sceneCaptureType - \sa {QtMultimedia::SceneCaptureType} + \sa {QtMediaservices::SceneCaptureType} */ /*! \qmlproperty variant Video::gainControl - \sa {QtMultimedia::GainControl} + \sa {QtMediaservices::GainControl} */ /*! \qmlproperty variant Video::contrast - \sa {QtMultimedia::contrast} + \sa {QtMediaservices::contrast} */ /*! \qmlproperty variant Video::saturation - \sa {QtMultimedia::Saturation} + \sa {QtMediaservices::Saturation} */ /*! \qmlproperty variant Video::sharpness - \sa {QtMultimedia::Sharpness} + \sa {QtMediaservices::Sharpness} */ /*! \qmlproperty variant Video::deviceSettingDescription - \sa {QtMultimedia::DeviceSettingDescription} + \sa {QtMediaservices::DeviceSettingDescription} */ #endif diff --git a/src/imports/multimedia/qdeclarativevideo_p.h b/src/imports/multimedia/qdeclarativevideo_p.h index 29e1090..99882ac 100644 --- a/src/imports/multimedia/qdeclarativevideo_p.h +++ b/src/imports/multimedia/qdeclarativevideo_p.h @@ -55,7 +55,7 @@ #include "qdeclarativemediabase_p.h" -#include +#include #include #include diff --git a/src/imports/multimedia/qmetadatacontrolmetaobject.cpp b/src/imports/multimedia/qmetadatacontrolmetaobject.cpp index e90cbd6..2f45b50 100644 --- a/src/imports/multimedia/qmetadatacontrolmetaobject.cpp +++ b/src/imports/multimedia/qmetadatacontrolmetaobject.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qmetadatacontrolmetaobject_p.h" -#include +#include QT_BEGIN_NAMESPACE @@ -106,101 +106,101 @@ namespace { struct MetaDataKey { - QtMultimedia::MetaData key; + QtMediaservices::MetaData key; const char *name; }; const MetaDataKey qt_metaDataKeys[] = { - { QtMultimedia::Title, "title" }, - { QtMultimedia::SubTitle, "subTitle" }, - { QtMultimedia::Author, "author" }, - { QtMultimedia::Comment, "comment" }, - { QtMultimedia::Description, "description" }, - { QtMultimedia::Category, "category" }, - { QtMultimedia::Genre, "genre" }, - { QtMultimedia::Year, "year" }, - { QtMultimedia::Date, "date" }, - { QtMultimedia::UserRating, "userRating" }, - { QtMultimedia::Keywords, "keywords" }, - { QtMultimedia::Language, "language" }, - { QtMultimedia::Publisher, "publisher" }, - { QtMultimedia::Copyright, "copyright" }, - { QtMultimedia::ParentalRating, "parentalRating" }, - { QtMultimedia::RatingOrganisation, "ratingOrganisation" }, + { QtMediaservices::Title, "title" }, + { QtMediaservices::SubTitle, "subTitle" }, + { QtMediaservices::Author, "author" }, + { QtMediaservices::Comment, "comment" }, + { QtMediaservices::Description, "description" }, + { QtMediaservices::Category, "category" }, + { QtMediaservices::Genre, "genre" }, + { QtMediaservices::Year, "year" }, + { QtMediaservices::Date, "date" }, + { QtMediaservices::UserRating, "userRating" }, + { QtMediaservices::Keywords, "keywords" }, + { QtMediaservices::Language, "language" }, + { QtMediaservices::Publisher, "publisher" }, + { QtMediaservices::Copyright, "copyright" }, + { QtMediaservices::ParentalRating, "parentalRating" }, + { QtMediaservices::RatingOrganisation, "ratingOrganisation" }, // Media - { QtMultimedia::Size, "size" }, - { QtMultimedia::MediaType, "mediaType" }, -// { QtMultimedia::Duration, "duration" }, + { QtMediaservices::Size, "size" }, + { QtMediaservices::MediaType, "mediaType" }, +// { QtMediaservices::Duration, "duration" }, // Audio - { QtMultimedia::AudioBitRate, "audioBitRate" }, - { QtMultimedia::AudioCodec, "audioCodec" }, - { QtMultimedia::AverageLevel, "averageLevel" }, - { QtMultimedia::ChannelCount, "channelCount" }, - { QtMultimedia::PeakValue, "peakValue" }, - { QtMultimedia::SampleRate, "sampleRate" }, + { QtMediaservices::AudioBitRate, "audioBitRate" }, + { QtMediaservices::AudioCodec, "audioCodec" }, + { QtMediaservices::AverageLevel, "averageLevel" }, + { QtMediaservices::ChannelCount, "channelCount" }, + { QtMediaservices::PeakValue, "peakValue" }, + { QtMediaservices::SampleRate, "sampleRate" }, // Music - { QtMultimedia::AlbumTitle, "albumTitle" }, - { QtMultimedia::AlbumArtist, "albumArtist" }, - { QtMultimedia::ContributingArtist, "contributingArtist" }, - { QtMultimedia::Composer, "composer" }, - { QtMultimedia::Conductor, "conductor" }, - { QtMultimedia::Lyrics, "lyrics" }, - { QtMultimedia::Mood, "mood" }, - { QtMultimedia::TrackNumber, "trackNumber" }, - { QtMultimedia::TrackCount, "trackCount" }, - - { QtMultimedia::CoverArtUrlSmall, "coverArtUrlSmall" }, - { QtMultimedia::CoverArtUrlLarge, "coverArtUrlLarge" }, + { QtMediaservices::AlbumTitle, "albumTitle" }, + { QtMediaservices::AlbumArtist, "albumArtist" }, + { QtMediaservices::ContributingArtist, "contributingArtist" }, + { QtMediaservices::Composer, "composer" }, + { QtMediaservices::Conductor, "conductor" }, + { QtMediaservices::Lyrics, "lyrics" }, + { QtMediaservices::Mood, "mood" }, + { QtMediaservices::TrackNumber, "trackNumber" }, + { QtMediaservices::TrackCount, "trackCount" }, + + { QtMediaservices::CoverArtUrlSmall, "coverArtUrlSmall" }, + { QtMediaservices::CoverArtUrlLarge, "coverArtUrlLarge" }, // Image/Video - { QtMultimedia::Resolution, "resolution" }, - { QtMultimedia::PixelAspectRatio, "pixelAspectRatio" }, + { QtMediaservices::Resolution, "resolution" }, + { QtMediaservices::PixelAspectRatio, "pixelAspectRatio" }, // Video - { QtMultimedia::VideoFrameRate, "videoFrameRate" }, - { QtMultimedia::VideoBitRate, "videoBitRate" }, - { QtMultimedia::VideoCodec, "videoCodec" }, + { QtMediaservices::VideoFrameRate, "videoFrameRate" }, + { QtMediaservices::VideoBitRate, "videoBitRate" }, + { QtMediaservices::VideoCodec, "videoCodec" }, - { QtMultimedia::PosterUrl, "posterUrl" }, + { QtMediaservices::PosterUrl, "posterUrl" }, // Movie - { QtMultimedia::ChapterNumber, "chapterNumber" }, - { QtMultimedia::Director, "director" }, - { QtMultimedia::LeadPerformer, "leadPerformer" }, - { QtMultimedia::Writer, "writer" }, + { QtMediaservices::ChapterNumber, "chapterNumber" }, + { QtMediaservices::Director, "director" }, + { QtMediaservices::LeadPerformer, "leadPerformer" }, + { QtMediaservices::Writer, "writer" }, // Photos - { QtMultimedia::CameraManufacturer, "cameraManufacturer" }, - { QtMultimedia::CameraModel, "cameraModel" }, - { QtMultimedia::Event, "event" }, - { QtMultimedia::Subject, "subject" }, - { QtMultimedia::Orientation, "orientation" }, - { QtMultimedia::ExposureTime, "exposureTime" }, - { QtMultimedia::FNumber, "fNumber" }, - { QtMultimedia::ExposureProgram, "exposureProgram" }, - { QtMultimedia::ISOSpeedRatings, "isoSpeedRatings" }, - { QtMultimedia::ExposureBiasValue, "exposureBiasValue" }, - { QtMultimedia::DateTimeOriginal, "dateTimeOriginal" }, - { QtMultimedia::DateTimeDigitized, "dateTimeDigitized" }, - { QtMultimedia::SubjectDistance, "subjectDistance" }, - { QtMultimedia::MeteringMode, "meteringMode" }, - { QtMultimedia::LightSource, "lightSource" }, - { QtMultimedia::Flash, "flash" }, - { QtMultimedia::FocalLength, "focalLength" }, - { QtMultimedia::ExposureMode, "exposureMode" }, - { QtMultimedia::WhiteBalance, "whiteBalance" }, - { QtMultimedia::DigitalZoomRatio, "digitalZoomRatio" }, - { QtMultimedia::FocalLengthIn35mmFilm, "focalLengthIn35mmFilm" }, - { QtMultimedia::SceneCaptureType, "sceneCaptureType" }, - { QtMultimedia::GainControl, "gainControl" }, - { QtMultimedia::Contrast, "contrast" }, - { QtMultimedia::Saturation, "saturation" }, - { QtMultimedia::Sharpness, "sharpness" }, - { QtMultimedia::DeviceSettingDescription, "deviceSettingDescription" } + { QtMediaservices::CameraManufacturer, "cameraManufacturer" }, + { QtMediaservices::CameraModel, "cameraModel" }, + { QtMediaservices::Event, "event" }, + { QtMediaservices::Subject, "subject" }, + { QtMediaservices::Orientation, "orientation" }, + { QtMediaservices::ExposureTime, "exposureTime" }, + { QtMediaservices::FNumber, "fNumber" }, + { QtMediaservices::ExposureProgram, "exposureProgram" }, + { QtMediaservices::ISOSpeedRatings, "isoSpeedRatings" }, + { QtMediaservices::ExposureBiasValue, "exposureBiasValue" }, + { QtMediaservices::DateTimeOriginal, "dateTimeOriginal" }, + { QtMediaservices::DateTimeDigitized, "dateTimeDigitized" }, + { QtMediaservices::SubjectDistance, "subjectDistance" }, + { QtMediaservices::MeteringMode, "meteringMode" }, + { QtMediaservices::LightSource, "lightSource" }, + { QtMediaservices::Flash, "flash" }, + { QtMediaservices::FocalLength, "focalLength" }, + { QtMediaservices::ExposureMode, "exposureMode" }, + { QtMediaservices::WhiteBalance, "whiteBalance" }, + { QtMediaservices::DigitalZoomRatio, "digitalZoomRatio" }, + { QtMediaservices::FocalLengthIn35mmFilm, "focalLengthIn35mmFilm" }, + { QtMediaservices::SceneCaptureType, "sceneCaptureType" }, + { QtMediaservices::GainControl, "gainControl" }, + { QtMediaservices::Contrast, "contrast" }, + { QtMediaservices::Saturation, "saturation" }, + { QtMediaservices::Sharpness, "sharpness" }, + { QtMediaservices::DeviceSettingDescription, "deviceSettingDescription" } }; class QMetaDataControlObject : public QObject diff --git a/src/imports/multimedia/qmetadatacontrolmetaobject_p.h b/src/imports/multimedia/qmetadatacontrolmetaobject_p.h index c381f2d..128eaa4 100644 --- a/src/imports/multimedia/qmetadatacontrolmetaobject_p.h +++ b/src/imports/multimedia/qmetadatacontrolmetaobject_p.h @@ -54,7 +54,7 @@ // #include -#include +#include #include diff --git a/src/multimedia/audio/audio.pri b/src/multimedia/audio/audio.pri deleted file mode 100644 index ae28a26..0000000 --- a/src/multimedia/audio/audio.pri +++ /dev/null @@ -1,73 +0,0 @@ -HEADERS += $$PWD/qaudio.h \ - $$PWD/qaudioformat.h \ - $$PWD/qaudioinput.h \ - $$PWD/qaudiooutput.h \ - $$PWD/qaudiodeviceinfo.h \ - $$PWD/qaudioengineplugin.h \ - $$PWD/qaudioengine.h \ - $$PWD/qaudiodevicefactory_p.h - - -SOURCES += $$PWD/qaudio.cpp \ - $$PWD/qaudioformat.cpp \ - $$PWD/qaudiodeviceinfo.cpp \ - $$PWD/qaudiooutput.cpp \ - $$PWD/qaudioinput.cpp \ - $$PWD/qaudioengineplugin.cpp \ - $$PWD/qaudioengine.cpp \ - $$PWD/qaudiodevicefactory.cpp - -contains(QT_CONFIG, audio-backend) { - -mac { - HEADERS += $$PWD/qaudioinput_mac_p.h \ - $$PWD/qaudiooutput_mac_p.h \ - $$PWD/qaudiodeviceinfo_mac_p.h \ - $$PWD/qaudio_mac_p.h - - SOURCES += $$PWD/qaudiodeviceinfo_mac_p.cpp \ - $$PWD/qaudiooutput_mac_p.cpp \ - $$PWD/qaudioinput_mac_p.cpp \ - $$PWD/qaudio_mac.cpp - - LIBS += -framework ApplicationServices -framework CoreAudio -framework AudioUnit -framework AudioToolbox - -} else:win32 { - - HEADERS += $$PWD/qaudioinput_win32_p.h $$PWD/qaudiooutput_win32_p.h $$PWD/qaudiodeviceinfo_win32_p.h - SOURCES += $$PWD/qaudiodeviceinfo_win32_p.cpp \ - $$PWD/qaudiooutput_win32_p.cpp \ - $$PWD/qaudioinput_win32_p.cpp - !wince*:LIBS += -lwinmm - wince*:LIBS += -lcoredll - -} else:symbian { - INCLUDEPATH += /epoc32/include/mmf/common - INCLUDEPATH += /epoc32/include/mmf/server - - HEADERS += $$PWD/qaudio_symbian_p.h \ - $$PWD/qaudiodeviceinfo_symbian_p.h \ - $$PWD/qaudioinput_symbian_p.h \ - $$PWD/qaudiooutput_symbian_p.h - - SOURCES += $$PWD/qaudio_symbian_p.cpp \ - $$PWD/qaudiodeviceinfo_symbian_p.cpp \ - $$PWD/qaudioinput_symbian_p.cpp \ - $$PWD/qaudiooutput_symbian_p.cpp - - LIBS += -lmmfdevsound -} else:unix { - unix:contains(QT_CONFIG, alsa) { - linux-*|freebsd-*|openbsd-*:{ - DEFINES += HAS_ALSA - HEADERS += $$PWD/qaudiooutput_alsa_p.h $$PWD/qaudioinput_alsa_p.h $$PWD/qaudiodeviceinfo_alsa_p.h - SOURCES += $$PWD/qaudiodeviceinfo_alsa_p.cpp \ - $$PWD/qaudiooutput_alsa_p.cpp \ - $$PWD/qaudioinput_alsa_p.cpp - LIBS_PRIVATE += -lasound - } - } -} -} else { - DEFINES += QT_NO_AUDIO_BACKEND -} diff --git a/src/multimedia/audio/qaudio.cpp b/src/multimedia/audio/qaudio.cpp deleted file mode 100644 index e0f24ce..0000000 --- a/src/multimedia/audio/qaudio.cpp +++ /dev/null @@ -1,104 +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 - - -QT_BEGIN_NAMESPACE - -namespace QAudio -{ - -class RegisterMetaTypes -{ -public: - RegisterMetaTypes() - { - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - } - -} _register; - -} - -/*! - \namespace QAudio - \brief The QAudio namespace contains enums used by the audio classes. - \inmodule QtMultimedia - \ingroup multimedia - \since 4.6 -*/ - -/*! - \enum QAudio::Error - - \value NoError No errors have occurred - \value OpenError An error opening the audio device - \value IOError An error occurred during read/write of audio device - \value UnderrunError Audio data is not being fed to the audio device at a fast enough rate - \value FatalError A non-recoverable error has occurred, the audio device is not usable at this time. -*/ - -/*! - \enum QAudio::State - - \value ActiveState Audio data is being processed, this state is set after start() is called - and while audio data is available to be processed. - \value SuspendedState The audio device is in a suspended state, this state will only be entered - after suspend() is called. - \value StoppedState The audio device is closed, not processing any audio data - \value IdleState The QIODevice passed in has no data and audio system's buffer is empty, this state - is set after start() is called and while no audio data is available to be processed. -*/ - -/*! - \enum QAudio::Mode - - \value AudioOutput audio output device - \value AudioInput audio input device -*/ - - -QT_END_NAMESPACE - diff --git a/src/multimedia/audio/qaudio.h b/src/multimedia/audio/qaudio.h deleted file mode 100644 index 9ca1dff..0000000 --- a/src/multimedia/audio/qaudio.h +++ /dev/null @@ -1,71 +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 QAUDIO_H -#define QAUDIO_H - - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -namespace QAudio -{ - enum Error { NoError, OpenError, IOError, UnderrunError, FatalError }; - enum State { ActiveState, SuspendedState, StoppedState, IdleState }; - enum Mode { AudioInput, AudioOutput }; -} - -QT_END_NAMESPACE - -QT_END_HEADER - -Q_DECLARE_METATYPE(QAudio::Error) -Q_DECLARE_METATYPE(QAudio::State) -Q_DECLARE_METATYPE(QAudio::Mode) - -#endif // QAUDIO_H diff --git a/src/multimedia/audio/qaudio_mac.cpp b/src/multimedia/audio/qaudio_mac.cpp deleted file mode 100644 index 14fee8b..0000000 --- a/src/multimedia/audio/qaudio_mac.cpp +++ /dev/null @@ -1,142 +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 "qaudio_mac_p.h" - -QT_BEGIN_NAMESPACE - -// Debugging -QDebug operator<<(QDebug dbg, const QAudioFormat& audioFormat) -{ - dbg.nospace() << "QAudioFormat(" << - audioFormat.frequency() << "," << - audioFormat.channels() << "," << - audioFormat.sampleSize()<< "," << - audioFormat.codec() << "," << - audioFormat.byteOrder() << "," << - audioFormat.sampleType() << ")"; - - return dbg.space(); -} - - -// Conversion -QAudioFormat toQAudioFormat(AudioStreamBasicDescription const& sf) -{ - QAudioFormat audioFormat; - - audioFormat.setFrequency(sf.mSampleRate); - audioFormat.setChannels(sf.mChannelsPerFrame); - audioFormat.setSampleSize(sf.mBitsPerChannel); - audioFormat.setCodec(QString::fromLatin1("audio/pcm")); - audioFormat.setByteOrder(sf.mFormatFlags & kLinearPCMFormatFlagIsBigEndian != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian); - QAudioFormat::SampleType type = QAudioFormat::UnSignedInt; - if ((sf.mFormatFlags & kLinearPCMFormatFlagIsSignedInteger) != 0) - type = QAudioFormat::SignedInt; - else if ((sf.mFormatFlags & kLinearPCMFormatFlagIsFloat) != 0) - type = QAudioFormat::Float; - audioFormat.setSampleType(type); - - return audioFormat; -} - -AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& audioFormat) -{ - AudioStreamBasicDescription sf; - - sf.mFormatFlags = kAudioFormatFlagIsPacked; - sf.mSampleRate = audioFormat.frequency(); - sf.mFramesPerPacket = 1; - sf.mChannelsPerFrame = audioFormat.channels(); - sf.mBitsPerChannel = audioFormat.sampleSize(); - sf.mBytesPerFrame = sf.mChannelsPerFrame * (sf.mBitsPerChannel / 8); - sf.mBytesPerPacket = sf.mFramesPerPacket * sf.mBytesPerFrame; - sf.mFormatID = kAudioFormatLinearPCM; - - switch (audioFormat.sampleType()) { - case QAudioFormat::SignedInt: sf.mFormatFlags |= kAudioFormatFlagIsSignedInteger; break; - case QAudioFormat::UnSignedInt: /* default */ break; - case QAudioFormat::Float: sf.mFormatFlags |= kAudioFormatFlagIsFloat; break; - case QAudioFormat::Unknown: default: break; - } - - return sf; -} - -// QAudioRingBuffer -QAudioRingBuffer::QAudioRingBuffer(int bufferSize): - m_bufferSize(bufferSize) -{ - m_buffer = new char[m_bufferSize]; - reset(); -} - -QAudioRingBuffer::~QAudioRingBuffer() -{ - delete m_buffer; -} - -int QAudioRingBuffer::used() const -{ - return m_bufferUsed; -} - -int QAudioRingBuffer::free() const -{ - return m_bufferSize - m_bufferUsed; -} - -int QAudioRingBuffer::size() const -{ - return m_bufferSize; -} - -void QAudioRingBuffer::reset() -{ - m_readPos = 0; - m_writePos = 0; - m_bufferUsed = 0; -} - -QT_END_NAMESPACE - - diff --git a/src/multimedia/audio/qaudio_mac_p.h b/src/multimedia/audio/qaudio_mac_p.h deleted file mode 100644 index 4e7d688..0000000 --- a/src/multimedia/audio/qaudio_mac_p.h +++ /dev/null @@ -1,144 +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$ -** -****************************************************************************/ - -// -// 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. -// - - -#ifndef QAUDIO_MAC_P_H -#define QAUDIO_MAC_P_H - -#include - -#include -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -extern QDebug operator<<(QDebug dbg, const QAudioFormat& audioFormat); - -extern QAudioFormat toQAudioFormat(const AudioStreamBasicDescription& streamFormat); -extern AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& audioFormat); - -class QAudioRingBuffer -{ -public: - typedef QPair Region; - - QAudioRingBuffer(int bufferSize); - ~QAudioRingBuffer(); - - Region acquireReadRegion(int size) - { - const int used = m_bufferUsed.fetchAndAddAcquire(0); - - if (used > 0) { - const int readSize = qMin(size, qMin(m_bufferSize - m_readPos, used)); - - return readSize > 0 ? Region(m_buffer + m_readPos, readSize) : Region(0, 0); - } - - return Region(0, 0); - } - - void releaseReadRegion(Region const& region) - { - m_readPos = (m_readPos + region.second) % m_bufferSize; - - m_bufferUsed.fetchAndAddRelease(-region.second); - } - - Region acquireWriteRegion(int size) - { - const int free = m_bufferSize - m_bufferUsed.fetchAndAddAcquire(0); - - if (free > 0) { - const int writeSize = qMin(size, qMin(m_bufferSize - m_writePos, free)); - - return writeSize > 0 ? Region(m_buffer + m_writePos, writeSize) : Region(0, 0); - } - - return Region(0, 0); - } - - void releaseWriteRegion(Region const& region) - { - m_writePos = (m_writePos + region.second) % m_bufferSize; - - m_bufferUsed.fetchAndAddRelease(region.second); - } - - int used() const; - int free() const; - int size() const; - - void reset(); - -private: - int m_bufferSize; - int m_readPos; - int m_writePos; - char* m_buffer; - QAtomicInt m_bufferUsed; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QAUDIO_MAC_P_H - - diff --git a/src/multimedia/audio/qaudio_symbian_p.cpp b/src/multimedia/audio/qaudio_symbian_p.cpp deleted file mode 100644 index 58e3745..0000000 --- a/src/multimedia/audio/qaudio_symbian_p.cpp +++ /dev/null @@ -1,395 +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 "qaudio_symbian_p.h" -#include - -QT_BEGIN_NAMESPACE - -namespace SymbianAudio { - -DevSoundCapabilities::DevSoundCapabilities(CMMFDevSound &devsound, - QAudio::Mode mode) -{ - QT_TRAP_THROWING(constructL(devsound, mode)); -} - -DevSoundCapabilities::~DevSoundCapabilities() -{ - m_fourCC.Close(); -} - -void DevSoundCapabilities::constructL(CMMFDevSound &devsound, - QAudio::Mode mode) -{ - m_caps = devsound.Capabilities(); - - TMMFPrioritySettings settings; - - switch (mode) { - case QAudio::AudioOutput: - settings.iState = EMMFStatePlaying; - devsound.GetSupportedInputDataTypesL(m_fourCC, settings); - break; - - case QAudio::AudioInput: - settings.iState = EMMFStateRecording; - devsound.GetSupportedInputDataTypesL(m_fourCC, settings); - break; - - default: - Q_ASSERT_X(false, Q_FUNC_INFO, "Invalid mode"); - } -} - -namespace Utils { - -//----------------------------------------------------------------------------- -// Static data -//----------------------------------------------------------------------------- - -// Sample rate / frequency - -typedef TMMFSampleRate SampleRateNative; -typedef int SampleRateQt; - -const int SampleRateCount = 12; - -const SampleRateNative SampleRateListNative[SampleRateCount] = { - EMMFSampleRate8000Hz - , EMMFSampleRate11025Hz - , EMMFSampleRate12000Hz - , EMMFSampleRate16000Hz - , EMMFSampleRate22050Hz - , EMMFSampleRate24000Hz - , EMMFSampleRate32000Hz - , EMMFSampleRate44100Hz - , EMMFSampleRate48000Hz - , EMMFSampleRate64000Hz - , EMMFSampleRate88200Hz - , EMMFSampleRate96000Hz -}; - -const SampleRateQt SampleRateListQt[SampleRateCount] = { - 8000 - , 11025 - , 12000 - , 16000 - , 22050 - , 24000 - , 32000 - , 44100 - , 48000 - , 64000 - , 88200 - , 96000 -}; - -// Channels - -typedef TMMFMonoStereo ChannelsNative; -typedef int ChannelsQt; - -const int ChannelsCount = 2; - -const ChannelsNative ChannelsListNative[ChannelsCount] = { - EMMFMono - , EMMFStereo -}; - -const ChannelsQt ChannelsListQt[ChannelsCount] = { - 1 - , 2 -}; - -// Encoding - -const int EncodingCount = 6; - -const TUint32 EncodingFourCC[EncodingCount] = { - KMMFFourCCCodePCM8 // 0 - , KMMFFourCCCodePCMU8 // 1 - , KMMFFourCCCodePCM16 // 2 - , KMMFFourCCCodePCMU16 // 3 - , KMMFFourCCCodePCM16B // 4 - , KMMFFourCCCodePCMU16B // 5 -}; - -// The characterised DevSound API specification states that the iEncoding -// field in TMMFCapabilities is ignored, and that the FourCC should be used -// to specify the PCM encoding. -// See "SGL.GT0287.102 Multimedia DevSound Baseline Compatibility.doc" in the -// mm_info/mm_docs repository. -const TMMFSoundEncoding EncodingNative[EncodingCount] = { - EMMFSoundEncoding16BitPCM // 0 - , EMMFSoundEncoding16BitPCM // 1 - , EMMFSoundEncoding16BitPCM // 2 - , EMMFSoundEncoding16BitPCM // 3 - , EMMFSoundEncoding16BitPCM // 4 - , EMMFSoundEncoding16BitPCM // 5 -}; - - -const int EncodingSampleSize[EncodingCount] = { - 8 // 0 - , 8 // 1 - , 16 // 2 - , 16 // 3 - , 16 // 4 - , 16 // 5 -}; - -const QAudioFormat::Endian EncodingByteOrder[EncodingCount] = { - QAudioFormat::LittleEndian // 0 - , QAudioFormat::LittleEndian // 1 - , QAudioFormat::LittleEndian // 2 - , QAudioFormat::LittleEndian // 3 - , QAudioFormat::BigEndian // 4 - , QAudioFormat::BigEndian // 5 -}; - -const QAudioFormat::SampleType EncodingSampleType[EncodingCount] = { - QAudioFormat::SignedInt // 0 - , QAudioFormat::UnSignedInt // 1 - , QAudioFormat::SignedInt // 2 - , QAudioFormat::UnSignedInt // 3 - , QAudioFormat::SignedInt // 4 - , QAudioFormat::UnSignedInt // 5 -}; - - -//----------------------------------------------------------------------------- -// Private functions -//----------------------------------------------------------------------------- - -// Helper functions for implementing parameter conversions - -template -bool findValue(const Input *inputArray, int length, Input input, int &index) { - bool result = false; - for (int i=0; !result && i -bool convertValue(const Input *inputArray, const Output *outputArray, - int length, Input input, Output &output) { - int index; - const bool result = findValue(inputArray, length, input, index); - if (result) - output = outputArray[index]; - return result; -} - -/** - * Macro which is used to generate the implementation of the conversion - * functions. The implementation is just a wrapper around the templated - * convertValue function, e.g. - * - * CONVERSION_FUNCTION_IMPL(SampleRate, Qt, Native) - * - * expands to - * - * bool SampleRateQtToNative(int input, TMMFSampleRate &output) { - * return convertValue - * (SampleRateListQt, SampleRateListNative, SampleRateCount, - * input, output); - * } - */ -#define CONVERSION_FUNCTION_IMPL(FieldLc, Field, Input, Output) \ -bool FieldLc##Input##To##Output(Field##Input input, Field##Output &output) { \ - return convertValue(Field##List##Input, \ - Field##List##Output, Field##Count, input, output); \ -} - -//----------------------------------------------------------------------------- -// Local helper functions -//----------------------------------------------------------------------------- - -CONVERSION_FUNCTION_IMPL(sampleRate, SampleRate, Qt, Native) -CONVERSION_FUNCTION_IMPL(sampleRate, SampleRate, Native, Qt) -CONVERSION_FUNCTION_IMPL(channels, Channels, Qt, Native) -CONVERSION_FUNCTION_IMPL(channels, Channels, Native, Qt) - -bool sampleInfoQtToNative(int inputSampleSize, - QAudioFormat::Endian inputByteOrder, - QAudioFormat::SampleType inputSampleType, - TUint32 &outputFourCC, - TMMFSoundEncoding &outputEncoding) { - - bool found = false; - - for (int i=0; i &frequencies, - QList &channels, - QList &sampleSizes, - QList &byteOrders, - QList &sampleTypes) { - - frequencies.clear(); - sampleSizes.clear(); - byteOrders.clear(); - sampleTypes.clear(); - channels.clear(); - - for (int i=0; i -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace SymbianAudio { - -/** - * Default values used by audio input and output classes, when underlying - * DevSound instance has not yet been created. - */ - -const int DefaultBufferSize = 4096; // bytes -const int DefaultNotifyInterval = 1000; // ms - -/** - * Enumeration used to track state of internal DevSound instances. - * Values are translated to the corresponding QAudio::State values by - * SymbianAudio::Utils::stateNativeToQt. - */ -enum State { - ClosedState - , InitializingState - , ActiveState - , IdleState - , SuspendedState -}; - -/* - * Helper class for querying DevSound codec / format support - */ -class DevSoundCapabilities { -public: - DevSoundCapabilities(CMMFDevSound &devsound, QAudio::Mode mode); - ~DevSoundCapabilities(); - - const RArray& fourCC() const { return m_fourCC; } - const TMMFCapabilities& caps() const { return m_caps; } - -private: - void constructL(CMMFDevSound &devsound, QAudio::Mode mode); - -private: - RArray m_fourCC; - TMMFCapabilities m_caps; -}; - -namespace Utils { - -/** - * Convert native audio capabilities to QAudio lists. - */ -void capabilitiesNativeToQt(const DevSoundCapabilities &caps, - QList &frequencies, - QList &channels, - QList &sampleSizes, - QList &byteOrders, - QList &sampleTypes); - -/** - * Check whether format is supported. - */ -bool isFormatSupported(const QAudioFormat &format, - const DevSoundCapabilities &caps); - -/** - * Convert QAudioFormat to native format types. - * - * Note that, despite the name, DevSound uses TMMFCapabilities to specify - * single formats as well as capabilities. - * - * Note that this function does not modify outputFormat.iBufferSize. - */ -bool formatQtToNative(const QAudioFormat &inputFormat, - TUint32 &outputFourCC, - TMMFCapabilities &outputFormat); - -/** - * Convert internal states to QAudio states. - */ -QAudio::State stateNativeToQt(State nativeState, - QAudio::State initializingState); - -/** - * Convert data length to number of samples. - */ -qint64 bytesToSamples(const QAudioFormat &format, qint64 length); - -/** - * Convert number of samples to data length. - */ -qint64 samplesToBytes(const QAudioFormat &format, qint64 samples); - -} // namespace Utils -} // namespace SymbianAudio - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/audio/qaudiodevicefactory.cpp deleted file mode 100644 index 4f45110..0000000 --- a/src/multimedia/audio/qaudiodevicefactory.cpp +++ /dev/null @@ -1,257 +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 -#include "qaudiodevicefactory_p.h" - -#ifndef QT_NO_AUDIO_BACKEND -#if defined(Q_OS_WIN) -#include "qaudiodeviceinfo_win32_p.h" -#include "qaudiooutput_win32_p.h" -#include "qaudioinput_win32_p.h" -#elif defined(Q_OS_MAC) -#include "qaudiodeviceinfo_mac_p.h" -#include "qaudiooutput_mac_p.h" -#include "qaudioinput_mac_p.h" -#elif defined(HAS_ALSA) -#include "qaudiodeviceinfo_alsa_p.h" -#include "qaudiooutput_alsa_p.h" -#include "qaudioinput_alsa_p.h" -#elif defined(Q_OS_SYMBIAN) -#include "qaudiodeviceinfo_symbian_p.h" -#include "qaudiooutput_symbian_p.h" -#include "qaudioinput_symbian_p.h" -#endif -#endif - -QT_BEGIN_NAMESPACE - -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, - (QAudioEngineFactoryInterface_iid, QLatin1String("/audio"), Qt::CaseInsensitive)) - - -class QNullDeviceInfo : public QAbstractAudioDeviceInfo -{ -public: - QAudioFormat preferredFormat() const { qWarning()<<"using null deviceinfo, none available"; return QAudioFormat(); } - bool isFormatSupported(const QAudioFormat& ) const { return false; } - QAudioFormat nearestFormat(const QAudioFormat& ) const { return QAudioFormat(); } - QString deviceName() const { return QString(); } - QStringList codecList() { return QStringList(); } - QList frequencyList() { return QList(); } - QList channelsList() { return QList(); } - QList sampleSizeList() { return QList(); } - QList byteOrderList() { return QList(); } - QList sampleTypeList() { return QList(); } -}; - -class QNullInputDevice : public QAbstractAudioInput -{ -public: - QIODevice* start(QIODevice* ) { qWarning()<<"using null input device, none available"; return 0; } - void stop() {} - void reset() {} - void suspend() {} - void resume() {} - int bytesReady() const { return 0; } - int periodSize() const { return 0; } - void setBufferSize(int ) {} - int bufferSize() const { return 0; } - void setNotifyInterval(int ) {} - int notifyInterval() const { return 0; } - qint64 processedUSecs() const { return 0; } - qint64 elapsedUSecs() const { return 0; } - QAudio::Error error() const { return QAudio::OpenError; } - QAudio::State state() const { return QAudio::StoppedState; } - QAudioFormat format() const { return QAudioFormat(); } -}; - -class QNullOutputDevice : public QAbstractAudioOutput -{ -public: - QIODevice* start(QIODevice* ) { qWarning()<<"using null output device, none available"; return 0; } - void stop() {} - void reset() {} - void suspend() {} - void resume() {} - int bytesFree() const { return 0; } - int periodSize() const { return 0; } - void setBufferSize(int ) {} - int bufferSize() const { return 0; } - void setNotifyInterval(int ) {} - int notifyInterval() const { return 0; } - qint64 processedUSecs() const { return 0; } - qint64 elapsedUSecs() const { return 0; } - QAudio::Error error() const { return QAudio::OpenError; } - QAudio::State state() const { return QAudio::StoppedState; } - QAudioFormat format() const { return QAudioFormat(); } -}; - -QList QAudioDeviceFactory::availableDevices(QAudio::Mode mode) -{ - QList devices; -#ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) - foreach (const QByteArray &handle, QAudioDeviceInfoInternal::availableDevices(mode)) - devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode); -#endif -#endif - QFactoryLoader* l = loader(); - - foreach (QString const& key, l->keys()) { - QAudioEngineFactoryInterface* plugin = qobject_cast(l->instance(key)); - if (plugin) { - foreach (QByteArray const& handle, plugin->availableDevices(mode)) - devices << QAudioDeviceInfo(key, handle, mode); - } - - delete plugin; - } - - return devices; -} - -QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice() -{ - QAudioEngineFactoryInterface* plugin = qobject_cast(loader()->instance(QLatin1String("default"))); - - if (plugin) { - QList list = plugin->availableDevices(QAudio::AudioInput); - if (list.size() > 0) - return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput); - } -#ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) - return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput); -#endif -#endif - return QAudioDeviceInfo(); -} - -QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice() -{ - QAudioEngineFactoryInterface* plugin = qobject_cast(loader()->instance(QLatin1String("default"))); - - if (plugin) { - QList list = plugin->availableDevices(QAudio::AudioOutput); - if (list.size() > 0) - return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput); - } -#ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) - return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput); -#endif -#endif - return QAudioDeviceInfo(); -} - -QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode) -{ - QAbstractAudioDeviceInfo *rc = 0; - -#ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) - if (realm == QLatin1String("builtin")) - return new QAudioDeviceInfoInternal(handle, mode); -#endif -#endif - QAudioEngineFactoryInterface* plugin = - qobject_cast(loader()->instance(realm)); - - if (plugin) - rc = plugin->createDeviceInfo(handle, mode); - - return rc == 0 ? new QNullDeviceInfo() : rc; -} - -QAbstractAudioInput* QAudioDeviceFactory::createDefaultInputDevice(QAudioFormat const &format) -{ - return createInputDevice(defaultInputDevice(), format); -} - -QAbstractAudioOutput* QAudioDeviceFactory::createDefaultOutputDevice(QAudioFormat const &format) -{ - return createOutputDevice(defaultOutputDevice(), format); -} - -QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format) -{ - if (deviceInfo.isNull()) - return new QNullInputDevice(); -#ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) - if (deviceInfo.realm() == QLatin1String("builtin")) - return new QAudioInputPrivate(deviceInfo.handle(), format); -#endif -#endif - QAudioEngineFactoryInterface* plugin = - qobject_cast(loader()->instance(deviceInfo.realm())); - - if (plugin) - return plugin->createInput(deviceInfo.handle(), format); - - return new QNullInputDevice(); -} - -QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format) -{ - if (deviceInfo.isNull()) - return new QNullOutputDevice(); -#ifndef QT_NO_AUDIO_BACKEND -#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) - if (deviceInfo.realm() == QLatin1String("builtin")) - return new QAudioOutputPrivate(deviceInfo.handle(), format); -#endif -#endif - QAudioEngineFactoryInterface* plugin = - qobject_cast(loader()->instance(deviceInfo.realm())); - - if (plugin) - return plugin->createOutput(deviceInfo.handle(), format); - - return new QNullOutputDevice(); -} - -QT_END_NAMESPACE - diff --git a/src/multimedia/audio/qaudiodevicefactory_p.h b/src/multimedia/audio/qaudiodevicefactory_p.h deleted file mode 100644 index 8ee8b05..0000000 --- a/src/multimedia/audio/qaudiodevicefactory_p.h +++ /dev/null @@ -1,97 +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$ -** -****************************************************************************/ - -// -// 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. -// - -#ifndef QAUDIODEVICEFACTORY_P_H -#define QAUDIODEVICEFACTORY_P_H - -#include -#include -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QAbstractAudioInput; -class QAbstractAudioOutput; -class QAbstractAudioDeviceInfo; - -class QAudioDeviceFactory -{ -public: - static QList availableDevices(QAudio::Mode mode); - - static QAudioDeviceInfo defaultInputDevice(); - static QAudioDeviceInfo defaultOutputDevice(); - - static QAbstractAudioDeviceInfo* audioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode); - - static QAbstractAudioInput* createDefaultInputDevice(QAudioFormat const &format); - static QAbstractAudioOutput* createDefaultOutputDevice(QAudioFormat const &format); - - static QAbstractAudioInput* createInputDevice(QAudioDeviceInfo const &device, QAudioFormat const &format); - static QAbstractAudioOutput* createOutputDevice(QAudioDeviceInfo const &device, QAudioFormat const &format); - - static QAbstractAudioInput* createNullInput(); - static QAbstractAudioOutput* createNullOutput(); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QAUDIODEVICEFACTORY_P_H - diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp deleted file mode 100644 index ff04b4e..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo.cpp +++ /dev/null @@ -1,400 +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 "qaudiodevicefactory_p.h" -#include -#include - - -QT_BEGIN_NAMESPACE - -class QAudioDeviceInfoPrivate : public QSharedData -{ -public: - QAudioDeviceInfoPrivate():info(0) {} - QAudioDeviceInfoPrivate(const QString &r, const QByteArray &h, QAudio::Mode m): - realm(r), handle(h), mode(m) - { - info = QAudioDeviceFactory::audioDeviceInfo(realm, handle, mode); - } - - QAudioDeviceInfoPrivate(const QAudioDeviceInfoPrivate &other): - QSharedData(other), - realm(other.realm), handle(other.handle), mode(other.mode) - { - info = QAudioDeviceFactory::audioDeviceInfo(realm, handle, mode); - } - - QAudioDeviceInfoPrivate& operator=(const QAudioDeviceInfoPrivate &other) - { - delete info; - - realm = other.realm; - handle = other.handle; - mode = other.mode; - info = QAudioDeviceFactory::audioDeviceInfo(realm, handle, mode); - return *this; - } - - ~QAudioDeviceInfoPrivate() - { - delete info; - } - - QString realm; - QByteArray handle; - QAudio::Mode mode; - QAbstractAudioDeviceInfo* info; -}; - - -/*! - \class QAudioDeviceInfo - \brief The QAudioDeviceInfo class provides an interface to query audio devices and their functionality. - \inmodule QtMultimedia - \ingroup multimedia - - \since 4.6 - - QAudioDeviceInfo lets you query for audio devices--such as sound - cards and USB headsets--that are currently available on the system. - The audio devices available are dependent on the platform or audio plugins installed. - - You can also query each device for the formats it supports. A - format in this context is a set consisting of a specific byte - order, channel, codec, frequency, sample rate, and sample type. A - format is represented by the QAudioFormat class. - - The values supported by the the device for each of these - parameters can be fetched with - supportedByteOrders(), supportedChannelCounts(), supportedCodecs(), - supportedSampleRates(), supportedSampleSizes(), and - supportedSampleTypes(). The combinations supported are dependent on the platform, - audio plugins installed and the audio device capabilities. If you need a specific format, you can check if - the device supports it with isFormatSupported(), or fetch a - supported format that is as close as possible to the format with - nearestFormat(). For instance: - - \snippet doc/src/snippets/audio/main.cpp 1 - \dots 8 - \snippet doc/src/snippets/audio/main.cpp 2 - - A QAudioDeviceInfo is used by Qt to construct - classes that communicate with the device--such as - QAudioInput, and QAudioOutput. The static - functions defaultInputDevice(), defaultOutputDevice(), and - availableDevices() let you get a list of all available - devices. Devices are fetch according to the value of mode - this is specified by the QAudio::Mode enum. - The QAudioDeviceInfo returned are only valid for the QAudio::Mode. - - For instance: - - \code - foreach(const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) - qDebug() << "Device name: " << deviceInfo.deviceName(); - \endcode - - In this code sample, we loop through all devices that are able to output - sound, i.e., play an audio stream in a supported format. For each device we - find, we simply print the deviceName(). - - \sa QAudioOutput, QAudioInput -*/ - -/*! - Constructs an empty QAudioDeviceInfo object. -*/ - -QAudioDeviceInfo::QAudioDeviceInfo(): - d(new QAudioDeviceInfoPrivate) -{ -} - -/*! - Constructs a copy of \a other. -*/ - -QAudioDeviceInfo::QAudioDeviceInfo(const QAudioDeviceInfo& other): - d(other.d) -{ -} - -/*! - Destroy this audio device info. -*/ - -QAudioDeviceInfo::~QAudioDeviceInfo() -{ -} - -/*! - Sets the QAudioDeviceInfo object to be equal to \a other. -*/ - -QAudioDeviceInfo& QAudioDeviceInfo::operator=(const QAudioDeviceInfo &other) -{ - d = other.d; - return *this; -} - -/*! - Returns whether this QAudioDeviceInfo object holds a device definition. -*/ - -bool QAudioDeviceInfo::isNull() const -{ - return d->info == 0; -} - -/*! - Returns human readable name of audio device. - - Device names vary depending on platform/audio plugin being used. - - They are a unique string identifiers for the audio device. - - eg. default, Intel, U0x46d0x9a4 -*/ - -QString QAudioDeviceInfo::deviceName() const -{ - return isNull() ? QString() : d->info->deviceName(); -} - -/*! - Returns true if \a settings are supported by the audio device of this QAudioDeviceInfo. -*/ - -bool QAudioDeviceInfo::isFormatSupported(const QAudioFormat &settings) const -{ - return isNull() ? false : d->info->isFormatSupported(settings); -} - -/*! - Returns QAudioFormat of default settings. - - These settings are provided by the platform/audio plugin being used. - - They also are dependent on the QAudio::Mode being used. - - A typical audio system would provide something like: - \list - \o Input settings: 8000Hz mono 8 bit. - \o Output settings: 44100Hz stereo 16 bit little endian. - \endlist -*/ - -QAudioFormat QAudioDeviceInfo::preferredFormat() const -{ - return isNull() ? QAudioFormat() : d->info->preferredFormat(); -} - -/*! - Returns closest QAudioFormat to \a settings that system audio supports. - - These settings are provided by the platform/audio plugin being used. - - They also are dependent on the QAudio::Mode being used. -*/ - -QAudioFormat QAudioDeviceInfo::nearestFormat(const QAudioFormat &settings) const -{ - return isNull() ? QAudioFormat() : d->info->nearestFormat(settings); -} - -/*! - Returns a list of supported codecs. - - All platform and plugin implementations should provide support for: - - "audio/pcm" - Linear PCM - - For writing plugins to support additional codecs refer to: - - http://www.iana.org/assignments/media-types/audio/ -*/ - -QStringList QAudioDeviceInfo::supportedCodecs() const -{ - return isNull() ? QStringList() : d->info->codecList(); -} - -/*! - Returns a list of supported sample rates. - - \since 4.7 -*/ - -QList QAudioDeviceInfo::supportedSampleRates() const -{ - return supportedFrequencies(); -} - -/*! - \obsolete - - Use supportedSampleRates() instead. -*/ - -QList QAudioDeviceInfo::supportedFrequencies() const -{ - return isNull() ? QList() : d->info->frequencyList(); -} - -/*! - Returns a list of supported channel counts. - - \since 4.7 -*/ - -QList QAudioDeviceInfo::supportedChannelCounts() const -{ - return supportedChannels(); -} - -/*! - \obsolete - - Use supportedChannelCount() instead. -*/ - -QList QAudioDeviceInfo::supportedChannels() const -{ - return isNull() ? QList() : d->info->channelsList(); -} - -/*! - Returns a list of supported sample sizes. -*/ - -QList QAudioDeviceInfo::supportedSampleSizes() const -{ - return isNull() ? QList() : d->info->sampleSizeList(); -} - -/*! - Returns a list of supported byte orders. -*/ - -QList QAudioDeviceInfo::supportedByteOrders() const -{ - return isNull() ? QList() : d->info->byteOrderList(); -} - -/*! - Returns a list of supported sample types. -*/ - -QList QAudioDeviceInfo::supportedSampleTypes() const -{ - return isNull() ? QList() : d->info->sampleTypeList(); -} - -/*! - Returns the name of the default input audio device. - All platform and audio plugin implementations provide a default audio device to use. -*/ - -QAudioDeviceInfo QAudioDeviceInfo::defaultInputDevice() -{ - return QAudioDeviceFactory::defaultInputDevice(); -} - -/*! - Returns the name of the default output audio device. - All platform and audio plugin implementations provide a default audio device to use. -*/ - -QAudioDeviceInfo QAudioDeviceInfo::defaultOutputDevice() -{ - return QAudioDeviceFactory::defaultOutputDevice(); -} - -/*! - Returns a list of audio devices that support \a mode. -*/ - -QList QAudioDeviceInfo::availableDevices(QAudio::Mode mode) -{ - return QAudioDeviceFactory::availableDevices(mode); -} - - -/*! - \internal -*/ - -QAudioDeviceInfo::QAudioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode): - d(new QAudioDeviceInfoPrivate(realm, handle, mode)) -{ -} - -/*! - \internal -*/ - -QString QAudioDeviceInfo::realm() const -{ - return d->realm; -} - -/*! - \internal -*/ - -QByteArray QAudioDeviceInfo::handle() const -{ - return d->handle; -} - - -/*! - \internal -*/ - -QAudio::Mode QAudioDeviceInfo::mode() const -{ - return d->mode; -} - -QT_END_NAMESPACE - diff --git a/src/multimedia/audio/qaudiodeviceinfo.h b/src/multimedia/audio/qaudiodeviceinfo.h deleted file mode 100644 index 1cc0731..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo.h +++ /dev/null @@ -1,114 +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 QAUDIODEVICEINFO_H -#define QAUDIODEVICEINFO_H - -#include -#include -#include -#include -#include -#include - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QAudioDeviceFactory; - -class QAudioDeviceInfoPrivate; -class Q_MULTIMEDIA_EXPORT QAudioDeviceInfo -{ - friend class QAudioDeviceFactory; - -public: - QAudioDeviceInfo(); - QAudioDeviceInfo(const QAudioDeviceInfo& other); - ~QAudioDeviceInfo(); - - QAudioDeviceInfo& operator=(const QAudioDeviceInfo& other); - - bool isNull() const; - - QString deviceName() const; - - bool isFormatSupported(const QAudioFormat &format) const; - QAudioFormat preferredFormat() const; - QAudioFormat nearestFormat(const QAudioFormat &format) const; - - QStringList supportedCodecs() const; - QList supportedFrequencies() const; - QList supportedSampleRates() const; - QList supportedChannels() const; - QList supportedChannelCounts() const; - QList supportedSampleSizes() const; - QList supportedByteOrders() const; - QList supportedSampleTypes() const; - - static QAudioDeviceInfo defaultInputDevice(); - static QAudioDeviceInfo defaultOutputDevice(); - - static QList availableDevices(QAudio::Mode mode); - -private: - QAudioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode); - QString realm() const; - QByteArray handle() const; - QAudio::Mode mode() const; - - QSharedDataPointer d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -Q_DECLARE_METATYPE(QAudioDeviceInfo) - -#endif // QAUDIODEVICEINFO_H diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp deleted file mode 100644 index 36270a7..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp +++ /dev/null @@ -1,486 +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$ -** -****************************************************************************/ - -// -// 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 "qaudiodeviceinfo_alsa_p.h" - -#include - -QT_BEGIN_NAMESPACE - -QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray dev, QAudio::Mode mode) -{ - handle = 0; - - device = QLatin1String(dev); - this->mode = mode; -} - -QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal() -{ - close(); -} - -bool QAudioDeviceInfoInternal::isFormatSupported(const QAudioFormat& format) const -{ - return testSettings(format); -} - -QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const -{ - QAudioFormat nearest; - if(mode == QAudio::AudioOutput) { - nearest.setFrequency(44100); - nearest.setChannels(2); - nearest.setByteOrder(QAudioFormat::LittleEndian); - nearest.setSampleType(QAudioFormat::SignedInt); - nearest.setSampleSize(16); - nearest.setCodec(QLatin1String("audio/pcm")); - } else { - nearest.setFrequency(8000); - nearest.setChannels(1); - nearest.setSampleType(QAudioFormat::UnSignedInt); - nearest.setSampleSize(8); - nearest.setCodec(QLatin1String("audio/pcm")); - if(!testSettings(nearest)) { - nearest.setChannels(2); - nearest.setSampleSize(16); - nearest.setSampleType(QAudioFormat::SignedInt); - } - } - return nearest; -} - -QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat& format) const -{ - if(testSettings(format)) - return format; - else - return preferredFormat(); -} - -QString QAudioDeviceInfoInternal::deviceName() const -{ - return device; -} - -QStringList QAudioDeviceInfoInternal::codecList() -{ - updateLists(); - return codecz; -} - -QList QAudioDeviceInfoInternal::frequencyList() -{ - updateLists(); - return freqz; -} - -QList QAudioDeviceInfoInternal::channelsList() -{ - updateLists(); - return channelz; -} - -QList QAudioDeviceInfoInternal::sampleSizeList() -{ - updateLists(); - return sizez; -} - -QList QAudioDeviceInfoInternal::byteOrderList() -{ - updateLists(); - return byteOrderz; -} - -QList QAudioDeviceInfoInternal::sampleTypeList() -{ - updateLists(); - return typez; -} - -bool QAudioDeviceInfoInternal::open() -{ - int err = 0; - QString dev = device; - QList devices = availableDevices(mode); - - if(dev.compare(QLatin1String("default")) == 0) { -#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) - dev = QLatin1String(devices.first().constData()); -#else - dev = QLatin1String("hw:0,0"); -#endif - } else { -#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) - dev = device; -#else - int idx = 0; - char *name; - - QString shortName = device.mid(device.indexOf(QLatin1String("="),0)+1); - - while(snd_card_get_name(idx,&name) == 0) { - if(dev.contains(QLatin1String(name))) - break; - idx++; - } - dev = QString(QLatin1String("hw:%1,0")).arg(idx); -#endif - } - if(mode == QAudio::AudioOutput) { - err=snd_pcm_open( &handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_PLAYBACK,0); - } else { - err=snd_pcm_open( &handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_CAPTURE,0); - } - if(err < 0) { - handle = 0; - return false; - } - return true; -} - -void QAudioDeviceInfoInternal::close() -{ - if(handle) - snd_pcm_close(handle); - handle = 0; -} - -bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const -{ - // Set nearest to closest settings that do work. - // See if what is in settings will work (return value). - int err = 0; - snd_pcm_t* handle; - snd_pcm_hw_params_t *params; - QString dev = device; - - QList devices = QAudioDeviceInfoInternal::availableDevices(QAudio::AudioOutput); - - if(dev.compare(QLatin1String("default")) == 0) { -#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) - dev = QLatin1String(devices.first().constData()); -#else - dev = QLatin1String("hw:0,0"); -#endif - } else { -#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) - dev = device; -#else - int idx = 0; - char *name; - - QString shortName = device.mid(device.indexOf(QLatin1String("="),0)+1); - - while(snd_card_get_name(idx,&name) == 0) { - if(shortName.compare(QLatin1String(name)) == 0) - break; - idx++; - } - dev = QString(QLatin1String("hw:%1,0")).arg(idx); -#endif - } - if(mode == QAudio::AudioOutput) { - err=snd_pcm_open( &handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_PLAYBACK,0); - } else { - err=snd_pcm_open( &handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_CAPTURE,0); - } - if(err < 0) { - handle = 0; - return false; - } - - bool testChannel = false; - bool testCodec = false; - bool testFreq = false; - bool testType = false; - bool testSize = false; - - int dir = 0; - - snd_pcm_nonblock( handle, 0 ); - snd_pcm_hw_params_alloca( ¶ms ); - snd_pcm_hw_params_any( handle, params ); - - // set the values! - snd_pcm_hw_params_set_channels(handle,params,format.channels()); - snd_pcm_hw_params_set_rate(handle,params,format.frequency(),dir); - switch(format.sampleSize()) { - case 8: - if(format.sampleType() == QAudioFormat::SignedInt) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S8); - else if(format.sampleType() == QAudioFormat::UnSignedInt) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U8); - break; - case 16: - if(format.sampleType() == QAudioFormat::SignedInt) { - if(format.byteOrder() == QAudioFormat::LittleEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_LE); - else if(format.byteOrder() == QAudioFormat::BigEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_BE); - } else if(format.sampleType() == QAudioFormat::UnSignedInt) { - if(format.byteOrder() == QAudioFormat::LittleEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_LE); - else if(format.byteOrder() == QAudioFormat::BigEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_BE); - } - break; - case 32: - if(format.sampleType() == QAudioFormat::SignedInt) { - if(format.byteOrder() == QAudioFormat::LittleEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_LE); - else if(format.byteOrder() == QAudioFormat::BigEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_BE); - } else if(format.sampleType() == QAudioFormat::UnSignedInt) { - if(format.byteOrder() == QAudioFormat::LittleEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_LE); - else if(format.byteOrder() == QAudioFormat::BigEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_BE); - } - } - - // For now, just accept only audio/pcm codec - if(!format.codec().startsWith(QLatin1String("audio/pcm"))) { - err=-1; - } else - testCodec = true; - - if(err>=0 && format.channels() != -1) { - err = snd_pcm_hw_params_test_channels(handle,params,format.channels()); - if(err>=0) - err = snd_pcm_hw_params_set_channels(handle,params,format.channels()); - if(err>=0) - testChannel = true; - } - - if(err>=0 && format.frequency() != -1) { - err = snd_pcm_hw_params_test_rate(handle,params,format.frequency(),0); - if(err>=0) - err = snd_pcm_hw_params_set_rate(handle,params,format.frequency(),dir); - if(err>=0) - testFreq = true; - } - - if((err>=0 && format.sampleSize() != -1) && - (format.sampleType() != QAudioFormat::Unknown)) { - switch(format.sampleSize()) { - case 8: - if(format.sampleType() == QAudioFormat::SignedInt) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S8); - else if(format.sampleType() == QAudioFormat::UnSignedInt) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U8); - break; - case 16: - if(format.sampleType() == QAudioFormat::SignedInt) { - if(format.byteOrder() == QAudioFormat::LittleEndian) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_LE); - else if(format.byteOrder() == QAudioFormat::BigEndian) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_BE); - } else if(format.sampleType() == QAudioFormat::UnSignedInt) { - if(format.byteOrder() == QAudioFormat::LittleEndian) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_LE); - else if(format.byteOrder() == QAudioFormat::BigEndian) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_BE); - } - break; - case 32: - if(format.sampleType() == QAudioFormat::SignedInt) { - if(format.byteOrder() == QAudioFormat::LittleEndian) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_LE); - else if(format.byteOrder() == QAudioFormat::BigEndian) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_BE); - } else if(format.sampleType() == QAudioFormat::UnSignedInt) { - if(format.byteOrder() == QAudioFormat::LittleEndian) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_LE); - else if(format.byteOrder() == QAudioFormat::BigEndian) - err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_BE); - } - } - if(err>=0) { - testSize = true; - testType = true; - } - } - if(err>=0) - err = snd_pcm_hw_params(handle, params); - - if(err == 0) { - // settings work - // close() - if(handle) - snd_pcm_close(handle); - return true; - } - if(handle) - snd_pcm_close(handle); - - return false; -} - -void QAudioDeviceInfoInternal::updateLists() -{ - // redo all lists based on current settings - freqz.clear(); - channelz.clear(); - sizez.clear(); - byteOrderz.clear(); - typez.clear(); - codecz.clear(); - - if(!handle) - open(); - - if(!handle) - return; - - for(int i=0; i<(int)MAX_SAMPLE_RATES; i++) { - //if(snd_pcm_hw_params_test_rate(handle, params, SAMPLE_RATES[i], dir) == 0) - freqz.append(SAMPLE_RATES[i]); - } - channelz.append(1); - channelz.append(2); - sizez.append(8); - sizez.append(16); - sizez.append(32); - byteOrderz.append(QAudioFormat::LittleEndian); - byteOrderz.append(QAudioFormat::BigEndian); - typez.append(QAudioFormat::SignedInt); - typez.append(QAudioFormat::UnSignedInt); - typez.append(QAudioFormat::Float); - codecz.append(QLatin1String("audio/pcm")); - close(); -} - -QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) -{ - QList allDevices; - QList devices; - QByteArray filter; - -#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) - // Create a list of all current audio devices that support mode - void **hints, **n; - char *name, *descr, *io; - - if(snd_device_name_hint(-1, "pcm", &hints) < 0) { - qWarning() << "no alsa devices available"; - return devices; - } - n = hints; - - if(mode == QAudio::AudioInput) { - filter = "Input"; - } else { - filter = "Output"; - } - - while (*n != NULL) { - name = snd_device_name_get_hint(*n, "NAME"); - descr = snd_device_name_get_hint(*n, "DESC"); - io = snd_device_name_get_hint(*n, "IOID"); - if((name != NULL) && (descr != NULL) && ((io == NULL) || (io == filter))) { - QString deviceName = QLatin1String(name); - QString deviceDescription = QLatin1String(descr); - allDevices.append(deviceName.toLocal8Bit().constData()); - if(deviceDescription.contains(QLatin1String("Default Audio Device"))) - devices.append(deviceName.toLocal8Bit().constData()); - } - if(name != NULL) - free(name); - if(descr != NULL) - free(descr); - if(io != NULL) - free(io); - ++n; - } - snd_device_name_free_hint(hints); - - if(devices.size() > 0) { - devices.append("default"); - } -#else - int idx = 0; - char* name; - - while(snd_card_get_name(idx,&name) == 0) { - devices.append(name); - idx++; - } - if (idx > 0) - devices.append("default"); -#endif - if (devices.size() == 0 && allDevices.size() > 0) - return allDevices; - - return devices; -} - -QByteArray QAudioDeviceInfoInternal::defaultInputDevice() -{ - QList devices = availableDevices(QAudio::AudioInput); - if(devices.size() == 0) - return QByteArray(); - - return devices.first(); -} - -QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() -{ - QList devices = availableDevices(QAudio::AudioOutput); - if(devices.size() == 0) - return QByteArray(); - - return devices.first(); -} - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h deleted file mode 100644 index 6f9a459..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h +++ /dev/null @@ -1,117 +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$ -** -****************************************************************************/ - -// -// 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. -// - - -#ifndef QAUDIODEVICEINFOALSA_H -#define QAUDIODEVICEINFOALSA_H - -#include - -#include -#include -#include -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -const unsigned int MAX_SAMPLE_RATES = 5; -const unsigned int SAMPLE_RATES[] = - { 8000, 11025, 22050, 44100, 48000 }; - -class QAudioDeviceInfoInternal : public QAbstractAudioDeviceInfo -{ - Q_OBJECT -public: - QAudioDeviceInfoInternal(QByteArray dev,QAudio::Mode mode); - ~QAudioDeviceInfoInternal(); - - bool testSettings(const QAudioFormat& format) const; - void updateLists(); - QAudioFormat preferredFormat() const; - bool isFormatSupported(const QAudioFormat& format) const; - QAudioFormat nearestFormat(const QAudioFormat& format) const; - QString deviceName() const; - QStringList codecList(); - QList frequencyList(); - QList channelsList(); - QList sampleSizeList(); - QList byteOrderList(); - QList sampleTypeList(); - static QByteArray defaultInputDevice(); - static QByteArray defaultOutputDevice(); - static QList availableDevices(QAudio::Mode); - -private: - bool open(); - void close(); - - QString device; - QAudio::Mode mode; - QAudioFormat nearest; - QList freqz; - QList channelz; - QList sizez; - QList byteOrderz; - QStringList codecz; - QList typez; - snd_pcm_t* handle; - snd_pcm_hw_params_t *params; -}; - -QT_END_NAMESPACE - -#endif - diff --git a/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp deleted file mode 100644 index ecd03e5..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp +++ /dev/null @@ -1,357 +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$ -** -****************************************************************************/ - -// -// 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 -#include -#include -#include -#include - -#include -#include "qaudio_mac_p.h" -#include "qaudiodeviceinfo_mac_p.h" - - - -QT_BEGIN_NAMESPACE - - -QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray const& handle, QAudio::Mode) -{ - QDataStream ds(handle); - quint32 did, tm; - - ds >> did >> tm >> name; - deviceId = AudioDeviceID(did); - mode = QAudio::Mode(tm); -} - -bool QAudioDeviceInfoInternal::isFormatSupported(const QAudioFormat& format) const -{ - return format.codec() == QString::fromLatin1("audio/pcm"); -} - -QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const -{ - QAudioFormat rc; - - UInt32 propSize = 0; - - if (AudioDeviceGetPropertyInfo(deviceId, - 0, - mode == QAudio::AudioInput, - kAudioDevicePropertyStreams, - &propSize, - 0) == noErr) { - - const int sc = propSize / sizeof(AudioStreamID); - - if (sc > 0) { - AudioStreamID* streams = new AudioStreamID[sc]; - - if (AudioDeviceGetProperty(deviceId, - 0, - mode == QAudio::AudioInput, - kAudioDevicePropertyStreams, - &propSize, - streams) == noErr) { - - for (int i = 0; i < sc; ++i) { - if (AudioStreamGetPropertyInfo(streams[i], - 0, - kAudioStreamPropertyPhysicalFormat, - &propSize, - 0) == noErr) { - - AudioStreamBasicDescription sf; - - if (AudioStreamGetProperty(streams[i], - 0, - kAudioStreamPropertyPhysicalFormat, - &propSize, - &sf) == noErr) { - rc = toQAudioFormat(sf); - break; - } - } - } - } - - delete streams; - } - } - - return rc; -} - -QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat& format) const -{ - QAudioFormat rc(format); - QAudioFormat target = preferredFormat(); - - if (!format.codec().isEmpty() && format.codec() != QString::fromLatin1("audio/pcm")) - return QAudioFormat(); - - rc.setCodec(QString::fromLatin1("audio/pcm")); - - if (rc.frequency() != target.frequency()) - rc.setFrequency(target.frequency()); - if (rc.channels() != target.channels()) - rc.setChannels(target.channels()); - if (rc.sampleSize() != target.sampleSize()) - rc.setSampleSize(target.sampleSize()); - if (rc.byteOrder() != target.byteOrder()) - rc.setByteOrder(target.byteOrder()); - if (rc.sampleType() != target.sampleType()) - rc.setSampleType(target.sampleType()); - - return rc; -} - -QString QAudioDeviceInfoInternal::deviceName() const -{ - return name; -} - -QStringList QAudioDeviceInfoInternal::codecList() -{ - return QStringList() << QString::fromLatin1("audio/pcm"); -} - -QList QAudioDeviceInfoInternal::frequencyList() -{ - QSet rc; - - // Add some common frequencies - rc << 8000 << 11025 << 22050 << 44100; - - // - UInt32 propSize = 0; - - if (AudioDeviceGetPropertyInfo(deviceId, - 0, - mode == QAudio::AudioInput, - kAudioDevicePropertyAvailableNominalSampleRates, - &propSize, - 0) == noErr) { - - const int pc = propSize / sizeof(AudioValueRange); - - if (pc > 0) { - AudioValueRange* vr = new AudioValueRange[pc]; - - if (AudioDeviceGetProperty(deviceId, - 0, - mode == QAudio::AudioInput, - kAudioDevicePropertyAvailableNominalSampleRates, - &propSize, - vr) == noErr) { - - for (int i = 0; i < pc; ++i) - rc << vr[i].mMaximum; - } - - delete vr; - } - } - - return rc.toList(); -} - -QList QAudioDeviceInfoInternal::channelsList() -{ - QList rc; - - // Can mix down to 1 channel - rc << 1; - - UInt32 propSize = 0; - int channels = 0; - - if (AudioDeviceGetPropertyInfo(deviceId, - 0, - mode == QAudio::AudioInput, - kAudioDevicePropertyStreamConfiguration, - &propSize, - 0) == noErr) { - - AudioBufferList* audioBufferList = static_cast(qMalloc(propSize)); - - if (audioBufferList != 0) { - if (AudioDeviceGetProperty(deviceId, - 0, - mode == QAudio::AudioInput, - kAudioDevicePropertyStreamConfiguration, - &propSize, - audioBufferList) == noErr) { - - for (int i = 0; i < int(audioBufferList->mNumberBuffers); ++i) { - channels += audioBufferList->mBuffers[i].mNumberChannels; - rc << channels; - } - } - - qFree(audioBufferList); - } - } - - return rc; -} - -QList QAudioDeviceInfoInternal::sampleSizeList() -{ - return QList() << 8 << 16 << 24 << 32 << 64; -} - -QList QAudioDeviceInfoInternal::byteOrderList() -{ - return QList() << QAudioFormat::LittleEndian << QAudioFormat::BigEndian; -} - -QList QAudioDeviceInfoInternal::sampleTypeList() -{ - return QList() << QAudioFormat::SignedInt << QAudioFormat::UnSignedInt << QAudioFormat::Float; -} - -static QByteArray get_device_info(AudioDeviceID audioDevice, QAudio::Mode mode) -{ - UInt32 size; - QByteArray device; - QDataStream ds(&device, QIODevice::WriteOnly); - AudioStreamBasicDescription sf; - CFStringRef name; - Boolean isInput = mode == QAudio::AudioInput; - - // Id - ds << quint32(audioDevice); - - // Mode - size = sizeof(AudioStreamBasicDescription); - if (AudioDeviceGetProperty(audioDevice, 0, isInput, kAudioDevicePropertyStreamFormat, - &size, &sf) != noErr) { - return QByteArray(); - } - ds << quint32(mode); - - // Name - size = sizeof(CFStringRef); - if (AudioDeviceGetProperty(audioDevice, 0, isInput, kAudioObjectPropertyName, - &size, &name) != noErr) { - qWarning() << "QAudioDeviceInfo: Unable to find device name"; - } - ds << QCFString::toQString(name); - - CFRelease(name); - - return device; -} - -QByteArray QAudioDeviceInfoInternal::defaultInputDevice() -{ - AudioDeviceID audioDevice; - UInt32 size = sizeof(audioDevice); - - if (AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, &size, - &audioDevice) != noErr) { - qWarning() << "QAudioDeviceInfo: Unable to find default input device"; - return QByteArray(); - } - - return get_device_info(audioDevice, QAudio::AudioInput); -} - -QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() -{ - AudioDeviceID audioDevice; - UInt32 size = sizeof(audioDevice); - - if (AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &size, - &audioDevice) != noErr) { - qWarning() << "QAudioDeviceInfo: Unable to find default output device"; - return QByteArray(); - } - - return get_device_info(audioDevice, QAudio::AudioOutput); -} - -QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) -{ - QList devices; - - UInt32 propSize = 0; - - if (AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &propSize, 0) == noErr) { - - const int dc = propSize / sizeof(AudioDeviceID); - - if (dc > 0) { - AudioDeviceID* audioDevices = new AudioDeviceID[dc]; - - if (AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &propSize, audioDevices) == noErr) { - for (int i = 0; i < dc; ++i) { - QByteArray info = get_device_info(audioDevices[i], mode); - if (!info.isNull()) - devices << info; - } - } - - delete audioDevices; - } - } - - return devices; -} - - -QT_END_NAMESPACE - diff --git a/src/multimedia/audio/qaudiodeviceinfo_mac_p.h b/src/multimedia/audio/qaudiodeviceinfo_mac_p.h deleted file mode 100644 index e234384..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo_mac_p.h +++ /dev/null @@ -1,97 +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$ -** -****************************************************************************/ - -// -// 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. -// - - -#ifndef QDEVICEINFO_MAC_P_H -#define QDEVICEINFO_MAC_P_H - -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QAudioDeviceInfoInternal : public QAbstractAudioDeviceInfo -{ -public: - AudioDeviceID deviceId; - QString name; - QAudio::Mode mode; - - QAudioDeviceInfoInternal(QByteArray const& handle, QAudio::Mode mode); - - bool isFormatSupported(const QAudioFormat& format) const; - QAudioFormat preferredFormat() const; - QAudioFormat nearestFormat(const QAudioFormat& format) const; - - QString deviceName() const; - - QStringList codecList(); - QList frequencyList(); - QList channelsList(); - QList sampleSizeList(); - QList byteOrderList(); - QList sampleTypeList(); - - static QByteArray defaultInputDevice(); - static QByteArray defaultOutputDevice(); - - static QList availableDevices(QAudio::Mode mode); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDEVICEINFO_MAC_P_H diff --git a/src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp deleted file mode 100644 index 36284d3..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp +++ /dev/null @@ -1,200 +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 "qaudiodeviceinfo_symbian_p.h" -#include "qaudio_symbian_p.h" - -QT_BEGIN_NAMESPACE - -QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray device, - QAudio::Mode mode) - : m_deviceName(QLatin1String(device)) - , m_mode(mode) - , m_updated(false) -{ - QT_TRAP_THROWING(m_devsound.reset(CMMFDevSound::NewL())); -} - -QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal() -{ - -} - -QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const -{ - QAudioFormat format; - switch (m_mode) { - case QAudio::AudioOutput: - format.setFrequency(44100); - format.setChannels(2); - format.setSampleSize(16); - format.setByteOrder(QAudioFormat::LittleEndian); - format.setSampleType(QAudioFormat::SignedInt); - format.setCodec(QLatin1String("audio/pcm")); - break; - - case QAudio::AudioInput: - format.setFrequency(8000); - format.setChannels(1); - format.setSampleSize(16); - format.setByteOrder(QAudioFormat::LittleEndian); - format.setSampleType(QAudioFormat::SignedInt); - format.setCodec(QLatin1String("audio/pcm")); - break; - - default: - Q_ASSERT_X(false, Q_FUNC_INFO, "Invalid mode"); - } - - if (!isFormatSupported(format)) { - if (m_frequencies.size()) - format.setFrequency(m_frequencies[0]); - if (m_channels.size()) - format.setChannels(m_channels[0]); - if (m_sampleSizes.size()) - format.setSampleSize(m_sampleSizes[0]); - if (m_byteOrders.size()) - format.setByteOrder(m_byteOrders[0]); - if (m_sampleTypes.size()) - format.setSampleType(m_sampleTypes[0]); - } - - return format; -} - -bool QAudioDeviceInfoInternal::isFormatSupported( - const QAudioFormat &format) const -{ - getSupportedFormats(); - const bool supported = - m_codecs.contains(format.codec()) - && m_frequencies.contains(format.frequency()) - && m_channels.contains(format.channels()) - && m_sampleSizes.contains(format.sampleSize()) - && m_byteOrders.contains(format.byteOrder()) - && m_sampleTypes.contains(format.sampleType()); - - return supported; -} - -QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat &format) const -{ - if (isFormatSupported(format)) - return format; - else - return preferredFormat(); -} - -QString QAudioDeviceInfoInternal::deviceName() const -{ - return m_deviceName; -} - -QStringList QAudioDeviceInfoInternal::codecList() -{ - getSupportedFormats(); - return m_codecs; -} - -QList QAudioDeviceInfoInternal::frequencyList() -{ - getSupportedFormats(); - return m_frequencies; -} - -QList QAudioDeviceInfoInternal::channelsList() -{ - getSupportedFormats(); - return m_channels; -} - -QList QAudioDeviceInfoInternal::sampleSizeList() -{ - getSupportedFormats(); - return m_sampleSizes; -} - -QList QAudioDeviceInfoInternal::byteOrderList() -{ - getSupportedFormats(); - return m_byteOrders; -} - -QList QAudioDeviceInfoInternal::sampleTypeList() -{ - getSupportedFormats(); - return m_sampleTypes; -} - -QByteArray QAudioDeviceInfoInternal::defaultInputDevice() -{ - return QByteArray("default"); -} - -QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() -{ - return QByteArray("default"); -} - -QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode) -{ - QList result; - result += QByteArray("default"); - return result; -} - -void QAudioDeviceInfoInternal::getSupportedFormats() const -{ - if (!m_updated) { - QScopedPointer caps( - new SymbianAudio::DevSoundCapabilities(*m_devsound, m_mode)); - - SymbianAudio::Utils::capabilitiesNativeToQt(*caps, - m_frequencies, m_channels, m_sampleSizes, - m_byteOrders, m_sampleTypes); - - m_codecs.append(QLatin1String("audio/pcm")); - - m_updated = true; - } -} - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudiodeviceinfo_symbian_p.h b/src/multimedia/audio/qaudiodeviceinfo_symbian_p.h deleted file mode 100644 index 89e539f..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo_symbian_p.h +++ /dev/null @@ -1,107 +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$ -** -****************************************************************************/ - -// -// 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. -// - -#ifndef QAUDIODEVICEINFO_SYMBIAN_P_H -#define QAUDIODEVICEINFO_SYMBIAN_P_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QAudioDeviceInfoInternal - : public QAbstractAudioDeviceInfo -{ - Q_OBJECT - -public: - QAudioDeviceInfoInternal(QByteArray device, QAudio::Mode mode); - ~QAudioDeviceInfoInternal(); - - // QAbstractAudioDeviceInfo - QAudioFormat preferredFormat() const; - bool isFormatSupported(const QAudioFormat &format) const; - QAudioFormat nearestFormat(const QAudioFormat &format) const; - QString deviceName() const; - QStringList codecList(); - QList frequencyList(); - QList channelsList(); - QList sampleSizeList(); - QList byteOrderList(); - QList sampleTypeList(); - static QByteArray defaultInputDevice(); - static QByteArray defaultOutputDevice(); - static QList availableDevices(QAudio::Mode); - -private: - void getSupportedFormats() const; - -private: - QScopedPointer m_devsound; - - QString m_deviceName; - QAudio::Mode m_mode; - - // Mutable to allow lazy initialization when called from const-qualified - // public functions (isFormatSupported, nearestFormat) - mutable bool m_updated; - mutable QStringList m_codecs; - mutable QList m_frequencies; - mutable QList m_channels; - mutable QList m_sampleSizes; - mutable QList m_byteOrders; - mutable QList m_sampleTypes; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp deleted file mode 100644 index aee0807..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp +++ /dev/null @@ -1,433 +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$ -** -****************************************************************************/ - -// -// 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 -#include "qaudiodeviceinfo_win32_p.h" - -QT_BEGIN_NAMESPACE - -// For mingw toolchain mmsystem.h only defines half the defines, so add if needed. -#ifndef WAVE_FORMAT_44M08 -#define WAVE_FORMAT_44M08 0x00000100 -#define WAVE_FORMAT_44S08 0x00000200 -#define WAVE_FORMAT_44M16 0x00000400 -#define WAVE_FORMAT_44S16 0x00000800 -#define WAVE_FORMAT_48M08 0x00001000 -#define WAVE_FORMAT_48S08 0x00002000 -#define WAVE_FORMAT_48M16 0x00004000 -#define WAVE_FORMAT_48S16 0x00008000 -#define WAVE_FORMAT_96M08 0x00010000 -#define WAVE_FORMAT_96S08 0x00020000 -#define WAVE_FORMAT_96M16 0x00040000 -#define WAVE_FORMAT_96S16 0x00080000 -#endif - - -QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray dev, QAudio::Mode mode) -{ - device = QLatin1String(dev); - this->mode = mode; - - updateLists(); -} - -QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal() -{ - close(); -} - -bool QAudioDeviceInfoInternal::isFormatSupported(const QAudioFormat& format) const -{ - return testSettings(format); -} - -QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const -{ - QAudioFormat nearest; - if(mode == QAudio::AudioOutput) { - nearest.setFrequency(44100); - nearest.setChannelCount(2); - nearest.setByteOrder(QAudioFormat::LittleEndian); - nearest.setSampleType(QAudioFormat::SignedInt); - nearest.setSampleSize(16); - nearest.setCodec(QLatin1String("audio/pcm")); - } else { - nearest.setFrequency(11025); - nearest.setChannelCount(1); - nearest.setByteOrder(QAudioFormat::LittleEndian); - nearest.setSampleType(QAudioFormat::SignedInt); - nearest.setSampleSize(8); - nearest.setCodec(QLatin1String("audio/pcm")); - } - return nearest; -} - -QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat& format) const -{ - if(testSettings(format)) - return format; - else - return preferredFormat(); -} - -QString QAudioDeviceInfoInternal::deviceName() const -{ - return device; -} - -QStringList QAudioDeviceInfoInternal::codecList() -{ - updateLists(); - return codecz; -} - -QList QAudioDeviceInfoInternal::frequencyList() -{ - updateLists(); - return freqz; -} - -QList QAudioDeviceInfoInternal::channelsList() -{ - updateLists(); - return channelz; -} - -QList QAudioDeviceInfoInternal::sampleSizeList() -{ - updateLists(); - return sizez; -} - -QList QAudioDeviceInfoInternal::byteOrderList() -{ - updateLists(); - return byteOrderz; -} - -QList QAudioDeviceInfoInternal::sampleTypeList() -{ - updateLists(); - return typez; -} - - -bool QAudioDeviceInfoInternal::open() -{ - return true; -} - -void QAudioDeviceInfoInternal::close() -{ -} - -bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const -{ - // Set nearest to closest settings that do work. - // See if what is in settings will work (return value). - - bool failed = false; - bool match = false; - - // check codec - for( int i = 0; i < codecz.count(); i++) { - if (format.codec() == codecz.at(i)) - match = true; - } - if (!match) failed = true; - - // check channel - match = false; - if (!failed) { - for( int i = 0; i < channelz.count(); i++) { - if (format.channels() == channelz.at(i)) { - match = true; - break; - } - } - } - if (!match) failed = true; - - // check frequency - match = false; - if (!failed) { - for( int i = 0; i < freqz.count(); i++) { - if (format.frequency() == freqz.at(i)) { - match = true; - break; - } - } - } - - // check sample size - match = false; - if (!failed) { - for( int i = 0; i < sizez.count(); i++) { - if (format.sampleSize() == sizez.at(i)) { - match = true; - break; - } - } - } - - // check byte order - match = false; - if (!failed) { - for( int i = 0; i < byteOrderz.count(); i++) { - if (format.byteOrder() == byteOrderz.at(i)) { - match = true; - break; - } - } - } - - // check sample type - match = false; - if (!failed) { - for( int i = 0; i < typez.count(); i++) { - if (format.sampleType() == typez.at(i)) { - match = true; - break; - } - } - } - - if(!failed) { - // settings work - return true; - } - return false; -} - -void QAudioDeviceInfoInternal::updateLists() -{ - // redo all lists based on current settings - bool base = false; - bool match = false; - DWORD fmt = NULL; - QString tmp; - - if(device.compare(QLatin1String("default")) == 0) - base = true; - - if(mode == QAudio::AudioOutput) { - WAVEOUTCAPS woc; - unsigned long iNumDevs,i; - iNumDevs = waveOutGetNumDevs(); - for(i=0;i 0) - freqz.prepend(8000); -} - -QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) -{ - Q_UNUSED(mode) - - QList devices; - - if(mode == QAudio::AudioOutput) { - WAVEOUTCAPS woc; - unsigned long iNumDevs,i; - iNumDevs = waveOutGetNumDevs(); - for(i=0;i 0) - devices.append("default"); - - return devices; -} - -QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() -{ - return QByteArray("default"); -} - -QByteArray QAudioDeviceInfoInternal::defaultInputDevice() -{ - return QByteArray("default"); -} - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.h b/src/multimedia/audio/qaudiodeviceinfo_win32_p.h deleted file mode 100644 index cb6dd91..0000000 --- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.h +++ /dev/null @@ -1,112 +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$ -** -****************************************************************************/ - -// -// 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. -// - - -#ifndef QAUDIODEVICEINFOWIN_H -#define QAUDIODEVICEINFOWIN_H - -#include -#include -#include -#include - -#include -#include - - -QT_BEGIN_NAMESPACE - -const unsigned int MAX_SAMPLE_RATES = 5; -const unsigned int SAMPLE_RATES[] = { 8000, 11025, 22050, 44100, 48000 }; - -class QAudioDeviceInfoInternal : public QAbstractAudioDeviceInfo -{ - Q_OBJECT - -public: - QAudioDeviceInfoInternal(QByteArray dev,QAudio::Mode mode); - ~QAudioDeviceInfoInternal(); - - bool open(); - void close(); - - bool testSettings(const QAudioFormat& format) const; - void updateLists(); - QAudioFormat preferredFormat() const; - bool isFormatSupported(const QAudioFormat& format) const; - QAudioFormat nearestFormat(const QAudioFormat& format) const; - QString deviceName() const; - QStringList codecList(); - QList frequencyList(); - QList channelsList(); - QList sampleSizeList(); - QList byteOrderList(); - QList sampleTypeList(); - static QByteArray defaultInputDevice(); - static QByteArray defaultOutputDevice(); - static QList availableDevices(QAudio::Mode); - -private: - QAudio::Mode mode; - QString device; - QAudioFormat nearest; - QList freqz; - QList channelz; - QList sizez; - QList byteOrderz; - QStringList codecz; - QList typez; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/audio/qaudioengine.cpp b/src/multimedia/audio/qaudioengine.cpp deleted file mode 100644 index 7f1f5d3..0000000 --- a/src/multimedia/audio/qaudioengine.cpp +++ /dev/null @@ -1,343 +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 - -QT_BEGIN_NAMESPACE - -/*! - \class QAbstractAudioDeviceInfo - \brief The QAbstractAudioDeviceInfo class provides access for QAudioDeviceInfo to access the audio - device provided by the plugin. - \internal - - \ingroup multimedia - - This class implements the audio functionality for - QAudioDeviceInfo, i.e., QAudioDeviceInfo keeps a - QAbstractAudioDeviceInfo and routes function calls to it. For a - description of the functionality that QAbstractAudioDeviceInfo - implements, you can read the class and functions documentation of - QAudioDeviceInfo. - - \sa QAudioDeviceInfo -*/ - -/*! - \fn virtual QAudioFormat QAbstractAudioDeviceInfo::preferredFormat() const - Returns the nearest settings. -*/ - -/*! - \fn virtual bool QAbstractAudioDeviceInfo::isFormatSupported(const QAudioFormat& format) const - Returns true if \a format is available from audio device. -*/ - -/*! - \fn virtual QAudioFormat QAbstractAudioDeviceInfo::nearestFormat(const QAudioFormat& format) const - Returns the nearest settings \a format. -*/ - -/*! - \fn virtual QString QAbstractAudioDeviceInfo::deviceName() const - Returns the audio device name. -*/ - -/*! - \fn virtual QStringList QAbstractAudioDeviceInfo::codecList() - Returns the list of currently available codecs. -*/ - -/*! - \fn virtual QList QAbstractAudioDeviceInfo::frequencyList() - Returns the list of currently available frequencies. -*/ - -/*! - \fn virtual QList QAbstractAudioDeviceInfo::channelsList() - Returns the list of currently available channels. -*/ - -/*! - \fn virtual QList QAbstractAudioDeviceInfo::sampleSizeList() - Returns the list of currently available sample sizes. -*/ - -/*! - \fn virtual QList QAbstractAudioDeviceInfo::byteOrderList() - Returns the list of currently available byte orders. -*/ - -/*! - \fn virtual QList QAbstractAudioDeviceInfo::sampleTypeList() - Returns the list of currently available sample types. -*/ - -/*! - \class QAbstractAudioOutput - \brief The QAbstractAudioOutput class provides access for QAudioOutput to access the audio - device provided by the plugin. - \internal - - \ingroup multimedia - - QAbstractAudioOutput implements audio functionality for - QAudioOutput, i.e., QAudioOutput routes function calls to - QAbstractAudioOutput. For a description of the functionality that - is implemented, see the QAudioOutput class and function - descriptions. - - \sa QAudioOutput -*/ - -/*! - \fn virtual QIODevice* QAbstractAudioOutput::start(QIODevice* device) - Uses the \a device as the QIODevice to transfer data. If \a device is null then the class - creates an internal QIODevice. Returns a pointer to the QIODevice being used to handle - the data transfer. This QIODevice can be used to write() audio data directly. Passing a - QIODevice allows the data to be transfered without any extra code. -*/ - -/*! - \fn virtual void QAbstractAudioOutput::stop() - Stops the audio output. -*/ - -/*! - \fn virtual void QAbstractAudioOutput::reset() - Drops all audio data in the buffers, resets buffers to zero. -*/ - -/*! - \fn virtual void QAbstractAudioOutput::suspend() - Stops processing audio data, preserving buffered audio data. -*/ - -/*! - \fn virtual void QAbstractAudioOutput::resume() - Resumes processing audio data after a suspend() -*/ - -/*! - \fn virtual int QAbstractAudioOutput::bytesFree() const - Returns the free space available in bytes in the audio buffer. -*/ - -/*! - \fn virtual int QAbstractAudioOutput::periodSize() const - Returns the period size in bytes. -*/ - -/*! - \fn virtual void QAbstractAudioOutput::setBufferSize(int value) - Sets the audio buffer size to \a value in bytes. -*/ - -/*! - \fn virtual int QAbstractAudioOutput::bufferSize() const - Returns the audio buffer size in bytes. -*/ - -/*! - \fn virtual void QAbstractAudioOutput::setNotifyInterval(int ms) - Sets the interval for notify() signal to be emitted. This is based on the \a ms - of audio data processed not on actual real-time. The resolution of the timer - is platform specific. -*/ - -/*! - \fn virtual int QAbstractAudioOutput::notifyInterval() const - Returns the notify interval in milliseconds. -*/ - -/*! - \fn virtual qint64 QAbstractAudioOutput::processedUSecs() const - Returns the amount of audio data processed since start() was called in milliseconds. -*/ - -/*! - \fn virtual qint64 QAbstractAudioOutput::elapsedUSecs() const - Returns the milliseconds since start() was called, including time in Idle and suspend states. -*/ - -/*! - \fn virtual QAudio::Error QAbstractAudioOutput::error() const - Returns the error state. -*/ - -/*! - \fn virtual QAudio::State QAbstractAudioOutput::state() const - Returns the state of audio processing. -*/ - -/*! - \fn virtual QAudioFormat QAbstractAudioOutput::format() const - Returns the QAudioFormat being used. -*/ - -/*! - \fn QAbstractAudioOutput::stateChanged(QAudio::State state) - This signal is emitted when the device \a state has changed. -*/ - -/*! - \fn QAbstractAudioOutput::notify() - This signal is emitted when x ms of audio data has been processed - the interval set by setNotifyInterval(x). -*/ - - -/*! - \class QAbstractAudioInput - \brief The QAbstractAudioInput class provides access for QAudioInput to access the audio - device provided by the plugin. - \internal - - \ingroup multimedia - - QAudioDeviceInput keeps an instance of QAbstractAudioInput and - routes calls to functions of the same name to QAbstractAudioInput. - This means that it is QAbstractAudioInput that implements the - audio functionality. For a description of the functionality, see - the QAudioInput class description. - - \sa QAudioInput -*/ - -/*! - \fn virtual QIODevice* QAbstractAudioInput::start(QIODevice* device) - Uses the \a device as the QIODevice to transfer data. If \a device is null - then the class creates an internal QIODevice. Returns a pointer to the - QIODevice being used to handle the data transfer. This QIODevice can be used to - read() audio data directly. Passing a QIODevice allows the data to be transfered - without any extra code. -*/ - -/*! - \fn virtual void QAbstractAudioInput::stop() - Stops the audio input. -*/ - -/*! - \fn virtual void QAbstractAudioInput::reset() - Drops all audio data in the buffers, resets buffers to zero. -*/ - -/*! - \fn virtual void QAbstractAudioInput::suspend() - Stops processing audio data, preserving buffered audio data. -*/ - -/*! - \fn virtual void QAbstractAudioInput::resume() - Resumes processing audio data after a suspend(). -*/ - -/*! - \fn virtual int QAbstractAudioInput::bytesReady() const - Returns the amount of audio data available to read in bytes. -*/ - -/*! - \fn virtual int QAbstractAudioInput::periodSize() const - Returns the period size in bytes. -*/ - -/*! - \fn virtual void QAbstractAudioInput::setBufferSize(int value) - Sets the audio buffer size to \a value in milliseconds. -*/ - -/*! - \fn virtual int QAbstractAudioInput::bufferSize() const - Returns the audio buffer size in milliseconds. -*/ - -/*! - \fn virtual void QAbstractAudioInput::setNotifyInterval(int ms) - Sets the interval for notify() signal to be emitted. This is based - on the \a ms of audio data processed not on actual real-time. - The resolution of the timer is platform specific. -*/ - -/*! - \fn virtual int QAbstractAudioInput::notifyInterval() const - Returns the notify interval in milliseconds. -*/ - -/*! - \fn virtual qint64 QAbstractAudioInput::processedUSecs() const - Returns the amount of audio data processed since start() was called in milliseconds. -*/ - -/*! - \fn virtual qint64 QAbstractAudioInput::elapsedUSecs() const - Returns the milliseconds since start() was called, including time in Idle and suspend states. -*/ - -/*! - \fn virtual QAudio::Error QAbstractAudioInput::error() const - Returns the error state. -*/ - -/*! - \fn virtual QAudio::State QAbstractAudioInput::state() const - Returns the state of audio processing. -*/ - -/*! - \fn virtual QAudioFormat QAbstractAudioInput::format() const - Returns the QAudioFormat being used -*/ - -/*! - \fn QAbstractAudioInput::stateChanged(QAudio::State state) - This signal is emitted when the device \a state has changed. -*/ - -/*! - \fn QAbstractAudioInput::notify() - This signal is emitted when x ms of audio data has been processed - the interval set by setNotifyInterval(x). -*/ - - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudioengine.h b/src/multimedia/audio/qaudioengine.h deleted file mode 100644 index df9d09d..0000000 --- a/src/multimedia/audio/qaudioengine.h +++ /dev/null @@ -1,131 +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 QAUDIOENGINE_H -#define QAUDIOENGINE_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class Q_MULTIMEDIA_EXPORT QAbstractAudioDeviceInfo : public QObject -{ - Q_OBJECT - -public: - virtual QAudioFormat preferredFormat() const = 0; - virtual bool isFormatSupported(const QAudioFormat &format) const = 0; - virtual QAudioFormat nearestFormat(const QAudioFormat &format) const = 0; - virtual QString deviceName() const = 0; - virtual QStringList codecList() = 0; - virtual QList frequencyList() = 0; - virtual QList channelsList() = 0; - virtual QList sampleSizeList() = 0; - virtual QList byteOrderList() = 0; - virtual QList sampleTypeList() = 0; -}; - -class Q_MULTIMEDIA_EXPORT QAbstractAudioOutput : public QObject -{ - Q_OBJECT - -public: - virtual QIODevice* start(QIODevice* device) = 0; - virtual void stop() = 0; - virtual void reset() = 0; - virtual void suspend() = 0; - virtual void resume() = 0; - virtual int bytesFree() const = 0; - virtual int periodSize() const = 0; - virtual void setBufferSize(int value) = 0; - virtual int bufferSize() const = 0; - virtual void setNotifyInterval(int milliSeconds) = 0; - virtual int notifyInterval() const = 0; - virtual qint64 processedUSecs() const = 0; - virtual qint64 elapsedUSecs() const = 0; - virtual QAudio::Error error() const = 0; - virtual QAudio::State state() const = 0; - virtual QAudioFormat format() const = 0; - -Q_SIGNALS: - void stateChanged(QAudio::State); - void notify(); -}; - -class Q_MULTIMEDIA_EXPORT QAbstractAudioInput : public QObject -{ - Q_OBJECT - -public: - virtual QIODevice* start(QIODevice* device) = 0; - virtual void stop() = 0; - virtual void reset() = 0; - virtual void suspend() = 0; - virtual void resume() = 0; - virtual int bytesReady() const = 0; - virtual int periodSize() const = 0; - virtual void setBufferSize(int value) = 0; - virtual int bufferSize() const = 0; - virtual void setNotifyInterval(int milliSeconds) = 0; - virtual int notifyInterval() const = 0; - virtual qint64 processedUSecs() const = 0; - virtual qint64 elapsedUSecs() const = 0; - virtual QAudio::Error error() const = 0; - virtual QAudio::State state() const = 0; - virtual QAudioFormat format() const = 0; - -Q_SIGNALS: - void stateChanged(QAudio::State); - void notify(); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QAUDIOENGINE_H diff --git a/src/multimedia/audio/qaudioengineplugin.cpp b/src/multimedia/audio/qaudioengineplugin.cpp deleted file mode 100644 index 82324b5..0000000 --- a/src/multimedia/audio/qaudioengineplugin.cpp +++ /dev/null @@ -1,54 +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 - -QT_BEGIN_NAMESPACE - -QAudioEnginePlugin::QAudioEnginePlugin(QObject* parent) : - QObject(parent) -{} - -QAudioEnginePlugin::~QAudioEnginePlugin() -{} - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudioengineplugin.h b/src/multimedia/audio/qaudioengineplugin.h deleted file mode 100644 index 2322d2a..0000000 --- a/src/multimedia/audio/qaudioengineplugin.h +++ /dev/null @@ -1,93 +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 QAUDIOENGINEPLUGIN_H -#define QAUDIOENGINEPLUGIN_H - -#include -#include -#include - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -struct Q_MULTIMEDIA_EXPORT QAudioEngineFactoryInterface : public QFactoryInterface -{ - virtual QList availableDevices(QAudio::Mode) const = 0; - virtual QAbstractAudioInput* createInput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; - virtual QAbstractAudioOutput* createOutput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; - virtual QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device, QAudio::Mode mode) = 0; -}; - -#define QAudioEngineFactoryInterface_iid \ - "com.nokia.qt.QAudioEngineFactoryInterface" -Q_DECLARE_INTERFACE(QAudioEngineFactoryInterface, QAudioEngineFactoryInterface_iid) - -class Q_MULTIMEDIA_EXPORT QAudioEnginePlugin : public QObject, public QAudioEngineFactoryInterface -{ - Q_OBJECT - Q_INTERFACES(QAudioEngineFactoryInterface:QFactoryInterface) - -public: - QAudioEnginePlugin(QObject *parent = 0); - ~QAudioEnginePlugin(); - - virtual QStringList keys() const = 0; - virtual QList availableDevices(QAudio::Mode) const = 0; - virtual QAbstractAudioInput* createInput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; - virtual QAbstractAudioOutput* createOutput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; - virtual QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device, QAudio::Mode mode) = 0; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QAUDIOENGINEPLUGIN_H diff --git a/src/multimedia/audio/qaudioformat.cpp b/src/multimedia/audio/qaudioformat.cpp deleted file mode 100644 index 86d72f6..0000000 --- a/src/multimedia/audio/qaudioformat.cpp +++ /dev/null @@ -1,407 +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 - - -QT_BEGIN_NAMESPACE - - -class QAudioFormatPrivate : public QSharedData -{ -public: - QAudioFormatPrivate() - { - frequency = -1; - channels = -1; - sampleSize = -1; - byteOrder = QAudioFormat::Endian(QSysInfo::ByteOrder); - sampleType = QAudioFormat::Unknown; - } - - QAudioFormatPrivate(const QAudioFormatPrivate &other): - QSharedData(other), - codec(other.codec), - byteOrder(other.byteOrder), - sampleType(other.sampleType), - frequency(other.frequency), - channels(other.channels), - sampleSize(other.sampleSize) - { - } - - QAudioFormatPrivate& operator=(const QAudioFormatPrivate &other) - { - codec = other.codec; - byteOrder = other.byteOrder; - sampleType = other.sampleType; - frequency = other.frequency; - channels = other.channels; - sampleSize = other.sampleSize; - - return *this; - } - - QString codec; - QAudioFormat::Endian byteOrder; - QAudioFormat::SampleType sampleType; - int frequency; - int channels; - int sampleSize; -}; - -/*! - \class QAudioFormat - \brief The QAudioFormat class stores audio parameter information. - - \inmodule QtMultimedia - \ingroup multimedia - \since 4.6 - - An audio format specifies how data in an audio stream is arranged, - i.e, how the stream is to be interpreted. The encoding itself is - specified by the codec() used for the stream. - - In addition to the encoding, QAudioFormat contains other - parameters that further specify how the audio data is arranged. - These are the frequency, the number of channels, the sample size, - the sample type, and the byte order. The following table describes - these in more detail. - - \table - \header - \o Parameter - \o Description - \row - \o Sample Rate - \o Samples per second of audio data in Hertz. - \row - \o Number of channels - \o The number of audio channels (typically one for mono - or two for stereo) - \row - \o Sample size - \o How much data is stored in each sample (typically 8 - or 16 bits) - \row - \o Sample type - \o Numerical representation of sample (typically signed integer, - unsigned integer or float) - \row - \o Byte order - \o Byte ordering of sample (typically little endian, big endian) - \endtable - - You can obtain audio formats compatible with the audio device used - through functions in QAudioDeviceInfo. This class also lets you - query available parameter values for a device, so that you can set - the parameters yourself. See the QAudioDeviceInfo class - description for details. You need to know the format of the audio - streams you wish to play. Qt does not set up formats for you. -*/ - -/*! - Construct a new audio format. - - Values are initialized as follows: - \list - \o sampleRate() = -1 - \o channelCount() = -1 - \o sampleSize() = -1 - \o byteOrder() = QAudioFormat::Endian(QSysInfo::ByteOrder) - \o sampleType() = QAudioFormat::Unknown - \c codec() = "" - \endlist -*/ - -QAudioFormat::QAudioFormat(): - d(new QAudioFormatPrivate) -{ -} - -/*! - Construct a new audio format using \a other. -*/ - -QAudioFormat::QAudioFormat(const QAudioFormat &other): - d(other.d) -{ -} - -/*! - Destroy this audio format. -*/ - -QAudioFormat::~QAudioFormat() -{ -} - -/*! - Assigns \a other to this QAudioFormat implementation. -*/ - -QAudioFormat& QAudioFormat::operator=(const QAudioFormat &other) -{ - d = other.d; - return *this; -} - -/*! - Returns true if this QAudioFormat is equal to the \a other - QAudioFormat; otherwise returns false. - - All elements of QAudioFormat are used for the comparison. -*/ - -bool QAudioFormat::operator==(const QAudioFormat &other) const -{ - return d->frequency == other.d->frequency && - d->channels == other.d->channels && - d->sampleSize == other.d->sampleSize && - d->byteOrder == other.d->byteOrder && - d->codec == other.d->codec && - d->sampleType == other.d->sampleType; -} - -/*! - Returns true if this QAudioFormat is not equal to the \a other - QAudioFormat; otherwise returns false. - - All elements of QAudioFormat are used for the comparison. -*/ - -bool QAudioFormat::operator!=(const QAudioFormat& other) const -{ - return !(*this == other); -} - -/*! - Returns true if all of the parameters are valid. -*/ - -bool QAudioFormat::isValid() const -{ - return d->frequency != -1 && d->channels != -1 && d->sampleSize != -1 && - d->sampleType != QAudioFormat::Unknown && !d->codec.isEmpty(); -} - -/*! - Sets the sample rate to \a samplerate Hertz. - - \since 4.7 -*/ - -void QAudioFormat::setSampleRate(int samplerate) -{ - d->frequency = samplerate; -} - -/*! - \obsolete - - Use setSampleRate() instead. -*/ - -void QAudioFormat::setFrequency(int frequency) -{ - d->frequency = frequency; -} - -/*! - Returns the current sample rate in Hertz. - - \since 4.7 -*/ - -int QAudioFormat::sampleRate() const -{ - return d->frequency; -} - -/*! - \obsolete - - Use sampleRate() instead. -*/ - -int QAudioFormat::frequency() const -{ - return d->frequency; -} - -/*! - Sets the channel count to \a channels. - - \since 4.7 -*/ - -void QAudioFormat::setChannelCount(int channels) -{ - d->channels = channels; -} - -/*! - \obsolete - - Use setChannelCount() instead. -*/ - -void QAudioFormat::setChannels(int channels) -{ - d->channels = channels; -} - -/*! - Returns the current channel count value. - - \since 4.7 -*/ - -int QAudioFormat::channelCount() const -{ - return d->channels; -} - -/*! - \obsolete - - Use channelCount() instead. -*/ - -int QAudioFormat::channels() const -{ - return d->channels; -} - -/*! - Sets the sample size to the \a sampleSize specified. -*/ - -void QAudioFormat::setSampleSize(int sampleSize) -{ - d->sampleSize = sampleSize; -} - -/*! - Returns the current sample size value. -*/ - -int QAudioFormat::sampleSize() const -{ - return d->sampleSize; -} - -/*! - Sets the codec to \a codec. - - \sa QAudioDeviceInfo::supportedCodecs() -*/ - -void QAudioFormat::setCodec(const QString &codec) -{ - d->codec = codec; -} - -/*! - Returns the current codec value. - - \sa QAudioDeviceInfo::supportedCodecs() -*/ - -QString QAudioFormat::codec() const -{ - return d->codec; -} - -/*! - Sets the byteOrder to \a byteOrder. -*/ - -void QAudioFormat::setByteOrder(QAudioFormat::Endian byteOrder) -{ - d->byteOrder = byteOrder; -} - -/*! - Returns the current byteOrder value. -*/ - -QAudioFormat::Endian QAudioFormat::byteOrder() const -{ - return d->byteOrder; -} - -/*! - Sets the sampleType to \a sampleType. -*/ - -void QAudioFormat::setSampleType(QAudioFormat::SampleType sampleType) -{ - d->sampleType = sampleType; -} - -/*! - Returns the current SampleType value. -*/ - -QAudioFormat::SampleType QAudioFormat::sampleType() const -{ - return d->sampleType; -} - -/*! - \enum QAudioFormat::SampleType - - \value Unknown Not Set - \value SignedInt samples are signed integers - \value UnSignedInt samples are unsigned intergers - \value Float samples are floats -*/ - -/*! - \enum QAudioFormat::Endian - - \value BigEndian samples are big endian byte order - \value LittleEndian samples are little endian byte order -*/ - -QT_END_NAMESPACE - diff --git a/src/multimedia/audio/qaudioformat.h b/src/multimedia/audio/qaudioformat.h deleted file mode 100644 index 6c835b7..0000000 --- a/src/multimedia/audio/qaudioformat.h +++ /dev/null @@ -1,107 +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 QAUDIOFORMAT_H -#define QAUDIOFORMAT_H - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QAudioFormatPrivate; - -class Q_MULTIMEDIA_EXPORT QAudioFormat -{ -public: - enum SampleType { Unknown, SignedInt, UnSignedInt, Float }; - enum Endian { BigEndian = QSysInfo::BigEndian, LittleEndian = QSysInfo::LittleEndian }; - - QAudioFormat(); - QAudioFormat(const QAudioFormat &other); - ~QAudioFormat(); - - QAudioFormat& operator=(const QAudioFormat &other); - bool operator==(const QAudioFormat &other) const; - bool operator!=(const QAudioFormat &other) const; - - bool isValid() const; - - void setFrequency(int frequency); - int frequency() const; - void setSampleRate(int sampleRate); - int sampleRate() const; - - void setChannels(int channels); - int channels() const; - void setChannelCount(int channelCount); - int channelCount() const; - - void setSampleSize(int sampleSize); - int sampleSize() const; - - void setCodec(const QString &codec); - QString codec() const; - - void setByteOrder(QAudioFormat::Endian byteOrder); - QAudioFormat::Endian byteOrder() const; - - void setSampleType(QAudioFormat::SampleType sampleType); - QAudioFormat::SampleType sampleType() const; - -private: - QSharedDataPointer d; -}; - - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QAUDIOFORMAT_H diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp deleted file mode 100644 index c99e870..0000000 --- a/src/multimedia/audio/qaudioinput.cpp +++ /dev/null @@ -1,432 +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 - -#include "qaudiodevicefactory_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \class QAudioInput - \brief The QAudioInput class provides an interface for receiving audio data from an audio input device. - - \inmodule QtMultimedia - \ingroup multimedia - \since 4.6 - - You can construct an audio input with the system's - \l{QAudioDeviceInfo::defaultInputDevice()}{default audio input - device}. It is also possible to create QAudioInput with a - specific QAudioDeviceInfo. When you create the audio input, you - should also send in the QAudioFormat to be used for the recording - (see the QAudioFormat class description for details). - - To record to a file: - - QAudioInput lets you record audio with an audio input device. The - default constructor of this class will use the systems default - audio device, but you can also specify a QAudioDeviceInfo for a - specific device. You also need to pass in the QAudioFormat in - which you wish to record. - - Starting up the QAudioInput is simply a matter of calling start() - with a QIODevice opened for writing. For instance, to record to a - file, you can: - - \code - QFile outputFile; // class member. - QAudioInput* audio; // class member. - \endcode - - \code - { - outputFile.setFileName("/tmp/test.raw"); - outputFile.open( QIODevice::WriteOnly | QIODevice::Truncate ); - - QAudioFormat format; - // set up the format you want, eg. - format.setFrequency(8000); - format.setChannels(1); - format.setSampleSize(8); - format.setCodec("audio/pcm"); - format.setByteOrder(QAudioFormat::LittleEndian); - format.setSampleType(QAudioFormat::UnSignedInt); - - QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice(); - if (!info.isFormatSupported(format)) { - qWarning()<<"default format not supported try to use nearest"; - format = info.nearestFormat(format); - } - - audio = new QAudioInput(format, this); - QTimer::singleShot(3000, this, SLOT(stopRecording())); - audio->start(&outputFile); - // Records audio for 3000ms - } - \endcode - - This will start recording if the format specified is supported by - the input device (you can check this with - QAudioDeviceInfo::isFormatSupported(). In case there are any - snags, use the error() function to check what went wrong. We stop - recording in the \c stopRecording() slot. - - \code - void stopRecording() - { - audio->stop(); - outputFile->close(); - delete audio; - } - \endcode - - At any point in time, QAudioInput will be in one of four states: - active, suspended, stopped, or idle. These states are specified by - the QAudio::State enum. You can request a state change directly through - suspend(), resume(), stop(), reset(), and start(). The current - state is reported by state(). QAudioOutput will also signal you - when the state changes (stateChanged()). - - QAudioInput provides several ways of measuring the time that has - passed since the start() of the recording. The \c processedUSecs() - function returns the length of the stream in microseconds written, - i.e., it leaves out the times the audio input was suspended or idle. - The elapsedUSecs() function returns the time elapsed since start() was called regardless of - which states the QAudioInput has been in. - - If an error should occur, you can fetch its reason with error(). - The possible error reasons are described by the QAudio::Error - enum. The QAudioInput will enter the \l{QAudio::}{StoppedState} when - an error is encountered. Connect to the stateChanged() signal to - handle the error: - - \snippet doc/src/snippets/audio/main.cpp 0 - - \sa QAudioOutput, QAudioDeviceInfo - - \section1 Symbian Platform Security Requirements - - On Symbian, processes which use this class must have the - \c UserEnvironment platform security capability. If the client - process lacks this capability, calls to either overload of start() - will fail. - This failure is indicated by the QAudioInput object setting - its error() value to \l{QAudio::OpenError} and then emitting a - \l{stateChanged()}{stateChanged}(\l{QAudio::StoppedState}) signal. - - Platform security capabilities are added via the - \l{qmake-variable-reference.html#target-capability}{TARGET.CAPABILITY} - qmake variable. -*/ - -/*! - Construct a new audio input and attach it to \a parent. - The default audio input device is used with the output - \a format parameters. -*/ - -QAudioInput::QAudioInput(const QAudioFormat &format, QObject *parent): - QObject(parent) -{ - d = QAudioDeviceFactory::createDefaultInputDevice(format); - connect(d, SIGNAL(notify()), SIGNAL(notify())); - connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); -} - -/*! - Construct a new audio input and attach it to \a parent. - The device referenced by \a audioDevice is used with the input - \a format parameters. -*/ - -QAudioInput::QAudioInput(const QAudioDeviceInfo &audioDevice, const QAudioFormat &format, QObject *parent): - QObject(parent) -{ - d = QAudioDeviceFactory::createInputDevice(audioDevice, format); - connect(d, SIGNAL(notify()), SIGNAL(notify())); - connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); -} - -/*! - Destroy this audio input. -*/ - -QAudioInput::~QAudioInput() -{ - delete d; -} - -/*! - Uses the \a device as the QIODevice to transfer data. - Passing a QIODevice allows the data to be transfered without any extra code. - All that is required is to open the QIODevice. - - If able to successfully get audio data from the systems audio device the - state() is set to either QAudio::ActiveState or QAudio::IdleState, - error() is set to QAudio::NoError and the stateChanged() signal is emitted. - - If a problem occurs during this process the error() is set to QAudio::OpenError, - state() is set to QAudio::StoppedState and stateChanged() signal is emitted. - - \sa {Symbian Platform Security Requirements} - - \sa QIODevice -*/ - -void QAudioInput::start(QIODevice* device) -{ - d->start(device); -} - -/*! - Returns a pointer to the QIODevice being used to handle the data - transfer. This QIODevice can be used to read() audio data - directly. - - If able to access the systems audio device the state() is set to - QAudio::IdleState, error() is set to QAudio::NoError - and the stateChanged() signal is emitted. - - If a problem occurs during this process the error() is set to QAudio::OpenError, - state() is set to QAudio::StoppedState and stateChanged() signal is emitted. - - \sa {Symbian Platform Security Requirements} - - \sa QIODevice -*/ - -QIODevice* QAudioInput::start() -{ - return d->start(0); -} - -/*! - Returns the QAudioFormat being used. -*/ - -QAudioFormat QAudioInput::format() const -{ - return d->format(); -} - -/*! - Stops the audio input, detaching from the system resource. - - Sets error() to QAudio::NoError, state() to QAudio::StoppedState and - emit stateChanged() signal. -*/ - -void QAudioInput::stop() -{ - d->stop(); -} - -/*! - Drops all audio data in the buffers, resets buffers to zero. -*/ - -void QAudioInput::reset() -{ - d->reset(); -} - -/*! - Stops processing audio data, preserving buffered audio data. - - Sets error() to QAudio::NoError, state() to QAudio::SuspendedState and - emit stateChanged() signal. -*/ - -void QAudioInput::suspend() -{ - d->suspend(); -} - -/*! - Resumes processing audio data after a suspend(). - - Sets error() to QAudio::NoError. - Sets state() to QAudio::ActiveState if you previously called start(QIODevice*). - Sets state() to QAudio::IdleState if you previously called start(). - emits stateChanged() signal. -*/ - -void QAudioInput::resume() -{ - d->resume(); -} - -/*! - Sets the audio buffer size to \a value milliseconds. - - Note: This function can be called anytime before start(), calls to this - are ignored after start(). It should not be assumed that the buffer size - set is the actual buffer size used, calling bufferSize() anytime after start() - will return the actual buffer size being used. - -*/ - -void QAudioInput::setBufferSize(int value) -{ - d->setBufferSize(value); -} - -/*! - Returns the audio buffer size in milliseconds. - - If called before start(), returns platform default value. - If called before start() but setBufferSize() was called prior, returns value set by setBufferSize(). - If called after start(), returns the actual buffer size being used. This may not be what was set previously - by setBufferSize(). - -*/ - -int QAudioInput::bufferSize() const -{ - return d->bufferSize(); -} - -/*! - Returns the amount of audio data available to read in bytes. - - NOTE: returned value is only valid while in QAudio::ActiveState or QAudio::IdleState - state, otherwise returns zero. -*/ - -int QAudioInput::bytesReady() const -{ - /* - -If not ActiveState|IdleState, return 0 - -return amount of audio data available to read - */ - return d->bytesReady(); -} - -/*! - Returns the period size in bytes. - - Note: This is the recommended read size in bytes. -*/ - -int QAudioInput::periodSize() const -{ - return d->periodSize(); -} - -/*! - Sets the interval for notify() signal to be emitted. - This is based on the \a ms of audio data processed - not on actual real-time. - The minimum resolution of the timer is platform specific and values - should be checked with notifyInterval() to confirm actual value - being used. -*/ - -void QAudioInput::setNotifyInterval(int ms) -{ - d->setNotifyInterval(ms); -} - -/*! - Returns the notify interval in milliseconds. -*/ - -int QAudioInput::notifyInterval() const -{ - return d->notifyInterval(); -} - -/*! - Returns the amount of audio data processed since start() - was called in microseconds. -*/ - -qint64 QAudioInput::processedUSecs() const -{ - return d->processedUSecs(); -} - -/*! - Returns the microseconds since start() was called, including time in Idle and - Suspend states. -*/ - -qint64 QAudioInput::elapsedUSecs() const -{ - return d->elapsedUSecs(); -} - -/*! - Returns the error state. -*/ - -QAudio::Error QAudioInput::error() const -{ - return d->error(); -} - -/*! - Returns the state of audio processing. -*/ - -QAudio::State QAudioInput::state() const -{ - return d->state(); -} - -/*! - \fn QAudioInput::stateChanged(QAudio::State state) - This signal is emitted when the device \a state has changed. -*/ - -/*! - \fn QAudioInput::notify() - This signal is emitted when x ms of audio data has been processed - the interval set by setNotifyInterval(x). -*/ - -QT_END_NAMESPACE - diff --git a/src/multimedia/audio/qaudioinput.h b/src/multimedia/audio/qaudioinput.h deleted file mode 100644 index 5be9b5a..0000000 --- a/src/multimedia/audio/qaudioinput.h +++ /dev/null @@ -1,111 +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 QAUDIOINPUT_H -#define QAUDIOINPUT_H - -#include -#include - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QAbstractAudioInput; - -class Q_MULTIMEDIA_EXPORT QAudioInput : public QObject -{ - Q_OBJECT - -public: - explicit QAudioInput(const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); - explicit QAudioInput(const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); - ~QAudioInput(); - - QAudioFormat format() const; - - void start(QIODevice *device); - QIODevice* start(); - - void stop(); - void reset(); - void suspend(); - void resume(); - - void setBufferSize(int bytes); - int bufferSize() const; - - int bytesReady() const; - int periodSize() const; - - void setNotifyInterval(int milliSeconds); - int notifyInterval() const; - - qint64 processedUSecs() const; - qint64 elapsedUSecs() const; - - QAudio::Error error() const; - QAudio::State state() const; - -Q_SIGNALS: - void stateChanged(QAudio::State); - void notify(); - -private: - Q_DISABLE_COPY(QAudioInput) - - QAbstractAudioInput* d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QAUDIOINPUT_H diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp deleted file mode 100644 index 6b15008..0000000 --- a/src/multimedia/audio/qaudioinput_alsa_p.cpp +++ /dev/null @@ -1,706 +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$ -** -****************************************************************************/ - -// -// 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 "qaudioinput_alsa_p.h" -#include "qaudiodeviceinfo_alsa_p.h" - -QT_BEGIN_NAMESPACE - -//#define DEBUG_AUDIO 1 - -static const int minimumIntervalTime = 50; - -QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): - settings(audioFormat) -{ - bytesAvailable = 0; - handle = 0; - ahandler = 0; - access = SND_PCM_ACCESS_RW_INTERLEAVED; - pcmformat = SND_PCM_FORMAT_S16; - buffer_size = 0; - period_size = 0; - buffer_time = 100000; - period_time = 20000; - totalTimeValue = 0; - intervalTime = 1000; - audioBuffer = 0; - errorState = QAudio::NoError; - deviceState = QAudio::StoppedState; - audioSource = 0; - pullMode = true; - resuming = false; - - m_device = device; - - timer = new QTimer(this); - connect(timer,SIGNAL(timeout()),SLOT(userFeed())); -} - -QAudioInputPrivate::~QAudioInputPrivate() -{ - close(); - disconnect(timer, SIGNAL(timeout())); - QCoreApplication::processEvents(); - delete timer; -} - -QAudio::Error QAudioInputPrivate::error() const -{ - return errorState; -} - -QAudio::State QAudioInputPrivate::state() const -{ - return deviceState; -} - - -QAudioFormat QAudioInputPrivate::format() const -{ - return settings; -} - -int QAudioInputPrivate::xrun_recovery(int err) -{ - int count = 0; - bool reset = false; - - if(err == -EPIPE) { - errorState = QAudio::UnderrunError; - err = snd_pcm_prepare(handle); - if(err < 0) - reset = true; - else { - bytesAvailable = bytesReady(); - if (bytesAvailable <= 0) - reset = true; - } - - } else if((err == -ESTRPIPE)||(err == -EIO)) { - errorState = QAudio::IOError; - while((err = snd_pcm_resume(handle)) == -EAGAIN){ - usleep(100); - count++; - if(count > 5) { - reset = true; - break; - } - } - if(err < 0) { - err = snd_pcm_prepare(handle); - if(err < 0) - reset = true; - } - } - if(reset) { - close(); - open(); - snd_pcm_prepare(handle); - return 0; - } - return err; -} - -int QAudioInputPrivate::setFormat() -{ - snd_pcm_format_t format = SND_PCM_FORMAT_S16; - - if(settings.sampleSize() == 8) { - format = SND_PCM_FORMAT_U8; - } else if(settings.sampleSize() == 16) { - if(settings.sampleType() == QAudioFormat::SignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - format = SND_PCM_FORMAT_S16_LE; - else - format = SND_PCM_FORMAT_S16_BE; - } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - format = SND_PCM_FORMAT_U16_LE; - else - format = SND_PCM_FORMAT_U16_BE; - } - } else if(settings.sampleSize() == 24) { - if(settings.sampleType() == QAudioFormat::SignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - format = SND_PCM_FORMAT_S24_LE; - else - format = SND_PCM_FORMAT_S24_BE; - } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - format = SND_PCM_FORMAT_U24_LE; - else - format = SND_PCM_FORMAT_U24_BE; - } - } else if(settings.sampleSize() == 32) { - if(settings.sampleType() == QAudioFormat::SignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - format = SND_PCM_FORMAT_S32_LE; - else - format = SND_PCM_FORMAT_S32_BE; - } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - format = SND_PCM_FORMAT_U32_LE; - else - format = SND_PCM_FORMAT_U32_BE; - } else if(settings.sampleType() == QAudioFormat::Float) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - format = SND_PCM_FORMAT_FLOAT_LE; - else - format = SND_PCM_FORMAT_FLOAT_BE; - } - } else if(settings.sampleSize() == 64) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - format = SND_PCM_FORMAT_FLOAT64_LE; - else - format = SND_PCM_FORMAT_FLOAT64_BE; - } - - return snd_pcm_hw_params_set_format( handle, hwparams, format); -} - -QIODevice* QAudioInputPrivate::start(QIODevice* device) -{ - if(deviceState != QAudio::StoppedState) - close(); - - if(!pullMode && audioSource) { - delete audioSource; - } - - if(device) { - //set to pull mode - pullMode = true; - audioSource = device; - deviceState = QAudio::ActiveState; - } else { - //set to push mode - pullMode = false; - deviceState = QAudio::IdleState; - audioSource = new InputPrivate(this); - audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered); - } - - if( !open() ) - return 0; - - emit stateChanged(deviceState); - - return audioSource; -} - -void QAudioInputPrivate::stop() -{ - if(deviceState == QAudio::StoppedState) - return; - - deviceState = QAudio::StoppedState; - - close(); - emit stateChanged(deviceState); -} - -bool QAudioInputPrivate::open() -{ -#ifdef DEBUG_AUDIO - QTime now(QTime::currentTime()); - qDebug()< devices = QAudioDeviceInfoInternal::availableDevices(QAudio::AudioInput); - if(dev.compare(QLatin1String("default")) == 0) { -#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) - dev = QLatin1String(devices.first()); -#else - dev = QLatin1String("hw:0,0"); -#endif - } else { -#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) - dev = QLatin1String(m_device); -#else - int idx = 0; - char *name; - - QString shortName = QLatin1String(m_device.mid(m_device.indexOf('=',0)+1).constData()); - - while(snd_card_get_name(idx,&name) == 0) { - if(qstrncmp(shortName.toLocal8Bit().constData(),name,shortName.length()) == 0) - break; - idx++; - } - dev = QString(QLatin1String("hw:%1,0")).arg(idx); -#endif - } - - // Step 1: try and open the device - while((count < 5) && (err < 0)) { - err=snd_pcm_open(&handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_CAPTURE,0); - if(err < 0) - count++; - } - if (( err < 0)||(handle == 0)) { - errorState = QAudio::OpenError; - deviceState = QAudio::StoppedState; - emit stateChanged(deviceState); - return false; - } - snd_pcm_nonblock( handle, 0 ); - - // Step 2: Set the desired HW parameters. - snd_pcm_hw_params_alloca( &hwparams ); - - bool fatal = false; - QString errMessage; - unsigned int chunks = 8; - - err = snd_pcm_hw_params_any( handle, hwparams ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_any: err = %1").arg(err); - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_rate_resample( handle, hwparams, 1 ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_rate_resample: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_access( handle, hwparams, access ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_access: err = %1").arg(err); - } - } - if ( !fatal ) { - err = setFormat(); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_format: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_channels( handle, hwparams, (unsigned int)settings.channels() ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_channels: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_rate_near( handle, hwparams, &freakuency, 0 ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_rate_near: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_buffer_time_near(handle, hwparams, &buffer_time, &dir); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_buffer_time_near: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_period_time_near(handle, hwparams, &period_time, &dir); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_period_time_near: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_periods_near(handle, hwparams, &chunks, &dir); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_periods_near: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params(handle, hwparams); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params: err = %1").arg(err); - } - } - if( err < 0) { - qWarning()<start(period_time*chunks/2000); - - errorState = QAudio::NoError; - - totalTimeValue = 0; - - return true; -} - -void QAudioInputPrivate::close() -{ - timer->stop(); - - if ( handle ) { - snd_pcm_drop( handle ); - snd_pcm_close( handle ); - handle = 0; - delete [] audioBuffer; - audioBuffer=0; - } -} - -int QAudioInputPrivate::bytesReady() const -{ - if(resuming) - return period_size; - - if(deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState) - return 0; - int frames = snd_pcm_avail_update(handle); - if (frames < 0) return frames; - if((int)frames > (int)buffer_frames) - frames = buffer_frames; - - return snd_pcm_frames_to_bytes(handle, frames); -} - -qint64 QAudioInputPrivate::read(char* data, qint64 len) -{ - Q_UNUSED(len) - - // Read in some audio data and write it to QIODevice, pull mode - if ( !handle ) - return 0; - - bytesAvailable = bytesReady(); - - if (bytesAvailable < 0) { - // bytesAvailable as negative is error code, try to recover from it. - xrun_recovery(bytesAvailable); - bytesAvailable = bytesReady(); - if (bytesAvailable < 0) { - // recovery failed must stop and set error. - close(); - errorState = QAudio::IOError; - deviceState = QAudio::StoppedState; - emit stateChanged(deviceState); - return 0; - } - } - - int count=0, err = 0; - while(count < 5) { - int chunks = bytesAvailable/period_size; - int frames = chunks*period_frames; - if(frames > (int)buffer_frames) - frames = buffer_frames; - int readFrames = snd_pcm_readi(handle, audioBuffer, frames); - if (readFrames >= 0) { - err = snd_pcm_frames_to_bytes(handle, readFrames); -#ifdef DEBUG_AUDIO - qDebug()< 0) { - // got some send it onward -#ifdef DEBUG_AUDIO - qDebug()<<"frames to write to QIODevice = "<< - snd_pcm_bytes_to_frames( handle, (int)err )<<" ("<write(audioBuffer,err); - if(l < 0) { - close(); - errorState = QAudio::IOError; - deviceState = QAudio::StoppedState; - emit stateChanged(deviceState); - } else if(l == 0) { - if (deviceState != QAudio::IdleState) { - errorState = QAudio::NoError; - deviceState = QAudio::IdleState; - emit stateChanged(deviceState); - } - } else { - totalTimeValue += err; - resuming = false; - if (deviceState != QAudio::ActiveState) { - errorState = QAudio::NoError; - deviceState = QAudio::ActiveState; - emit stateChanged(deviceState); - } - } - return l; - - } else { - memcpy(data,audioBuffer,err); - totalTimeValue += err; - resuming = false; - if (deviceState != QAudio::ActiveState) { - errorState = QAudio::NoError; - deviceState = QAudio::ActiveState; - emit stateChanged(deviceState); - } - return err; - } - } - return 0; -} - -void QAudioInputPrivate::resume() -{ - if(deviceState == QAudio::SuspendedState) { - int err = 0; - - if(handle) { - err = snd_pcm_prepare( handle ); - if(err < 0) - xrun_recovery(err); - - err = snd_pcm_start(handle); - if(err < 0) - xrun_recovery(err); - - bytesAvailable = buffer_size; - } - resuming = true; - deviceState = QAudio::ActiveState; - int chunks = buffer_size/period_size; - timer->start(period_time*chunks/2000); - emit stateChanged(deviceState); - } -} - -void QAudioInputPrivate::setBufferSize(int value) -{ - buffer_size = value; -} - -int QAudioInputPrivate::bufferSize() const -{ - return buffer_size; -} - -int QAudioInputPrivate::periodSize() const -{ - return period_size; -} - -void QAudioInputPrivate::setNotifyInterval(int ms) -{ - if(ms >= minimumIntervalTime) - intervalTime = ms; - else - intervalTime = minimumIntervalTime; -} - -int QAudioInputPrivate::notifyInterval() const -{ - return intervalTime; -} - -qint64 QAudioInputPrivate::processedUSecs() const -{ - qint64 result = qint64(1000000) * totalTimeValue / - (settings.channels()*(settings.sampleSize()/8)) / - settings.frequency(); - - return result; -} - -void QAudioInputPrivate::suspend() -{ - if(deviceState == QAudio::ActiveState||resuming) { - timer->stop(); - deviceState = QAudio::SuspendedState; - emit stateChanged(deviceState); - } -} - -void QAudioInputPrivate::userFeed() -{ - if(deviceState == QAudio::StoppedState || deviceState == QAudio::SuspendedState) - return; -#ifdef DEBUG_AUDIO - QTime now(QTime::currentTime()); - qDebug()<(audioSource); - a->trigger(); - } - bytesAvailable = bytesReady(); - - if(deviceState != QAudio::ActiveState) - return true; - - if((timeStamp.elapsed() + elapsedTimeOffset) > intervalTime) { - emit notify(); - elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime; - timeStamp.restart(); - } - return true; -} - -qint64 QAudioInputPrivate::elapsedUSecs() const -{ - if (deviceState == QAudio::StoppedState) - return 0; - - return clockStamp.elapsed()*1000; -} - -void QAudioInputPrivate::reset() -{ - if(handle) - snd_pcm_reset(handle); -} - -void QAudioInputPrivate::drain() -{ - if(handle) - snd_pcm_drain(handle); -} - -InputPrivate::InputPrivate(QAudioInputPrivate* audio) -{ - audioDevice = qobject_cast(audio); -} - -InputPrivate::~InputPrivate() -{ -} - -qint64 InputPrivate::readData( char* data, qint64 len) -{ - return audioDevice->read(data,len); -} - -qint64 InputPrivate::writeData(const char* data, qint64 len) -{ - Q_UNUSED(data) - Q_UNUSED(len) - return 0; -} - -void InputPrivate::trigger() -{ - emit readyRead(); -} - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudioinput_alsa_p.h b/src/multimedia/audio/qaudioinput_alsa_p.h deleted file mode 100644 index c907019..0000000 --- a/src/multimedia/audio/qaudioinput_alsa_p.h +++ /dev/null @@ -1,158 +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$ -** -****************************************************************************/ - -// -// 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. -// - - -#ifndef QAUDIOINPUTALSA_H -#define QAUDIOINPUTALSA_H - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class InputPrivate; - -class QAudioInputPrivate : public QAbstractAudioInput -{ - Q_OBJECT -public: - QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat); - ~QAudioInputPrivate(); - - qint64 read(char* data, qint64 len); - - QIODevice* start(QIODevice* device = 0); - void stop(); - void reset(); - void suspend(); - void resume(); - int bytesReady() const; - int periodSize() const; - void setBufferSize(int value); - int bufferSize() const; - void setNotifyInterval(int milliSeconds); - int notifyInterval() const; - qint64 processedUSecs() const; - qint64 elapsedUSecs() const; - QAudio::Error error() const; - QAudio::State state() const; - QAudioFormat format() const; - bool resuming; - snd_pcm_t* handle; - qint64 totalTimeValue; - QIODevice* audioSource; - QAudioFormat settings; - QAudio::Error errorState; - QAudio::State deviceState; - -private slots: - void userFeed(); - bool deviceReady(); - -private: - int xrun_recovery(int err); - int setFormat(); - bool open(); - void close(); - void drain(); - - QTimer* timer; - QElapsedTimer timeStamp; - QElapsedTimer clockStamp; - qint64 elapsedTimeOffset; - int intervalTime; - char* audioBuffer; - int bytesAvailable; - QByteArray m_device; - bool pullMode; - int buffer_size; - int period_size; - unsigned int buffer_time; - unsigned int period_time; - snd_pcm_uframes_t buffer_frames; - snd_pcm_uframes_t period_frames; - snd_async_handler_t* ahandler; - snd_pcm_access_t access; - snd_pcm_format_t pcmformat; - snd_timestamp_t* timestamp; - snd_pcm_hw_params_t *hwparams; -}; - -class InputPrivate : public QIODevice -{ - Q_OBJECT -public: - InputPrivate(QAudioInputPrivate* audio); - ~InputPrivate(); - - qint64 readData( char* data, qint64 len); - qint64 writeData(const char* data, qint64 len); - - void trigger(); -private: - QAudioInputPrivate *audioDevice; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp deleted file mode 100644 index cb65f6e..0000000 --- a/src/multimedia/audio/qaudioinput_mac_p.cpp +++ /dev/null @@ -1,956 +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$ -** -****************************************************************************/ - -// -// 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 -#include - -#include - -#include "qaudio_mac_p.h" -#include "qaudioinput_mac_p.h" -#include "qaudiodeviceinfo_mac_p.h" - -QT_BEGIN_NAMESPACE - - -namespace QtMultimediaInternal -{ - -static const int default_buffer_size = 4 * 1024; - -class QAudioBufferList -{ -public: - QAudioBufferList(AudioStreamBasicDescription const& streamFormat): - owner(false), - sf(streamFormat) - { - const bool isInterleaved = (sf.mFormatFlags & kAudioFormatFlagIsNonInterleaved) == 0; - const int numberOfBuffers = isInterleaved ? 1 : sf.mChannelsPerFrame; - - dataSize = 0; - - bfs = reinterpret_cast(qMalloc(sizeof(AudioBufferList) + - (sizeof(AudioBuffer) * numberOfBuffers))); - - bfs->mNumberBuffers = numberOfBuffers; - for (int i = 0; i < numberOfBuffers; ++i) { - bfs->mBuffers[i].mNumberChannels = isInterleaved ? numberOfBuffers : 1; - bfs->mBuffers[i].mDataByteSize = 0; - bfs->mBuffers[i].mData = 0; - } - } - - QAudioBufferList(AudioStreamBasicDescription const& streamFormat, char* buffer, int bufferSize): - owner(false), - sf(streamFormat), - bfs(0) - { - dataSize = bufferSize; - - bfs = reinterpret_cast(qMalloc(sizeof(AudioBufferList) + sizeof(AudioBuffer))); - - bfs->mNumberBuffers = 1; - bfs->mBuffers[0].mNumberChannels = 1; - bfs->mBuffers[0].mDataByteSize = dataSize; - bfs->mBuffers[0].mData = buffer; - } - - QAudioBufferList(AudioStreamBasicDescription const& streamFormat, int framesToBuffer): - owner(true), - sf(streamFormat), - bfs(0) - { - const bool isInterleaved = (sf.mFormatFlags & kAudioFormatFlagIsNonInterleaved) == 0; - const int numberOfBuffers = isInterleaved ? 1 : sf.mChannelsPerFrame; - - dataSize = framesToBuffer * sf.mBytesPerFrame; - - bfs = reinterpret_cast(qMalloc(sizeof(AudioBufferList) + - (sizeof(AudioBuffer) * numberOfBuffers))); - bfs->mNumberBuffers = numberOfBuffers; - for (int i = 0; i < numberOfBuffers; ++i) { - bfs->mBuffers[i].mNumberChannels = isInterleaved ? numberOfBuffers : 1; - bfs->mBuffers[i].mDataByteSize = dataSize; - bfs->mBuffers[i].mData = qMalloc(dataSize); - } - } - - ~QAudioBufferList() - { - if (owner) { - for (UInt32 i = 0; i < bfs->mNumberBuffers; ++i) - qFree(bfs->mBuffers[i].mData); - } - - qFree(bfs); - } - - AudioBufferList* audioBufferList() const - { - return bfs; - } - - char* data(int buffer = 0) const - { - return static_cast(bfs->mBuffers[buffer].mData); - } - - qint64 bufferSize(int buffer = 0) const - { - return bfs->mBuffers[buffer].mDataByteSize; - } - - int frameCount(int buffer = 0) const - { - return bfs->mBuffers[buffer].mDataByteSize / sf.mBytesPerFrame; - } - - int packetCount(int buffer = 0) const - { - return bfs->mBuffers[buffer].mDataByteSize / sf.mBytesPerPacket; - } - - int packetSize() const - { - return sf.mBytesPerPacket; - } - - void reset() - { - for (UInt32 i = 0; i < bfs->mNumberBuffers; ++i) { - bfs->mBuffers[i].mDataByteSize = dataSize; - bfs->mBuffers[i].mData = 0; - } - } - -private: - bool owner; - int dataSize; - AudioStreamBasicDescription sf; - AudioBufferList* bfs; -}; - -class QAudioPacketFeeder -{ -public: - QAudioPacketFeeder(QAudioBufferList* abl): - audioBufferList(abl) - { - totalPackets = audioBufferList->packetCount(); - position = 0; - } - - bool feed(AudioBufferList& dst, UInt32& packetCount) - { - if (position == totalPackets) { - dst.mBuffers[0].mDataByteSize = 0; - packetCount = 0; - return false; - } - - if (totalPackets - position < packetCount) - packetCount = totalPackets - position; - - dst.mBuffers[0].mDataByteSize = packetCount * audioBufferList->packetSize(); - dst.mBuffers[0].mData = audioBufferList->data() + (position * audioBufferList->packetSize()); - - position += packetCount; - - return true; - } - -private: - UInt32 totalPackets; - UInt32 position; - QAudioBufferList* audioBufferList; -}; - -class QAudioInputBuffer : public QObject -{ - Q_OBJECT - -public: - QAudioInputBuffer(int bufferSize, - int maxPeriodSize, - AudioStreamBasicDescription const& inputFormat, - AudioStreamBasicDescription const& outputFormat, - QObject* parent): - QObject(parent), - m_deviceError(false), - m_audioConverter(0), - m_inputFormat(inputFormat), - m_outputFormat(outputFormat) - { - m_maxPeriodSize = maxPeriodSize; - m_periodTime = m_maxPeriodSize / m_outputFormat.mBytesPerFrame * 1000 / m_outputFormat.mSampleRate; - m_buffer = new QAudioRingBuffer(bufferSize + (bufferSize % maxPeriodSize == 0 ? 0 : maxPeriodSize - (bufferSize % maxPeriodSize))); - m_inputBufferList = new QAudioBufferList(m_inputFormat); - - m_flushTimer = new QTimer(this); - connect(m_flushTimer, SIGNAL(timeout()), SLOT(flushBuffer())); - - if (toQAudioFormat(inputFormat) != toQAudioFormat(outputFormat)) { - if (AudioConverterNew(&m_inputFormat, &m_outputFormat, &m_audioConverter) != noErr) { - qWarning() << "QAudioInput: Unable to create an Audio Converter"; - m_audioConverter = 0; - } - } - } - - ~QAudioInputBuffer() - { - delete m_buffer; - } - - qint64 renderFromDevice(AudioUnit audioUnit, - AudioUnitRenderActionFlags* ioActionFlags, - const AudioTimeStamp* inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumberFrames) - { - const bool wasEmpty = m_buffer->used() == 0; - - OSStatus err; - qint64 framesRendered = 0; - - m_inputBufferList->reset(); - err = AudioUnitRender(audioUnit, - ioActionFlags, - inTimeStamp, - inBusNumber, - inNumberFrames, - m_inputBufferList->audioBufferList()); - - if (m_audioConverter != 0) { - QAudioPacketFeeder feeder(m_inputBufferList); - - bool wecan = true; - int copied = 0; - - const int available = m_buffer->free(); - - while (err == noErr && wecan) { - QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(available); - - if (region.second > 0) { - AudioBufferList output; - output.mNumberBuffers = 1; - output.mBuffers[0].mNumberChannels = 1; - output.mBuffers[0].mDataByteSize = region.second; - output.mBuffers[0].mData = region.first; - - UInt32 packetSize = region.second / m_outputFormat.mBytesPerPacket; - err = AudioConverterFillComplexBuffer(m_audioConverter, - converterCallback, - &feeder, - &packetSize, - &output, - 0); - - region.second = output.mBuffers[0].mDataByteSize; - copied += region.second; - - m_buffer->releaseWriteRegion(region); - } - else - wecan = false; - } - - framesRendered += copied / m_outputFormat.mBytesPerFrame; - } - else { - const int available = m_inputBufferList->bufferSize(); - bool wecan = true; - int copied = 0; - - while (wecan && copied < available) { - QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(available - copied); - - if (region.second > 0) { - memcpy(region.first, m_inputBufferList->data() + copied, region.second); - copied += region.second; - } - else - wecan = false; - - m_buffer->releaseWriteRegion(region); - } - - framesRendered = copied / m_outputFormat.mBytesPerFrame; - } - - if (wasEmpty && framesRendered > 0) - emit readyRead(); - - return framesRendered; - } - - qint64 readBytes(char* data, qint64 len) - { - bool wecan = true; - qint64 bytesCopied = 0; - - len -= len % m_maxPeriodSize; - while (wecan && bytesCopied < len) { - QAudioRingBuffer::Region region = m_buffer->acquireReadRegion(len - bytesCopied); - - if (region.second > 0) { - memcpy(data + bytesCopied, region.first, region.second); - bytesCopied += region.second; - } - else - wecan = false; - - m_buffer->releaseReadRegion(region); - } - - return bytesCopied; - } - - void setFlushDevice(QIODevice* device) - { - if (m_device != device) - m_device = device; - } - - void startFlushTimer() - { - if (m_device != 0) { - m_flushTimer->start((m_buffer->size() - (m_maxPeriodSize * 2)) / m_maxPeriodSize * m_periodTime); - } - } - - void stopFlushTimer() - { - m_flushTimer->stop(); - } - - void flush(bool all = false) - { - if (m_device == 0) - return; - - const int used = m_buffer->used(); - const int readSize = all ? used : used - (used % m_maxPeriodSize); - - if (readSize > 0) { - bool wecan = true; - int flushed = 0; - - while (!m_deviceError && wecan && flushed < readSize) { - QAudioRingBuffer::Region region = m_buffer->acquireReadRegion(readSize - flushed); - - if (region.second > 0) { - int bytesWritten = m_device->write(region.first, region.second); - if (bytesWritten < 0) { - stopFlushTimer(); - m_deviceError = true; - } - else { - region.second = bytesWritten; - flushed += bytesWritten; - wecan = bytesWritten != 0; - } - } - else - wecan = false; - - m_buffer->releaseReadRegion(region); - } - } - } - - void reset() - { - m_buffer->reset(); - m_deviceError = false; - } - - int available() const - { - return m_buffer->free(); - } - - int used() const - { - return m_buffer->used(); - } - -signals: - void readyRead(); - -private slots: - void flushBuffer() - { - flush(); - } - -private: - bool m_deviceError; - int m_maxPeriodSize; - int m_periodTime; - QIODevice* m_device; - QTimer* m_flushTimer; - QAudioRingBuffer* m_buffer; - QAudioBufferList* m_inputBufferList; - AudioConverterRef m_audioConverter; - AudioStreamBasicDescription m_inputFormat; - AudioStreamBasicDescription m_outputFormat; - - const static OSStatus as_empty = 'qtem'; - - // Converter callback - static OSStatus converterCallback(AudioConverterRef inAudioConverter, - UInt32* ioNumberDataPackets, - AudioBufferList* ioData, - AudioStreamPacketDescription** outDataPacketDescription, - void* inUserData) - { - Q_UNUSED(inAudioConverter); - Q_UNUSED(outDataPacketDescription); - - QAudioPacketFeeder* feeder = static_cast(inUserData); - - if (!feeder->feed(*ioData, *ioNumberDataPackets)) - return as_empty; - - return noErr; - } -}; - - -class MacInputDevice : public QIODevice -{ - Q_OBJECT - -public: - MacInputDevice(QAudioInputBuffer* audioBuffer, QObject* parent): - QIODevice(parent), - m_audioBuffer(audioBuffer) - { - open(QIODevice::ReadOnly | QIODevice::Unbuffered); - connect(m_audioBuffer, SIGNAL(readyRead()), SIGNAL(readyRead())); - } - - qint64 readData(char* data, qint64 len) - { - return m_audioBuffer->readBytes(data, len); - } - - qint64 writeData(const char* data, qint64 len) - { - Q_UNUSED(data); - Q_UNUSED(len); - - return 0; - } - - bool isSequential() const - { - return true; - } - -private: - QAudioInputBuffer* m_audioBuffer; -}; - -} - - -QAudioInputPrivate::QAudioInputPrivate(const QByteArray& device, QAudioFormat const& format): - audioFormat(format) -{ - QDataStream ds(device); - quint32 did, mode; - - ds >> did >> mode; - - if (QAudio::Mode(mode) == QAudio::AudioOutput) - errorCode = QAudio::OpenError; - else { - audioDeviceInfo = new QAudioDeviceInfoInternal(device, QAudio::AudioInput); - isOpen = false; - audioDeviceId = AudioDeviceID(did); - audioUnit = 0; - startTime = 0; - totalFrames = 0; - audioBuffer = 0; - internalBufferSize = QtMultimediaInternal::default_buffer_size; - clockFrequency = AudioGetHostClockFrequency() / 1000; - errorCode = QAudio::NoError; - stateCode = QAudio::StoppedState; - - intervalTimer = new QTimer(this); - intervalTimer->setInterval(1000); - connect(intervalTimer, SIGNAL(timeout()), SIGNAL(notify())); - } -} - -QAudioInputPrivate::~QAudioInputPrivate() -{ - close(); - delete audioDeviceInfo; -} - -bool QAudioInputPrivate::open() -{ - UInt32 size = 0; - - if (isOpen) - return true; - - ComponentDescription cd; - cd.componentType = kAudioUnitType_Output; - cd.componentSubType = kAudioUnitSubType_HALOutput; - cd.componentManufacturer = kAudioUnitManufacturer_Apple; - cd.componentFlags = 0; - cd.componentFlagsMask = 0; - - // Open - Component cp = FindNextComponent(NULL, &cd); - if (cp == 0) { - qWarning() << "QAudioInput: Failed to find HAL Output component"; - return false; - } - - if (OpenAComponent(cp, &audioUnit) != noErr) { - qWarning() << "QAudioInput: Unable to Open Output Component"; - return false; - } - - // Set mode - // switch to input mode - UInt32 enable = 1; - if (AudioUnitSetProperty(audioUnit, - kAudioOutputUnitProperty_EnableIO, - kAudioUnitScope_Input, - 1, - &enable, - sizeof(enable)) != noErr) { - qWarning() << "QAudioInput: Unable to switch to input mode (Enable Input)"; - return false; - } - - enable = 0; - if (AudioUnitSetProperty(audioUnit, - kAudioOutputUnitProperty_EnableIO, - kAudioUnitScope_Output, - 0, - &enable, - sizeof(enable)) != noErr) { - qWarning() << "QAudioInput: Unable to switch to input mode (Disable output)"; - return false; - } - - // register callback - AURenderCallbackStruct cb; - cb.inputProc = inputCallback; - cb.inputProcRefCon = this; - - if (AudioUnitSetProperty(audioUnit, - kAudioOutputUnitProperty_SetInputCallback, - kAudioUnitScope_Global, - 0, - &cb, - sizeof(cb)) != noErr) { - qWarning() << "QAudioInput: Failed to set AudioUnit callback"; - return false; - } - - // Set Audio Device - if (AudioUnitSetProperty(audioUnit, - kAudioOutputUnitProperty_CurrentDevice, - kAudioUnitScope_Global, - 0, - &audioDeviceId, - sizeof(audioDeviceId)) != noErr) { - qWarning() << "QAudioInput: Unable to use configured device"; - return false; - } - - // Set format - // Wanted - streamFormat = toAudioStreamBasicDescription(audioFormat); - - // Required on unit - if (audioFormat == audioDeviceInfo->preferredFormat()) { - deviceFormat = streamFormat; - AudioUnitSetProperty(audioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Output, - 1, - &deviceFormat, - sizeof(deviceFormat)); - } - else { - size = sizeof(deviceFormat); - if (AudioUnitGetProperty(audioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 1, - &deviceFormat, - &size) != noErr) { - qWarning() << "QAudioInput: Unable to retrieve device format"; - return false; - } - - if (AudioUnitSetProperty(audioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Output, - 1, - &deviceFormat, - sizeof(deviceFormat)) != noErr) { - qWarning() << "QAudioInput: Unable to set device format"; - return false; - } - } - - // Setup buffers - UInt32 numberOfFrames; - size = sizeof(UInt32); - if (AudioUnitGetProperty(audioUnit, - kAudioDevicePropertyBufferFrameSize, - kAudioUnitScope_Global, - 0, - &numberOfFrames, - &size) != noErr) { - qWarning() << "QAudioInput: Failed to get audio period size"; - return false; - } - - // Allocate buffer - periodSizeBytes = numberOfFrames * streamFormat.mBytesPerFrame; - - if (internalBufferSize < periodSizeBytes * 2) - internalBufferSize = periodSizeBytes * 2; - else - internalBufferSize -= internalBufferSize % streamFormat.mBytesPerFrame; - - audioBuffer = new QtMultimediaInternal::QAudioInputBuffer(internalBufferSize, - periodSizeBytes, - deviceFormat, - streamFormat, - this); - - audioIO = new QtMultimediaInternal::MacInputDevice(audioBuffer, this); - - // Init - if (AudioUnitInitialize(audioUnit) != noErr) { - qWarning() << "QAudioInput: Failed to initialize AudioUnit"; - return false; - } - - isOpen = true; - - return isOpen; -} - -void QAudioInputPrivate::close() -{ - if (audioUnit != 0) { - AudioOutputUnitStop(audioUnit); - AudioUnitUninitialize(audioUnit); - CloseComponent(audioUnit); - } - - delete audioBuffer; -} - -QAudioFormat QAudioInputPrivate::format() const -{ - return audioFormat; -} - -QIODevice* QAudioInputPrivate::start(QIODevice* device) -{ - QIODevice* op = device; - - if (!audioFormat.isValid() || !open()) { - stateCode = QAudio::StoppedState; - errorCode = QAudio::OpenError; - return audioIO; - } - - reset(); - audioBuffer->reset(); - audioBuffer->setFlushDevice(op); - - if (op == 0) - op = audioIO; - - // Start - startTime = AudioGetCurrentHostTime(); - totalFrames = 0; - - audioThreadStart(); - - stateCode = QAudio::ActiveState; - errorCode = QAudio::NoError; - emit stateChanged(stateCode); - - return op; -} - -void QAudioInputPrivate::stop() -{ - QMutexLocker lock(&mutex); - if (stateCode != QAudio::StoppedState) { - audioThreadStop(); - audioBuffer->flush(true); - - errorCode = QAudio::NoError; - stateCode = QAudio::StoppedState; - QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); - } -} - -void QAudioInputPrivate::reset() -{ - QMutexLocker lock(&mutex); - if (stateCode != QAudio::StoppedState) { - audioThreadStop(); - - errorCode = QAudio::NoError; - stateCode = QAudio::StoppedState; - QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); - } -} - -void QAudioInputPrivate::suspend() -{ - QMutexLocker lock(&mutex); - if (stateCode == QAudio::ActiveState || stateCode == QAudio::IdleState) { - audioThreadStop(); - - errorCode = QAudio::NoError; - stateCode = QAudio::SuspendedState; - QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); - } -} - -void QAudioInputPrivate::resume() -{ - QMutexLocker lock(&mutex); - if (stateCode == QAudio::SuspendedState) { - audioThreadStart(); - - errorCode = QAudio::NoError; - stateCode = QAudio::ActiveState; - QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); - } -} - -int QAudioInputPrivate::bytesReady() const -{ - return audioBuffer->used(); -} - -int QAudioInputPrivate::periodSize() const -{ - return periodSizeBytes; -} - -void QAudioInputPrivate::setBufferSize(int bs) -{ - internalBufferSize = bs; -} - -int QAudioInputPrivate::bufferSize() const -{ - return internalBufferSize; -} - -void QAudioInputPrivate::setNotifyInterval(int milliSeconds) -{ - if (intervalTimer->interval() == milliSeconds) - return; - - if (milliSeconds <= 0) - milliSeconds = 0; - - intervalTimer->setInterval(milliSeconds); -} - -int QAudioInputPrivate::notifyInterval() const -{ - return intervalTimer->interval(); -} - -qint64 QAudioInputPrivate::processedUSecs() const -{ - return totalFrames * 1000000 / audioFormat.frequency(); -} - -qint64 QAudioInputPrivate::elapsedUSecs() const -{ - if (stateCode == QAudio::StoppedState) - return 0; - - return (AudioGetCurrentHostTime() - startTime) / (clockFrequency / 1000); -} - -QAudio::Error QAudioInputPrivate::error() const -{ - return errorCode; -} - -QAudio::State QAudioInputPrivate::state() const -{ - return stateCode; -} - -void QAudioInputPrivate::audioThreadStop() -{ - stopTimers(); - if (audioThreadState.testAndSetAcquire(Running, Stopped)) - threadFinished.wait(&mutex); -} - -void QAudioInputPrivate::audioThreadStart() -{ - startTimers(); - audioThreadState = Running; - AudioOutputUnitStart(audioUnit); -} - -void QAudioInputPrivate::audioDeviceStop() -{ - AudioOutputUnitStop(audioUnit); - audioThreadState = Stopped; - threadFinished.wakeOne(); -} - -void QAudioInputPrivate::audioDeviceFull() -{ - QMutexLocker lock(&mutex); - if (stateCode == QAudio::ActiveState) { - audioDeviceStop(); - - errorCode = QAudio::UnderrunError; - stateCode = QAudio::IdleState; - QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection); - } -} - -void QAudioInputPrivate::audioDeviceError() -{ - QMutexLocker lock(&mutex); - if (stateCode == QAudio::ActiveState) { - audioDeviceStop(); - - errorCode = QAudio::IOError; - stateCode = QAudio::StoppedState; - QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection); - } -} - -void QAudioInputPrivate::startTimers() -{ - audioBuffer->startFlushTimer(); - if (intervalTimer->interval() > 0) - intervalTimer->start(); -} - -void QAudioInputPrivate::stopTimers() -{ - audioBuffer->stopFlushTimer(); - intervalTimer->stop(); -} - -void QAudioInputPrivate::deviceStopped() -{ - stopTimers(); - emit stateChanged(stateCode); -} - -// Input callback -OSStatus QAudioInputPrivate::inputCallback(void* inRefCon, - AudioUnitRenderActionFlags* ioActionFlags, - const AudioTimeStamp* inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumberFrames, - AudioBufferList* ioData) -{ - Q_UNUSED(ioData); - - QAudioInputPrivate* d = static_cast(inRefCon); - - const int threadState = d->audioThreadState.fetchAndAddAcquire(0); - if (threadState == Stopped) - d->audioDeviceStop(); - else { - qint64 framesWritten; - - framesWritten = d->audioBuffer->renderFromDevice(d->audioUnit, - ioActionFlags, - inTimeStamp, - inBusNumber, - inNumberFrames); - - if (framesWritten > 0) - d->totalFrames += framesWritten; - else if (framesWritten == 0) - d->audioDeviceFull(); - else if (framesWritten < 0) - d->audioDeviceError(); - } - - return noErr; -} - - -QT_END_NAMESPACE - -#include "qaudioinput_mac_p.moc" - diff --git a/src/multimedia/audio/qaudioinput_mac_p.h b/src/multimedia/audio/qaudioinput_mac_p.h deleted file mode 100644 index 7aa4168..0000000 --- a/src/multimedia/audio/qaudioinput_mac_p.h +++ /dev/null @@ -1,169 +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$ -** -****************************************************************************/ - -// -// 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. -// - - -#ifndef QAUDIOINPUT_MAC_P_H -#define QAUDIOINPUT_MAC_P_H - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QTimer; -class QIODevice; -class QAbstractAudioDeviceInfo; - -namespace QtMultimediaInternal -{ -class QAudioInputBuffer; -} - -class QAudioInputPrivate : public QAbstractAudioInput -{ - Q_OBJECT - -public: - bool isOpen; - int periodSizeBytes; - int internalBufferSize; - qint64 totalFrames; - QAudioFormat audioFormat; - QIODevice* audioIO; - AudioUnit audioUnit; - AudioDeviceID audioDeviceId; - Float64 clockFrequency; - UInt64 startTime; - QAudio::Error errorCode; - QAudio::State stateCode; - QtMultimediaInternal::QAudioInputBuffer* audioBuffer; - QMutex mutex; - QWaitCondition threadFinished; - QAtomicInt audioThreadState; - QTimer* intervalTimer; - AudioStreamBasicDescription streamFormat; - AudioStreamBasicDescription deviceFormat; - QAbstractAudioDeviceInfo *audioDeviceInfo; - - QAudioInputPrivate(const QByteArray& device, QAudioFormat const& format); - ~QAudioInputPrivate(); - - bool open(); - void close(); - - QAudioFormat format() const; - - QIODevice* start(QIODevice* device); - void stop(); - void reset(); - void suspend(); - void resume(); - void idle(); - - int bytesReady() const; - int periodSize() const; - - void setBufferSize(int value); - int bufferSize() const; - - void setNotifyInterval(int milliSeconds); - int notifyInterval() const; - - qint64 processedUSecs() const; - qint64 elapsedUSecs() const; - - QAudio::Error error() const; - QAudio::State state() const; - - void audioThreadStart(); - void audioThreadStop(); - - void audioDeviceStop(); - void audioDeviceFull(); - void audioDeviceError(); - - void startTimers(); - void stopTimers(); - -private slots: - void deviceStopped(); - -private: - enum { Running, Stopped }; - - // Input callback - static OSStatus inputCallback(void* inRefCon, - AudioUnitRenderActionFlags* ioActionFlags, - const AudioTimeStamp* inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumberFrames, - AudioBufferList* ioData); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QAUDIOINPUT_MAC_P_H diff --git a/src/multimedia/audio/qaudioinput_symbian_p.cpp b/src/multimedia/audio/qaudioinput_symbian_p.cpp deleted file mode 100644 index 52daa88..0000000 --- a/src/multimedia/audio/qaudioinput_symbian_p.cpp +++ /dev/null @@ -1,594 +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 "qaudioinput_symbian_p.h" - -QT_BEGIN_NAMESPACE - -//----------------------------------------------------------------------------- -// Constants -//----------------------------------------------------------------------------- - -const int PushInterval = 50; // ms - - -//----------------------------------------------------------------------------- -// Private class -//----------------------------------------------------------------------------- - -SymbianAudioInputPrivate::SymbianAudioInputPrivate( - QAudioInputPrivate *audioDevice) - : m_audioDevice(audioDevice) -{ - -} - -SymbianAudioInputPrivate::~SymbianAudioInputPrivate() -{ - -} - -qint64 SymbianAudioInputPrivate::readData(char *data, qint64 len) -{ - qint64 totalRead = 0; - - if (m_audioDevice->state() == QAudio::ActiveState || - m_audioDevice->state() == QAudio::IdleState) { - - while (totalRead < len) { - const qint64 read = m_audioDevice->read(data + totalRead, - len - totalRead); - if (read > 0) - totalRead += read; - else - break; - } - } - - return totalRead; -} - -qint64 SymbianAudioInputPrivate::writeData(const char *data, qint64 len) -{ - Q_UNUSED(data) - Q_UNUSED(len) - return 0; -} - -void SymbianAudioInputPrivate::dataReady() -{ - emit readyRead(); -} - - -//----------------------------------------------------------------------------- -// Public functions -//----------------------------------------------------------------------------- - -QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, - const QAudioFormat &format) - : m_device(device) - , m_format(format) - , m_clientBufferSize(SymbianAudio::DefaultBufferSize) - , m_notifyInterval(SymbianAudio::DefaultNotifyInterval) - , m_notifyTimer(new QTimer(this)) - , m_error(QAudio::NoError) - , m_internalState(SymbianAudio::ClosedState) - , m_externalState(QAudio::StoppedState) - , m_pullMode(false) - , m_sink(0) - , m_pullTimer(new QTimer(this)) - , m_devSoundBuffer(0) - , m_devSoundBufferSize(0) - , m_totalBytesReady(0) - , m_devSoundBufferPos(0) - , m_totalSamplesRecorded(0) -{ - connect(m_notifyTimer.data(), SIGNAL(timeout()), this, SIGNAL(notify())); - - SymbianAudio::Utils::formatQtToNative(m_format, m_nativeFourCC, - m_nativeFormat); - - m_pullTimer->setInterval(PushInterval); - connect(m_pullTimer.data(), SIGNAL(timeout()), this, SLOT(pullData())); -} - -QAudioInputPrivate::~QAudioInputPrivate() -{ - close(); -} - -QIODevice* QAudioInputPrivate::start(QIODevice *device) -{ - stop(); - - open(); - if (SymbianAudio::ClosedState != m_internalState) { - if (device) { - m_pullMode = true; - m_sink = device; - } else { - m_sink = new SymbianAudioInputPrivate(this); - m_sink->open(QIODevice::ReadOnly | QIODevice::Unbuffered); - } - - m_elapsed.restart(); - } - - return m_sink; -} - -void QAudioInputPrivate::stop() -{ - close(); -} - -void QAudioInputPrivate::reset() -{ - m_totalSamplesRecorded += getSamplesRecorded(); - m_devSound->Stop(); - startRecording(); -} - -void QAudioInputPrivate::suspend() -{ - if (SymbianAudio::ActiveState == m_internalState - || SymbianAudio::IdleState == m_internalState) { - m_notifyTimer->stop(); - m_pullTimer->stop(); - m_devSound->Pause(); - const qint64 samplesRecorded = getSamplesRecorded(); - m_totalSamplesRecorded += samplesRecorded; - - if (m_devSoundBuffer) { - m_devSoundBufferQ.append(m_devSoundBuffer); - m_devSoundBuffer = 0; - } - - setState(SymbianAudio::SuspendedState); - } -} - -void QAudioInputPrivate::resume() -{ - if (SymbianAudio::SuspendedState == m_internalState) - startDataTransfer(); -} - -int QAudioInputPrivate::bytesReady() const -{ - Q_ASSERT(m_devSoundBufferPos <= m_totalBytesReady); - return m_totalBytesReady - m_devSoundBufferPos; -} - -int QAudioInputPrivate::periodSize() const -{ - return bufferSize(); -} - -void QAudioInputPrivate::setBufferSize(int value) -{ - // Note that DevSound does not allow its client to specify the buffer size. - // This functionality is available via custom interfaces, but since these - // cannot be guaranteed to work across all DevSound implementations, we - // do not use them here. - // In order to comply with the expected bevahiour of QAudioInput, we store - // the value and return it from bufferSize(), but the underlying DevSound - // buffer size remains unchanged. - if (value > 0) - m_clientBufferSize = value; -} - -int QAudioInputPrivate::bufferSize() const -{ - return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize; -} - -void QAudioInputPrivate::setNotifyInterval(int ms) -{ - if (ms > 0) { - const int oldNotifyInterval = m_notifyInterval; - m_notifyInterval = ms; - if (m_notifyTimer->isActive() && ms != oldNotifyInterval) - m_notifyTimer->start(m_notifyInterval); - } -} - -int QAudioInputPrivate::notifyInterval() const -{ - return m_notifyInterval; -} - -qint64 QAudioInputPrivate::processedUSecs() const -{ - int samplesPlayed = 0; - if (m_devSound && SymbianAudio::SuspendedState != m_internalState) - samplesPlayed = getSamplesRecorded(); - - // Protect against division by zero - Q_ASSERT_X(m_format.frequency() > 0, Q_FUNC_INFO, "Invalid frequency"); - - const qint64 result = qint64(1000000) * - (samplesPlayed + m_totalSamplesRecorded) - / m_format.frequency(); - - return result; -} - -qint64 QAudioInputPrivate::elapsedUSecs() const -{ - const qint64 result = (QAudio::StoppedState == state()) ? - 0 : m_elapsed.elapsed() * 1000; - return result; -} - -QAudio::Error QAudioInputPrivate::error() const -{ - return m_error; -} - -QAudio::State QAudioInputPrivate::state() const -{ - return m_externalState; -} - -QAudioFormat QAudioInputPrivate::format() const -{ - return m_format; -} - -//----------------------------------------------------------------------------- -// MDevSoundObserver implementation -//----------------------------------------------------------------------------- - -void QAudioInputPrivate::InitializeComplete(TInt aError) -{ - Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState, - Q_FUNC_INFO, "Invalid state"); - - if (KErrNone == aError) - startRecording(); -} - -void QAudioInputPrivate::ToneFinished(TInt aError) -{ - Q_UNUSED(aError) - // This class doesn't use DevSound's tone playback functions, so should - // never receive this callback. - Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); -} - -void QAudioInputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer) -{ - Q_UNUSED(aBuffer) - // This class doesn't use DevSound in play mode, so should never receive - // this callback. - Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); -} - -void QAudioInputPrivate::PlayError(TInt aError) -{ - Q_UNUSED(aError) - // This class doesn't use DevSound in play mode, so should never receive - // this callback. - Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); -} - -void QAudioInputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer) -{ - // Following receipt of this callback, DevSound should not provide another - // buffer until we have returned the current one. - Q_ASSERT_X(!m_devSoundBuffer, Q_FUNC_INFO, "Buffer already held"); - - CMMFDataBuffer *const buffer = static_cast(aBuffer); - - if (!m_devSoundBufferSize) - m_devSoundBufferSize = buffer->Data().MaxLength(); - - m_totalBytesReady += buffer->Data().Length(); - - if (SymbianAudio::SuspendedState == m_internalState) { - m_devSoundBufferQ.append(buffer); - } else { - // Will be returned to DevSound by bufferEmptied(). - m_devSoundBuffer = buffer; - m_devSoundBufferPos = 0; - - if (bytesReady() && !m_pullMode) - pushData(); - } -} - -void QAudioInputPrivate::RecordError(TInt aError) -{ - Q_UNUSED(aError) - setError(QAudio::IOError); -} - -void QAudioInputPrivate::ConvertError(TInt aError) -{ - Q_UNUSED(aError) - // This class doesn't use DevSound's format conversion functions, so - // should never receive this callback. - Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); -} - -void QAudioInputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) -{ - Q_UNUSED(aMessageType) - Q_UNUSED(aMsg) - // Ignore this callback. -} - -//----------------------------------------------------------------------------- -// Private functions -//----------------------------------------------------------------------------- - -void QAudioInputPrivate::open() -{ - Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState, - Q_FUNC_INFO, "DevSound already opened"); - - QT_TRAP_THROWING( m_devSound.reset(CMMFDevSound::NewL()) ) - - QScopedPointer caps( - new SymbianAudio::DevSoundCapabilities(*m_devSound, QAudio::AudioInput)); - - int err = SymbianAudio::Utils::isFormatSupported(m_format, *caps) ? - KErrNone : KErrNotSupported; - - if (KErrNone == err) { - setState(SymbianAudio::InitializingState); - TRAP(err, m_devSound->InitializeL(*this, m_nativeFourCC, - EMMFStateRecording)); - } - - if (KErrNone != err) { - setError(QAudio::OpenError); - m_devSound.reset(); - } -} - -void QAudioInputPrivate::startRecording() -{ - const int samplesRecorded = m_devSound->SamplesRecorded(); - Q_ASSERT(samplesRecorded == 0); - - TRAPD(err, startDevSoundL()); - if (KErrNone == err) { - startDataTransfer(); - } else { - setError(QAudio::OpenError); - close(); - } -} - -void QAudioInputPrivate::startDevSoundL() -{ - TMMFCapabilities nativeFormat = m_devSound->Config(); - m_nativeFormat.iBufferSize = nativeFormat.iBufferSize; - m_devSound->SetConfigL(m_nativeFormat); - m_devSound->RecordInitL(); -} - -void QAudioInputPrivate::startDataTransfer() -{ - m_notifyTimer->start(m_notifyInterval); - - if (m_pullMode) - m_pullTimer->start(); - - if (bytesReady()) { - setState(SymbianAudio::ActiveState); - if (!m_pullMode) - pushData(); - } else { - if (SymbianAudio::SuspendedState == m_internalState) - setState(SymbianAudio::ActiveState); - else - setState(SymbianAudio::IdleState); - } -} - -CMMFDataBuffer* QAudioInputPrivate::currentBuffer() const -{ - CMMFDataBuffer *result = m_devSoundBuffer; - if (!result && !m_devSoundBufferQ.empty()) - result = m_devSoundBufferQ.front(); - return result; -} - -void QAudioInputPrivate::pushData() -{ - Q_ASSERT_X(bytesReady(), Q_FUNC_INFO, "No data available"); - Q_ASSERT_X(!m_pullMode, Q_FUNC_INFO, "pushData called when in pull mode"); - qobject_cast(m_sink)->dataReady(); -} - -qint64 QAudioInputPrivate::read(char *data, qint64 len) -{ - // SymbianAudioInputPrivate is ready to read data - - Q_ASSERT_X(!m_pullMode, Q_FUNC_INFO, - "read called when in pull mode"); - - qint64 bytesRead = 0; - - CMMFDataBuffer *buffer = 0; - while ((buffer = currentBuffer()) && (bytesRead < len)) { - if (SymbianAudio::IdleState == m_internalState) - setState(SymbianAudio::ActiveState); - - TDesC8 &inputBuffer = buffer->Data(); - - const qint64 inputBytes = bytesReady(); - const qint64 outputBytes = len - bytesRead; - const qint64 copyBytes = outputBytes < inputBytes ? - outputBytes : inputBytes; - - memcpy(data, inputBuffer.Ptr() + m_devSoundBufferPos, copyBytes); - - m_devSoundBufferPos += copyBytes; - data += copyBytes; - bytesRead += copyBytes; - - if (!bytesReady()) - bufferEmptied(); - } - - return bytesRead; -} - -void QAudioInputPrivate::pullData() -{ - Q_ASSERT_X(m_pullMode, Q_FUNC_INFO, - "pullData called when in push mode"); - - CMMFDataBuffer *buffer = 0; - while (buffer = currentBuffer()) { - if (SymbianAudio::IdleState == m_internalState) - setState(SymbianAudio::ActiveState); - - TDesC8 &inputBuffer = buffer->Data(); - - const qint64 inputBytes = bytesReady(); - const qint64 bytesPushed = m_sink->write( - (char*)inputBuffer.Ptr() + m_devSoundBufferPos, inputBytes); - - m_devSoundBufferPos += bytesPushed; - - if (!bytesReady()) - bufferEmptied(); - - if (!bytesPushed) - break; - } -} - -void QAudioInputPrivate::bufferEmptied() -{ - m_devSoundBufferPos = 0; - - if (m_devSoundBuffer) { - m_totalBytesReady -= m_devSoundBuffer->Data().Length(); - m_devSoundBuffer = 0; - m_devSound->RecordData(); - } else { - Q_ASSERT(!m_devSoundBufferQ.empty()); - m_totalBytesReady -= m_devSoundBufferQ.front()->Data().Length(); - m_devSoundBufferQ.erase(m_devSoundBufferQ.begin()); - - // If the queue has been emptied, resume transfer from the hardware - if (m_devSoundBufferQ.empty()) - m_devSound->RecordInitL(); - } - - Q_ASSERT(m_totalBytesReady >= 0); -} - -void QAudioInputPrivate::close() -{ - m_notifyTimer->stop(); - m_pullTimer->stop(); - - m_error = QAudio::NoError; - - if (m_devSound) - m_devSound->Stop(); - m_devSound.reset(); - m_devSoundBuffer = 0; - m_devSoundBufferSize = 0; - m_totalBytesReady = 0; - - if (!m_pullMode) // m_sink is owned - delete m_sink; - m_pullMode = false; - m_sink = 0; - - m_devSoundBufferQ.clear(); - m_devSoundBufferPos = 0; - m_totalSamplesRecorded = 0; - - setState(SymbianAudio::ClosedState); -} - -qint64 QAudioInputPrivate::getSamplesRecorded() const -{ - qint64 result = 0; - if (m_devSound) - result = qint64(m_devSound->SamplesRecorded()); - return result; -} - -void QAudioInputPrivate::setError(QAudio::Error error) -{ - m_error = error; - - // Although no state transition actually occurs here, a stateChanged event - // must be emitted to inform the client that the call to start() was - // unsuccessful. - if (QAudio::OpenError == error) - emit stateChanged(QAudio::StoppedState); - - // Close the DevSound instance. This causes a transition to StoppedState. - // This must be done asynchronously in case the current function was called - // from a DevSound event handler, in which case deleting the DevSound - // instance may cause an exception. - QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection); -} - -void QAudioInputPrivate::setState(SymbianAudio::State newInternalState) -{ - const QAudio::State oldExternalState = m_externalState; - m_internalState = newInternalState; - m_externalState = SymbianAudio::Utils::stateNativeToQt( - m_internalState, initializingState()); - - if (m_externalState != oldExternalState) - emit stateChanged(m_externalState); -} - -QAudio::State QAudioInputPrivate::initializingState() const -{ - return QAudio::IdleState; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudioinput_symbian_p.h b/src/multimedia/audio/qaudioinput_symbian_p.h deleted file mode 100644 index ca3ccf7..0000000 --- a/src/multimedia/audio/qaudioinput_symbian_p.h +++ /dev/null @@ -1,188 +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$ -** -****************************************************************************/ - -// -// 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. -// - -#ifndef QAUDIOINPUT_SYMBIAN_P_H -#define QAUDIOINPUT_SYMBIAN_P_H - -#include -#include -#include -#include -#include "qaudio_symbian_p.h" - -QT_BEGIN_NAMESPACE - -class QAudioInputPrivate; - -class SymbianAudioInputPrivate : public QIODevice -{ - friend class QAudioInputPrivate; - Q_OBJECT -public: - SymbianAudioInputPrivate(QAudioInputPrivate *audio); - ~SymbianAudioInputPrivate(); - - qint64 readData(char *data, qint64 len); - qint64 writeData(const char *data, qint64 len); - - void dataReady(); - -private: - QAudioInputPrivate *const m_audioDevice; -}; - -class QAudioInputPrivate - : public QAbstractAudioInput - , public MDevSoundObserver -{ - friend class SymbianAudioInputPrivate; - Q_OBJECT -public: - QAudioInputPrivate(const QByteArray &device, - const QAudioFormat &audioFormat); - ~QAudioInputPrivate(); - - // QAbstractAudioInput - QIODevice* start(QIODevice *device = 0); - void stop(); - void reset(); - void suspend(); - void resume(); - int bytesReady() const; - int periodSize() const; - void setBufferSize(int value); - int bufferSize() const; - void setNotifyInterval(int milliSeconds); - int notifyInterval() const; - qint64 processedUSecs() const; - qint64 elapsedUSecs() const; - QAudio::Error error() const; - QAudio::State state() const; - QAudioFormat format() const; - - // MDevSoundObserver - void InitializeComplete(TInt aError); - void ToneFinished(TInt aError); - void BufferToBeFilled(CMMFBuffer *aBuffer); - void PlayError(TInt aError); - void BufferToBeEmptied(CMMFBuffer *aBuffer); - void RecordError(TInt aError); - void ConvertError(TInt aError); - void DeviceMessage(TUid aMessageType, const TDesC8 &aMsg); - -private slots: - void pullData(); - -private: - void open(); - void startRecording(); - void startDevSoundL(); - void startDataTransfer(); - CMMFDataBuffer* currentBuffer() const; - void pushData(); - qint64 read(char *data, qint64 len); - void bufferEmptied(); - Q_INVOKABLE void close(); - - qint64 getSamplesRecorded() const; - - void setError(QAudio::Error error); - void setState(SymbianAudio::State state); - - QAudio::State initializingState() const; - -private: - const QByteArray m_device; - const QAudioFormat m_format; - - int m_clientBufferSize; - int m_notifyInterval; - QScopedPointer m_notifyTimer; - QTime m_elapsed; - QAudio::Error m_error; - - SymbianAudio::State m_internalState; - QAudio::State m_externalState; - - bool m_pullMode; - QIODevice *m_sink; - - QScopedPointer m_pullTimer; - - QScopedPointer m_devSound; - TUint32 m_nativeFourCC; - TMMFCapabilities m_nativeFormat; - - // Latest buffer provided by DevSound, to be empied of data. - CMMFDataBuffer *m_devSoundBuffer; - - int m_devSoundBufferSize; - - // Total amount of data in buffers provided by DevSound - int m_totalBytesReady; - - // Queue of buffers returned after call to CMMFDevSound::Pause(). - QList m_devSoundBufferQ; - - // Current read position within m_devSoundBuffer - qint64 m_devSoundBufferPos; - - // Samples recorded up to the last call to suspend(). It is necessary - // to cache this because suspend() is implemented using - // CMMFDevSound::Stop(), which resets DevSound's SamplesRecorded() counter. - quint32 m_totalSamplesRecorded; - -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp deleted file mode 100644 index b5d673e..0000000 --- a/src/multimedia/audio/qaudioinput_win32_p.cpp +++ /dev/null @@ -1,613 +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$ -** -****************************************************************************/ - -// -// 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 "qaudioinput_win32_p.h" - -QT_BEGIN_NAMESPACE - -//#define DEBUG_AUDIO 1 - -static const int minimumIntervalTime = 50; - -QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): - settings(audioFormat) -{ - bytesAvailable = 0; - buffer_size = 0; - period_size = 0; - m_device = device; - totalTimeValue = 0; - intervalTime = 1000; - errorState = QAudio::NoError; - deviceState = QAudio::StoppedState; - audioSource = 0; - pullMode = true; - resuming = false; - finished = false; - - connect(this,SIGNAL(processMore()),SLOT(deviceReady())); - - InitializeCriticalSection(&waveInCriticalSection); -} - -QAudioInputPrivate::~QAudioInputPrivate() -{ - stop(); - DeleteCriticalSection(&waveInCriticalSection); -} - -void QT_WIN_CALLBACK QAudioInputPrivate::waveInProc( HWAVEIN hWaveIn, UINT uMsg, - DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ) -{ - Q_UNUSED(dwParam1) - Q_UNUSED(dwParam2) - Q_UNUSED(hWaveIn) - - QAudioInputPrivate* qAudio; - qAudio = (QAudioInputPrivate*)(dwInstance); - if(!qAudio) - return; - - switch(uMsg) { - case WIM_OPEN: - break; - case WIM_DATA: - EnterCriticalSection(&qAudio->waveInCriticalSection); - if(qAudio->waveFreeBlockCount > 0) - qAudio->waveFreeBlockCount--; - qAudio->feedback(); - LeaveCriticalSection(&qAudio->waveInCriticalSection); - break; - case WIM_CLOSE: - EnterCriticalSection(&qAudio->waveInCriticalSection); - qAudio->finished = true; - LeaveCriticalSection(&qAudio->waveInCriticalSection); - break; - default: - return; - } -} - -WAVEHDR* QAudioInputPrivate::allocateBlocks(int size, int count) -{ - int i; - unsigned char* buffer; - WAVEHDR* blocks; - DWORD totalBufferSize = (size + sizeof(WAVEHDR))*count; - - if((buffer=(unsigned char*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, - totalBufferSize)) == 0) { - qWarning("QAudioInput: Memory allocation error"); - return 0; - } - blocks = (WAVEHDR*)buffer; - buffer += sizeof(WAVEHDR)*count; - for(i = 0; i < count; i++) { - blocks[i].dwBufferLength = size; - blocks[i].lpData = (LPSTR)buffer; - blocks[i].dwBytesRecorded=0; - blocks[i].dwUser = 0L; - blocks[i].dwFlags = 0L; - blocks[i].dwLoops = 0L; - result = waveInPrepareHeader(hWaveIn,&blocks[i], sizeof(WAVEHDR)); - if(result != MMSYSERR_NOERROR) { - qWarning("QAudioInput: Can't prepare block %d",i); - return 0; - } - buffer += size; - } - return blocks; -} - -void QAudioInputPrivate::freeBlocks(WAVEHDR* blockArray) -{ - WAVEHDR* blocks = blockArray; - - int count = buffer_size/period_size; - - for(int i = 0; i < count; i++) { - waveInUnprepareHeader(hWaveIn,&blocks[i], sizeof(WAVEHDR)); - blocks+=sizeof(WAVEHDR); - } - HeapFree(GetProcessHeap(), 0, blockArray); -} - -QAudio::Error QAudioInputPrivate::error() const -{ - return errorState; -} - -QAudio::State QAudioInputPrivate::state() const -{ - return deviceState; -} - -QAudioFormat QAudioInputPrivate::format() const -{ - return settings; -} - -QIODevice* QAudioInputPrivate::start(QIODevice* device) -{ - if(deviceState != QAudio::StoppedState) - close(); - - if(!pullMode && audioSource) { - delete audioSource; - } - - if(device) { - //set to pull mode - pullMode = true; - audioSource = device; - deviceState = QAudio::ActiveState; - } else { - //set to push mode - pullMode = false; - deviceState = QAudio::IdleState; - audioSource = new InputPrivate(this); - audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered); - } - - if( !open() ) - return 0; - - emit stateChanged(deviceState); - - return audioSource; -} - -void QAudioInputPrivate::stop() -{ - if(deviceState == QAudio::StoppedState) - return; - - close(); - emit stateChanged(deviceState); -} - -bool QAudioInputPrivate::open() -{ -#ifdef DEBUG_AUDIO - QTime now(QTime::currentTime()); - qDebug()<> 3) * wfx.nChannels; - wfx.nAvgBytesPerSec = wfx.nBlockAlign * wfx.nSamplesPerSec; - - UINT_PTR devId = WAVE_MAPPER; - - WAVEINCAPS wic; - unsigned long iNumDevs,ii; - iNumDevs = waveInGetNumDevs(); - for(ii=0;ii 0 && waveBlocks[header].dwFlags & WHDR_DONE) { - if(pullMode) { - l = audioSource->write(waveBlocks[header].lpData, - waveBlocks[header].dwBytesRecorded); -#ifdef DEBUG_AUDIO - qDebug()<<"IN: "<= buffer_size/period_size) - header = 0; - p+=l; - - EnterCriticalSection(&waveInCriticalSection); - if(!pullMode) { - if(l+period_size > len && waveFreeBlockCount == buffer_size/period_size) - done = true; - } else { - if(waveFreeBlockCount == buffer_size/period_size) - done = true; - } - LeaveCriticalSection(&waveInCriticalSection); - - written+=l; - } -#ifdef DEBUG_AUDIO - qDebug()<<"read in len="<= minimumIntervalTime) - intervalTime = ms; - else - intervalTime = minimumIntervalTime; -} - -int QAudioInputPrivate::notifyInterval() const -{ - return intervalTime; -} - -qint64 QAudioInputPrivate::processedUSecs() const -{ - if (deviceState == QAudio::StoppedState) - return 0; - qint64 result = qint64(1000000) * totalTimeValue / - (settings.channels()*(settings.sampleSize()/8)) / - settings.frequency(); - - return result; -} - -void QAudioInputPrivate::suspend() -{ - if(deviceState == QAudio::ActiveState) { - waveInReset(hWaveIn); - deviceState = QAudio::SuspendedState; - emit stateChanged(deviceState); - } -} - -void QAudioInputPrivate::feedback() -{ -#ifdef DEBUG_AUDIO - QTime now(QTime::currentTime()); - qDebug()<(audioSource); - a->trigger(); - } - - if((timeStamp.elapsed() + elapsedTimeOffset) > intervalTime) { - emit notify(); - elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime; - timeStamp.restart(); - } - return true; -} - -qint64 QAudioInputPrivate::elapsedUSecs() const -{ - if (deviceState == QAudio::StoppedState) - return 0; - - return timeStampOpened.elapsed()*1000; -} - -void QAudioInputPrivate::reset() -{ - close(); -} - -InputPrivate::InputPrivate(QAudioInputPrivate* audio) -{ - audioDevice = qobject_cast(audio); -} - -InputPrivate::~InputPrivate() {} - -qint64 InputPrivate::readData( char* data, qint64 len) -{ - // push mode, user read() called - if(audioDevice->deviceState != QAudio::ActiveState && - audioDevice->deviceState != QAudio::IdleState) - return 0; - // Read in some audio data - return audioDevice->read(data,len); -} - -qint64 InputPrivate::writeData(const char* data, qint64 len) -{ - Q_UNUSED(data) - Q_UNUSED(len) - - emit readyRead(); - return 0; -} - -void InputPrivate::trigger() -{ - emit readyRead(); -} - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudioinput_win32_p.h b/src/multimedia/audio/qaudioinput_win32_p.h deleted file mode 100644 index 66c2535..0000000 --- a/src/multimedia/audio/qaudioinput_win32_p.h +++ /dev/null @@ -1,159 +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$ -** -****************************************************************************/ - -// -// 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. -// - -#ifndef QAUDIOINPUTWIN_H -#define QAUDIOINPUTWIN_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -QT_BEGIN_NAMESPACE - -class QAudioInputPrivate : public QAbstractAudioInput -{ - Q_OBJECT -public: - QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat); - ~QAudioInputPrivate(); - - qint64 read(char* data, qint64 len); - - QAudioFormat format() const; - QIODevice* start(QIODevice* device = 0); - void stop(); - void reset(); - void suspend(); - void resume(); - int bytesReady() const; - int periodSize() const; - void setBufferSize(int value); - int bufferSize() const; - void setNotifyInterval(int milliSeconds); - int notifyInterval() const; - qint64 processedUSecs() const; - qint64 elapsedUSecs() const; - QAudio::Error error() const; - QAudio::State state() const; - - QIODevice* audioSource; - QAudioFormat settings; - QAudio::Error errorState; - QAudio::State deviceState; - -private: - qint32 buffer_size; - qint32 period_size; - qint32 header; - QByteArray m_device; - int bytesAvailable; - int intervalTime; - QTime timeStamp; - qint64 elapsedTimeOffset; - QTime timeStampOpened; - qint64 totalTimeValue; - bool pullMode; - bool resuming; - WAVEFORMATEX wfx; - HWAVEIN hWaveIn; - MMRESULT result; - WAVEHDR* waveBlocks; - volatile bool finished; - volatile int waveFreeBlockCount; - int waveCurrentBlock; - - CRITICAL_SECTION waveInCriticalSection; - static void QT_WIN_CALLBACK waveInProc( HWAVEIN hWaveIn, UINT uMsg, - DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ); - - WAVEHDR* allocateBlocks(int size, int count); - void freeBlocks(WAVEHDR* blockArray); - bool open(); - void close(); - -private slots: - void feedback(); - bool deviceReady(); - -signals: - void processMore(); -}; - -class InputPrivate : public QIODevice -{ - Q_OBJECT -public: - InputPrivate(QAudioInputPrivate* audio); - ~InputPrivate(); - - qint64 readData( char* data, qint64 len); - qint64 writeData(const char* data, qint64 len); - - void trigger(); -private: - QAudioInputPrivate *audioDevice; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp deleted file mode 100644 index b0b5244..0000000 --- a/src/multimedia/audio/qaudiooutput.cpp +++ /dev/null @@ -1,411 +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 - -#include "qaudiodevicefactory_p.h" - - -QT_BEGIN_NAMESPACE - -/*! - \class QAudioOutput - \brief The QAudioOutput class provides an interface for sending audio data to an audio output device. - - \inmodule QtMultimedia - \ingroup multimedia - \since 4.6 - - You can construct an audio output with the system's - \l{QAudioDeviceInfo::defaultOutputDevice()}{default audio output - device}. It is also possible to create QAudioOutput with a - specific QAudioDeviceInfo. When you create the audio output, you - should also send in the QAudioFormat to be used for the playback - (see the QAudioFormat class description for details). - - To play a file: - - Starting to play an audio stream is simply a matter of calling - start() with a QIODevice. QAudioOutput will then fetch the data it - needs from the io device. So playing back an audio file is as - simple as: - - \code - QFile inputFile; // class member. - QAudioOutput* audio; // class member. - \endcode - - \code - inputFile.setFileName("/tmp/test.raw"); - inputFile.open(QIODevice::ReadOnly); - - QAudioFormat format; - // Set up the format, eg. - format.setFrequency(8000); - format.setChannels(1); - format.setSampleSize(8); - format.setCodec("audio/pcm"); - format.setByteOrder(QAudioFormat::LittleEndian); - format.setSampleType(QAudioFormat::UnSignedInt); - - QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice()); - if (!info.isFormatSupported(format)) { - qWarning()<<"raw audio format not supported by backend, cannot play audio."; - return; - } - - audio = new QAudioOutput(format, this); - connect(audio,SIGNAL(stateChanged(QAudio::State)),SLOT(finishedPlaying(QAudio::State))); - audio->start(&inputFile); - - \endcode - - The file will start playing assuming that the audio system and - output device support it. If you run out of luck, check what's - up with the error() function. - - After the file has finished playing, we need to stop the device: - - \code - void finishedPlaying(QAudio::State state) - { - if(state == QAudio::IdleState) { - audio->stop(); - inputFile.close(); - delete audio; - } - } - \endcode - - At any given time, the QAudioOutput will be in one of four states: - active, suspended, stopped, or idle. These states are described - by the QAudio::State enum. - State changes are reported through the stateChanged() signal. You - can use this signal to, for instance, update the GUI of the - application; the mundane example here being changing the state of - a \c { play/pause } button. You request a state change directly - with suspend(), stop(), reset(), resume(), and start(). - - While the stream is playing, you can set a notify interval in - milliseconds with setNotifyInterval(). This interval specifies the - time between two emissions of the notify() signal. This is - relative to the position in the stream, i.e., if the QAudioOutput - is in the SuspendedState or the IdleState, the notify() signal is - not emitted. A typical use-case would be to update a - \l{QSlider}{slider} that allows seeking in the stream. - If you want the time since playback started regardless of which - states the audio output has been in, elapsedUSecs() is the function for you. - - If an error occurs, you can fetch the \l{QAudio::Error}{error - type} with the error() function. Please see the QAudio::Error enum - for a description of the possible errors that are reported. When - an error is encountered, the state changes to QAudio::StoppedState. - You can check for errors by connecting to the stateChanged() - signal: - - \snippet doc/src/snippets/audio/main.cpp 3 - - \sa QAudioInput, QAudioDeviceInfo -*/ - -/*! - Construct a new audio output and attach it to \a parent. - The default audio output device is used with the output - \a format parameters. -*/ - -QAudioOutput::QAudioOutput(const QAudioFormat &format, QObject *parent): - QObject(parent) -{ - d = QAudioDeviceFactory::createDefaultOutputDevice(format); - connect(d, SIGNAL(notify()), SIGNAL(notify())); - connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); -} - -/*! - Construct a new audio output and attach it to \a parent. - The device referenced by \a audioDevice is used with the output - \a format parameters. -*/ - -QAudioOutput::QAudioOutput(const QAudioDeviceInfo &audioDevice, const QAudioFormat &format, QObject *parent): - QObject(parent) -{ - d = QAudioDeviceFactory::createOutputDevice(audioDevice, format); - connect(d, SIGNAL(notify()), SIGNAL(notify())); - connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); -} - -/*! - Destroys this audio output. -*/ - -QAudioOutput::~QAudioOutput() -{ - delete d; -} - -/*! - Returns the QAudioFormat being used. - -*/ - -QAudioFormat QAudioOutput::format() const -{ - return d->format(); -} - -/*! - Uses the \a device as the QIODevice to transfer data. - Passing a QIODevice allows the data to be transfered without any extra code. - All that is required is to open the QIODevice. - - If able to successfully output audio data to the systems audio device the - state() is set to QAudio::ActiveState, error() is set to QAudio::NoError - and the stateChanged() signal is emitted. - - If a problem occurs during this process the error() is set to QAudio::OpenError, - state() is set to QAudio::StoppedState and stateChanged() signal is emitted. - - \sa QIODevice -*/ - -void QAudioOutput::start(QIODevice* device) -{ - d->start(device); -} - -/*! - Returns a pointer to the QIODevice being used to handle the data - transfer. This QIODevice can be used to write() audio data directly. - - If able to access the systems audio device the state() is set to - QAudio::IdleState, error() is set to QAudio::NoError - and the stateChanged() signal is emitted. - - If a problem occurs during this process the error() is set to QAudio::OpenError, - state() is set to QAudio::StoppedState and stateChanged() signal is emitted. - - \sa QIODevice -*/ - -QIODevice* QAudioOutput::start() -{ - return d->start(0); -} - -/*! - Stops the audio output, detaching from the system resource. - - Sets error() to QAudio::NoError, state() to QAudio::StoppedState and - emit stateChanged() signal. -*/ - -void QAudioOutput::stop() -{ - d->stop(); -} - -/*! - Drops all audio data in the buffers, resets buffers to zero. -*/ - -void QAudioOutput::reset() -{ - d->reset(); -} - -/*! - Stops processing audio data, preserving buffered audio data. - - Sets error() to QAudio::NoError, state() to QAudio::SuspendedState and - emit stateChanged() signal. -*/ - -void QAudioOutput::suspend() -{ - d->suspend(); -} - -/*! - Resumes processing audio data after a suspend(). - - Sets error() to QAudio::NoError. - Sets state() to QAudio::ActiveState if you previously called start(QIODevice*). - Sets state() to QAudio::IdleState if you previously called start(). - emits stateChanged() signal. -*/ - -void QAudioOutput::resume() -{ - d->resume(); -} - -/*! - Returns the free space available in bytes in the audio buffer. - - NOTE: returned value is only valid while in QAudio::ActiveState or QAudio::IdleState - state, otherwise returns zero. -*/ - -int QAudioOutput::bytesFree() const -{ - return d->bytesFree(); -} - -/*! - Returns the period size in bytes. - - Note: This is the recommended write size in bytes. -*/ - -int QAudioOutput::periodSize() const -{ - return d->periodSize(); -} - -/*! - Sets the audio buffer size to \a value in bytes. - - Note: This function can be called anytime before start(), calls to this - are ignored after start(). It should not be assumed that the buffer size - set is the actual buffer size used, calling bufferSize() anytime after start() - will return the actual buffer size being used. -*/ - -void QAudioOutput::setBufferSize(int value) -{ - d->setBufferSize(value); -} - -/*! - Returns the audio buffer size in bytes. - - If called before start(), returns platform default value. - If called before start() but setBufferSize() was called prior, returns value set by setBufferSize(). - If called after start(), returns the actual buffer size being used. This may not be what was set previously - by setBufferSize(). - -*/ - -int QAudioOutput::bufferSize() const -{ - return d->bufferSize(); -} - -/*! - Sets the interval for notify() signal to be emitted. - This is based on the \a ms of audio data processed - not on actual real-time. - The minimum resolution of the timer is platform specific and values - should be checked with notifyInterval() to confirm actual value - being used. -*/ - -void QAudioOutput::setNotifyInterval(int ms) -{ - d->setNotifyInterval(ms); -} - -/*! - Returns the notify interval in milliseconds. -*/ - -int QAudioOutput::notifyInterval() const -{ - return d->notifyInterval(); -} - -/*! - Returns the amount of audio data processed since start() - was called in microseconds. -*/ - -qint64 QAudioOutput::processedUSecs() const -{ - return d->processedUSecs(); -} - -/*! - Returns the microseconds since start() was called, including time in Idle and - Suspend states. -*/ - -qint64 QAudioOutput::elapsedUSecs() const -{ - return d->elapsedUSecs(); -} - -/*! - Returns the error state. -*/ - -QAudio::Error QAudioOutput::error() const -{ - return d->error(); -} - -/*! - Returns the state of audio processing. -*/ - -QAudio::State QAudioOutput::state() const -{ - return d->state(); -} - -/*! - \fn QAudioOutput::stateChanged(QAudio::State state) - This signal is emitted when the device \a state has changed. - This is the current state of the audio output. -*/ - -/*! - \fn QAudioOutput::notify() - This signal is emitted when x ms of audio data has been processed - the interval set by setNotifyInterval(x). -*/ - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudiooutput.h b/src/multimedia/audio/qaudiooutput.h deleted file mode 100644 index 0f45b1b..0000000 --- a/src/multimedia/audio/qaudiooutput.h +++ /dev/null @@ -1,111 +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 QAUDIOOUTPUT_H -#define QAUDIOOUTPUT_H - -#include -#include - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QAbstractAudioOutput; - -class Q_MULTIMEDIA_EXPORT QAudioOutput : public QObject -{ - Q_OBJECT - -public: - explicit QAudioOutput(const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); - explicit QAudioOutput(const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); - ~QAudioOutput(); - - QAudioFormat format() const; - - void start(QIODevice *device); - QIODevice* start(); - - void stop(); - void reset(); - void suspend(); - void resume(); - - void setBufferSize(int bytes); - int bufferSize() const; - - int bytesFree() const; - int periodSize() const; - - void setNotifyInterval(int milliSeconds); - int notifyInterval() const; - - qint64 processedUSecs() const; - qint64 elapsedUSecs() const; - - QAudio::Error error() const; - QAudio::State state() const; - -Q_SIGNALS: - void stateChanged(QAudio::State); - void notify(); - -private: - Q_DISABLE_COPY(QAudioOutput) - - QAbstractAudioOutput* d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QAUDIOOUTPUT_H diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp deleted file mode 100644 index cf3726b..0000000 --- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp +++ /dev/null @@ -1,780 +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$ -** -****************************************************************************/ - -// -// 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 "qaudiooutput_alsa_p.h" -#include "qaudiodeviceinfo_alsa_p.h" - -QT_BEGIN_NAMESPACE - -//#define DEBUG_AUDIO 1 - -static const int minimumIntervalTime = 50; - -QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): - settings(audioFormat) -{ - bytesAvailable = 0; - handle = 0; - ahandler = 0; - access = SND_PCM_ACCESS_RW_INTERLEAVED; - pcmformat = SND_PCM_FORMAT_S16; - buffer_frames = 0; - period_frames = 0; - buffer_size = 0; - period_size = 0; - buffer_time = 100000; - period_time = 20000; - totalTimeValue = 0; - intervalTime = 1000; - audioBuffer = 0; - errorState = QAudio::NoError; - deviceState = QAudio::StoppedState; - audioSource = 0; - pullMode = true; - resuming = false; - opened = false; - - QStringList list1 = QString(QLatin1String(device)).split(QLatin1String(":")); - m_device = QByteArray(list1.at(0).toLocal8Bit().constData()); - - timer = new QTimer(this); - connect(timer,SIGNAL(timeout()),SLOT(userFeed())); -} - -QAudioOutputPrivate::~QAudioOutputPrivate() -{ - close(); - disconnect(timer, SIGNAL(timeout())); - QCoreApplication::processEvents(); - delete timer; -} - -QAudio::Error QAudioOutputPrivate::error() const -{ - return errorState; -} - -QAudio::State QAudioOutputPrivate::state() const -{ - return deviceState; -} - -void QAudioOutputPrivate::async_callback(snd_async_handler_t *ahandler) -{ - QAudioOutputPrivate* audioOut; - - audioOut = static_cast - (snd_async_handler_get_callback_private(ahandler)); - - if((audioOut->deviceState==QAudio::ActiveState)||(audioOut->resuming)) - audioOut->feedback(); -} - -int QAudioOutputPrivate::xrun_recovery(int err) -{ - int count = 0; - bool reset = false; - - if(err == -EPIPE) { - errorState = QAudio::UnderrunError; - err = snd_pcm_prepare(handle); - if(err < 0) - reset = true; - - } else if((err == -ESTRPIPE)||(err == -EIO)) { - errorState = QAudio::IOError; - while((err = snd_pcm_resume(handle)) == -EAGAIN){ - usleep(100); - count++; - if(count > 5) { - reset = true; - break; - } - } - if(err < 0) { - err = snd_pcm_prepare(handle); - if(err < 0) - reset = true; - } - } - if(reset) { - close(); - open(); - snd_pcm_prepare(handle); - return 0; - } - return err; -} - -int QAudioOutputPrivate::setFormat() -{ - snd_pcm_format_t pcmformat = SND_PCM_FORMAT_S16; - - if(settings.sampleSize() == 8) { - pcmformat = SND_PCM_FORMAT_U8; - - } else if(settings.sampleSize() == 16) { - if(settings.sampleType() == QAudioFormat::SignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - pcmformat = SND_PCM_FORMAT_S16_LE; - else - pcmformat = SND_PCM_FORMAT_S16_BE; - } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - pcmformat = SND_PCM_FORMAT_U16_LE; - else - pcmformat = SND_PCM_FORMAT_U16_BE; - } - } else if(settings.sampleSize() == 24) { - if(settings.sampleType() == QAudioFormat::SignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - pcmformat = SND_PCM_FORMAT_S24_LE; - else - pcmformat = SND_PCM_FORMAT_S24_BE; - } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - pcmformat = SND_PCM_FORMAT_U24_LE; - else - pcmformat = SND_PCM_FORMAT_U24_BE; - } - } else if(settings.sampleSize() == 32) { - if(settings.sampleType() == QAudioFormat::SignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - pcmformat = SND_PCM_FORMAT_S32_LE; - else - pcmformat = SND_PCM_FORMAT_S32_BE; - } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - pcmformat = SND_PCM_FORMAT_U32_LE; - else - pcmformat = SND_PCM_FORMAT_U32_BE; - } else if(settings.sampleType() == QAudioFormat::Float) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - pcmformat = SND_PCM_FORMAT_FLOAT_LE; - else - pcmformat = SND_PCM_FORMAT_FLOAT_BE; - } - } else if(settings.sampleSize() == 64) { - if(settings.byteOrder() == QAudioFormat::LittleEndian) - pcmformat = SND_PCM_FORMAT_FLOAT64_LE; - else - pcmformat = SND_PCM_FORMAT_FLOAT64_BE; - } - - return snd_pcm_hw_params_set_format( handle, hwparams, pcmformat); -} - -QIODevice* QAudioOutputPrivate::start(QIODevice* device) -{ - if(deviceState != QAudio::StoppedState) - deviceState = QAudio::StoppedState; - - errorState = QAudio::NoError; - - // Handle change of mode - if(audioSource && pullMode && !device) { - // pull -> push - close(); - audioSource = 0; - } else if(audioSource && !pullMode && device) { - // push -> pull - close(); - delete audioSource; - audioSource = 0; - } - - if(device) { - //set to pull mode - pullMode = true; - audioSource = device; - deviceState = QAudio::ActiveState; - } else { - //set to push mode - if(!audioSource) { - audioSource = new OutputPrivate(this); - audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered); - } - pullMode = false; - deviceState = QAudio::IdleState; - } - - open(); - - emit stateChanged(deviceState); - - return audioSource; -} - -void QAudioOutputPrivate::stop() -{ - if(deviceState == QAudio::StoppedState) - return; - errorState = QAudio::NoError; - deviceState = QAudio::StoppedState; - close(); - emit stateChanged(deviceState); -} - -bool QAudioOutputPrivate::open() -{ - if(opened) - return true; - -#ifdef DEBUG_AUDIO - QTime now(QTime::currentTime()); - qDebug()< devices = QAudioDeviceInfoInternal::availableDevices(QAudio::AudioOutput); - if(dev.compare(QLatin1String("default")) == 0) { -#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) - dev = QLatin1String(devices.first().constData()); -#else - dev = QLatin1String("hw:0,0"); -#endif - } else { -#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) - dev = QLatin1String(m_device); -#else - int idx = 0; - char *name; - - QString shortName = QLatin1String(m_device.mid(m_device.indexOf('=',0)+1).constData()); - - while(snd_card_get_name(idx,&name) == 0) { - if(qstrncmp(shortName.toLocal8Bit().constData(),name,shortName.length()) == 0) - break; - idx++; - } - dev = QString(QLatin1String("hw:%1,0")).arg(idx); -#endif - } - - // Step 1: try and open the device - while((count < 5) && (err < 0)) { - err=snd_pcm_open(&handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_PLAYBACK,0); - if(err < 0) - count++; - } - if (( err < 0)||(handle == 0)) { - errorState = QAudio::OpenError; - deviceState = QAudio::StoppedState; - return false; - } - snd_pcm_nonblock( handle, 0 ); - - // Step 2: Set the desired HW parameters. - snd_pcm_hw_params_alloca( &hwparams ); - - bool fatal = false; - QString errMessage; - unsigned int chunks = 8; - - err = snd_pcm_hw_params_any( handle, hwparams ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_any: err = %1").arg(err); - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_rate_resample( handle, hwparams, 1 ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_rate_resample: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_access( handle, hwparams, access ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_access: err = %1").arg(err); - } - } - if ( !fatal ) { - err = setFormat(); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_format: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_channels( handle, hwparams, (unsigned int)settings.channels() ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_channels: err = %1").arg(err); - } - } - if ( !fatal ) { - err = snd_pcm_hw_params_set_rate_near( handle, hwparams, &freakuency, 0 ); - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_rate_near: err = %1").arg(err); - } - } - if ( !fatal ) { - unsigned int maxBufferTime = 0; - unsigned int minBufferTime = 0; - unsigned int maxPeriodTime = 0; - unsigned int minPeriodTime = 0; - - err = snd_pcm_hw_params_get_buffer_time_max(hwparams, &maxBufferTime, &dir); - if ( err >= 0) - err = snd_pcm_hw_params_get_buffer_time_min(hwparams, &minBufferTime, &dir); - if ( err >= 0) - err = snd_pcm_hw_params_get_period_time_max(hwparams, &maxPeriodTime, &dir); - if ( err >= 0) - err = snd_pcm_hw_params_get_period_time_min(hwparams, &minPeriodTime, &dir); - - if ( err < 0 ) { - fatal = true; - errMessage = QString::fromLatin1("QAudioOutput: buffer/period min and max: err = %1").arg(err); - } else { - if (maxBufferTime < buffer_time || buffer_time < minBufferTime || maxPeriodTime < period_time || minPeriodTime > period_time) { -#ifdef DEBUG_AUDIO - qDebug()<<"defaults out of range"; - qDebug()<<"pmin="<start(period_time/1000); - - clockStamp.restart(); - timeStamp.restart(); - elapsedTimeOffset = 0; - errorState = QAudio::NoError; - totalTimeValue = 0; - opened = true; - - return true; -} - -void QAudioOutputPrivate::close() -{ - timer->stop(); - - if ( handle ) { - snd_pcm_drain( handle ); - snd_pcm_close( handle ); - handle = 0; - delete [] audioBuffer; - audioBuffer=0; - } - if(!pullMode && audioSource) { - delete audioSource; - audioSource = 0; - } - opened = false; -} - -int QAudioOutputPrivate::bytesFree() const -{ - if(resuming) - return period_size; - - if(deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState) - return 0; - int frames = snd_pcm_avail_update(handle); - if((int)frames > (int)buffer_frames) - frames = buffer_frames; - - return snd_pcm_frames_to_bytes(handle, frames); -} - -qint64 QAudioOutputPrivate::write( const char *data, qint64 len ) -{ - // Write out some audio data - if ( !handle ) - return 0; -#ifdef DEBUG_AUDIO - qDebug()<<"frames to write out = "<< - snd_pcm_bytes_to_frames( handle, (int)len )<<" ("< 0) { - totalTimeValue += err; - resuming = false; - errorState = QAudio::NoError; - if (deviceState != QAudio::ActiveState) { - deviceState = QAudio::ActiveState; - emit stateChanged(deviceState); - } - return snd_pcm_frames_to_bytes( handle, err ); - } else - err = xrun_recovery(err); - - if(err < 0) { - close(); - errorState = QAudio::FatalError; - deviceState = QAudio::StoppedState; - emit stateChanged(deviceState); - } - return 0; -} - -int QAudioOutputPrivate::periodSize() const -{ - return period_size; -} - -void QAudioOutputPrivate::setBufferSize(int value) -{ - if(deviceState == QAudio::StoppedState) - buffer_size = value; -} - -int QAudioOutputPrivate::bufferSize() const -{ - return buffer_size; -} - -void QAudioOutputPrivate::setNotifyInterval(int ms) -{ - if(ms >= minimumIntervalTime) - intervalTime = ms; - else - intervalTime = minimumIntervalTime; -} - -int QAudioOutputPrivate::notifyInterval() const -{ - return intervalTime; -} - -qint64 QAudioOutputPrivate::processedUSecs() const -{ - return qint64(1000000) * totalTimeValue / settings.frequency(); -} - -void QAudioOutputPrivate::resume() -{ - if(deviceState == QAudio::SuspendedState) { - int err = 0; - - if(handle) { - err = snd_pcm_prepare( handle ); - if(err < 0) - xrun_recovery(err); - - err = snd_pcm_start(handle); - if(err < 0) - xrun_recovery(err); - - bytesAvailable = (int)snd_pcm_frames_to_bytes(handle, buffer_frames); - } - resuming = true; - - deviceState = QAudio::ActiveState; - - errorState = QAudio::NoError; - timer->start(period_time/1000); - emit stateChanged(deviceState); - } -} - -QAudioFormat QAudioOutputPrivate::format() const -{ - return settings; -} - -void QAudioOutputPrivate::suspend() -{ - if(deviceState == QAudio::ActiveState || deviceState == QAudio::IdleState || resuming) { - timer->stop(); - deviceState = QAudio::SuspendedState; - errorState = QAudio::NoError; - emit stateChanged(deviceState); - } -} - -void QAudioOutputPrivate::userFeed() -{ - if(deviceState == QAudio::StoppedState || deviceState == QAudio::SuspendedState) - return; -#ifdef DEBUG_AUDIO - QTime now(QTime::currentTime()); - qDebug()<acquireReadRegion((maxFrames - framesRead) * m_bytesPerFrame); - - if (region.second > 0) { - region.second -= region.second % m_bytesPerFrame; - memcpy(data + (framesRead * m_bytesPerFrame), region.first, region.second); - framesRead += region.second / m_bytesPerFrame; - } - else - wecan = false; - - m_buffer->releaseReadRegion(region); - } - - if (framesRead == 0 && m_deviceError) - framesRead = -1; - - return framesRead; - } - - qint64 writeBytes(const char* data, qint64 maxSize) - { - bool wecan = true; - qint64 bytesWritten = 0; - - maxSize -= maxSize % m_bytesPerFrame; - while (wecan && bytesWritten < maxSize) { - QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(maxSize - bytesWritten); - - if (region.second > 0) { - memcpy(region.first, data + bytesWritten, region.second); - bytesWritten += region.second; - } - else - wecan = false; - - m_buffer->releaseWriteRegion(region); - } - - if (bytesWritten > 0) - emit readyRead(); - - return bytesWritten; - } - - int available() const - { - return m_buffer->free(); - } - - void reset() - { - m_buffer->reset(); - m_deviceError = false; - } - - void setPrefetchDevice(QIODevice* device) - { - if (m_device != device) { - m_device = device; - if (m_device != 0) - fillBuffer(); - } - } - - void startFillTimer() - { - if (m_device != 0) - m_fillTimer->start(m_buffer->size() / 2 / m_maxPeriodSize * m_periodTime); - } - - void stopFillTimer() - { - m_fillTimer->stop(); - } - -signals: - void readyRead(); - -private slots: - void fillBuffer() - { - const int free = m_buffer->free(); - const int writeSize = free - (free % m_maxPeriodSize); - - if (writeSize > 0) { - bool wecan = true; - int filled = 0; - - while (!m_deviceError && wecan && filled < writeSize) { - QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(writeSize - filled); - - if (region.second > 0) { - region.second = m_device->read(region.first, region.second); - if (region.second > 0) - filled += region.second; - else if (region.second == 0) - wecan = false; - else if (region.second < 0) { - m_fillTimer->stop(); - region.second = 0; - m_deviceError = true; - } - } - else - wecan = false; - - m_buffer->releaseWriteRegion(region); - } - - if (filled > 0) - emit readyRead(); - } - } - -private: - bool m_deviceError; - int m_maxPeriodSize; - int m_bytesPerFrame; - int m_periodTime; - QIODevice* m_device; - QTimer* m_fillTimer; - QAudioRingBuffer* m_buffer; -}; - - -} - -class MacOutputDevice : public QIODevice -{ - Q_OBJECT - -public: - MacOutputDevice(QtMultimediaInternal::QAudioOutputBuffer* audioBuffer, QObject* parent): - QIODevice(parent), - m_audioBuffer(audioBuffer) - { - open(QIODevice::WriteOnly | QIODevice::Unbuffered); - } - - qint64 readData(char* data, qint64 len) - { - Q_UNUSED(data); - Q_UNUSED(len); - - return 0; - } - - qint64 writeData(const char* data, qint64 len) - { - return m_audioBuffer->writeBytes(data, len); - } - - bool isSequential() const - { - return true; - } - -private: - QtMultimediaInternal::QAudioOutputBuffer* m_audioBuffer; -}; - - -QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray& device, const QAudioFormat& format): - audioFormat(format) -{ - QDataStream ds(device); - quint32 did, mode; - - ds >> did >> mode; - - if (QAudio::Mode(mode) == QAudio::AudioInput) - errorCode = QAudio::OpenError; - else { - isOpen = false; - audioDeviceId = AudioDeviceID(did); - audioUnit = 0; - audioIO = 0; - startTime = 0; - totalFrames = 0; - audioBuffer = 0; - internalBufferSize = QtMultimediaInternal::default_buffer_size; - clockFrequency = AudioGetHostClockFrequency() / 1000; - errorCode = QAudio::NoError; - stateCode = QAudio::StoppedState; - audioThreadState = Stopped; - - intervalTimer = new QTimer(this); - intervalTimer->setInterval(1000); - connect(intervalTimer, SIGNAL(timeout()), SIGNAL(notify())); - } -} - -QAudioOutputPrivate::~QAudioOutputPrivate() -{ - close(); -} - -bool QAudioOutputPrivate::open() -{ - if (errorCode != QAudio::NoError) - return false; - - if (isOpen) - return true; - - ComponentDescription cd; - cd.componentType = kAudioUnitType_Output; - cd.componentSubType = kAudioUnitSubType_HALOutput; - cd.componentManufacturer = kAudioUnitManufacturer_Apple; - cd.componentFlags = 0; - cd.componentFlagsMask = 0; - - // Open - Component cp = FindNextComponent(NULL, &cd); - if (cp == 0) { - qWarning() << "QAudioOutput: Failed to find HAL Output component"; - return false; - } - - if (OpenAComponent(cp, &audioUnit) != noErr) { - qWarning() << "QAudioOutput: Unable to Open Output Component"; - return false; - } - - // register callback - AURenderCallbackStruct cb; - cb.inputProc = renderCallback; - cb.inputProcRefCon = this; - - if (AudioUnitSetProperty(audioUnit, - kAudioUnitProperty_SetRenderCallback, - kAudioUnitScope_Global, - 0, - &cb, - sizeof(cb)) != noErr) { - qWarning() << "QAudioOutput: Failed to set AudioUnit callback"; - return false; - } - - // Set Audio Device - if (AudioUnitSetProperty(audioUnit, - kAudioOutputUnitProperty_CurrentDevice, - kAudioUnitScope_Global, - 0, - &audioDeviceId, - sizeof(audioDeviceId)) != noErr) { - qWarning() << "QAudioOutput: Unable to use configured device"; - return false; - } - - // Set stream format - streamFormat = toAudioStreamBasicDescription(audioFormat); - - UInt32 size = sizeof(deviceFormat); - if (AudioUnitGetProperty(audioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 0, - &deviceFormat, - &size) != noErr) { - qWarning() << "QAudioOutput: Unable to retrieve device format"; - return false; - } - - if (AudioUnitSetProperty(audioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 0, - &streamFormat, - sizeof(streamFormat)) != noErr) { - qWarning() << "QAudioOutput: Unable to Set Stream information"; - return false; - } - - // Allocate buffer - UInt32 numberOfFrames = 0; - size = sizeof(UInt32); - if (AudioUnitGetProperty(audioUnit, - kAudioDevicePropertyBufferFrameSize, - kAudioUnitScope_Global, - 0, - &numberOfFrames, - &size) != noErr) { - qWarning() << "QAudioInput: Failed to get audio period size"; - return false; - } - - periodSizeBytes = (numberOfFrames * streamFormat.mSampleRate / deviceFormat.mSampleRate) * - streamFormat.mBytesPerFrame; - if (internalBufferSize < periodSizeBytes * 2) - internalBufferSize = periodSizeBytes * 2; - else - internalBufferSize -= internalBufferSize % streamFormat.mBytesPerFrame; - - audioBuffer = new QtMultimediaInternal::QAudioOutputBuffer(internalBufferSize, periodSizeBytes, audioFormat); - connect(audioBuffer, SIGNAL(readyRead()), SLOT(inputReady())); // Pull - - audioIO = new MacOutputDevice(audioBuffer, this); - - // Init - if (AudioUnitInitialize(audioUnit)) { - qWarning() << "QAudioOutput: Failed to initialize AudioUnit"; - return false; - } - - isOpen = true; - - return true; -} - -void QAudioOutputPrivate::close() -{ - if (audioUnit != 0) { - AudioOutputUnitStop(audioUnit); - AudioUnitUninitialize(audioUnit); - CloseComponent(audioUnit); - } - - delete audioBuffer; -} - -QAudioFormat QAudioOutputPrivate::format() const -{ - return audioFormat; -} - -QIODevice* QAudioOutputPrivate::start(QIODevice* device) -{ - QIODevice* op = device; - - if (!audioFormat.isValid() || !open()) { - stateCode = QAudio::StoppedState; - errorCode = QAudio::OpenError; - return audioIO; - } - - reset(); - audioBuffer->reset(); - audioBuffer->setPrefetchDevice(op); - - if (op == 0) { - op = audioIO; - stateCode = QAudio::IdleState; - } - else - stateCode = QAudio::ActiveState; - - // Start - errorCode = QAudio::NoError; - totalFrames = 0; - startTime = AudioGetCurrentHostTime(); - - if (stateCode == QAudio::ActiveState) - audioThreadStart(); - - emit stateChanged(stateCode); - - return op; -} - -void QAudioOutputPrivate::stop() -{ - QMutexLocker lock(&mutex); - if (stateCode != QAudio::StoppedState) { - audioThreadDrain(); - - stateCode = QAudio::StoppedState; - errorCode = QAudio::NoError; - QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); - } -} - -void QAudioOutputPrivate::reset() -{ - QMutexLocker lock(&mutex); - if (stateCode != QAudio::StoppedState) { - audioThreadStop(); - - stateCode = QAudio::StoppedState; - errorCode = QAudio::NoError; - QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); - } -} - -void QAudioOutputPrivate::suspend() -{ - QMutexLocker lock(&mutex); - if (stateCode == QAudio::ActiveState || stateCode == QAudio::IdleState) { - audioThreadStop(); - - stateCode = QAudio::SuspendedState; - errorCode = QAudio::NoError; - QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); - } -} - -void QAudioOutputPrivate::resume() -{ - QMutexLocker lock(&mutex); - if (stateCode == QAudio::SuspendedState) { - audioThreadStart(); - - stateCode = QAudio::ActiveState; - errorCode = QAudio::NoError; - QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); - } -} - -int QAudioOutputPrivate::bytesFree() const -{ - return audioBuffer->available(); -} - -int QAudioOutputPrivate::periodSize() const -{ - return periodSizeBytes; -} - -void QAudioOutputPrivate::setBufferSize(int bs) -{ - if (stateCode == QAudio::StoppedState) - internalBufferSize = bs; -} - -int QAudioOutputPrivate::bufferSize() const -{ - return internalBufferSize; -} - -void QAudioOutputPrivate::setNotifyInterval(int milliSeconds) -{ - if (intervalTimer->interval() == milliSeconds) - return; - - if (milliSeconds <= 0) - milliSeconds = 0; - - intervalTimer->setInterval(milliSeconds); -} - -int QAudioOutputPrivate::notifyInterval() const -{ - return intervalTimer->interval(); -} - -qint64 QAudioOutputPrivate::processedUSecs() const -{ - return totalFrames * 1000000 / audioFormat.frequency(); -} - -qint64 QAudioOutputPrivate::elapsedUSecs() const -{ - if (stateCode == QAudio::StoppedState) - return 0; - - return (AudioGetCurrentHostTime() - startTime) / (clockFrequency / 1000); -} - -QAudio::Error QAudioOutputPrivate::error() const -{ - return errorCode; -} - -QAudio::State QAudioOutputPrivate::state() const -{ - return stateCode; -} - -void QAudioOutputPrivate::audioThreadStart() -{ - startTimers(); - audioThreadState = Running; - AudioOutputUnitStart(audioUnit); -} - -void QAudioOutputPrivate::audioThreadStop() -{ - stopTimers(); - if (audioThreadState.testAndSetAcquire(Running, Stopped)) - threadFinished.wait(&mutex); -} - -void QAudioOutputPrivate::audioThreadDrain() -{ - stopTimers(); - if (audioThreadState.testAndSetAcquire(Running, Draining)) - threadFinished.wait(&mutex); -} - -void QAudioOutputPrivate::audioDeviceStop() -{ - AudioOutputUnitStop(audioUnit); - audioThreadState = Stopped; - threadFinished.wakeOne(); -} - -void QAudioOutputPrivate::audioDeviceIdle() -{ - QMutexLocker lock(&mutex); - if (stateCode == QAudio::ActiveState) { - audioDeviceStop(); - - errorCode = QAudio::UnderrunError; - stateCode = QAudio::IdleState; - QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection); - } -} - -void QAudioOutputPrivate::audioDeviceError() -{ - QMutexLocker lock(&mutex); - if (stateCode == QAudio::ActiveState) { - audioDeviceStop(); - - errorCode = QAudio::IOError; - stateCode = QAudio::StoppedState; - QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection); - } -} - -void QAudioOutputPrivate::startTimers() -{ - audioBuffer->startFillTimer(); - if (intervalTimer->interval() > 0) - intervalTimer->start(); -} - -void QAudioOutputPrivate::stopTimers() -{ - audioBuffer->stopFillTimer(); - intervalTimer->stop(); -} - - -void QAudioOutputPrivate::deviceStopped() -{ - intervalTimer->stop(); - emit stateChanged(stateCode); -} - -void QAudioOutputPrivate::inputReady() -{ - QMutexLocker lock(&mutex); - if (stateCode == QAudio::IdleState) { - audioThreadStart(); - - stateCode = QAudio::ActiveState; - errorCode = QAudio::NoError; - - QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); - } -} - - -OSStatus QAudioOutputPrivate::renderCallback(void* inRefCon, - AudioUnitRenderActionFlags* ioActionFlags, - const AudioTimeStamp* inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumberFrames, - AudioBufferList* ioData) -{ - Q_UNUSED(ioActionFlags) - Q_UNUSED(inTimeStamp) - Q_UNUSED(inBusNumber) - Q_UNUSED(inNumberFrames) - - QAudioOutputPrivate* d = static_cast(inRefCon); - - const int threadState = d->audioThreadState.fetchAndAddAcquire(0); - if (threadState == Stopped) { - ioData->mBuffers[0].mDataByteSize = 0; - d->audioDeviceStop(); - } - else { - const UInt32 bytesPerFrame = d->streamFormat.mBytesPerFrame; - qint64 framesRead; - - framesRead = d->audioBuffer->readFrames((char*)ioData->mBuffers[0].mData, - ioData->mBuffers[0].mDataByteSize / bytesPerFrame); - - if (framesRead > 0) { - ioData->mBuffers[0].mDataByteSize = framesRead * bytesPerFrame; - d->totalFrames += framesRead; - } - else { - ioData->mBuffers[0].mDataByteSize = 0; - if (framesRead == 0) { - if (threadState == Draining) - d->audioDeviceStop(); - else - d->audioDeviceIdle(); - } - else - d->audioDeviceError(); - } - } - - return noErr; -} - - -QT_END_NAMESPACE - -#include "qaudiooutput_mac_p.moc" - diff --git a/src/multimedia/audio/qaudiooutput_mac_p.h b/src/multimedia/audio/qaudiooutput_mac_p.h deleted file mode 100644 index 752905c..0000000 --- a/src/multimedia/audio/qaudiooutput_mac_p.h +++ /dev/null @@ -1,167 +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$ -** -****************************************************************************/ - -// -// 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. -// - -#ifndef QAUDIOOUTPUT_MAC_P_H -#define QAUDIOOUTPUT_MAC_P_H - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QIODevice; - -namespace QtMultimediaInternal -{ -class QAudioOutputBuffer; -} - -class QAudioOutputPrivate : public QAbstractAudioOutput -{ - Q_OBJECT - -public: - bool isOpen; - int internalBufferSize; - int periodSizeBytes; - qint64 totalFrames; - QAudioFormat audioFormat; - QIODevice* audioIO; - AudioDeviceID audioDeviceId; - AudioUnit audioUnit; - Float64 clockFrequency; - UInt64 startTime; - AudioStreamBasicDescription deviceFormat; - AudioStreamBasicDescription streamFormat; - QtMultimediaInternal::QAudioOutputBuffer* audioBuffer; - QAtomicInt audioThreadState; - QWaitCondition threadFinished; - QMutex mutex; - QTimer* intervalTimer; - - QAudio::Error errorCode; - QAudio::State stateCode; - - QAudioOutputPrivate(const QByteArray& device, const QAudioFormat& format); - ~QAudioOutputPrivate(); - - bool open(); - void close(); - - QAudioFormat format() const; - - QIODevice* start(QIODevice* device); - void stop(); - void reset(); - void suspend(); - void resume(); - - int bytesFree() const; - int periodSize() const; - - void setBufferSize(int value); - int bufferSize() const; - - void setNotifyInterval(int milliSeconds); - int notifyInterval() const; - - qint64 processedUSecs() const; - qint64 elapsedUSecs() const; - - QAudio::Error error() const; - QAudio::State state() const; - - void audioThreadStart(); - void audioThreadStop(); - void audioThreadDrain(); - - void audioDeviceStop(); - void audioDeviceIdle(); - void audioDeviceError(); - - void startTimers(); - void stopTimers(); - -private slots: - void deviceStopped(); - void inputReady(); - -private: - enum { Running, Draining, Stopped }; - - static OSStatus renderCallback(void* inRefCon, - AudioUnitRenderActionFlags* ioActionFlags, - const AudioTimeStamp* inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumberFrames, - AudioBufferList* ioData); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/audio/qaudiooutput_symbian_p.cpp b/src/multimedia/audio/qaudiooutput_symbian_p.cpp deleted file mode 100644 index 3f8e933..0000000 --- a/src/multimedia/audio/qaudiooutput_symbian_p.cpp +++ /dev/null @@ -1,697 +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 "qaudiooutput_symbian_p.h" - -QT_BEGIN_NAMESPACE - -//----------------------------------------------------------------------------- -// Constants -//----------------------------------------------------------------------------- - -const int UnderflowTimerInterval = 50; // ms - - -//----------------------------------------------------------------------------- -// Private class -//----------------------------------------------------------------------------- - -SymbianAudioOutputPrivate::SymbianAudioOutputPrivate( - QAudioOutputPrivate *audioDevice) - : m_audioDevice(audioDevice) -{ - -} - -SymbianAudioOutputPrivate::~SymbianAudioOutputPrivate() -{ - -} - -qint64 SymbianAudioOutputPrivate::readData(char *data, qint64 len) -{ - Q_UNUSED(data) - Q_UNUSED(len) - return 0; -} - -qint64 SymbianAudioOutputPrivate::writeData(const char *data, qint64 len) -{ - qint64 totalWritten = 0; - - if (m_audioDevice->state() == QAudio::ActiveState || - m_audioDevice->state() == QAudio::IdleState) { - - while (totalWritten < len) { - const qint64 written = m_audioDevice->pushData(data + totalWritten, - len - totalWritten); - if (written > 0) - totalWritten += written; - else - break; - } - } - - return totalWritten; -} - - -//----------------------------------------------------------------------------- -// Public functions -//----------------------------------------------------------------------------- - -QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, - const QAudioFormat &format) - : m_device(device) - , m_format(format) - , m_clientBufferSize(SymbianAudio::DefaultBufferSize) - , m_notifyInterval(SymbianAudio::DefaultNotifyInterval) - , m_notifyTimer(new QTimer(this)) - , m_error(QAudio::NoError) - , m_internalState(SymbianAudio::ClosedState) - , m_externalState(QAudio::StoppedState) - , m_pullMode(false) - , m_source(0) - , m_devSoundBuffer(0) - , m_devSoundBufferSize(0) - , m_bytesWritten(0) - , m_pushDataReady(false) - , m_bytesPadding(0) - , m_underflow(false) - , m_lastBuffer(false) - , m_underflowTimer(new QTimer(this)) - , m_samplesPlayed(0) - , m_totalSamplesPlayed(0) -{ - connect(m_notifyTimer.data(), SIGNAL(timeout()), this, SIGNAL(notify())); - - SymbianAudio::Utils::formatQtToNative(m_format, m_nativeFourCC, - m_nativeFormat); - - m_underflowTimer->setInterval(UnderflowTimerInterval); - connect(m_underflowTimer.data(), SIGNAL(timeout()), this, - SLOT(underflowTimerExpired())); -} - -QAudioOutputPrivate::~QAudioOutputPrivate() -{ - close(); -} - -QIODevice* QAudioOutputPrivate::start(QIODevice *device) -{ - stop(); - - // We have to set these before the call to open() because of the - // logic in initializingState() - if (device) { - m_pullMode = true; - m_source = device; - } - - open(); - - if (SymbianAudio::ClosedState != m_internalState) { - if (device) { - connect(m_source, SIGNAL(readyRead()), this, SLOT(dataReady())); - } else { - m_source = new SymbianAudioOutputPrivate(this); - m_source->open(QIODevice::WriteOnly | QIODevice::Unbuffered); - } - - m_elapsed.restart(); - } - - return m_source; -} - -void QAudioOutputPrivate::stop() -{ - close(); -} - -void QAudioOutputPrivate::reset() -{ - m_totalSamplesPlayed += getSamplesPlayed(); - m_devSound->Stop(); - m_bytesPadding = 0; - startPlayback(); -} - -void QAudioOutputPrivate::suspend() -{ - if (SymbianAudio::ActiveState == m_internalState - || SymbianAudio::IdleState == m_internalState) { - m_notifyTimer->stop(); - m_underflowTimer->stop(); - - const qint64 samplesWritten = SymbianAudio::Utils::bytesToSamples( - m_format, m_bytesWritten); - - const qint64 samplesPlayed = getSamplesPlayed(); - - m_bytesWritten = 0; - - // CMMFDevSound::Pause() is not guaranteed to work correctly in all - // implementations, for play-mode DevSound sessions. We therefore - // have to implement suspend() by calling CMMFDevSound::Stop(). - // Because this causes buffered data to be dropped, we replace the - // lost data with silence following a call to resume(), in order to - // ensure that processedUSecs() returns the correct value. - m_devSound->Stop(); - m_totalSamplesPlayed += samplesPlayed; - - // Calculate the amount of data dropped - const qint64 paddingSamples = samplesWritten - samplesPlayed; - m_bytesPadding = SymbianAudio::Utils::samplesToBytes(m_format, - paddingSamples); - - setState(SymbianAudio::SuspendedState); - } -} - -void QAudioOutputPrivate::resume() -{ - if (SymbianAudio::SuspendedState == m_internalState) - startPlayback(); -} - -int QAudioOutputPrivate::bytesFree() const -{ - int result = 0; - if (m_devSoundBuffer) { - const TDes8 &outputBuffer = m_devSoundBuffer->Data(); - result = outputBuffer.MaxLength() - outputBuffer.Length(); - } - return result; -} - -int QAudioOutputPrivate::periodSize() const -{ - return bufferSize(); -} - -void QAudioOutputPrivate::setBufferSize(int value) -{ - // Note that DevSound does not allow its client to specify the buffer size. - // This functionality is available via custom interfaces, but since these - // cannot be guaranteed to work across all DevSound implementations, we - // do not use them here. - // In order to comply with the expected bevahiour of QAudioOutput, we store - // the value and return it from bufferSize(), but the underlying DevSound - // buffer size remains unchanged. - if (value > 0) - m_clientBufferSize = value; -} - -int QAudioOutputPrivate::bufferSize() const -{ - return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize; -} - -void QAudioOutputPrivate::setNotifyInterval(int ms) -{ - if (ms > 0) { - const int oldNotifyInterval = m_notifyInterval; - m_notifyInterval = ms; - if (m_notifyTimer->isActive() && ms != oldNotifyInterval) - m_notifyTimer->start(m_notifyInterval); - } -} - -int QAudioOutputPrivate::notifyInterval() const -{ - return m_notifyInterval; -} - -qint64 QAudioOutputPrivate::processedUSecs() const -{ - int samplesPlayed = 0; - if (m_devSound && SymbianAudio::SuspendedState != m_internalState) - samplesPlayed = getSamplesPlayed(); - - // Protect against division by zero - Q_ASSERT_X(m_format.frequency() > 0, Q_FUNC_INFO, "Invalid frequency"); - - const qint64 result = qint64(1000000) * - (samplesPlayed + m_totalSamplesPlayed) - / m_format.frequency(); - - return result; -} - -qint64 QAudioOutputPrivate::elapsedUSecs() const -{ - const qint64 result = (QAudio::StoppedState == state()) ? - 0 : m_elapsed.elapsed() * 1000; - return result; -} - -QAudio::Error QAudioOutputPrivate::error() const -{ - return m_error; -} - -QAudio::State QAudioOutputPrivate::state() const -{ - return m_externalState; -} - -QAudioFormat QAudioOutputPrivate::format() const -{ - return m_format; -} - -//----------------------------------------------------------------------------- -// MDevSoundObserver implementation -//----------------------------------------------------------------------------- - -void QAudioOutputPrivate::InitializeComplete(TInt aError) -{ - Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState, - Q_FUNC_INFO, "Invalid state"); - - if (KErrNone == aError) - startPlayback(); -} - -void QAudioOutputPrivate::ToneFinished(TInt aError) -{ - Q_UNUSED(aError) - // This class doesn't use DevSound's tone playback functions, so should - // never receive this callback. - Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); -} - -void QAudioOutputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer) -{ - // Following receipt of this callback, DevSound should not provide another - // buffer until we have returned the current one. - Q_ASSERT_X(!m_devSoundBuffer, Q_FUNC_INFO, "Buffer already held"); - - // Will be returned to DevSound by bufferFilled(). - m_devSoundBuffer = static_cast(aBuffer); - - if (!m_devSoundBufferSize) - m_devSoundBufferSize = m_devSoundBuffer->Data().MaxLength(); - - writePaddingData(); - - if (m_pullMode && isDataReady() && !m_bytesPadding) - pullData(); -} - -void QAudioOutputPrivate::PlayError(TInt aError) -{ - switch (aError) { - case KErrUnderflow: - m_underflow = true; - if (m_pullMode && !m_lastBuffer) - setError(QAudio::UnderrunError); - else - setState(SymbianAudio::IdleState); - break; - default: - setError(QAudio::IOError); - break; - } -} - -void QAudioOutputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer) -{ - Q_UNUSED(aBuffer) - // This class doesn't use DevSound in record mode, so should never receive - // this callback. - Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); -} - -void QAudioOutputPrivate::RecordError(TInt aError) -{ - Q_UNUSED(aError) - // This class doesn't use DevSound in record mode, so should never receive - // this callback. - Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); -} - -void QAudioOutputPrivate::ConvertError(TInt aError) -{ - Q_UNUSED(aError) - // This class doesn't use DevSound's format conversion functions, so - // should never receive this callback. - Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); -} - -void QAudioOutputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) -{ - Q_UNUSED(aMessageType) - Q_UNUSED(aMsg) - // Ignore this callback. -} - -//----------------------------------------------------------------------------- -// Private functions -//----------------------------------------------------------------------------- - -void QAudioOutputPrivate::dataReady() -{ - // Client-provided QIODevice has data ready to read. - - Q_ASSERT_X(m_source->bytesAvailable(), Q_FUNC_INFO, - "readyRead signal received, but no data available"); - - if (!m_bytesPadding) - pullData(); -} - -void QAudioOutputPrivate::underflowTimerExpired() -{ - const TInt samplesPlayed = getSamplesPlayed(); - if (m_samplesPlayed && (samplesPlayed == m_samplesPlayed)) { - setError(QAudio::UnderrunError); - } else { - m_samplesPlayed = samplesPlayed; - m_underflowTimer->start(); - } -} - -void QAudioOutputPrivate::open() -{ - Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState, - Q_FUNC_INFO, "DevSound already opened"); - - QT_TRAP_THROWING( m_devSound.reset(CMMFDevSound::NewL()) ) - - QScopedPointer caps( - new SymbianAudio::DevSoundCapabilities(*m_devSound, - QAudio::AudioOutput)); - - int err = SymbianAudio::Utils::isFormatSupported(m_format, *caps) ? - KErrNone : KErrNotSupported; - - if (KErrNone == err) { - setState(SymbianAudio::InitializingState); - TRAP(err, m_devSound->InitializeL(*this, m_nativeFourCC, - EMMFStatePlaying)); - } - - if (KErrNone != err) { - setError(QAudio::OpenError); - m_devSound.reset(); - } -} - -void QAudioOutputPrivate::startPlayback() -{ - TRAPD(err, startDevSoundL()); - if (KErrNone == err) { - if (isDataReady()) - setState(SymbianAudio::ActiveState); - else - setState(SymbianAudio::IdleState); - - m_notifyTimer->start(m_notifyInterval); - m_underflow = false; - - Q_ASSERT(m_devSound->SamplesPlayed() == 0); - - writePaddingData(); - - if (m_pullMode && m_source->bytesAvailable() && !m_bytesPadding) - dataReady(); - } else { - setError(QAudio::OpenError); - close(); - } -} - -void QAudioOutputPrivate::startDevSoundL() -{ - TMMFCapabilities nativeFormat = m_devSound->Config(); - m_nativeFormat.iBufferSize = nativeFormat.iBufferSize; - m_devSound->SetConfigL(m_nativeFormat); - m_devSound->PlayInitL(); -} - -void QAudioOutputPrivate::writePaddingData() -{ - // See comments in suspend() - - while (m_devSoundBuffer && m_bytesPadding) { - if (SymbianAudio::IdleState == m_internalState) - setState(SymbianAudio::ActiveState); - - TDes8 &outputBuffer = m_devSoundBuffer->Data(); - const qint64 outputBytes = bytesFree(); - const qint64 paddingBytes = outputBytes < m_bytesPadding ? - outputBytes : m_bytesPadding; - unsigned char *ptr = const_cast(outputBuffer.Ptr()); - Mem::FillZ(ptr, paddingBytes); - outputBuffer.SetLength(outputBuffer.Length() + paddingBytes); - m_bytesPadding -= paddingBytes; - - if (m_pullMode && m_source->atEnd()) - lastBufferFilled(); - if (paddingBytes == outputBytes) - bufferFilled(); - } -} - -qint64 QAudioOutputPrivate::pushData(const char *data, qint64 len) -{ - // Data has been written to SymbianAudioOutputPrivate - - Q_ASSERT_X(!m_pullMode, Q_FUNC_INFO, - "pushData called when in pull mode"); - - const unsigned char *const inputPtr = - reinterpret_cast(data); - qint64 bytesWritten = 0; - - if (SymbianAudio::IdleState == m_internalState) - setState(SymbianAudio::ActiveState); - - while (m_devSoundBuffer && (bytesWritten < len)) { - // writePaddingData() is called from BufferToBeFilled(), so we should - // never have any padding data left at this point. - Q_ASSERT_X(0 == m_bytesPadding, Q_FUNC_INFO, - "Padding bytes remaining in pushData"); - - TDes8 &outputBuffer = m_devSoundBuffer->Data(); - - const qint64 outputBytes = bytesFree(); - const qint64 inputBytes = len - bytesWritten; - const qint64 copyBytes = outputBytes < inputBytes ? - outputBytes : inputBytes; - - outputBuffer.Append(inputPtr + bytesWritten, copyBytes); - bytesWritten += copyBytes; - - bufferFilled(); - } - - m_pushDataReady = (bytesWritten < len); - - // If DevSound is still initializing (m_internalState == InitializingState), - // we cannot transition m_internalState to ActiveState, but we must emit - // an (external) state change from IdleState to ActiveState. The following - // call triggers this signal. - setState(m_internalState); - - return bytesWritten; -} - -void QAudioOutputPrivate::pullData() -{ - Q_ASSERT_X(m_pullMode, Q_FUNC_INFO, - "pullData called when in push mode"); - - if (m_bytesPadding) - m_bytesPadding = 1; - - // writePaddingData() is called by BufferToBeFilled() before pullData(), - // so we should never have any padding data left at this point. - Q_ASSERT_X(0 == m_bytesPadding, Q_FUNC_INFO, - "Padding bytes remaining in pullData"); - - qint64 inputBytes = m_source->bytesAvailable(); - while (m_devSoundBuffer && inputBytes) { - if (SymbianAudio::IdleState == m_internalState) - setState(SymbianAudio::ActiveState); - - TDes8 &outputBuffer = m_devSoundBuffer->Data(); - - const qint64 outputBytes = bytesFree(); - const qint64 copyBytes = outputBytes < inputBytes ? - outputBytes : inputBytes; - - char *outputPtr = (char*)(outputBuffer.Ptr() + outputBuffer.Length()); - const qint64 bytesCopied = m_source->read(outputPtr, copyBytes); - Q_ASSERT(bytesCopied == copyBytes); - outputBuffer.SetLength(outputBuffer.Length() + bytesCopied); - inputBytes -= bytesCopied; - - if (m_source->atEnd()) - lastBufferFilled(); - else if (copyBytes == outputBytes) - bufferFilled(); - } -} - -void QAudioOutputPrivate::bufferFilled() -{ - Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to return"); - - const TDes8 &outputBuffer = m_devSoundBuffer->Data(); - m_bytesWritten += outputBuffer.Length(); - - m_devSoundBuffer = 0; - - m_samplesPlayed = getSamplesPlayed(); - m_underflowTimer->start(); - - if (QAudio::UnderrunError == m_error) - m_error = QAudio::NoError; - - m_devSound->PlayData(); -} - -void QAudioOutputPrivate::lastBufferFilled() -{ - Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to fill"); - Q_ASSERT_X(!m_lastBuffer, Q_FUNC_INFO, "Last buffer already sent"); - m_lastBuffer = true; - m_devSoundBuffer->SetLastBuffer(ETrue); - bufferFilled(); -} - -void QAudioOutputPrivate::close() -{ - m_notifyTimer->stop(); - m_underflowTimer->stop(); - - m_error = QAudio::NoError; - - if (m_devSound) - m_devSound->Stop(); - m_devSound.reset(); - m_devSoundBuffer = 0; - m_devSoundBufferSize = 0; - - if (!m_pullMode) // m_source is owned - delete m_source; - m_pullMode = false; - m_source = 0; - - m_bytesWritten = 0; - m_pushDataReady = false; - m_bytesPadding = 0; - m_underflow = false; - m_lastBuffer = false; - m_samplesPlayed = 0; - m_totalSamplesPlayed = 0; - - setState(SymbianAudio::ClosedState); -} - -qint64 QAudioOutputPrivate::getSamplesPlayed() const -{ - qint64 result = 0; - if (m_devSound) { - const qint64 samplesWritten = SymbianAudio::Utils::bytesToSamples( - m_format, m_bytesWritten); - - if (m_underflow) { - result = samplesWritten; - } else { - // This is necessary because some DevSound implementations report - // that they have played more data than has actually been provided to them - // by the client. - const qint64 devSoundSamplesPlayed(m_devSound->SamplesPlayed()); - result = qMin(devSoundSamplesPlayed, samplesWritten); - } - } - return result; -} - -void QAudioOutputPrivate::setError(QAudio::Error error) -{ - m_error = error; - - // Although no state transition actually occurs here, a stateChanged event - // must be emitted to inform the client that the call to start() was - // unsuccessful. - if (QAudio::OpenError == error) - emit stateChanged(QAudio::StoppedState); - - if (QAudio::UnderrunError == error) - setState(SymbianAudio::IdleState); - else - // Close the DevSound instance. This causes a transition to - // StoppedState. This must be done asynchronously in case the - // current function was called from a DevSound event handler, in which - // case deleting the DevSound instance may cause an exception. - QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection); -} - -void QAudioOutputPrivate::setState(SymbianAudio::State newInternalState) -{ - const QAudio::State oldExternalState = m_externalState; - m_internalState = newInternalState; - m_externalState = SymbianAudio::Utils::stateNativeToQt( - m_internalState, initializingState()); - - if (m_externalState != oldExternalState) - emit stateChanged(m_externalState); -} - -bool QAudioOutputPrivate::isDataReady() const -{ - return (m_source && m_source->bytesAvailable()) - || m_bytesPadding - || m_pushDataReady; -} - -QAudio::State QAudioOutputPrivate::initializingState() const -{ - return isDataReady() ? QAudio::ActiveState : QAudio::IdleState; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudiooutput_symbian_p.h b/src/multimedia/audio/qaudiooutput_symbian_p.h deleted file mode 100644 index 00ccb24..0000000 --- a/src/multimedia/audio/qaudiooutput_symbian_p.h +++ /dev/null @@ -1,210 +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$ -** -****************************************************************************/ - -// -// 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. -// - -#ifndef QAUDIOOUTPUT_SYMBIAN_P_H -#define QAUDIOOUTPUT_SYMBIAN_P_H - -#include -#include -#include -#include -#include "qaudio_symbian_p.h" - -QT_BEGIN_NAMESPACE - -class QAudioOutputPrivate; - -class SymbianAudioOutputPrivate : public QIODevice -{ - friend class QAudioOutputPrivate; - Q_OBJECT -public: - SymbianAudioOutputPrivate(QAudioOutputPrivate *audio); - ~SymbianAudioOutputPrivate(); - - qint64 readData(char *data, qint64 len); - qint64 writeData(const char *data, qint64 len); - -private: - QAudioOutputPrivate *const m_audioDevice; -}; - -class QAudioOutputPrivate - : public QAbstractAudioOutput - , public MDevSoundObserver -{ - friend class SymbianAudioOutputPrivate; - Q_OBJECT -public: - QAudioOutputPrivate(const QByteArray &device, - const QAudioFormat &audioFormat); - ~QAudioOutputPrivate(); - - // QAbstractAudioOutput - QIODevice* start(QIODevice *device = 0); - void stop(); - void reset(); - void suspend(); - void resume(); - int bytesFree() const; - int periodSize() const; - void setBufferSize(int value); - int bufferSize() const; - void setNotifyInterval(int milliSeconds); - int notifyInterval() const; - qint64 processedUSecs() const; - qint64 elapsedUSecs() const; - QAudio::Error error() const; - QAudio::State state() const; - QAudioFormat format() const; - - // MDevSoundObserver - void InitializeComplete(TInt aError); - void ToneFinished(TInt aError); - void BufferToBeFilled(CMMFBuffer *aBuffer); - void PlayError(TInt aError); - void BufferToBeEmptied(CMMFBuffer *aBuffer); - void RecordError(TInt aError); - void ConvertError(TInt aError); - void DeviceMessage(TUid aMessageType, const TDesC8 &aMsg); - -private slots: - void dataReady(); - void underflowTimerExpired(); - -private: - void open(); - void startPlayback(); - void startDevSoundL(); - void writePaddingData(); - qint64 pushData(const char *data, qint64 len); - void pullData(); - void bufferFilled(); - void lastBufferFilled(); - Q_INVOKABLE void close(); - - qint64 getSamplesPlayed() const; - - void setError(QAudio::Error error); - void setState(SymbianAudio::State state); - - bool isDataReady() const; - QAudio::State initializingState() const; - -private: - const QByteArray m_device; - const QAudioFormat m_format; - - int m_clientBufferSize; - int m_notifyInterval; - QScopedPointer m_notifyTimer; - QTime m_elapsed; - QAudio::Error m_error; - - SymbianAudio::State m_internalState; - QAudio::State m_externalState; - - bool m_pullMode; - QIODevice *m_source; - - QScopedPointer m_devSound; - TUint32 m_nativeFourCC; - TMMFCapabilities m_nativeFormat; - - // Buffer provided by DevSound, to be filled with data. - CMMFDataBuffer *m_devSoundBuffer; - - int m_devSoundBufferSize; - - // Number of bytes transferred from QIODevice to QAudioOutput. It is - // necessary to count this because data is dropped when suspend() is - // called. The difference between the position reported by DevSound and - // this value allows us to calculate m_bytesPadding; - quint32 m_bytesWritten; - - // True if client has provided data while the audio subsystem was not - // ready to consume it. - bool m_pushDataReady; - - // Number of zero bytes which will be written when client calls resume(). - quint32 m_bytesPadding; - - // True if PlayError(KErrUnderflow) has been called. - bool m_underflow; - - // True if a buffer marked with the "last buffer" flag has been provided - // to DevSound. - bool m_lastBuffer; - - // Some DevSound implementations ignore all underflow errors raised by the - // audio driver, unless the last buffer flag has been set by the client. - // In push-mode playback, this flag will never be set, so the underflow - // error will never be reported. In order to work around this, a timer - // is used, which gets reset every time the client provides more data. If - // the timer expires, an underflow error is raised by this object. - QScopedPointer m_underflowTimer; - - // Result of previous call to CMMFDevSound::SamplesPlayed(). This value is - // used to determine whether, when m_underflowTimer expires, an - // underflow error has actually occurred. - quint32 m_samplesPlayed; - - // Samples played up to the last call to suspend(). It is necessary - // to cache this because suspend() is implemented using - // CMMFDevSound::Stop(), which resets DevSound's SamplesPlayed() counter. - quint32 m_totalSamplesPlayed; - -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp deleted file mode 100644 index 13bce58..0000000 --- a/src/multimedia/audio/qaudiooutput_win32_p.cpp +++ /dev/null @@ -1,606 +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$ -** -****************************************************************************/ - -// -// 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 "qaudiooutput_win32_p.h" - -//#define DEBUG_AUDIO 1 - -QT_BEGIN_NAMESPACE - -static const int minimumIntervalTime = 50; - -QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): - settings(audioFormat) -{ - bytesAvailable = 0; - buffer_size = 0; - period_size = 0; - m_device = device; - totalTimeValue = 0; - intervalTime = 1000; - audioBuffer = 0; - errorState = QAudio::NoError; - deviceState = QAudio::StoppedState; - audioSource = 0; - pullMode = true; - finished = false; - InitializeCriticalSection(&waveOutCriticalSection); -} - -QAudioOutputPrivate::~QAudioOutputPrivate() -{ - EnterCriticalSection(&waveOutCriticalSection); - finished = true; - LeaveCriticalSection(&waveOutCriticalSection); - - close(); - DeleteCriticalSection(&waveOutCriticalSection); -} - -void CALLBACK QAudioOutputPrivate::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg, - DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ) -{ - Q_UNUSED(dwParam1) - Q_UNUSED(dwParam2) - Q_UNUSED(hWaveOut) - - QAudioOutputPrivate* qAudio; - qAudio = (QAudioOutputPrivate*)(dwInstance); - if(!qAudio) - return; - - switch(uMsg) { - case WOM_OPEN: - qAudio->feedback(); - break; - case WOM_CLOSE: - return; - case WOM_DONE: - EnterCriticalSection(&qAudio->waveOutCriticalSection); - if(qAudio->finished || qAudio->buffer_size == 0 || qAudio->period_size == 0) { - LeaveCriticalSection(&qAudio->waveOutCriticalSection); - return; - } - qAudio->waveFreeBlockCount++; - if(qAudio->waveFreeBlockCount >= qAudio->buffer_size/qAudio->period_size) - qAudio->waveFreeBlockCount = qAudio->buffer_size/qAudio->period_size; - qAudio->feedback(); - LeaveCriticalSection(&qAudio->waveOutCriticalSection); - break; - default: - return; - } -} - -WAVEHDR* QAudioOutputPrivate::allocateBlocks(int size, int count) -{ - int i; - unsigned char* buffer; - WAVEHDR* blocks; - DWORD totalBufferSize = (size + sizeof(WAVEHDR))*count; - - if((buffer=(unsigned char*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, - totalBufferSize)) == 0) { - qWarning("QAudioOutput: Memory allocation error"); - return 0; - } - blocks = (WAVEHDR*)buffer; - buffer += sizeof(WAVEHDR)*count; - for(i = 0; i < count; i++) { - blocks[i].dwBufferLength = size; - blocks[i].lpData = (LPSTR)buffer; - buffer += size; - } - return blocks; -} - -void QAudioOutputPrivate::freeBlocks(WAVEHDR* blockArray) -{ - WAVEHDR* blocks = blockArray; - - int count = buffer_size/period_size; - - for(int i = 0; i < count; i++) { - waveOutUnprepareHeader(hWaveOut,&blocks[i], sizeof(WAVEHDR)); - blocks+=sizeof(WAVEHDR); - } - HeapFree(GetProcessHeap(), 0, blockArray); -} - -QAudioFormat QAudioOutputPrivate::format() const -{ - return settings; -} - -QIODevice* QAudioOutputPrivate::start(QIODevice* device) -{ - if(deviceState != QAudio::StoppedState) - close(); - - if(!pullMode && audioSource) { - delete audioSource; - } - - if(device) { - //set to pull mode - pullMode = true; - audioSource = device; - deviceState = QAudio::ActiveState; - } else { - //set to push mode - pullMode = false; - audioSource = new OutputPrivate(this); - audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered); - deviceState = QAudio::IdleState; - } - - if( !open() ) - return 0; - - emit stateChanged(deviceState); - - return audioSource; -} - -void QAudioOutputPrivate::stop() -{ - if(deviceState == QAudio::StoppedState) - return; - close(); - if(!pullMode && audioSource) { - delete audioSource; - audioSource = 0; - } - emit stateChanged(deviceState); -} - -bool QAudioOutputPrivate::open() -{ -#ifdef DEBUG_AUDIO - QTime now(QTime::currentTime()); - qDebug()<= 8000 && settings.frequency() <= 48000)) { - errorState = QAudio::OpenError; - deviceState = QAudio::StoppedState; - emit stateChanged(deviceState); - qWarning("QAudioOutput: open error, frequency out of range."); - return false; - } - if(buffer_size == 0) { - // Default buffer size, 200ms, default period size is 40ms - buffer_size = settings.frequency()*settings.channels()*(settings.sampleSize()/8)*0.2; - period_size = buffer_size/5; - } else { - period_size = buffer_size/5; - } - waveBlocks = allocateBlocks(period_size, buffer_size/period_size); - - EnterCriticalSection(&waveOutCriticalSection); - waveFreeBlockCount = buffer_size/period_size; - LeaveCriticalSection(&waveOutCriticalSection); - - waveCurrentBlock = 0; - - if(audioBuffer == 0) - audioBuffer = new char[buffer_size]; - - timeStamp.restart(); - elapsedTimeOffset = 0; - - wfx.nSamplesPerSec = settings.frequency(); - wfx.wBitsPerSample = settings.sampleSize(); - wfx.nChannels = settings.channels(); - wfx.cbSize = 0; - - wfx.wFormatTag = WAVE_FORMAT_PCM; - wfx.nBlockAlign = (wfx.wBitsPerSample >> 3) * wfx.nChannels; - wfx.nAvgBytesPerSec = wfx.nBlockAlign * wfx.nSamplesPerSec; - - UINT_PTR devId = WAVE_MAPPER; - - WAVEOUTCAPS woc; - unsigned long iNumDevs,ii; - iNumDevs = waveOutGetNumDevs(); - for(ii=0;ii= minimumIntervalTime) - intervalTime = ms; - else - intervalTime = minimumIntervalTime; -} - -int QAudioOutputPrivate::notifyInterval() const -{ - return intervalTime; -} - -qint64 QAudioOutputPrivate::processedUSecs() const -{ - if (deviceState == QAudio::StoppedState) - return 0; - qint64 result = qint64(1000000) * totalTimeValue / - (settings.channels()*(settings.sampleSize()/8)) / - settings.frequency(); - - return result; -} - -qint64 QAudioOutputPrivate::write( const char *data, qint64 len ) -{ - // Write out some audio data - if (deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState) - return 0; - - char* p = (char*)data; - int l = (int)len; - - WAVEHDR* current; - int remain; - current = &waveBlocks[waveCurrentBlock]; - while(l > 0) { - EnterCriticalSection(&waveOutCriticalSection); - if(waveFreeBlockCount==0) { - LeaveCriticalSection(&waveOutCriticalSection); - break; - } - LeaveCriticalSection(&waveOutCriticalSection); - - if(current->dwFlags & WHDR_PREPARED) - waveOutUnprepareHeader(hWaveOut, current, sizeof(WAVEHDR)); - - if(l < period_size) - remain = l; - else - remain = period_size; - memcpy(current->lpData, p, remain); - - l -= remain; - p += remain; - current->dwBufferLength = remain; - waveOutPrepareHeader(hWaveOut, current, sizeof(WAVEHDR)); - waveOutWrite(hWaveOut, current, sizeof(WAVEHDR)); - - EnterCriticalSection(&waveOutCriticalSection); - waveFreeBlockCount--; - LeaveCriticalSection(&waveOutCriticalSection); -#ifdef DEBUG_AUDIO - EnterCriticalSection(&waveOutCriticalSection); - qDebug("write out l=%d, waveFreeBlockCount=%d", - current->dwBufferLength,waveFreeBlockCount); - LeaveCriticalSection(&waveOutCriticalSection); -#endif - totalTimeValue += current->dwBufferLength; - waveCurrentBlock++; - waveCurrentBlock %= buffer_size/period_size; - current = &waveBlocks[waveCurrentBlock]; - current->dwUser = 0; - errorState = QAudio::NoError; - if (deviceState != QAudio::ActiveState) { - deviceState = QAudio::ActiveState; - emit stateChanged(deviceState); - } - } - return (len-l); -} - -void QAudioOutputPrivate::resume() -{ - if(deviceState == QAudio::SuspendedState) { - deviceState = QAudio::ActiveState; - errorState = QAudio::NoError; - waveOutRestart(hWaveOut); - QTimer::singleShot(10, this, SLOT(feedback())); - emit stateChanged(deviceState); - } -} - -void QAudioOutputPrivate::suspend() -{ - if(deviceState == QAudio::ActiveState || deviceState == QAudio::IdleState) { - int delay = (buffer_size-bytesFree())*1000/(settings.frequency() - *settings.channels()*(settings.sampleSize()/8)); - waveOutPause(hWaveOut); - Sleep(delay+10); - deviceState = QAudio::SuspendedState; - errorState = QAudio::NoError; - emit stateChanged(deviceState); - } -} - -void QAudioOutputPrivate::feedback() -{ -#ifdef DEBUG_AUDIO - QTime now(QTime::currentTime()); - qDebug()<= period_size) - QMetaObject::invokeMethod(this, "deviceReady", Qt::QueuedConnection); - } -} - -bool QAudioOutputPrivate::deviceReady() -{ - if(deviceState == QAudio::StoppedState) - return false; - - if(pullMode) { - int chunks = bytesAvailable/period_size; -#ifdef DEBUG_AUDIO - qDebug()<<"deviceReady() avail="< intervalTime ) { - emit notify(); - elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime; - timeStamp.restart(); - } - return true; - } - - if(startup) - waveOutPause(hWaveOut); - int input = period_size*chunks; - int l = audioSource->read(audioBuffer,input); - if(l > 0) { - int out= write(audioBuffer,l); - if(out > 0) { - if (deviceState != QAudio::ActiveState) { - deviceState = QAudio::ActiveState; - emit stateChanged(deviceState); - } - } - if ( out < l) { - // Didnt write all data - audioSource->seek(audioSource->pos()-(l-out)); - } - if(startup) - waveOutRestart(hWaveOut); - } else if(l == 0) { - bytesAvailable = bytesFree(); - - int check = 0; - EnterCriticalSection(&waveOutCriticalSection); - check = waveFreeBlockCount; - LeaveCriticalSection(&waveOutCriticalSection); - if(check == buffer_size/period_size) { - errorState = QAudio::UnderrunError; - if (deviceState != QAudio::IdleState) { - deviceState = QAudio::IdleState; - emit stateChanged(deviceState); - } - } - - } else if(l < 0) { - bytesAvailable = bytesFree(); - errorState = QAudio::IOError; - } - } else { - int buffered; - EnterCriticalSection(&waveOutCriticalSection); - buffered = waveFreeBlockCount; - LeaveCriticalSection(&waveOutCriticalSection); - errorState = QAudio::UnderrunError; - if (buffered >= buffer_size/period_size && deviceState == QAudio::ActiveState) { - deviceState = QAudio::IdleState; - emit stateChanged(deviceState); - } - } - if(deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState) - return true; - - if((timeStamp.elapsed() + elapsedTimeOffset) > intervalTime) { - emit notify(); - elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime; - timeStamp.restart(); - } - - return true; -} - -qint64 QAudioOutputPrivate::elapsedUSecs() const -{ - if (deviceState == QAudio::StoppedState) - return 0; - - return timeStampOpened.elapsed()*1000; -} - -QAudio::Error QAudioOutputPrivate::error() const -{ - return errorState; -} - -QAudio::State QAudioOutputPrivate::state() const -{ - return deviceState; -} - -void QAudioOutputPrivate::reset() -{ - close(); -} - -OutputPrivate::OutputPrivate(QAudioOutputPrivate* audio) -{ - audioDevice = qobject_cast(audio); -} - -OutputPrivate::~OutputPrivate() {} - -qint64 OutputPrivate::readData( char* data, qint64 len) -{ - Q_UNUSED(data) - Q_UNUSED(len) - - return 0; -} - -qint64 OutputPrivate::writeData(const char* data, qint64 len) -{ - int retry = 0; - qint64 written = 0; - - if((audioDevice->deviceState == QAudio::ActiveState) - ||(audioDevice->deviceState == QAudio::IdleState)) { - qint64 l = len; - while(written < l) { - int chunk = audioDevice->write(data+written,(l-written)); - if(chunk <= 0) - retry++; - else - written+=chunk; - - if(retry > 10) - return written; - } - audioDevice->deviceState = QAudio::ActiveState; - } - return written; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/audio/qaudiooutput_win32_p.h b/src/multimedia/audio/qaudiooutput_win32_p.h deleted file mode 100644 index 68a40f7..0000000 --- a/src/multimedia/audio/qaudiooutput_win32_p.h +++ /dev/null @@ -1,156 +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$ -** -****************************************************************************/ - -// -// 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. -// - -#ifndef QAUDIOOUTPUTWIN_H -#define QAUDIOOUTPUTWIN_H - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - - -QT_BEGIN_NAMESPACE - -class QAudioOutputPrivate : public QAbstractAudioOutput -{ - Q_OBJECT -public: - QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat); - ~QAudioOutputPrivate(); - - qint64 write( const char *data, qint64 len ); - - QAudioFormat format() const; - QIODevice* start(QIODevice* device = 0); - void stop(); - void reset(); - void suspend(); - void resume(); - int bytesFree() const; - int periodSize() const; - void setBufferSize(int value); - int bufferSize() const; - void setNotifyInterval(int milliSeconds); - int notifyInterval() const; - qint64 processedUSecs() const; - qint64 elapsedUSecs() const; - QAudio::Error error() const; - QAudio::State state() const; - - QIODevice* audioSource; - QAudioFormat settings; - QAudio::Error errorState; - QAudio::State deviceState; - -private slots: - void feedback(); - bool deviceReady(); - -private: - QByteArray m_device; - bool resuming; - int bytesAvailable; - QTime timeStamp; - qint64 elapsedTimeOffset; - QTime timeStampOpened; - qint32 buffer_size; - qint32 period_size; - qint64 totalTimeValue; - bool pullMode; - int intervalTime; - static void QT_WIN_CALLBACK waveOutProc( HWAVEOUT hWaveOut, UINT uMsg, - DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ); - - CRITICAL_SECTION waveOutCriticalSection; - - WAVEHDR* allocateBlocks(int size, int count); - void freeBlocks(WAVEHDR* blockArray); - bool open(); - void close(); - - WAVEFORMATEX wfx; - HWAVEOUT hWaveOut; - MMRESULT result; - WAVEHDR header; - WAVEHDR* waveBlocks; - volatile bool finished; - volatile int waveFreeBlockCount; - int waveCurrentBlock; - char* audioBuffer; -}; - -class OutputPrivate : public QIODevice -{ - Q_OBJECT -public: - OutputPrivate(QAudioOutputPrivate* audio); - ~OutputPrivate(); - - qint64 readData( char* data, qint64 len); - qint64 writeData(const char* data, qint64 len); - -private: - QAudioOutputPrivate *audioDevice; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/base/base.pri b/src/multimedia/base/base.pri deleted file mode 100644 index 49eca49..0000000 --- a/src/multimedia/base/base.pri +++ /dev/null @@ -1,69 +0,0 @@ - -QT += network -contains(QT_CONFIG, opengl):QT += opengl - -HEADERS += \ - $$PWD/qmediaresource.h \ - $$PWD/qmediacontent.h \ - $$PWD/qmediaobject.h \ - $$PWD/qmediaobject_p.h \ - $$PWD/qmediapluginloader_p.h \ - $$PWD/qmediaservice.h \ - $$PWD/qmediaservice_p.h \ - $$PWD/qmediaserviceprovider.h \ - $$PWD/qmediaserviceproviderplugin.h \ - $$PWD/qmediacontrol.h \ - $$PWD/qmediacontrol_p.h \ - $$PWD/qmetadatacontrol.h \ - $$PWD/qvideooutputcontrol.h \ - $$PWD/qvideowindowcontrol.h \ - $$PWD/qvideorenderercontrol.h \ - $$PWD/qvideodevicecontrol.h \ - $$PWD/qvideowidgetcontrol.h \ - $$PWD/qvideowidget.h \ - $$PWD/qvideowidget_p.h \ - $$PWD/qgraphicsvideoitem.h \ - $$PWD/qmediaplaylistcontrol.h \ - $$PWD/qmediaplaylist.h \ - $$PWD/qmediaplaylist_p.h \ - $$PWD/qmediaplaylistprovider.h \ - $$PWD/qmediaplaylistprovider_p.h \ - $$PWD/qmediaplaylistioplugin.h \ - $$PWD/qlocalmediaplaylistprovider.h \ - $$PWD/qmediaplaylistnavigator.h \ - $$PWD/qpaintervideosurface_p.h \ - $$PWD/qmediatimerange.h \ - $$PWD/qtmedianamespace.h - -SOURCES += \ - $$PWD/qmediaresource.cpp \ - $$PWD/qmediacontent.cpp \ - $$PWD/qmediaobject.cpp \ - $$PWD/qmediapluginloader.cpp \ - $$PWD/qmediaservice.cpp \ - $$PWD/qmediaserviceprovider.cpp \ - $$PWD/qmediacontrol.cpp \ - $$PWD/qmetadatacontrol.cpp \ - $$PWD/qvideooutputcontrol.cpp \ - $$PWD/qvideowindowcontrol.cpp \ - $$PWD/qvideorenderercontrol.cpp \ - $$PWD/qvideodevicecontrol.cpp \ - $$PWD/qvideowidgetcontrol.cpp \ - $$PWD/qvideowidget.cpp \ - $$PWD/qgraphicsvideoitem.cpp \ - $$PWD/qmediaplaylistcontrol.cpp \ - $$PWD/qmediaplaylist.cpp \ - $$PWD/qmediaplaylistprovider.cpp \ - $$PWD/qmediaplaylistioplugin.cpp \ - $$PWD/qlocalmediaplaylistprovider.cpp \ - $$PWD/qmediaplaylistnavigator.cpp \ - $$PWD/qpaintervideosurface.cpp \ - $$PWD/qmediatimerange.cpp - -mac { - HEADERS += $$PWD/qpaintervideosurface_mac_p.h - OBJECTIVE_SOURCES += $$PWD/qpaintervideosurface_mac.mm - - LIBS += -framework AppKit -framework QuartzCore -framework QTKit - -} diff --git a/src/multimedia/base/qgraphicsvideoitem.cpp b/src/multimedia/base/qgraphicsvideoitem.cpp deleted file mode 100644 index f903eb7..0000000 --- a/src/multimedia/base/qgraphicsvideoitem.cpp +++ /dev/null @@ -1,437 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 -#include -#include -#include - -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) -#include -#endif - -QT_BEGIN_NAMESPACE - - -class QGraphicsVideoItemPrivate -{ -public: - QGraphicsVideoItemPrivate() - : q_ptr(0) - , surface(0) - , mediaObject(0) - , service(0) - , outputControl(0) - , rendererControl(0) - , aspectRatioMode(Qt::KeepAspectRatio) - , updatePaintDevice(true) - , rect(0.0, 0.0, 320, 240) - { - } - - QGraphicsVideoItem *q_ptr; - - QPainterVideoSurface *surface; - QMediaObject *mediaObject; - QMediaService *service; - QVideoOutputControl *outputControl; - QVideoRendererControl *rendererControl; - Qt::AspectRatioMode aspectRatioMode; - bool updatePaintDevice; - QRectF rect; - QRectF boundingRect; - QRectF sourceRect; - QSizeF nativeSize; - - void clearService(); - void updateRects(); - - void _q_present(); - void _q_formatChanged(const QVideoSurfaceFormat &format); - void _q_serviceDestroyed(); - void _q_mediaObjectDestroyed(); -}; - -void QGraphicsVideoItemPrivate::clearService() -{ - if (outputControl) { - outputControl->setOutput(QVideoOutputControl::NoOutput); - outputControl = 0; - } - if (rendererControl) { - surface->stop(); - rendererControl->setSurface(0); - rendererControl = 0; - } - if (service) { - QObject::disconnect(service, SIGNAL(destroyed()), q_ptr, SLOT(_q_serviceDestroyed())); - service = 0; - } -} - -void QGraphicsVideoItemPrivate::updateRects() -{ - q_ptr->prepareGeometryChange(); - - if (nativeSize.isEmpty()) { - boundingRect = QRectF(); - } else if (aspectRatioMode == Qt::IgnoreAspectRatio) { - boundingRect = rect; - sourceRect = QRectF(0, 0, 1, 1); - } else if (aspectRatioMode == Qt::KeepAspectRatio) { - QSizeF size = nativeSize; - size.scale(rect.size(), Qt::KeepAspectRatio); - - boundingRect = QRectF(0, 0, size.width(), size.height()); - boundingRect.moveCenter(rect.center()); - - sourceRect = QRectF(0, 0, 1, 1); - } else if (aspectRatioMode == Qt::KeepAspectRatioByExpanding) { - boundingRect = rect; - - QSizeF size = rect.size(); - size.scale(nativeSize, Qt::KeepAspectRatio); - - sourceRect = QRectF( - 0, 0, size.width() / nativeSize.width(), size.height() / nativeSize.height()); - sourceRect.moveCenter(QPointF(0.5, 0.5)); - } -} - -void QGraphicsVideoItemPrivate::_q_present() -{ - if (q_ptr->isObscured()) { - q_ptr->update(boundingRect); - surface->setReady(true); - } else { - q_ptr->update(boundingRect); - } -} - -void QGraphicsVideoItemPrivate::_q_formatChanged(const QVideoSurfaceFormat &format) -{ - nativeSize = format.sizeHint(); - - updateRects(); - - emit q_ptr->nativeSizeChanged(nativeSize); -} - -void QGraphicsVideoItemPrivate::_q_serviceDestroyed() -{ - rendererControl = 0; - outputControl = 0; - service = 0; - - surface->stop(); -} - -void QGraphicsVideoItemPrivate::_q_mediaObjectDestroyed() -{ - mediaObject = 0; - - clearService(); -} - -/*! - \class QGraphicsVideoItem - \brief The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject. - - \since 4.7 - - \ingroup multimedia - - Attaching a QGraphicsVideoItem to a QMediaObject allows it to display - the video or image output of that media object. A QGraphicsVideoItem - is attached to a media object by passing a pointer to the QMediaObject - to the setMediaObject() function. - - \code - player = new QMediaPlayer(this); - - QGraphicsVideoItem *item = new QGraphicsVideoItem; - item->setMediaObject(player); - graphicsView->scence()->addItem(item); - graphicsView->show(); - - player->setMedia(video); - player->play(); - \endcode - - \bold {Note}: Only a single display output can be attached to a media - object at one time. - - \sa QMediaObject, QMediaPlayer, QVideoWidget -*/ - -/*! - Constructs a graphics item that displays video. - - The \a parent is passed to QGraphicsItem. -*/ -QGraphicsVideoItem::QGraphicsVideoItem(QGraphicsItem *parent) - : QGraphicsObject(parent) - , d_ptr(new QGraphicsVideoItemPrivate) -{ - d_ptr->q_ptr = this; - d_ptr->surface = new QPainterVideoSurface; - - connect(d_ptr->surface, SIGNAL(frameChanged()), this, SLOT(_q_present())); - connect(d_ptr->surface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), - this, SLOT(_q_formatChanged(QVideoSurfaceFormat))); -} - -/*! - Destroys a video graphics item. -*/ -QGraphicsVideoItem::~QGraphicsVideoItem() -{ - if (d_ptr->outputControl) - d_ptr->outputControl->setOutput(QVideoOutputControl::NoOutput); - - if (d_ptr->rendererControl) - d_ptr->rendererControl->setSurface(0); - - delete d_ptr->surface; - delete d_ptr; -} - -/*! - \property QGraphicsVideoItem::mediaObject - \brief the media object which provides the video displayed by a graphics - item. -*/ - -QMediaObject *QGraphicsVideoItem::mediaObject() const -{ - return d_func()->mediaObject; -} - -void QGraphicsVideoItem::setMediaObject(QMediaObject *object) -{ - Q_D(QGraphicsVideoItem); - - if (object == d->mediaObject) - return; - - d->clearService(); - - if (d->mediaObject) { - disconnect(d->mediaObject, SIGNAL(destroyed()), this, SLOT(_q_mediaObjectDestroyed())); - d->mediaObject->unbind(this); - } - - d->mediaObject = object; - - if (d->mediaObject) { - d->mediaObject->bind(this); - - connect(d->mediaObject, SIGNAL(destroyed()), this, SLOT(_q_mediaObjectDestroyed())); - - d->service = d->mediaObject->service(); - - if (d->service) { - connect(d->service, SIGNAL(destroyed()), this, SLOT(_q_serviceDestroyed())); - - d->outputControl = qobject_cast( - d->service->control(QVideoOutputControl_iid)); - d->rendererControl = qobject_cast( - d->service->control(QVideoRendererControl_iid)); - - if (d->outputControl != 0 && d->rendererControl != 0) { - d->rendererControl->setSurface(d->surface); - - if (isVisible()) - d->outputControl->setOutput(QVideoOutputControl::RendererOutput); - } - } - } -} - -/*! - \property QGraphicsVideoItem::aspectRatioMode - \brief how a video is scaled to fit the graphics item's size. -*/ - -Qt::AspectRatioMode QGraphicsVideoItem::aspectRatioMode() const -{ - return d_func()->aspectRatioMode; -} - -void QGraphicsVideoItem::setAspectRatioMode(Qt::AspectRatioMode mode) -{ - Q_D(QGraphicsVideoItem); - - d->aspectRatioMode = mode; - d->updateRects(); -} - -/*! - \property QGraphicsVideoItem::offset - \brief the video item's offset. - - QGraphicsVideoItem will draw video using the offset for its top left - corner. -*/ - -QPointF QGraphicsVideoItem::offset() const -{ - return d_func()->rect.topLeft(); -} - -void QGraphicsVideoItem::setOffset(const QPointF &offset) -{ - Q_D(QGraphicsVideoItem); - - d->rect.moveTo(offset); - d->updateRects(); -} - -/*! - \property QGraphicsVideoItem::size - \brief the video item's size. - - QGraphicsVideoItem will draw video scaled to fit size according to its - fillMode. -*/ - -QSizeF QGraphicsVideoItem::size() const -{ - return d_func()->rect.size(); -} - -void QGraphicsVideoItem::setSize(const QSizeF &size) -{ - Q_D(QGraphicsVideoItem); - - d->rect.setSize(size.isValid() ? size : QSizeF(0, 0)); - d->updateRects(); -} - -/*! - \property QGraphicsVideoItem::nativeSize - \brief the native size of the video. -*/ - -QSizeF QGraphicsVideoItem::nativeSize() const -{ - return d_func()->nativeSize; -} - -/*! - \fn QGraphicsVideoItem::nativeSizeChanged(const QSizeF &size) - - Signals that the native \a size of the video has changed. -*/ - -/*! - \reimp -*/ -QRectF QGraphicsVideoItem::boundingRect() const -{ - return d_func()->boundingRect; -} - -/*! - \reimp -*/ -void QGraphicsVideoItem::paint( - QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - Q_D(QGraphicsVideoItem); - - Q_UNUSED(option); - Q_UNUSED(widget); - - if (d->surface && d->surface->isActive()) { - d->surface->paint(painter, d->boundingRect, d->sourceRect); - d->surface->setReady(true); -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - } else if (d->updatePaintDevice && (painter->paintEngine()->type() == QPaintEngine::OpenGL - || painter->paintEngine()->type() == QPaintEngine::OpenGL2)) { - d->updatePaintDevice = false; - - d->surface->setGLContext(const_cast(QGLContext::currentContext())); - if (d->surface->supportedShaderTypes() & QPainterVideoSurface::GlslShader) { - d->surface->setShaderType(QPainterVideoSurface::GlslShader); - } else { - d->surface->setShaderType(QPainterVideoSurface::FragmentProgramShader); - } -#endif - } -} - -/*! - \reimp - - \internal -*/ -QVariant QGraphicsVideoItem::itemChange(GraphicsItemChange change, const QVariant &value) -{ - return QGraphicsObject::itemChange(change, value); -} - -/*! - \reimp - - \internal -*/ -bool QGraphicsVideoItem::event(QEvent *event) -{ - return QGraphicsObject::event(event); -} - -/*! - \reimp - - \internal -*/ -bool QGraphicsVideoItem::sceneEvent(QEvent *event) -{ - return QGraphicsObject::sceneEvent(event); -} - -QT_END_NAMESPACE -#include "moc_qgraphicsvideoitem.cpp" diff --git a/src/multimedia/base/qgraphicsvideoitem.h b/src/multimedia/base/qgraphicsvideoitem.h deleted file mode 100644 index e6f0d81..0000000 --- a/src/multimedia/base/qgraphicsvideoitem.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QGRAPHICSVIDEOITEM_H -#define QGRAPHICSVIDEOITEM_H - -#include - -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QVideoSurfaceFormat; - -class QGraphicsVideoItemPrivate; -class Q_MULTIMEDIA_EXPORT QGraphicsVideoItem : public QGraphicsObject -{ - Q_OBJECT - Q_PROPERTY(QMediaObject* mediaObject READ mediaObject WRITE setMediaObject) - Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode) - Q_PROPERTY(QPointF offset READ offset WRITE setOffset) - Q_PROPERTY(QSizeF size READ size WRITE setSize) - Q_PROPERTY(QSizeF nativeSize READ nativeSize NOTIFY nativeSizeChanged) -public: - QGraphicsVideoItem(QGraphicsItem *parent = 0); - ~QGraphicsVideoItem(); - - QMediaObject *mediaObject() const; - void setMediaObject(QMediaObject *object); - - Qt::AspectRatioMode aspectRatioMode() const; - void setAspectRatioMode(Qt::AspectRatioMode mode); - - QPointF offset() const; - void setOffset(const QPointF &offset); - - QSizeF size() const; - void setSize(const QSizeF &size); - - QSizeF nativeSize() const; - - QRectF boundingRect() const; - - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); - -Q_SIGNALS: - void nativeSizeChanged(const QSizeF &size); - -protected: - bool event(QEvent *event); - bool sceneEvent(QEvent *event); - - QVariant itemChange(GraphicsItemChange change, const QVariant &value); - - QGraphicsVideoItemPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QGraphicsVideoItem) - Q_PRIVATE_SLOT(d_func(), void _q_present()) - Q_PRIVATE_SLOT(d_func(), void _q_formatChanged(const QVideoSurfaceFormat &)) - Q_PRIVATE_SLOT(d_func(), void _q_serviceDestroyed()) - Q_PRIVATE_SLOT(d_func(), void _q_mediaObjectDestroyed()) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qlocalmediaplaylistprovider.cpp b/src/multimedia/base/qlocalmediaplaylistprovider.cpp deleted file mode 100644 index 40ff1fc..0000000 --- a/src/multimedia/base/qlocalmediaplaylistprovider.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediaplaylistprovider_p.h" -#include - - -QT_BEGIN_NAMESPACE - -class QLocalMediaPlaylistProviderPrivate: public QMediaPlaylistProviderPrivate -{ -public: - QList resources; -}; - -QLocalMediaPlaylistProvider::QLocalMediaPlaylistProvider(QObject *parent) - :QMediaPlaylistProvider(*new QLocalMediaPlaylistProviderPrivate, parent) -{ -} - -QLocalMediaPlaylistProvider::~QLocalMediaPlaylistProvider() -{ -} - -bool QLocalMediaPlaylistProvider::isReadOnly() const -{ - return false; -} - -int QLocalMediaPlaylistProvider::mediaCount() const -{ - return d_func()->resources.size(); -} - -QMediaContent QLocalMediaPlaylistProvider::media(int pos) const -{ - return d_func()->resources.value(pos); -} - -bool QLocalMediaPlaylistProvider::addMedia(const QMediaContent &content) -{ - Q_D(QLocalMediaPlaylistProvider); - - int pos = d->resources.count(); - - emit mediaAboutToBeInserted(pos, pos); - d->resources.append(content); - emit mediaInserted(pos, pos); - - return true; -} - -bool QLocalMediaPlaylistProvider::addMedia(const QList &items) -{ - Q_D(QLocalMediaPlaylistProvider); - - if (items.isEmpty()) - return true; - - int pos = d->resources.count(); - int end = pos+items.count()-1; - - emit mediaAboutToBeInserted(pos, end); - d->resources.append(items); - emit mediaInserted(pos, end); - - return true; -} - - -bool QLocalMediaPlaylistProvider::insertMedia(int pos, const QMediaContent &content) -{ - Q_D(QLocalMediaPlaylistProvider); - - emit mediaAboutToBeInserted(pos, pos); - d->resources.insert(pos, content); - emit mediaInserted(pos,pos); - - return true; -} - -bool QLocalMediaPlaylistProvider::insertMedia(int pos, const QList &items) -{ - Q_D(QLocalMediaPlaylistProvider); - - if (items.isEmpty()) - return true; - - const int last = pos+items.count()-1; - - emit mediaAboutToBeInserted(pos, last); - for (int i=0; iresources.insert(pos+i, items.at(i)); - emit mediaInserted(pos, last); - - return true; -} - -bool QLocalMediaPlaylistProvider::removeMedia(int fromPos, int toPos) -{ - Q_D(QLocalMediaPlaylistProvider); - - Q_ASSERT(fromPos >= 0); - Q_ASSERT(fromPos <= toPos); - Q_ASSERT(toPos < mediaCount()); - - emit mediaAboutToBeRemoved(fromPos, toPos); - d->resources.erase(d->resources.begin()+fromPos, d->resources.begin()+toPos+1); - emit mediaRemoved(fromPos, toPos); - - return true; -} - -bool QLocalMediaPlaylistProvider::removeMedia(int pos) -{ - Q_D(QLocalMediaPlaylistProvider); - - emit mediaAboutToBeRemoved(pos, pos); - d->resources.removeAt(pos); - emit mediaRemoved(pos, pos); - - return true; -} - -bool QLocalMediaPlaylistProvider::clear() -{ - Q_D(QLocalMediaPlaylistProvider); - if (!d->resources.isEmpty()) { - int lastPos = mediaCount()-1; - emit mediaAboutToBeRemoved(0, lastPos); - d->resources.clear(); - emit mediaRemoved(0, lastPos); - } - - return true; -} - -void QLocalMediaPlaylistProvider::shuffle() -{ - Q_D(QLocalMediaPlaylistProvider); - if (!d->resources.isEmpty()) { - QList resources; - - while (!d->resources.isEmpty()) { - resources.append(d->resources.takeAt(qrand() % d->resources.size())); - } - - d->resources = resources; - emit mediaChanged(0, mediaCount()-1); - } - -} - -#include "moc_qlocalmediaplaylistprovider.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qlocalmediaplaylistprovider.h b/src/multimedia/base/qlocalmediaplaylistprovider.h deleted file mode 100644 index db8deb1..0000000 --- a/src/multimedia/base/qlocalmediaplaylistprovider.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QLOCALMEDIAPAYLISTPROVIDER_H -#define QLOCALMEDIAPAYLISTPROVIDER_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QLocalMediaPlaylistProviderPrivate; -class Q_MULTIMEDIA_EXPORT QLocalMediaPlaylistProvider : public QMediaPlaylistProvider -{ - Q_OBJECT - -public: - QLocalMediaPlaylistProvider(QObject *parent=0); - virtual ~QLocalMediaPlaylistProvider(); - - virtual int mediaCount() const; - virtual QMediaContent media(int pos) const; - - virtual bool isReadOnly() const; - - virtual bool addMedia(const QMediaContent &content); - virtual bool addMedia(const QList &items); - virtual bool insertMedia(int pos, const QMediaContent &content); - virtual bool insertMedia(int pos, const QList &items); - virtual bool removeMedia(int pos); - virtual bool removeMedia(int start, int end); - virtual bool clear(); - -public Q_SLOTS: - virtual void shuffle(); - -private: - Q_DECLARE_PRIVATE(QLocalMediaPlaylistProvider) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QLOCALMEDIAPAYLISTSOURCE_H diff --git a/src/multimedia/base/qmediacontent.cpp b/src/multimedia/base/qmediacontent.cpp deleted file mode 100644 index b6bf56b..0000000 --- a/src/multimedia/base/qmediacontent.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 - - -QT_BEGIN_NAMESPACE - - -class QMediaContentPrivate : public QSharedData -{ -public: - QMediaContentPrivate() {} - QMediaContentPrivate(const QMediaResourceList &r): - resources(r) {} - - QMediaContentPrivate(const QMediaContentPrivate &other): - QSharedData(other), - resources(other.resources) - {} - - bool operator==(const QMediaContentPrivate &other) const - { - return resources == other.resources; - } - - QMediaResourceList resources; - -private: - QMediaContentPrivate& operator=(const QMediaContentPrivate &other); -}; - - -/*! - \class QMediaContent - \preliminary - \brief The QMediaContent class provides access to the resources relating to a media content. - \since 4.7 - - \ingroup multimedia - - QMediaContent is used within the multimedia framework as the logical handle - to media content. A QMediaContent object is composed of one or more - \l {QMediaResource}s where each resource provides the URL and format - information of a different encoding of the content. - - A non-null QMediaContent will always have a primary or canonical reference to - the content available through the canonicalUrl() or canonicalResource() - methods, any additional resources are optional. -*/ - - -/*! - Constructs a null QMediaContent. -*/ - -QMediaContent::QMediaContent() -{ -} - -/*! - Constructs a media content with \a url providing a reference to the content. -*/ - -QMediaContent::QMediaContent(const QUrl &url): - d(new QMediaContentPrivate) -{ - d->resources << QMediaResource(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. -*/ - -QMediaContent::QMediaContent(const QMediaResource &resource): - d(new QMediaContentPrivate) -{ - d->resources << resource; -} - -/*! - Constructs a media content with \a resources providing a reference to the content. -*/ - -QMediaContent::QMediaContent(const QMediaResourceList &resources): - d(new QMediaContentPrivate(resources)) -{ -} - -/*! - Constructs a copy of the media content \a other. -*/ - -QMediaContent::QMediaContent(const QMediaContent &other): - d(other.d) -{ -} - -/*! - Destroys the media content object. -*/ - -QMediaContent::~QMediaContent() -{ -} - -/*! - Assigns the value of \a other to this media content. -*/ - -QMediaContent& QMediaContent::operator=(const QMediaContent &other) -{ - d = other.d; - return *this; -} - -/*! - Returns true if \a other is equivalent to this media content; false otherwise. -*/ - -bool QMediaContent::operator==(const QMediaContent &other) const -{ - return (d.constData() == 0 && other.d.constData() == 0) || - (d.constData() != 0 && other.d.constData() != 0 && - *d.constData() == *other.d.constData()); -} - -/*! - Returns true if \a other is not equivalent to this media content; false otherwise. -*/ - -bool QMediaContent::operator!=(const QMediaContent &other) const -{ - return !(*this == other); -} - -/*! - Returns true if this media content is null (uninitialized); false otherwise. -*/ - -bool QMediaContent::isNull() const -{ - return d.constData() == 0; -} - -/*! - Returns a QUrl that represents that canonical resource for this media content. -*/ - -QUrl QMediaContent::canonicalUrl() const -{ - return canonicalResource().url(); -} - -/*! - Returns a QNetworkRequest that represents that canonical resource for this media content. -*/ - -QNetworkRequest QMediaContent::canonicalRequest() const -{ - return canonicalResource().request(); -} - -/*! - Returns a QMediaResource that represents that canonical resource for this media content. -*/ - -QMediaResource QMediaContent::canonicalResource() const -{ - return d.constData() != 0 - ? d->resources.value(0) - : QMediaResource(); -} - -/*! - Returns a list of alternative resources for this media content. The first item in this list - is always the canonical resource. -*/ - -QMediaResourceList QMediaContent::resources() const -{ - return d.constData() != 0 - ? d->resources - : QMediaResourceList(); -} - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qmediacontent.h b/src/multimedia/base/qmediacontent.h deleted file mode 100644 index 5a279c1..0000000 --- a/src/multimedia/base/qmediacontent.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIACONTENT_H -#define QMEDIACONTENT_H - -#include -#include - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QMediaContentPrivate; -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); - ~QMediaContent(); - - QMediaContent& operator=(const QMediaContent &other); - - bool operator==(const QMediaContent &other) const; - bool operator!=(const QMediaContent &other) const; - - bool isNull() const; - - QUrl canonicalUrl() const; - QNetworkRequest canonicalRequest() const; - QMediaResource canonicalResource() const; - - QMediaResourceList resources() const; - -private: - QSharedDataPointer d; -}; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QMediaContent) - -QT_END_HEADER - -#endif // QMEDIACONTENT_H diff --git a/src/multimedia/base/qmediacontrol.cpp b/src/multimedia/base/qmediacontrol.cpp deleted file mode 100644 index b84c49e..0000000 --- a/src/multimedia/base/qmediacontrol.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediacontrol_p.h" - - - -QT_BEGIN_NAMESPACE - -/*! - \class QMediaControl - \ingroup multimedia-serv - \since 4.7 - - \preliminary - \brief The QMediaControl class provides a base interface for media service controls. - - Media controls provide an interface to individual features provided by a media service. Most - services implement a principal control which exposes the core functionality of the service and - a number optional controls which expose any additional functionality. - - A pointer to a control implemented by a media service can be obtained using the - \l {QMediaService::control()}{control()} member of QMediaService. If the service doesn't - implement a control it will instead return a null pointer. - - \code - QMediaPlayerControl *control = qobject_cast( - service->control("com.nokia.Qt.QMediaPlayerControl/1.0")); - \endcode - - Alternatively if the IId of the control has been declared using Q_MEDIA_DECLARE_CONTROL - the template version of QMediaService::control() can be used to request the service without - explicitly passing the IId. - - \code - QMediaPlayerControl *control = service->control(); - \endcode - - Most application code will not interface directly with a media service's controls, instead the - QMediaObject which owns the service acts as an intermeditary between one or more controls and - the application. - - \sa QMediaService, QMediaObject -*/ - -/*! - \macro Q_MEDIA_DECLARE_CONTROL(Class, IId) - \relates QMediaControl - - The Q_MEDIA_DECLARE_CONTROL macro declares an \a IId for a \a Class that inherits from - QMediaControl. - - Declaring an IId for a QMediaControl allows an instance of that control to be requested from - QMediaService::control() without explicitly passing the IId. - - \code - QMediaPlayerControl *control = service->control(); - \endcode - - \sa QMediaService::control() -*/ - -/*! - Destroys a media control. -*/ - -QMediaControl::~QMediaControl() -{ - delete d_ptr; -} - -/*! - Constructs a media control with the given \a parent. -*/ - -QMediaControl::QMediaControl(QObject *parent) - : QObject(parent) - , d_ptr(new QMediaControlPrivate) -{ - d_ptr->q_ptr = this; -} - -/*! - \internal -*/ - -QMediaControl::QMediaControl(QMediaControlPrivate &dd, QObject *parent) - : QObject(parent) - , d_ptr(&dd) - -{ - d_ptr->q_ptr = this; -} - -#include "moc_qmediacontrol.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qmediacontrol.h b/src/multimedia/base/qmediacontrol.h deleted file mode 100644 index 8ed9fe8..0000000 --- a/src/multimedia/base/qmediacontrol.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QABSTRACTMEDIACONTROL_H -#define QABSTRACTMEDIACONTROL_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QMediaControlPrivate; -class Q_MULTIMEDIA_EXPORT QMediaControl : public QObject -{ - Q_OBJECT - -public: - ~QMediaControl(); - -protected: - QMediaControl(QObject *parent = 0); - QMediaControl(QMediaControlPrivate &dd, QObject *parent = 0); - - QMediaControlPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QMediaControl) -}; - -template const char *qmediacontrol_iid() { return 0; } - -#define Q_MEDIA_DECLARE_CONTROL(Class, IId) \ - template <> inline const char *qmediacontrol_iid() { return IId; } - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QABSTRACTMEDIACONTROL_H diff --git a/src/multimedia/base/qmediacontrol_p.h b/src/multimedia/base/qmediacontrol_p.h deleted file mode 100644 index 4d00f11..0000000 --- a/src/multimedia/base/qmediacontrol_p.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QABSTRACTMEDIACONTROL_P_H -#define QABSTRACTMEDIACONTROL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QMediaControl; - -class QMediaControlPrivate -{ -public: - virtual ~QMediaControlPrivate() {} - - QMediaControl *q_ptr; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qmediaobject.cpp b/src/multimedia/base/qmediaobject.cpp deleted file mode 100644 index 0422718..0000000 --- a/src/multimedia/base/qmediaobject.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediaobject_p.h" - -#include -#include - - -QT_BEGIN_NAMESPACE - -void QMediaObjectPrivate::_q_notify() -{ - Q_Q(QMediaObject); - - const QMetaObject* m = q->metaObject(); - - foreach (int pi, notifyProperties) { - QMetaProperty p = m->property(pi); - p.notifySignal().invoke( - q, QGenericArgument(QMetaType::typeName(p.userType()), p.read(q).data())); - } -} - - -/*! - \class QMediaObject - \preliminary - \brief The QMediaObject class provides a common base for multimedia objects. - \since 4.7 - - \ingroup multimedia - - QMediaObject derived classes provide access to the functionality of a - QMediaService. Each media object hosts a QMediaService and uses the - QMediaControl interfaces implemented by the service to implement its - API. Most media objects when constructed will request a new - QMediaService instance from a QMediaServiceProvider, but some like - QMediaRecorder will share a service with another object. - - QMediaObject itself provides an API for accessing a media service's \l {metaData()}{meta-data} and a means of connecting other media objects, - and peripheral classes like QVideoWidget and QMediaPlaylist. - - \sa QMediaService, QMediaControl -*/ - -/*! - Destroys a media object. -*/ - -QMediaObject::~QMediaObject() -{ - delete d_ptr; -} - -/*! - Returns the service availability error state. -*/ - -QtMultimedia::AvailabilityError QMediaObject::availabilityError() const -{ - return QtMultimedia::ServiceMissingError; -} - -/*! - Returns true if the service is available for use. -*/ - -bool QMediaObject::isAvailable() const -{ - return false; -} - -/*! - Returns the media service that provides the functionality of a multimedia object. -*/ - -QMediaService* QMediaObject::service() const -{ - return d_func()->service; -} - -int QMediaObject::notifyInterval() const -{ - return d_func()->notifyTimer->interval(); -} - -void QMediaObject::setNotifyInterval(int milliSeconds) -{ - Q_D(QMediaObject); - - if (d->notifyTimer->interval() != milliSeconds) { - d->notifyTimer->setInterval(milliSeconds); - - emit notifyIntervalChanged(milliSeconds); - } -} - -/*! - \internal -*/ -void QMediaObject::bind(QObject*) -{ -} - -/*! - \internal -*/ -void QMediaObject::unbind(QObject*) -{ -} - - -/*! - Constructs a media object which uses the functionality provided by a media \a service. - - The \a parent is passed to QObject. - - This class is meant as a base class for Multimedia objects so this - constructor is protected. -*/ - -QMediaObject::QMediaObject(QObject *parent, QMediaService *service): - QObject(parent), - d_ptr(new QMediaObjectPrivate) - -{ - Q_D(QMediaObject); - - d->q_ptr = this; - - d->notifyTimer = new QTimer(this); - d->notifyTimer->setInterval(1000); - connect(d->notifyTimer, SIGNAL(timeout()), SLOT(_q_notify())); - - d->service = service; - - setupMetaData(); -} - -/*! - \internal -*/ - -QMediaObject::QMediaObject(QMediaObjectPrivate &dd, QObject *parent, - QMediaService *service): - QObject(parent), - d_ptr(&dd) -{ - Q_D(QMediaObject); - d->q_ptr = this; - - d->notifyTimer = new QTimer(this); - d->notifyTimer->setInterval(1000); - connect(d->notifyTimer, SIGNAL(timeout()), SLOT(_q_notify())); - - d->service = service; - - setupMetaData(); -} - -/*! - Watch the property \a name. The property's notify signal will be emitted - once every notifyInterval milliseconds. - - \sa notifyInterval -*/ - -void QMediaObject::addPropertyWatch(QByteArray const &name) -{ - Q_D(QMediaObject); - - const QMetaObject* m = metaObject(); - - int index = m->indexOfProperty(name.constData()); - - if (index != -1 && m->property(index).hasNotifySignal()) { - d->notifyProperties.insert(index); - - if (!d->notifyTimer->isActive()) - d->notifyTimer->start(); - } -} - -/*! - Remove property \a name from the list of properties whose changes are - regularly signaled. - - \sa notifyInterval -*/ - -void QMediaObject::removePropertyWatch(QByteArray const &name) -{ - Q_D(QMediaObject); - - int index = metaObject()->indexOfProperty(name.constData()); - - if (index != -1) { - d->notifyProperties.remove(index); - - if (d->notifyProperties.isEmpty()) - d->notifyTimer->stop(); - } -} - -/*! - \property QMediaObject::notifyInterval - - The interval at which notifiable properties will update. - - The interval is expressed in milliseconds, the default value is 1000. - - \sa addPropertyWatch(), removePropertyWatch() -*/ - -/*! - \fn void QMediaObject::notifyIntervalChanged(int milliseconds) - - Signal a change in the notify interval period to \a milliseconds. -*/ - -/*! - \property QMediaObject::metaDataAvailable - \brief whether access to a media object's meta-data is available. - - If this is true there is meta-data available, otherwise there is no meta-data available. -*/ - -bool QMediaObject::isMetaDataAvailable() const -{ - Q_D(const QMediaObject); - - return d->metaDataControl - ? d->metaDataControl->isMetaDataAvailable() - : false; -} - -/*! - \fn QMediaObject::metaDataAvailableChanged(bool available) - - Signals that the \a available state of a media object's meta-data has changed. -*/ - -/*! - \property QMediaObject::metaDataWritable - \brief whether a media object's meta-data is writable. - - If this is true the meta-data is writable, otherwise the meta-data is read-only. -*/ - -bool QMediaObject::isMetaDataWritable() const -{ - Q_D(const QMediaObject); - - return d->metaDataControl - ? d->metaDataControl->isWritable() - : false; -} - -/*! - \fn QMediaObject::metaDataWritableChanged(bool writable) - - Signals that the \a writable state of a media object's meta-data has changed. -*/ - -/*! - Returns the value associated with a meta-data \a key. -*/ -QVariant QMediaObject::metaData(QtMultimedia::MetaData key) const -{ - Q_D(const QMediaObject); - - return d->metaDataControl - ? d->metaDataControl->metaData(key) - : QVariant(); -} - -/*! - Sets a \a value for a meta-data \a key. -*/ -void QMediaObject::setMetaData(QtMultimedia::MetaData key, const QVariant &value) -{ - Q_D(QMediaObject); - - if (d->metaDataControl) - d->metaDataControl->setMetaData(key, value); -} - -/*! - Returns a list of keys there is meta-data available for. -*/ -QList QMediaObject::availableMetaData() const -{ - Q_D(const QMediaObject); - - return d->metaDataControl - ? d->metaDataControl->availableMetaData() - : QList(); -} - -/*! - \fn QMediaObject::metaDataChanged() - - Signals that a media object's meta-data has changed. -*/ - -/*! - Returns the value associated with a meta-data \a key. - - The naming and type of extended meta-data is not standardized, so the values and meaning - of keys may vary between backends. -*/ -QVariant QMediaObject::extendedMetaData(const QString &key) const -{ - Q_D(const QMediaObject); - - return d->metaDataControl - ? d->metaDataControl->extendedMetaData(key) - : QVariant(); -} - -/*! - Sets a \a value for a meta-data \a key. - - The naming and type of extended meta-data is not standardized, so the values and meaning - of keys may vary between backends. -*/ -void QMediaObject::setExtendedMetaData(const QString &key, const QVariant &value) -{ - Q_D(QMediaObject); - - if (d->metaDataControl) - d->metaDataControl->setExtendedMetaData(key, value); -} - -/*! - Returns a list of keys there is extended meta-data available for. -*/ -QStringList QMediaObject::availableExtendedMetaData() const -{ - Q_D(const QMediaObject); - - return d->metaDataControl - ? d->metaDataControl->availableExtendedMetaData() - : QStringList(); -} - - -void QMediaObject::setupMetaData() -{ - Q_D(QMediaObject); - - if (d->service != 0) { - d->metaDataControl = - qobject_cast(d->service->control(QMetaDataControl_iid)); - - if (d->metaDataControl) { - connect(d->metaDataControl, SIGNAL(metaDataChanged()), SIGNAL(metaDataChanged())); - connect(d->metaDataControl, - SIGNAL(metaDataAvailableChanged(bool)), - SIGNAL(metaDataAvailableChanged(bool))); - connect(d->metaDataControl, - SIGNAL(writableChanged(bool)), - SIGNAL(metaDataWritableChanged(bool))); - } - } -} - -/*! - \fn QMediaObject::availabilityChanged(bool available) - - Signal emitted when the availability state has changed to \a available -*/ - - -#include "moc_qmediaobject.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qmediaobject.h b/src/multimedia/base/qmediaobject.h deleted file mode 100644 index d09b1af..0000000 --- a/src/multimedia/base/qmediaobject.h +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QABSTRACTMEDIAOBJECT_H -#define QABSTRACTMEDIAOBJECT_H - -#include -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QMediaService; - -class QMediaObjectPrivate; -class Q_MULTIMEDIA_EXPORT QMediaObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(int notifyInterval READ notifyInterval WRITE setNotifyInterval NOTIFY notifyIntervalChanged) - Q_PROPERTY(bool metaDataAvailable READ isMetaDataAvailable NOTIFY metaDataAvailableChanged) - Q_PROPERTY(bool metaDataWritable READ isMetaDataWritable NOTIFY metaDataWritableChanged) - -public: - ~QMediaObject(); - - virtual bool isAvailable() const; - virtual QtMultimedia::AvailabilityError availabilityError() const; - - virtual QMediaService* service() const; - - int notifyInterval() const; - void setNotifyInterval(int milliSeconds); - - virtual void bind(QObject*); - virtual void unbind(QObject*); - - bool isMetaDataAvailable() const; - bool isMetaDataWritable() const; - - QVariant metaData(QtMultimedia::MetaData key) const; - void setMetaData(QtMultimedia::MetaData key, const QVariant &value); - QList availableMetaData() const; - - QVariant extendedMetaData(const QString &key) const; - void setExtendedMetaData(const QString &key, const QVariant &value); - QStringList availableExtendedMetaData() const; - -Q_SIGNALS: - void notifyIntervalChanged(int milliSeconds); - - void metaDataAvailableChanged(bool available); - void metaDataWritableChanged(bool writable); - void metaDataChanged(); - - void availabilityChanged(bool available); - -protected: - QMediaObject(QObject *parent, QMediaService *service); - QMediaObject(QMediaObjectPrivate &dd, QObject *parent, QMediaService *service); - - void addPropertyWatch(QByteArray const &name); - void removePropertyWatch(QByteArray const &name); - - QMediaObjectPrivate *d_ptr; - -private: - void setupMetaData(); - - Q_DECLARE_PRIVATE(QMediaObject) - Q_PRIVATE_SLOT(d_func(), void _q_notify()) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - - -#endif // QABSTRACTMEDIAOBJECT_H diff --git a/src/multimedia/base/qmediaobject_p.h b/src/multimedia/base/qmediaobject_p.h deleted file mode 100644 index ec2f75a..0000000 --- a/src/multimedia/base/qmediaobject_p.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QABSTRACTMEDIAOBJECT_P_H -#define QABSTRACTMEDIAOBJECT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QMetaDataControl; - -#define Q_DECLARE_NON_CONST_PUBLIC(Class) \ - inline Class* q_func() { return static_cast(q_ptr); } \ - friend class Class; - - -class QMediaObjectPrivate -{ - Q_DECLARE_PUBLIC(QMediaObject) - -public: - QMediaObjectPrivate():metaDataControl(0), notifyTimer(0) {} - virtual ~QMediaObjectPrivate() {} - - void _q_notify(); - - QMediaService *service; - QMetaDataControl *metaDataControl; - QTimer* notifyTimer; - QSet notifyProperties; - - QMediaObject *q_ptr; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qmediaplaylist.cpp b/src/multimedia/base/qmediaplaylist.cpp deleted file mode 100644 index b3f3dd3..0000000 --- a/src/multimedia/base/qmediaplaylist.cpp +++ /dev/null @@ -1,724 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 -#include - -#include -#include "qmediaplaylist_p.h" -#include -#include -#include -#include -#include -#include - -#include "qmediapluginloader_p.h" - - -QT_BEGIN_NAMESPACE - -Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, playlistIOLoader, - (QMediaPlaylistIOInterface_iid, QLatin1String("/playlistformats"), Qt::CaseInsensitive)) - - -/*! - \class QMediaPlaylist - \ingroup multimedia - \since 4.7 - - \preliminary - \brief The QMediaPlaylist class provides a list of media content to play. - - QMediaPlaylist is intended to be used with other media objects, - like QMediaPlayer or QMediaImageViewer. - QMediaPlaylist allows to access the service intrinsic playlist functionality - if available, otherwise it provides the the local memory playlist implementation. - -\code - player = new QMediaPlayer; - - playlist = new QMediaPlaylist; - playlist->setMediaObject(player); - playlist->append(QUrl("http://example.com/movie1.mp4")); - playlist->append(QUrl("http://example.com/movie2.mp4")); - playlist->append(QUrl("http://example.com/movie3.mp4")); - - playlist->setCurrentIndex(1); - - player->play(); -\endcode - - Depending on playlist source implementation, - most of playlist modifcation operations can be asynchronous. - - \sa QMediaContent -*/ - - -/*! - \enum QMediaPlaylist::PlaybackMode - - The QMediaPlaylist::PlaybackMode describes the order items in playlist are played. - - \value CurrentItemOnce The current item is played only once. - - \value CurrentItemInLoop The current item is played in the loop. - - \value Linear Playback starts from the first to the last items and stops. - next item is a null item when the last one is currently playing. - - \value Loop Playback continues from the first item after the last one finished playing. - - \value Random Play items in random order. -*/ - - - -/*! - Create a new playlist object for with the given \a parent. -*/ - -QMediaPlaylist::QMediaPlaylist(QObject *parent) - : QObject(parent) - , d_ptr(new QMediaPlaylistPrivate) -{ - Q_D(QMediaPlaylist); - - d->q_ptr = this; - d->localPlaylistControl = new QLocalMediaPlaylistControl(this); - - setMediaObject(0); -} - -/*! - Destroys the playlist. - */ - -QMediaPlaylist::~QMediaPlaylist() -{ - Q_D(QMediaPlaylist); - - if (d->mediaObject) - d->mediaObject->unbind(this); - - delete d_ptr; -} - -/*! - Returns the QMediaObject that is being used to play the contents of this playlist. -*/ - -QMediaObject *QMediaPlaylist::mediaObject() const -{ - return d_func()->mediaObject; -} - -/*! - If \a mediaObject is null or doesn't have an intrinsic playlist, - internal local memory playlist source will be created. -*/ -void QMediaPlaylist::setMediaObject(QMediaObject *mediaObject) -{ - Q_D(QMediaPlaylist); - - if (mediaObject && mediaObject == d->mediaObject) - return; - - QMediaService *service = mediaObject - ? mediaObject->service() : 0; - - QMediaPlaylistControl *newControl = 0; - - if (service) - newControl = qobject_cast(service->control(QMediaPlaylistControl_iid)); - - if (!newControl) - newControl = d->localPlaylistControl; - - if (d->control != newControl) { - int oldSize = 0; - if (d->control) { - QMediaPlaylistProvider *playlist = d->control->playlistProvider(); - oldSize = playlist->mediaCount(); - disconnect(playlist, SIGNAL(loadFailed(QMediaPlaylist::Error,QString)), - this, SLOT(_q_loadFailed(QMediaPlaylist::Error,QString))); - - disconnect(playlist, SIGNAL(mediaChanged(int,int)), this, SIGNAL(mediaChanged(int,int))); - disconnect(playlist, SIGNAL(mediaAboutToBeInserted(int,int)), this, SIGNAL(mediaAboutToBeInserted(int,int))); - disconnect(playlist, SIGNAL(mediaInserted(int,int)), this, SIGNAL(mediaInserted(int,int))); - disconnect(playlist, SIGNAL(mediaAboutToBeRemoved(int,int)), this, SIGNAL(mediaAboutToBeRemoved(int,int))); - disconnect(playlist, SIGNAL(mediaRemoved(int,int)), this, SIGNAL(mediaRemoved(int,int))); - - disconnect(playlist, SIGNAL(loaded()), this, SIGNAL(loaded())); - - disconnect(d->control, SIGNAL(playbackModeChanged(QMediaPlaylist::PlaybackMode)), - this, SIGNAL(playbackModeChanged(QMediaPlaylist::PlaybackMode))); - disconnect(d->control, SIGNAL(currentIndexChanged(int)), - this, SIGNAL(currentIndexChanged(int))); - disconnect(d->control, SIGNAL(currentMediaChanged(QMediaContent)), - this, SIGNAL(currentMediaChanged(QMediaContent))); - } - - d->control = newControl; - QMediaPlaylistProvider *playlist = d->control->playlistProvider(); - connect(playlist, SIGNAL(loadFailed(QMediaPlaylist::Error,QString)), - this, SLOT(_q_loadFailed(QMediaPlaylist::Error,QString))); - - connect(playlist, SIGNAL(mediaChanged(int,int)), this, SIGNAL(mediaChanged(int,int))); - connect(playlist, SIGNAL(mediaAboutToBeInserted(int,int)), this, SIGNAL(mediaAboutToBeInserted(int,int))); - connect(playlist, SIGNAL(mediaInserted(int,int)), this, SIGNAL(mediaInserted(int,int))); - connect(playlist, SIGNAL(mediaAboutToBeRemoved(int,int)), this, SIGNAL(mediaAboutToBeRemoved(int,int))); - connect(playlist, SIGNAL(mediaRemoved(int,int)), this, SIGNAL(mediaRemoved(int,int))); - - connect(playlist, SIGNAL(loaded()), this, SIGNAL(loaded())); - - connect(d->control, SIGNAL(playbackModeChanged(QMediaPlaylist::PlaybackMode)), - this, SIGNAL(playbackModeChanged(QMediaPlaylist::PlaybackMode))); - connect(d->control, SIGNAL(currentIndexChanged(int)), - this, SIGNAL(currentIndexChanged(int))); - connect(d->control, SIGNAL(currentMediaChanged(QMediaContent)), - this, SIGNAL(currentMediaChanged(QMediaContent))); - - if (oldSize) - emit mediaRemoved(0, oldSize-1); - - if (playlist->mediaCount()) { - emit mediaAboutToBeInserted(0,playlist->mediaCount()-1); - emit mediaInserted(0,playlist->mediaCount()-1); - } - } - - if (d->mediaObject) - d->mediaObject->unbind(this); - - d->mediaObject = mediaObject; - if (d->mediaObject) - d->mediaObject->bind(this); -} - -/*! - \property QMediaPlaylist::playbackMode - - This property defines the order, items in playlist are played. - - \sa QMediaPlaylist::PlaybackMode -*/ - -QMediaPlaylist::PlaybackMode QMediaPlaylist::playbackMode() const -{ - return d_func()->control->playbackMode(); -} - -void QMediaPlaylist::setPlaybackMode(QMediaPlaylist::PlaybackMode mode) -{ - Q_D(QMediaPlaylist); - d->control->setPlaybackMode(mode); -} - -/*! - Returns position of the current media source in the playlist. -*/ -int QMediaPlaylist::currentIndex() const -{ - return d_func()->control->currentIndex(); -} - -/*! - Returns the current media content. -*/ - -QMediaContent QMediaPlaylist::currentMedia() const -{ - return d_func()->playlist()->media(currentIndex()); -} - -/*! - Returns the index of item, which were current after calling next() - \a steps times. - - Returned value depends on the size of playlist, current position - and playback mode. - - \sa QMediaPlaylist::playbackMode -*/ -int QMediaPlaylist::nextIndex(int steps) const -{ - return d_func()->control->nextIndex(steps); -} - -/*! - Returns the index of item, which were current after calling previous() - \a steps times. - - \sa QMediaPlaylist::playbackMode -*/ - -int QMediaPlaylist::previousIndex(int steps) const -{ - return d_func()->control->previousIndex(steps); -} - - -/*! - Returns the number of items in the playlist. - - \sa isEmpty() - */ -int QMediaPlaylist::mediaCount() const -{ - return d_func()->playlist()->mediaCount(); -} - -/*! - Returns true if the playlist contains no items; otherwise returns false. - \sa mediaCount() - */ -bool QMediaPlaylist::isEmpty() const -{ - return mediaCount() == 0; -} - -/*! - Returns true if the playlist can be modified; otherwise returns false. - \sa mediaCount() - */ -bool QMediaPlaylist::isReadOnly() const -{ - return d_func()->playlist()->isReadOnly(); -} - -/*! - Returns the media content at \a index in the playlist. -*/ - -QMediaContent QMediaPlaylist::media(int index) const -{ - return d_func()->playlist()->media(index); -} - -/*! - Append the media \a content to the playlist. - - Returns true if the operation is successfull, other wise return false. - */ -bool QMediaPlaylist::addMedia(const QMediaContent &content) -{ - return d_func()->control->playlistProvider()->addMedia(content); -} - -/*! - Append multiple media content \a items to the playlist. - - Returns true if the operation is successfull, other wise return false. - */ -bool QMediaPlaylist::addMedia(const QList &items) -{ - return d_func()->control->playlistProvider()->addMedia(items); -} - -/*! - Insert the media \a content to the playlist at position \a pos. - - Returns true if the operation is successful, otherwise false. -*/ - -bool QMediaPlaylist::insertMedia(int pos, const QMediaContent &content) -{ - return d_func()->playlist()->insertMedia(pos, content); -} - -/*! - Insert multiple media content \a items to the playlist at position \a pos. - - Returns true if the operation is successful, otherwise false. -*/ - -bool QMediaPlaylist::insertMedia(int pos, const QList &items) -{ - return d_func()->playlist()->insertMedia(pos, items); -} - -/*! - Remove the item from the playlist at position \a pos. - - Returns true if the operation is successfull, other wise return false. - */ -bool QMediaPlaylist::removeMedia(int pos) -{ - Q_D(QMediaPlaylist); - return d->playlist()->removeMedia(pos); -} - -/*! - Remove the items from the playlist from position \a start to \a end inclusive. - - Returns true if the operation is successfull, other wise return false. - */ -bool QMediaPlaylist::removeMedia(int start, int end) -{ - Q_D(QMediaPlaylist); - return d->playlist()->removeMedia(start, end); -} - -/*! - Remove all the items from the playlist. - - Returns true if the operation is successfull, other wise return false. - */ -bool QMediaPlaylist::clear() -{ - Q_D(QMediaPlaylist); - return d->playlist()->clear(); -} - -bool QMediaPlaylistPrivate::readItems(QMediaPlaylistReader *reader) -{ - while (!reader->atEnd()) - playlist()->addMedia(reader->readItem()); - - return true; -} - -bool QMediaPlaylistPrivate::writeItems(QMediaPlaylistWriter *writer) -{ - for (int i=0; imediaCount(); i++) { - if (!writer->writeItem(playlist()->media(i))) - return false; - } - writer->close(); - return true; -} - -/*! - Load playlist from \a location. If \a format is specified, it is used, - otherwise format is guessed from location name and data. - - New items are appended to playlist. - - QMediaPlaylist::loaded() signal is emited if playlist was loaded succesfully, - otherwise the playlist emits loadFailed(). -*/ -void QMediaPlaylist::load(const QUrl &location, const char *format) -{ - Q_D(QMediaPlaylist); - - d->error = NoError; - d->errorString.clear(); - - if (d->playlist()->load(location,format)) - return; - - if (isReadOnly()) { - d->error = AccessDeniedError; - d->errorString = tr("Could not add items to read only playlist."); - emit loadFailed(); - return; - } - - foreach (QString const& key, playlistIOLoader()->keys()) { - QMediaPlaylistIOInterface* plugin = qobject_cast(playlistIOLoader()->instance(key)); - if (plugin && plugin->canRead(location,format)) { - QMediaPlaylistReader *reader = plugin->createReader(location,QByteArray(format)); - if (reader && d->readItems(reader)) { - delete reader; - emit loaded(); - return; - } - delete reader; - } - } - - d->error = FormatNotSupportedError; - d->errorString = tr("Playlist format is not supported"); - emit loadFailed(); - - return; -} - -/*! - Load playlist from QIODevice \a device. If \a format is specified, it is used, - otherwise format is guessed from device data. - - New items are appended to playlist. - - QMediaPlaylist::loaded() signal is emited if playlist was loaded succesfully, - otherwise the playlist emits loadFailed(). -*/ -void QMediaPlaylist::load(QIODevice * device, const char *format) -{ - Q_D(QMediaPlaylist); - - d->error = NoError; - d->errorString.clear(); - - if (d->playlist()->load(device,format)) - return; - - if (isReadOnly()) { - d->error = AccessDeniedError; - d->errorString = tr("Could not add items to read only playlist."); - emit loadFailed(); - return; - } - - foreach (QString const& key, playlistIOLoader()->keys()) { - QMediaPlaylistIOInterface* plugin = qobject_cast(playlistIOLoader()->instance(key)); - if (plugin && plugin->canRead(device,format)) { - QMediaPlaylistReader *reader = plugin->createReader(device,QByteArray(format)); - if (reader && d->readItems(reader)) { - delete reader; - emit loaded(); - return; - } - delete reader; - } - } - - d->error = FormatNotSupportedError; - d->errorString = tr("Playlist format is not supported"); - emit loadFailed(); - - return; -} - -/*! - Save playlist to \a location. If \a format is specified, it is used, - otherwise format is guessed from location name. - - Returns true if playlist was saved succesfully, otherwise returns false. - */ -bool QMediaPlaylist::save(const QUrl &location, const char *format) -{ - Q_D(QMediaPlaylist); - - d->error = NoError; - d->errorString.clear(); - - if (d->playlist()->save(location,format)) - return true; - - QFile file(location.toLocalFile()); - - if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - d->error = AccessDeniedError; - d->errorString = tr("The file could not be accessed."); - return false; - } - - return save(&file, format); -} - -/*! - Save playlist to QIODevice \a device using format \a format. - - Returns true if playlist was saved succesfully, otherwise returns false. -*/ -bool QMediaPlaylist::save(QIODevice * device, const char *format) -{ - Q_D(QMediaPlaylist); - - d->error = NoError; - d->errorString.clear(); - - if (d->playlist()->save(device,format)) - return true; - - foreach (QString const& key, playlistIOLoader()->keys()) { - QMediaPlaylistIOInterface* plugin = qobject_cast(playlistIOLoader()->instance(key)); - if (plugin && plugin->canWrite(device,format)) { - QMediaPlaylistWriter *writer = plugin->createWriter(device,QByteArray(format)); - if (writer && d->writeItems(writer)) { - delete writer; - return true; - } - delete writer; - } - } - - d->error = FormatNotSupportedError; - d->errorString = tr("Playlist format is not supported."); - - return false; -} - -/*! - Returns the last error condition. -*/ -QMediaPlaylist::Error QMediaPlaylist::error() const -{ - return d_func()->error; -} - -/*! - Returns the string describing the last error condition. -*/ -QString QMediaPlaylist::errorString() const -{ - return d_func()->errorString; -} - -/*! - Shuffle items in the playlist. -*/ -void QMediaPlaylist::shuffle() -{ - d_func()->playlist()->shuffle(); -} - - -/*! - Advance to the next media content in playlist. -*/ -void QMediaPlaylist::next() -{ - d_func()->control->next(); -} - -/*! - Return to the previous media content in playlist. -*/ -void QMediaPlaylist::previous() -{ - d_func()->control->previous(); -} - -/*! - Activate media content from playlist at position \a playlistPosition. -*/ - -void QMediaPlaylist::setCurrentIndex(int playlistPosition) -{ - d_func()->control->setCurrentIndex(playlistPosition); -} - -/*! - \fn void QMediaPlaylist::mediaInserted(int start, int end) - - This signal is emitted after media has been inserted into the playlist. - The new items are those between \a start and \a end inclusive. - */ - -/*! - \fn void QMediaPlaylist::mediaRemoved(int start, int end) - - This signal is emitted after media has been removed from the playlist. - The removed items are those between \a start and \a end inclusive. - */ - -/*! - \fn void QMediaPlaylist::mediaChanged(int start, int end) - - This signal is emitted after media has been changed in the playlist - between \a start and \a end positions inclusive. - */ - -/*! - \fn void QMediaPlaylist::currentIndexChanged(int position) - - Signal emitted when playlist position changed to \a position. -*/ - -/*! - \fn void QMediaPlaylist::playbackModeChanged(QMediaPlaylist::PlaybackMode mode) - - Signal emitted when playback mode changed to \a mode. -*/ - -/*! - \fn void QMediaPlaylist::mediaAboutToBeInserted(int start, int end) - - Signal emitted when item to be inserted at \a start and ending at \a end. -*/ - -/*! - \fn void QMediaPlaylist::mediaAboutToBeRemoved(int start, int end) - - Signal emitted when item to de deleted ar \a start and ending at \a end. -*/ - -/*! - \fn void QMediaPlaylist::currentMediaChanged(const QMediaContent &content) - - Signal emitted when current media changes to \a content. -*/ - -/*! - \property QMediaPlaylist::currentIndex - \brief Current position. -*/ - -/*! - \property QMediaPlaylist::currentMedia - \brief Current media content. -*/ - -/*! - \fn QMediaPlaylist::loaded() - - Signal emitted when playlist finished loading. -*/ - -/*! - \fn QMediaPlaylist::loadFailed() - - Signal emitted if failed to load playlist. -*/ - -/*! - \enum QMediaPlaylist::Error - - This enum describes the QMediaPlaylist error codes. - - \value NoError No errors. - \value FormatError Format error. - \value FormatNotSupportedError Format not supported. - \value NetworkError Network error. - \value AccessDeniedError Access denied error. -*/ - -QT_END_NAMESPACE - -#include "moc_qmediaplaylist.cpp" -#include "moc_qmediaplaylist_p.cpp" diff --git a/src/multimedia/base/qmediaplaylist.h b/src/multimedia/base/qmediaplaylist.h deleted file mode 100644 index 494cf11..0000000 --- a/src/multimedia/base/qmediaplaylist.h +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIAPLAYLIST_H -#define QMEDIAPLAYLIST_H - -#include - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QMediaPlaylistProvider; - -class QMediaPlaylistPrivate; -class Q_MULTIMEDIA_EXPORT QMediaPlaylist : public QObject -{ - Q_OBJECT - Q_PROPERTY(QMediaPlaylist::PlaybackMode playbackMode READ playbackMode WRITE setPlaybackMode NOTIFY playbackModeChanged) - Q_PROPERTY(QMediaContent currentMedia READ currentMedia NOTIFY currentMediaChanged) - Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) - Q_ENUMS(PlaybackMode Error) - -public: - enum PlaybackMode { CurrentItemOnce, CurrentItemInLoop, Linear, Loop, Random }; - enum Error { NoError, FormatError, FormatNotSupportedError, NetworkError, AccessDeniedError }; - - QMediaPlaylist(QObject *parent = 0); - virtual ~QMediaPlaylist(); - - QMediaObject *mediaObject() const; - void setMediaObject(QMediaObject *object); - - PlaybackMode playbackMode() const; - void setPlaybackMode(PlaybackMode mode); - - int currentIndex() const; - QMediaContent currentMedia() const; - - int nextIndex(int steps = 1) const; - int previousIndex(int steps = 1) const; - - QMediaContent media(int index) const; - - int mediaCount() const; - bool isEmpty() const; - bool isReadOnly() const; - - bool addMedia(const QMediaContent &content); - bool addMedia(const QList &items); - bool insertMedia(int index, const QMediaContent &content); - bool insertMedia(int index, const QList &items); - bool removeMedia(int pos); - bool removeMedia(int start, int end); - bool clear(); - - void load(const QUrl &location, const char *format = 0); - void load(QIODevice * device, const char *format = 0); - - bool save(const QUrl &location, const char *format = 0); - bool save(QIODevice * device, const char *format); - - Error error() const; - QString errorString() const; - -public Q_SLOTS: - void shuffle(); - - void next(); - void previous(); - - void setCurrentIndex(int index); - -Q_SIGNALS: - void currentIndexChanged(int index); - void playbackModeChanged(QMediaPlaylist::PlaybackMode mode); - void currentMediaChanged(const QMediaContent&); - - void mediaAboutToBeInserted(int start, int end); - void mediaInserted(int start, int end); - void mediaAboutToBeRemoved(int start, int end); - void mediaRemoved(int start, int end); - void mediaChanged(int start, int end); - - void loaded(); - void loadFailed(); - -protected: - QMediaPlaylistPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QMediaPlaylist) - Q_PRIVATE_SLOT(d_func(), void _q_loadFailed(QMediaPlaylist::Error, const QString &)) -}; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QMediaPlaylist::PlaybackMode) -Q_DECLARE_METATYPE(QMediaPlaylist::Error) - -QT_END_HEADER - -#endif // QMEDIAPLAYLIST_H diff --git a/src/multimedia/base/qmediaplaylist_p.h b/src/multimedia/base/qmediaplaylist_p.h deleted file mode 100644 index da529b7..0000000 --- a/src/multimedia/base/qmediaplaylist_p.h +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIAPLAYLIST_P_H -#define QMEDIAPLAYLIST_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include -#include -#include "qmediaobject_p.h" - -#include - -#ifdef Q_MOC_RUN -# pragma Q_MOC_EXPAND_MACROS -#endif - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QMediaPlaylistControl; -class QMediaPlaylistProvider; -class QMediaPlaylistReader; -class QMediaPlaylistWriter; -class QMediaPlayerControl; - -class QMediaPlaylistPrivate -{ - Q_DECLARE_PUBLIC(QMediaPlaylist) -public: - QMediaPlaylistPrivate() - :mediaObject(0), - control(0), - localPlaylistControl(0), - error(QMediaPlaylist::NoError) - { - } - - virtual ~QMediaPlaylistPrivate() {} - - void _q_loadFailed(QMediaPlaylist::Error error, const QString &errorString) - { - this->error = error; - this->errorString = errorString; - - emit q_ptr->loadFailed(); - } - - void _q_mediaObjectDeleted() - { - Q_Q(QMediaPlaylist); - mediaObject = 0; - if (control != localPlaylistControl) - control = 0; - q->setMediaObject(0); - } - - QMediaObject *mediaObject; - - QMediaPlaylistControl *control; - QMediaPlaylistProvider *playlist() const { return control->playlistProvider(); } - - QMediaPlaylistControl *localPlaylistControl; - - bool readItems(QMediaPlaylistReader *reader); - bool writeItems(QMediaPlaylistWriter *writer); - - QMediaPlaylist::Error error; - QString errorString; - - QMediaPlaylist *q_ptr; -}; - - -class QLocalMediaPlaylistControl : public QMediaPlaylistControl -{ - Q_OBJECT -public: - QLocalMediaPlaylistControl(QObject *parent) - :QMediaPlaylistControl(parent) - { - QMediaPlaylistProvider *playlist = new QLocalMediaPlaylistProvider(this); - m_navigator = new QMediaPlaylistNavigator(playlist,this); - m_navigator->setPlaybackMode(QMediaPlaylist::Linear); - - connect(m_navigator, SIGNAL(currentIndexChanged(int)), SIGNAL(currentIndexChanged(int))); - connect(m_navigator, SIGNAL(activated(QMediaContent)), SIGNAL(currentMediaChanged(QMediaContent))); - } - - virtual ~QLocalMediaPlaylistControl() {}; - - QMediaPlaylistProvider* playlistProvider() const { return m_navigator->playlist(); } - bool setPlaylistProvider(QMediaPlaylistProvider *mediaPlaylist) - { - m_navigator->setPlaylist(mediaPlaylist); - emit playlistProviderChanged(); - return true; - } - - int currentIndex() const { return m_navigator->currentIndex(); } - void setCurrentIndex(int position) { m_navigator->jump(position); } - int nextIndex(int steps) const { return m_navigator->nextIndex(steps); } - int previousIndex(int steps) const { return m_navigator->previousIndex(steps); } - - void next() { m_navigator->next(); } - void previous() { m_navigator->previous(); } - - QMediaPlaylist::PlaybackMode playbackMode() const { return m_navigator->playbackMode(); } - void setPlaybackMode(QMediaPlaylist::PlaybackMode mode) { m_navigator->setPlaybackMode(mode); } - -private: - QMediaPlaylistNavigator *m_navigator; -}; - - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIAPLAYLIST_P_H diff --git a/src/multimedia/base/qmediaplaylistcontrol.cpp b/src/multimedia/base/qmediaplaylistcontrol.cpp deleted file mode 100644 index ba3d224..0000000 --- a/src/multimedia/base/qmediaplaylistcontrol.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediacontrol_p.h" - - -QT_BEGIN_NAMESPACE - -/*! - \class QMediaPlaylistControl - \ingroup multimedia-serv - \since 4.7 - - \preliminary - \brief The QMediaPlaylistControl class provides access to the playlist functionality of a - QMediaService. - - If a QMediaService contains an internal playlist it will implement QMediaPlaylistControl. This - control provides access to the contents of the \l {playlistProvider()}{playlist}, as well as the - \l {currentIndex()}{position} of the current media, and a means of navigating to the - \l {next()}{next} and \l {previous()}{previous} media. - - The functionality provided by the control is exposed to application code through the - QMediaPlaylist class. - - The interface name of QMediaPlaylistControl is \c com.nokia.Qt.QMediaPlaylistControl/1.0 as - defined in QMediaPlaylistControl_iid. - - \sa QMediaService::control(), QMediaPlayer -*/ - -/*! - \macro QMediaPlaylistControl_iid - - \c com.nokia.Qt.QMediaPlaylistControl/1.0 - - Defines the interface name of the QMediaPlaylistControl class. - - \relates QMediaPlaylistControl -*/ - -/*! - Create a new playlist control object with the given \a parent. -*/ -QMediaPlaylistControl::QMediaPlaylistControl(QObject *parent): - QMediaControl(*new QMediaControlPrivate, parent) -{ -} - -/*! - Destroys the playlist control. -*/ -QMediaPlaylistControl::~QMediaPlaylistControl() -{ -} - - -/*! - \fn QMediaPlaylistControl::playlistProvider() const - - Returns the playlist used by this media player. -*/ - -/*! - \fn QMediaPlaylistControl::setPlaylistProvider(QMediaPlaylistProvider *playlist) - - Set the playlist of this media player to \a playlist. - - In many cases it is possible just to use the playlist - constructed by player, but sometimes replacing the whole - playlist allows to avoid copyting of all the items bettween playlists. - - Returns true if player can use this passed playlist; otherwise returns false. - -*/ - -/*! - \fn QMediaPlaylistControl::currentIndex() const - - Returns position of the current media source in the playlist. -*/ - -/*! - \fn QMediaPlaylistControl::setCurrentIndex(int position) - - Jump to the item at the given \a position. -*/ - -/*! - \fn QMediaPlaylistControl::nextIndex(int step) const - - Returns the index of item, which were current after calling next() - \a step times. - - Returned value depends on the size of playlist, current position - and playback mode. - - \sa QMediaPlaylist::playbackMode -*/ - -/*! - \fn QMediaPlaylistControl::previousIndex(int step) const - - Returns the index of item, which were current after calling previous() - \a step times. - - \sa QMediaPlaylist::playbackMode -*/ - -/*! - \fn QMediaPlaylistControl::next() - - Moves to the next item in playlist. -*/ - -/*! - \fn QMediaPlaylistControl::previous() - - Returns to the previous item in playlist. -*/ - -/*! - \fn QMediaPlaylistControl::playbackMode() const - - Returns the playlist navigation mode. - - \sa QMediaPlaylist::PlaybackMode -*/ - -/*! - \fn QMediaPlaylistControl::setPlaybackMode(QMediaPlaylist::PlaybackMode mode) - - Sets the playback \a mode. - - \sa QMediaPlaylist::PlaybackMode -*/ - -/*! - \fn QMediaPlaylistControl::playlistProviderChanged() - - Signal emited when the playlist provider has changed. -*/ - -/*! - \fn QMediaPlaylistControl::currentIndexChanged(int position) - - Signal emited when the playlist \a position is changed. -*/ - -/*! - \fn QMediaPlaylistControl::playbackModeChanged(QMediaPlaylist::PlaybackMode mode) - - Signal emited when the playback \a mode is changed. -*/ - -/*! - \fn QMediaPlaylistControl::currentMediaChanged(const QMediaContent& content) - - Signal emitted when current media changes to \a content. -*/ - -#include "moc_qmediaplaylistcontrol.cpp" -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qmediaplaylistcontrol.h b/src/multimedia/base/qmediaplaylistcontrol.h deleted file mode 100644 index 228ee19..0000000 --- a/src/multimedia/base/qmediaplaylistcontrol.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIAPLAYLISTCONTROL_H -#define QMEDIAPLAYLISTCONTROL_H - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QMediaPlaylistProvider; - -class Q_MULTIMEDIA_EXPORT QMediaPlaylistControl : public QMediaControl -{ - Q_OBJECT - -public: - virtual ~QMediaPlaylistControl(); - - virtual QMediaPlaylistProvider* playlistProvider() const = 0; - virtual bool setPlaylistProvider(QMediaPlaylistProvider *playlist) = 0; - - virtual int currentIndex() const = 0; - virtual void setCurrentIndex(int position) = 0; - virtual int nextIndex(int steps) const = 0; - virtual int previousIndex(int steps) const = 0; - - virtual void next() = 0; - virtual void previous() = 0; - - virtual QMediaPlaylist::PlaybackMode playbackMode() const = 0; - virtual void setPlaybackMode(QMediaPlaylist::PlaybackMode mode) = 0; - -Q_SIGNALS: - void playlistProviderChanged(); - void currentIndexChanged(int position); - void currentMediaChanged(const QMediaContent&); - void playbackModeChanged(QMediaPlaylist::PlaybackMode mode); - -protected: - QMediaPlaylistControl(QObject* parent = 0); -}; - -#define QMediaPlaylistControl_iid "com.nokia.Qt.QMediaPlaylistControl/1.0" -Q_MEDIA_DECLARE_CONTROL(QMediaPlaylistControl, QMediaPlaylistControl_iid) - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIAPLAYLISTCONTROL_H diff --git a/src/multimedia/base/qmediaplaylistioplugin.cpp b/src/multimedia/base/qmediaplaylistioplugin.cpp deleted file mode 100644 index 48fd721..0000000 --- a/src/multimedia/base/qmediaplaylistioplugin.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 - -QT_BEGIN_NAMESPACE - -/*! - \class QMediaPlaylistReader - \preliminary - \since 4.7 - \brief The QMediaPlaylistReader class provides an interface for reading a playlist file. - - \sa QMediaPlaylistIOPlugin -*/ - -/*! - Destroys a media playlist reader. -*/ -QMediaPlaylistReader::~QMediaPlaylistReader() -{ -} - -/*! - \fn QMediaPlaylistReader::atEnd() const - - Identifies if a playlist reader has reached the end of its input. - - Returns true if the reader has reached the end; and false otherwise. -*/ - -/*! - \fn QMediaPlaylistReader::readItem() - - Reads an item of media from a playlist file. - - Returns the read media, or a null QMediaContent if no more media is available. -*/ - -/*! - \fn QMediaPlaylistReader::close() - - Closes a playlist reader's input device. -*/ - -/*! - \class QMediaPlaylistWriter - \preliminary - \since 4.7 - \brief The QMediaPlaylistWriter class provides an interface for writing a playlist file. - - \sa QMediaPlaylistIOPlugin -*/ - -/*! - Destroys a media playlist writer. -*/ -QMediaPlaylistWriter::~QMediaPlaylistWriter() -{ -} - -/*! - \fn QMediaPlaylistWriter::writeItem(const QMediaContent &media) - - Writes an item of \a media to a playlist file. - - Returns true if the media was written succesfully; and false otherwise. -*/ - -/*! - \fn QMediaPlaylistWriter::close() - - Finalizes the writing of a playlist and closes the output device. -*/ - -/*! - \class QMediaPlaylistIOPlugin - \since 4.7 - \brief The QMediaPlaylistIOPlugin class provides an interface for media playlist I/O plug-ins. -*/ - -/*! - Constructs a media playlist I/O plug-in with the given \a parent. -*/ -QMediaPlaylistIOPlugin::QMediaPlaylistIOPlugin(QObject *parent) - :QObject(parent) -{ -} - -/*! - Destroys a media playlist I/O plug-in. -*/ -QMediaPlaylistIOPlugin::~QMediaPlaylistIOPlugin() -{ -} - -/*! - \fn QMediaPlaylistIOPlugin::canRead(QIODevice *device, const QByteArray &format) const - - Identifies if plug-in can read \a format data from an I/O \a device. - - Returns true if the data can be read; and false otherwise. -*/ - -/*! - \fn QMediaPlaylistIOPlugin::canRead(const QUrl& location, const QByteArray &format) const - - Identifies if a plug-in can read \a format data from a URL \a location. - - Returns true if the data can be read; and false otherwise. -*/ - -/*! - \fn QMediaPlaylistIOPlugin::canWrite(QIODevice *device, const QByteArray &format) const - - Identifies if a plug-in can write \a format data to an I/O \a device. - - Returns true if the data can be written; and false otherwise. -*/ - -/*! - \fn QMediaPlaylistIOPlugin::keys() const - - Returns a list of format keys supported by a plug-in. -*/ - -/*! - \fn QMediaPlaylistIOPlugin::createReader(QIODevice *device, const QByteArray &format) - - Returns a new QMediaPlaylistReader which reads \a format data from an I/O \a device. - - If the device is invalid or the format is unsupported this will return a null pointer. -*/ - -/*! - \fn QMediaPlaylistIOPlugin::createReader(const QUrl& location, const QByteArray &format) - - Returns a new QMediaPlaylistReader which reads \a format data from a URL \a location. - - If the location or the format is unsupported this will return a null pointer. -*/ - -/*! - \fn QMediaPlaylistIOPlugin::createWriter(QIODevice *device, const QByteArray &format) - - Returns a new QMediaPlaylistWriter which writes \a format data to an I/O \a device. - - If the device is invalid or the format is unsupported this will return a null pointer. -*/ - -QT_END_NAMESPACE - -#include "moc_qmediaplaylistioplugin.cpp" - diff --git a/src/multimedia/base/qmediaplaylistioplugin.h b/src/multimedia/base/qmediaplaylistioplugin.h deleted file mode 100644 index e55298d..0000000 --- a/src/multimedia/base/qmediaplaylistioplugin.h +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIAPLAYLISTIOPLUGIN_H -#define QMEDIAPLAYLISTIOPLUGIN_H - -#include -#include -#include - -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QString; -class QUrl; -class QByteArray; -class QIODevice; -class QStringList; - -class Q_MULTIMEDIA_EXPORT QMediaPlaylistReader -{ -public: - virtual ~QMediaPlaylistReader(); - - virtual bool atEnd() const = 0; - virtual QMediaContent readItem() = 0; - virtual void close() = 0; -}; - -class Q_MULTIMEDIA_EXPORT QMediaPlaylistWriter -{ -public: - virtual ~QMediaPlaylistWriter(); - - virtual bool writeItem(const QMediaContent &content) = 0; - virtual void close() = 0; -}; - -struct Q_MULTIMEDIA_EXPORT QMediaPlaylistIOInterface : public QFactoryInterface -{ - virtual bool canRead(QIODevice *device, const QByteArray &format = QByteArray() ) const = 0; - virtual bool canRead(const QUrl& location, const QByteArray &format = QByteArray()) const = 0; - - virtual bool canWrite(QIODevice *device, const QByteArray &format) const = 0; - - virtual QMediaPlaylistReader *createReader(QIODevice *device, const QByteArray &format = QByteArray()) = 0; - virtual QMediaPlaylistReader *createReader(const QUrl& location, const QByteArray &format = QByteArray()) = 0; - - virtual QMediaPlaylistWriter *createWriter(QIODevice *device, const QByteArray &format) = 0; -}; - -#define QMediaPlaylistIOInterface_iid "com.nokia.Qt.QMediaPlaylistIOInterface" -Q_DECLARE_INTERFACE(QMediaPlaylistIOInterface, QMediaPlaylistIOInterface_iid); - -class Q_MULTIMEDIA_EXPORT QMediaPlaylistIOPlugin : public QObject, public QMediaPlaylistIOInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaPlaylistIOInterface:QFactoryInterface) - -public: - explicit QMediaPlaylistIOPlugin(QObject *parent = 0); - virtual ~QMediaPlaylistIOPlugin(); - - virtual bool canRead(QIODevice *device, const QByteArray &format = QByteArray() ) const = 0; - virtual bool canRead(const QUrl& location, const QByteArray &format = QByteArray()) const = 0; - - virtual bool canWrite(QIODevice *device, const QByteArray &format) const = 0; - - virtual QStringList keys() const = 0; - - virtual QMediaPlaylistReader *createReader(QIODevice *device, const QByteArray &format = QByteArray()) = 0; - virtual QMediaPlaylistReader *createReader(const QUrl& location, const QByteArray &format = QByteArray()) = 0; - - virtual QMediaPlaylistWriter *createWriter(QIODevice *device, const QByteArray &format) = 0; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIAPLAYLISTIOPLUGIN_H diff --git a/src/multimedia/base/qmediaplaylistnavigator.cpp b/src/multimedia/base/qmediaplaylistnavigator.cpp deleted file mode 100644 index 0c52c71..0000000 --- a/src/multimedia/base/qmediaplaylistnavigator.cpp +++ /dev/null @@ -1,545 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediaobject_p.h" - -#include - -QT_BEGIN_NAMESPACE - -class QMediaPlaylistNullProvider : public QMediaPlaylistProvider -{ -public: - QMediaPlaylistNullProvider() :QMediaPlaylistProvider() {} - virtual ~QMediaPlaylistNullProvider() {} - virtual int mediaCount() const {return 0;} - virtual QMediaContent media(int) const { return QMediaContent(); } -}; - -Q_GLOBAL_STATIC(QMediaPlaylistNullProvider, _q_nullMediaPlaylist) - -class QMediaPlaylistNavigatorPrivate -{ - Q_DECLARE_NON_CONST_PUBLIC(QMediaPlaylistNavigator) -public: - QMediaPlaylistNavigatorPrivate() - :playlist(0), - currentPos(-1), - lastValidPos(-1), - playbackMode(QMediaPlaylist::Linear), - randomPositionsOffset(-1) - { - } - - QMediaPlaylistProvider *playlist; - int currentPos; - int lastValidPos; //to be used with CurrentItemOnce playback mode - QMediaPlaylist::PlaybackMode playbackMode; - QMediaContent currentItem; - - mutable QList randomModePositions; - mutable int randomPositionsOffset; - - int nextItemPos(int steps = 1) const; - int previousItemPos(int steps = 1) const; - - void _q_mediaInserted(int start, int end); - void _q_mediaRemoved(int start, int end); - void _q_mediaChanged(int start, int end); - - QMediaPlaylistNavigator *q_ptr; -}; - - -int QMediaPlaylistNavigatorPrivate::nextItemPos(int steps) const -{ - if (playlist->mediaCount() == 0) - return -1; - - if (steps == 0) - return currentPos; - - switch (playbackMode) { - case QMediaPlaylist::CurrentItemOnce: - return /*currentPos == -1 ? lastValidPos :*/ -1; - case QMediaPlaylist::CurrentItemInLoop: - return currentPos; - case QMediaPlaylist::Linear: - { - int nextPos = currentPos+steps; - return nextPos < playlist->mediaCount() ? nextPos : -1; - } - case QMediaPlaylist::Loop: - return (currentPos+steps) % playlist->mediaCount(); - case QMediaPlaylist::Random: - { - //TODO: limit the history size - - if (randomPositionsOffset == -1) { - randomModePositions.clear(); - randomModePositions.append(currentPos); - randomPositionsOffset = 0; - } - - while (randomModePositions.size() < randomPositionsOffset+steps+1) - randomModePositions.append(-1); - int res = randomModePositions[randomPositionsOffset+steps]; - if (res<0 || res >= playlist->mediaCount()) { - res = qrand() % playlist->mediaCount(); - randomModePositions[randomPositionsOffset+steps] = res; - } - - return res; - } - } - - return -1; -} - -int QMediaPlaylistNavigatorPrivate::previousItemPos(int steps) const -{ - if (playlist->mediaCount() == 0) - return -1; - - if (steps == 0) - return currentPos; - - switch (playbackMode) { - case QMediaPlaylist::CurrentItemOnce: - return /*currentPos == -1 ? lastValidPos :*/ -1; - case QMediaPlaylist::CurrentItemInLoop: - return currentPos; - case QMediaPlaylist::Linear: - { - int prevPos = currentPos == -1 ? playlist->mediaCount() - steps : currentPos - steps; - return prevPos>=0 ? prevPos : -1; - } - case QMediaPlaylist::Loop: - { - int prevPos = currentPos - steps; - while (prevPos<0) - prevPos += playlist->mediaCount(); - return prevPos; - } - case QMediaPlaylist::Random: - { - //TODO: limit the history size - - if (randomPositionsOffset == -1) { - randomModePositions.clear(); - randomModePositions.append(currentPos); - randomPositionsOffset = 0; - } - - while (randomPositionsOffset-steps < 0) { - randomModePositions.prepend(-1); - randomPositionsOffset++; - } - - int res = randomModePositions[randomPositionsOffset-steps]; - if (res<0 || res >= playlist->mediaCount()) { - res = qrand() % playlist->mediaCount(); - randomModePositions[randomPositionsOffset-steps] = res; - } - - return res; - } - } - - return -1; -} - -/*! - \class QMediaPlaylistNavigator - \preliminary - \since 4.7 - \brief The QMediaPlaylistNavigator class provides navigation for a media playlist. - - \sa QMediaPlaylist, QMediaPlaylistProvider -*/ - - -/*! - Constructs a media playlist navigator for a \a playlist. - - The \a parent is passed to QObject. - */ -QMediaPlaylistNavigator::QMediaPlaylistNavigator(QMediaPlaylistProvider *playlist, QObject *parent) - : QObject(parent) - , d_ptr(new QMediaPlaylistNavigatorPrivate) -{ - d_ptr->q_ptr = this; - - setPlaylist(playlist ? playlist : _q_nullMediaPlaylist()); -} - -/*! - Destroys a media playlist navigator. - */ - -QMediaPlaylistNavigator::~QMediaPlaylistNavigator() -{ - delete d_ptr; -} - - -/*! \property QMediaPlaylistNavigator::playbackMode - Contains the playback mode. - */ -QMediaPlaylist::PlaybackMode QMediaPlaylistNavigator::playbackMode() const -{ - return d_func()->playbackMode; -} - -/*! - Sets the playback \a mode. - */ -void QMediaPlaylistNavigator::setPlaybackMode(QMediaPlaylist::PlaybackMode mode) -{ - Q_D(QMediaPlaylistNavigator); - if (d->playbackMode == mode) - return; - - if (mode == QMediaPlaylist::Random) { - d->randomPositionsOffset = 0; - d->randomModePositions.append(d->currentPos); - } else if (d->playbackMode == QMediaPlaylist::Random) { - d->randomPositionsOffset = -1; - d->randomModePositions.clear(); - } - - d->playbackMode = mode; - - emit playbackModeChanged(mode); - emit surroundingItemsChanged(); -} - -/*! - Returns the playlist being navigated. -*/ - -QMediaPlaylistProvider *QMediaPlaylistNavigator::playlist() const -{ - return d_func()->playlist; -} - -/*! - Sets the \a playlist to navigate. -*/ -void QMediaPlaylistNavigator::setPlaylist(QMediaPlaylistProvider *playlist) -{ - Q_D(QMediaPlaylistNavigator); - - if (d->playlist == playlist) - return; - - if (d->playlist) { - d->playlist->disconnect(this); - } - - if (playlist) { - d->playlist = playlist; - } else { - //assign to shared readonly null playlist - d->playlist = _q_nullMediaPlaylist(); - } - - connect(d->playlist, SIGNAL(mediaInserted(int,int)), SLOT(_q_mediaInserted(int,int))); - connect(d->playlist, SIGNAL(mediaRemoved(int,int)), SLOT(_q_mediaRemoved(int,int))); - connect(d->playlist, SIGNAL(mediaChanged(int,int)), SLOT(_q_mediaChanged(int,int))); - - d->randomPositionsOffset = -1; - d->randomModePositions.clear(); - - if (d->currentPos != -1) { - d->currentPos = -1; - emit currentIndexChanged(-1); - } - - if (!d->currentItem.isNull()) { - d->currentItem = QMediaContent(); - emit activated(d->currentItem); //stop playback - } -} - -/*! \property QMediaPlaylistNavigator::currentItem - - Contains the media at the current position in the playlist. - - \sa currentIndex() -*/ - -QMediaContent QMediaPlaylistNavigator::currentItem() const -{ - return itemAt(d_func()->currentPos); -} - -/*! \fn QMediaContent QMediaPlaylistNavigator::nextItem(int steps) const - - Returns the media that is \a steps positions ahead of the current - position in the playlist. - - \sa nextIndex() -*/ -QMediaContent QMediaPlaylistNavigator::nextItem(int steps) const -{ - return itemAt(nextIndex(steps)); -} - -/*! - Returns the media that is \a steps positions behind the current - position in the playlist. - - \sa previousIndex() - */ -QMediaContent QMediaPlaylistNavigator::previousItem(int steps) const -{ - return itemAt(previousIndex(steps)); -} - -/*! - Returns the media at a \a position in the playlist. - */ -QMediaContent QMediaPlaylistNavigator::itemAt(int position) const -{ - return d_func()->playlist->media(position); -} - -/*! \property QMediaPlaylistNavigator::currentIndex - - Contains the position of the current media. - - If no media is current, the property contains -1. - - \sa nextIndex(), previousIndex() -*/ - -int QMediaPlaylistNavigator::currentIndex() const -{ - return d_func()->currentPos; -} - -/*! - Returns a position \a steps ahead of the current position - accounting for the playbackMode(). - - If the position is beyond the end of the playlist, this value - returned is -1. - - \sa currentIndex(), previousIndex(), playbackMode() -*/ - -int QMediaPlaylistNavigator::nextIndex(int steps) const -{ - return d_func()->nextItemPos(steps); -} - -/*! - - Returns a position \a steps behind the current position accounting - for the playbackMode(). - - If the position is prior to the beginning of the playlist this will - return -1. - - \sa currentIndex(), nextIndex(), playbackMode() -*/ -int QMediaPlaylistNavigator::previousIndex(int steps) const -{ - return d_func()->previousItemPos(steps); -} - -/*! - Advances to the next item in the playlist. - - \sa previous(), jump(), playbackMode() - */ -void QMediaPlaylistNavigator::next() -{ - Q_D(QMediaPlaylistNavigator); - - int nextPos = d->nextItemPos(); - - if ( playbackMode() == QMediaPlaylist::Random ) - d->randomPositionsOffset++; - - jump(nextPos); -} - -/*! - Returns to the previous item in the playlist, - - \sa next(), jump(), playbackMode() - */ -void QMediaPlaylistNavigator::previous() -{ - Q_D(QMediaPlaylistNavigator); - - int prevPos = d->previousItemPos(); - if ( playbackMode() == QMediaPlaylist::Random ) - d->randomPositionsOffset--; - - jump(prevPos); -} - -/*! - Jumps to a new \a position in the playlist. - */ -void QMediaPlaylistNavigator::jump(int position) -{ - Q_D(QMediaPlaylistNavigator); - - if (position<-1 || position>=d->playlist->mediaCount()) { - qWarning() << "QMediaPlaylistNavigator: Jump outside playlist range"; - position = -1; - } - - if (position != -1) - d->lastValidPos = position; - - if (playbackMode() == QMediaPlaylist::Random) { - if (d->randomModePositions[d->randomPositionsOffset] != position) { - d->randomModePositions.clear(); - d->randomModePositions.append(position); - d->randomPositionsOffset = 0; - } - } - - if (position != -1) - d->currentItem = d->playlist->media(position); - else - d->currentItem = QMediaContent(); - - if (position != d->currentPos) { - d->currentPos = position; - emit currentIndexChanged(d->currentPos); - emit surroundingItemsChanged(); - } - - emit activated(d->currentItem); -} - -/*! - \internal -*/ -void QMediaPlaylistNavigatorPrivate::_q_mediaInserted(int start, int end) -{ - Q_Q(QMediaPlaylistNavigator); - - if (currentPos >= start) { - currentPos = end-start+1; - q->jump(currentPos); - } - - //TODO: check if they really changed - emit q->surroundingItemsChanged(); -} - -/*! - \internal -*/ -void QMediaPlaylistNavigatorPrivate::_q_mediaRemoved(int start, int end) -{ - Q_Q(QMediaPlaylistNavigator); - - if (currentPos > end) { - currentPos = currentPos - end-start+1; - q->jump(currentPos); - } else if (currentPos >= start) { - //current item was removed - currentPos = qMin(start, playlist->mediaCount()-1); - q->jump(currentPos); - } - - //TODO: check if they really changed - emit q->surroundingItemsChanged(); -} - -/*! - \internal -*/ -void QMediaPlaylistNavigatorPrivate::_q_mediaChanged(int start, int end) -{ - Q_Q(QMediaPlaylistNavigator); - - if (currentPos >= start && currentPos<=end) { - QMediaContent src = playlist->media(currentPos); - if (src != currentItem) { - currentItem = src; - emit q->activated(src); - } - } - - //TODO: check if they really changed - emit q->surroundingItemsChanged(); -} - -/*! - \fn QMediaPlaylistNavigator::activated(const QMediaContent &media) - - Signals that the current \a media has changed. -*/ - -/*! - \fn QMediaPlaylistNavigator::currentIndexChanged(int position) - - Signals the \a position of the current media has changed. -*/ - -/*! - \fn QMediaPlaylistNavigator::playbackModeChanged(QMediaPlaylist::PlaybackMode mode) - - Signals that the playback \a mode has changed. -*/ - -/*! - \fn QMediaPlaylistNavigator::surroundingItemsChanged() - - Signals that media immediately surrounding the current position has changed. -*/ - -#include "moc_qmediaplaylistnavigator.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qmediaplaylistnavigator.h b/src/multimedia/base/qmediaplaylistnavigator.h deleted file mode 100644 index 73789af..0000000 --- a/src/multimedia/base/qmediaplaylistnavigator.h +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIAPLAYLISTNAVIGATOR_H -#define QMEDIAPLAYLISTNAVIGATOR_H - -#include - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QMediaPlaylistNavigatorPrivate; -class Q_MULTIMEDIA_EXPORT QMediaPlaylistNavigator : public QObject -{ - Q_OBJECT - Q_PROPERTY(QMediaPlaylist::PlaybackMode playbackMode READ playbackMode WRITE setPlaybackMode NOTIFY playbackModeChanged) - Q_PROPERTY(int currentIndex READ currentIndex WRITE jump NOTIFY currentIndexChanged) - Q_PROPERTY(QMediaContent currentItem READ currentItem NOTIFY currentItemChanged) - -public: - QMediaPlaylistNavigator(QMediaPlaylistProvider *playlist, QObject *parent = 0); - virtual ~QMediaPlaylistNavigator(); - - QMediaPlaylistProvider *playlist() const; - void setPlaylist(QMediaPlaylistProvider *playlist); - - QMediaPlaylist::PlaybackMode playbackMode() const; - - QMediaContent currentItem() const; - QMediaContent nextItem(int steps = 1) const; - QMediaContent previousItem(int steps = 1) const; - - QMediaContent itemAt(int position) const; - - int currentIndex() const; - int nextIndex(int steps = 1) const; - int previousIndex(int steps = 1) const; - -public Q_SLOTS: - void next(); - void previous(); - - void jump(int); - - void setPlaybackMode(QMediaPlaylist::PlaybackMode mode); - -Q_SIGNALS: - void activated(const QMediaContent &content); - void currentIndexChanged(int); - void playbackModeChanged(QMediaPlaylist::PlaybackMode mode); - - void surroundingItemsChanged(); - -protected: - QMediaPlaylistNavigatorPrivate *d_ptr; - -private: - Q_DISABLE_COPY(QMediaPlaylistNavigator) - Q_DECLARE_PRIVATE(QMediaPlaylistNavigator) - - Q_PRIVATE_SLOT(d_func(), void _q_mediaInserted(int start, int end)) - Q_PRIVATE_SLOT(d_func(), void _q_mediaRemoved(int start, int end)) - Q_PRIVATE_SLOT(d_func(), void _q_mediaChanged(int start, int end)) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIAPLAYLISTNAVIGATOR_H diff --git a/src/multimedia/base/qmediaplaylistprovider.cpp b/src/multimedia/base/qmediaplaylistprovider.cpp deleted file mode 100644 index 942f155..0000000 --- a/src/multimedia/base/qmediaplaylistprovider.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediaplaylistprovider_p.h" - - -QT_BEGIN_NAMESPACE - -/*! - \class QMediaPlaylistProvider - \preliminary - \since 4.7 - \brief The QMediaPlaylistProvider class provides an abstract list of media. - - \sa QMediaPlaylist -*/ - -/*! - Constructs a playlist provider with the given \a parent. -*/ -QMediaPlaylistProvider::QMediaPlaylistProvider(QObject *parent) - :QObject(parent), d_ptr(new QMediaPlaylistProviderPrivate) -{ -} - -/*! - \internal -*/ -QMediaPlaylistProvider::QMediaPlaylistProvider(QMediaPlaylistProviderPrivate &dd, QObject *parent) - :QObject(parent), d_ptr(&dd) -{ -} - -/*! - Destroys a playlist provider. -*/ -QMediaPlaylistProvider::~QMediaPlaylistProvider() -{ - delete d_ptr; -} - -/*! - \fn QMediaPlaylistProvider::mediaCount() const; - - Returns the size of playlist. -*/ - -/*! - \fn QMediaPlaylistProvider::media(int index) const; - - Returns the media at \a index in the playlist. - - If the index is invalid this will return a null media content. -*/ - - -/*! - Loads a playlist from from a URL \a location. If no playlist \a format is specified the loader - will inspect the URL or probe the headers to guess the format. - - New items are appended to playlist. - - Returns true if the provider supports the format and loading from the locations URL protocol, - otherwise this will return false. -*/ -bool QMediaPlaylistProvider::load(const QUrl &location, const char *format) -{ - Q_UNUSED(location); - Q_UNUSED(format); - return false; -} - -/*! - Loads a playlist from from an I/O \a device. If no playlist \a format is specified the loader - will probe the headers to guess the format. - - New items are appended to playlist. - - Returns true if the provider supports the format and loading from an I/O device, otherwise this - will return false. -*/ -bool QMediaPlaylistProvider::load(QIODevice * device, const char *format) -{ - Q_UNUSED(device); - Q_UNUSED(format); - return false; -} - -/*! - Saves the contents of a playlist to a URL \a location. If no playlist \a format is specified - the writer will inspect the URL to guess the format. - - Returns true if the playlist was saved succesfully; and false otherwise. - */ -bool QMediaPlaylistProvider::save(const QUrl &location, const char *format) -{ - Q_UNUSED(location); - Q_UNUSED(format); - return false; -} - -/*! - Saves the contents of a playlist to an I/O \a device in the specified \a format. - - Returns true if the playlist was saved succesfully; and false otherwise. -*/ -bool QMediaPlaylistProvider::save(QIODevice * device, const char *format) -{ - Q_UNUSED(device); - Q_UNUSED(format); - return false; -} - -/*! - Returns true if a playlist is read-only; otherwise returns false. -*/ -bool QMediaPlaylistProvider::isReadOnly() const -{ - return true; -} - -/*! - Append \a media to a playlist. - - Returns true if the media was appended; and false otherwise. -*/ -bool QMediaPlaylistProvider::addMedia(const QMediaContent &media) -{ - Q_UNUSED(media); - return false; -} - -/*! - Append multiple media \a items to a playlist. - - Returns true if the media items were appended; and false otherwise. -*/ -bool QMediaPlaylistProvider::addMedia(const QList &items) -{ - foreach(const QMediaContent &item, items) { - if (!addMedia(item)) - return false; - } - - return true; -} - -/*! - Inserts \a media into a playlist at \a position. - - Returns true if the media was inserted; and false otherwise. -*/ -bool QMediaPlaylistProvider::insertMedia(int position, const QMediaContent &media) -{ - Q_UNUSED(position); - Q_UNUSED(media); - return false; -} - -/*! - Inserts multiple media \a items into a playlist at \a position. - - Returns true if the media \a items were inserted; and false otherwise. -*/ -bool QMediaPlaylistProvider::insertMedia(int position, const QList &items) -{ - for (int i=0; i - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QString; - - -class QMediaPlaylistProviderPrivate; -class Q_MULTIMEDIA_EXPORT QMediaPlaylistProvider : public QObject -{ - Q_OBJECT - -public: - QMediaPlaylistProvider(QObject *parent=0); - virtual ~QMediaPlaylistProvider(); - - virtual bool load(const QUrl &location, const char *format = 0); - virtual bool load(QIODevice * device, const char *format = 0); - virtual bool save(const QUrl &location, const char *format = 0); - virtual bool save(QIODevice * device, const char *format); - - virtual int mediaCount() const = 0; - virtual QMediaContent media(int index) const = 0; - - virtual bool isReadOnly() const; - - virtual bool addMedia(const QMediaContent &content); - virtual bool addMedia(const QList &contentList); - virtual bool insertMedia(int index, const QMediaContent &content); - virtual bool insertMedia(int index, const QList &content); - virtual bool removeMedia(int pos); - virtual bool removeMedia(int start, int end); - virtual bool clear(); - -public Q_SLOTS: - virtual void shuffle(); - -Q_SIGNALS: - void mediaAboutToBeInserted(int start, int end); - void mediaInserted(int start, int end); - - void mediaAboutToBeRemoved(int start, int end); - void mediaRemoved(int start, int end); - - void mediaChanged(int start, int end); - - void loaded(); - void loadFailed(QMediaPlaylist::Error, const QString& errorMessage); - -protected: - QMediaPlaylistProviderPrivate *d_ptr; - QMediaPlaylistProvider(QMediaPlaylistProviderPrivate &dd, QObject *parent); - -private: - Q_DECLARE_PRIVATE(QMediaPlaylistProvider) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIAPLAYLISTPROVIDER_H diff --git a/src/multimedia/base/qmediaplaylistprovider_p.h b/src/multimedia/base/qmediaplaylistprovider_p.h deleted file mode 100644 index aaf6deb..0000000 --- a/src/multimedia/base/qmediaplaylistprovider_p.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIAPLAYLISTPROVIDER_P_H -#define QMEDIAPLAYLISTPROVIDER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QMediaPlaylistProviderPrivate -{ -public: - QMediaPlaylistProviderPrivate() - {} - virtual ~QMediaPlaylistProviderPrivate() - {} -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIAPLAYLISTSOURCE_P_H diff --git a/src/multimedia/base/qmediapluginloader.cpp b/src/multimedia/base/qmediapluginloader.cpp deleted file mode 100644 index eaf6218..0000000 --- a/src/multimedia/base/qmediapluginloader.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediapluginloader_p.h" -#include -#include -#include -#include - -#include - - -QT_BEGIN_NAMESPACE - - -typedef QMap ObjectListMap; -Q_GLOBAL_STATIC(ObjectListMap, staticMediaPlugins); - -QMediaPluginLoader::QMediaPluginLoader(const char *iid, const QString &location, Qt::CaseSensitivity): - m_iid(iid) -{ - m_location = location + QLatin1String("/"); - load(); -} - -QStringList QMediaPluginLoader::keys() const -{ - return m_instances.keys(); -} - -QObject* QMediaPluginLoader::instance(QString const &key) -{ - return m_instances.value(key); -} - -QList QMediaPluginLoader::instances(QString const &key) -{ - return m_instances.values(key); -} - -//to be used for testing purposes only -void QMediaPluginLoader::setStaticPlugins(const QString &location, const QObjectList& objects) -{ - staticMediaPlugins()->insert(location + QLatin1String("/"), objects); -} - -void QMediaPluginLoader::load() -{ - if (!m_instances.isEmpty()) - return; - - if (staticMediaPlugins() && staticMediaPlugins()->contains(m_location)) { - foreach(QObject *o, staticMediaPlugins()->value(m_location)) { - if (o != 0 && o->qt_metacast(m_iid) != 0) { - QFactoryInterface* p = qobject_cast(o); - if (p != 0) { - foreach (QString const &key, p->keys()) - m_instances.insertMulti(key, o); - } - } - } - } else { -#ifndef QT_NO_LIBRARY - QStringList paths = QCoreApplication::libraryPaths(); - - foreach (QString const &path, paths) { - QString pluginPathName(path + m_location); - QDir pluginDir(pluginPathName); - - if (!pluginDir.exists()) - continue; - - foreach (QString pluginLib, pluginDir.entryList(QDir::Files)) { - QPluginLoader loader(pluginPathName + pluginLib); - - QObject *o = loader.instance(); - if (o != 0 && o->qt_metacast(m_iid) != 0) { - QFactoryInterface* p = qobject_cast(o); - if (p != 0) { - foreach (QString const &key, p->keys()) - m_instances.insertMulti(key, o); - } - - continue; - } else { - qWarning() << "QMediaPluginLoader: Failed to load plugin: " << pluginLib << loader.errorString(); - } - delete o; - loader.unload(); - } - } -#endif - } -} - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qmediapluginloader_p.h b/src/multimedia/base/qmediapluginloader_p.h deleted file mode 100644 index 351d2f1..0000000 --- a/src/multimedia/base/qmediapluginloader_p.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIAPLUGINLOADER_H -#define QMEDIAPLUGINLOADER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QMediaServiceProviderPlugin; - -class Q_AUTOTEST_EXPORT QMediaPluginLoader -{ -public: - QMediaPluginLoader(const char *iid, - const QString &suffix = QString(), - Qt::CaseSensitivity = Qt::CaseSensitive); - - QStringList keys() const; - QObject* instance(QString const &key); - QList instances(QString const &key); - - static void setStaticPlugins(const QString &location, const QObjectList& objects); - -private: - void load(); - - QByteArray m_iid; - QString m_location; - QMap m_instances; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIAPLUGINLOADER_H diff --git a/src/multimedia/base/qmediaresource.cpp b/src/multimedia/base/qmediaresource.cpp deleted file mode 100644 index 646d9a7..0000000 --- a/src/multimedia/base/qmediaresource.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 - -/*! - \class QMediaResource - \preliminary - \since 4.7 - \brief The QMediaResource class provides a description of a media resource. - \ingroup multimedia - - A media resource is composed of a \l {url()}{URL} containing the - location of the resource and a set of properties that describe the - format of the resource. The properties provide a means to assess a - resource without first attempting to load it, and in situations where - media be represented by multiple alternative representations provide a - means to select the appropriate resource. - - Media made available by a remote services can often be available in - multiple encodings or quality levels, this allows a client to select - an appropriate resource based on considerations such as codecs supported, - network bandwidth, and display constraints. QMediaResource includes - information such as the \l {mimeType()}{MIME type}, \l {audioCodec()}{audio} - and \l {videoCodec()}{video} codecs, \l {audioBitRate()}{audio} and - \l {videoBitRate()}{video} bit rates, and \l {resolution()}{resolution} - so these constraints and others can be evaluated. - - The only mandatory property of a QMediaResource is the url(). - - \sa QMediaContent -*/ - -/*! - \typedef QMediaResourceList - - Synonym for \c QList -*/ - -/*! - Constructs a null media resource. -*/ -QMediaResource::QMediaResource() -{ -} - -/*! - Constructs a media resource with the given \a mimeType from a \a url. -*/ -QMediaResource::QMediaResource(const QUrl &url, const QString &mimeType) -{ - values.insert(Url, url); - values.insert(MimeType, mimeType); -} - -/*! - Constructs a media resource with the given \a mimeType from a network \a request. -*/ -QMediaResource::QMediaResource(const QNetworkRequest &request, const QString &mimeType) -{ - values.insert(Request, QVariant::fromValue(request)); - values.insert(Url, request.url()); - values.insert(MimeType, mimeType); -} - -/*! - Constructs a copy of a media resource \a other. -*/ -QMediaResource::QMediaResource(const QMediaResource &other) - : values(other.values) -{ -} - -/*! - Assigns the value of \a other to a media resource. -*/ -QMediaResource &QMediaResource::operator =(const QMediaResource &other) -{ - values = other.values; - - return *this; -} - -/*! - Destroys a media resource. -*/ -QMediaResource::~QMediaResource() -{ -} - - -/*! - Compares a media resource to \a other. - - Returns true if the resources are identical, and false otherwise. -*/ -bool QMediaResource::operator ==(const QMediaResource &other) const -{ - return values == other.values; -} - -/*! - Compares a media resource to \a other. - - Returns true if they are different, and false otherwise. -*/ -bool QMediaResource::operator !=(const QMediaResource &other) const -{ - return values != other.values; -} - -/*! - Identifies if a media resource is null. - - Returns true if the resource is null, and false otherwise. -*/ -bool QMediaResource::isNull() const -{ - return values.isEmpty(); -} - -/*! - Returns the URL of a media resource. -*/ -QUrl QMediaResource::url() const -{ - return qvariant_cast(values.value(Url)); -} - -/*! - Returns the network request associated with this media resource. -*/ -QNetworkRequest QMediaResource::request() const -{ - if(values.contains(Request)) - return qvariant_cast(values.value(Request)); - - return QNetworkRequest(url()); -} - -/*! - Returns the MIME type of a media resource. - - This may be null if the MIME type is unknown. -*/ -QString QMediaResource::mimeType() const -{ - return qvariant_cast(values.value(MimeType)); -} - -/*! - Returns the language of a media resource as an ISO 639-2 code. - - This may be null if the language is unknown. -*/ -QString QMediaResource::language() const -{ - return qvariant_cast(values.value(Language)); -} - -/*! - Sets the \a language of a media resource. -*/ -void QMediaResource::setLanguage(const QString &language) -{ - if (!language.isNull()) - values.insert(Language, language); - else - values.remove(Language); -} - -/*! - Returns the audio codec of a media resource. - - This may be null if the media resource does not contain an audio stream, or the codec is - unknown. -*/ -QString QMediaResource::audioCodec() const -{ - return qvariant_cast(values.value(AudioCodec)); -} - -/*! - Sets the audio \a codec of a media resource. -*/ -void QMediaResource::setAudioCodec(const QString &codec) -{ - if (!codec.isNull()) - values.insert(AudioCodec, codec); - else - values.remove(AudioCodec); -} - -/*! - Returns the video codec of a media resource. - - This may be null if the media resource does not contain a video stream, or the codec is - unknonwn. -*/ -QString QMediaResource::videoCodec() const -{ - return qvariant_cast(values.value(VideoCodec)); -} - -/*! - Sets the video \a codec of media resource. -*/ -void QMediaResource::setVideoCodec(const QString &codec) -{ - if (!codec.isNull()) - values.insert(VideoCodec, codec); - else - values.remove(VideoCodec); -} - -/*! - Returns the size in bytes of a media resource. - - This may be zero if the size is unknown. -*/ -qint64 QMediaResource::dataSize() const -{ - return qvariant_cast(values.value(DataSize)); -} - -/*! - Sets the \a size in bytes of a media resource. -*/ -void QMediaResource::setDataSize(const qint64 size) -{ - if (size != 0) - values.insert(DataSize, size); - else - values.remove(DataSize); -} - -/*! - Returns the bit rate in bits per second of a media resource's audio stream. - - This may be zero if the bit rate is unknown, or the resource contains no audio stream. -*/ -int QMediaResource::audioBitRate() const -{ - return values.value(AudioBitRate).toInt(); -} - -/*! - Sets the bit \a rate in bits per second of a media resource's video stream. -*/ -void QMediaResource::setAudioBitRate(int rate) -{ - if (rate != 0) - values.insert(AudioBitRate, rate); - else - values.remove(AudioBitRate); -} - -/*! - Returns the audio sample rate of a media resource. - - This may be zero if the sample size is unknown, or the resource contains no audio stream. -*/ -int QMediaResource::sampleRate() const -{ - return qvariant_cast(values.value(SampleRate)); -} - -/*! - Sets the audio \a sampleRate of a media resource. -*/ -void QMediaResource::setSampleRate(int sampleRate) -{ - if (sampleRate != 0) - values.insert(SampleRate, sampleRate); - else - values.remove(SampleRate); -} - -/*! - Returns the number of audio channels in a media resource. - - This may be zero if the sample size is unknown, or the resource contains no audio stream. -*/ -int QMediaResource::channelCount() const -{ - return qvariant_cast(values.value(ChannelCount)); -} - -/*! - Sets the number of audio \a channels in a media resource. -*/ -void QMediaResource::setChannelCount(int channels) -{ - if (channels != 0) - values.insert(ChannelCount, channels); - else - values.remove(ChannelCount); -} - -/*! - Returns the bit rate in bits per second of a media resource's video stream. - - This may be zero if the bit rate is unknown, or the resource contains no video stream. -*/ -int QMediaResource::videoBitRate() const -{ - return values.value(VideoBitRate).toInt(); -} - -/*! - Sets the bit \a rate in bits per second of a media resource's video stream. -*/ -void QMediaResource::setVideoBitRate(int rate) -{ - if (rate != 0) - values.insert(VideoBitRate, rate); - else - values.remove(VideoBitRate); -} - -/*! - Returns the resolution in pixels of a media resource. - - This may be null is the resolution is unknown, or the resource contains no pixel data (i.e. the - resource is an audio stream. -*/ -QSize QMediaResource::resolution() const -{ - return qvariant_cast(values.value(Resolution)); -} - -/*! - Sets the \a resolution in pixels of a media resource. -*/ -void QMediaResource::setResolution(const QSize &resolution) -{ - if (resolution.width() != -1 || resolution.height() != -1) - values.insert(Resolution, resolution); - else - values.remove(Resolution); -} - -/*! - Sets the \a width and \a height in pixels of a media resource. -*/ -void QMediaResource::setResolution(int width, int height) -{ - if (width != -1 || height != -1) - values.insert(Resolution, QSize(width, height)); - else - values.remove(Resolution); -} -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qmediaresource.h b/src/multimedia/base/qmediaresource.h deleted file mode 100644 index a535bbd..0000000 --- a/src/multimedia/base/qmediaresource.h +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIARESOURCE_H -#define QMEDIARESOURCE_H - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class Q_MULTIMEDIA_EXPORT QMediaResource -{ -public: - QMediaResource(); - QMediaResource(const QUrl &url, const QString &mimeType = QString()); - QMediaResource(const QNetworkRequest &request, const QString &mimeType = QString()); - QMediaResource(const QMediaResource &other); - QMediaResource &operator =(const QMediaResource &other); - ~QMediaResource(); - - bool isNull() const; - - bool operator ==(const QMediaResource &other) const; - bool operator !=(const QMediaResource &other) const; - - QUrl url() const; - QNetworkRequest request() const; - QString mimeType() const; - - QString language() const; - void setLanguage(const QString &language); - - QString audioCodec() const; - void setAudioCodec(const QString &codec); - - QString videoCodec() const; - void setVideoCodec(const QString &codec); - - qint64 dataSize() const; - void setDataSize(const qint64 size); - - int audioBitRate() const; - void setAudioBitRate(int rate); - - int sampleRate() const; - void setSampleRate(int frequency); - - int channelCount() const; - void setChannelCount(int channels); - - int videoBitRate() const; - void setVideoBitRate(int rate); - - QSize resolution() const; - void setResolution(const QSize &resolution); - void setResolution(int width, int height); - - -private: - enum Property - { - Url, - Request, - MimeType, - Language, - AudioCodec, - VideoCodec, - DataSize, - AudioBitRate, - VideoBitRate, - SampleRate, - ChannelCount, - Resolution - }; - QMap values; -}; - -typedef QList QMediaResourceList; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QMediaResource) -Q_DECLARE_METATYPE(QMediaResourceList) - -QT_END_HEADER - - -#endif diff --git a/src/multimedia/base/qmediaservice.cpp b/src/multimedia/base/qmediaservice.cpp deleted file mode 100644 index d9e980b..0000000 --- a/src/multimedia/base/qmediaservice.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediaservice_p.h" - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -/*! - \class QMediaService - \brief The QMediaService class provides a common base class for media - service implementations. - \ingroup multimedia-serv - \preliminary - \since 4.7 - - Media services provide implementations of the functionality promised - by media objects, and allow multiple providers to implement a QMediaObject. - - To provide the functionality of a QMediaObject media services implement - QMediaControl interfaces. Services typically implement one core media - control which provides the core feature of a media object, and some - number of additional controls which provide either optional features of - the media object, or features of a secondary media object or peripheral - object. - - A pointer to media service's QMediaControl implementation can be - obtained by passing the control's interface name to the control() function. - - \code - QMediaPlayerControl *control = qobject_cast( - service->control("com.nokia.Qt.QMediaPlayerControl/1.0")); - \endcode - - Media objects can use services loaded dynamically from plug-ins or - implemented statically within an applications. Plug-in based services - should also implement the QMediaServiceProviderPlugin interface. Static - services should implement the QMediaServiceProvider interface. - - \sa QMediaObject, QMediaControl, QMediaServiceProvider, QMediaServiceProviderPlugin -*/ - -/*! - Construct a media service with the given \a parent. This class is meant as a - base class for Multimedia services so this constructor is protected. -*/ - -QMediaService::QMediaService(QObject *parent) - : QObject(parent) - , d_ptr(new QMediaServicePrivate) -{ - d_ptr->q_ptr = this; -} - -/*! - \internal -*/ -QMediaService::QMediaService(QMediaServicePrivate &dd, QObject *parent) - : QObject(parent) - , d_ptr(&dd) -{ - d_ptr->q_ptr = this; -} - -/*! - Destroys a media service. -*/ - -QMediaService::~QMediaService() -{ - delete d_ptr; -} - -/*! - \fn QMediaService::control(const char *interface) const - - Returns a pointer to the media control implementing \a interface. - - If the service does not implement the control a null pointer is returned instead. -*/ - -/*! - \fn QMediaService::control() const - - Returns a pointer to the media control of type T implemented by a media service. - - If the service does not implment the control a null pointer is returned instead. -*/ - -#include "moc_qmediaservice.cpp" - -QT_END_NAMESPACE - -QT_END_HEADER - diff --git a/src/multimedia/base/qmediaservice.h b/src/multimedia/base/qmediaservice.h deleted file mode 100644 index c53a15f..0000000 --- a/src/multimedia/base/qmediaservice.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QABSTRACTMEDIASERVICE_H -#define QABSTRACTMEDIASERVICE_H - -#include -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QMediaServicePrivate; -class Q_MULTIMEDIA_EXPORT QMediaService : public QObject -{ - Q_OBJECT - -public: - ~QMediaService(); - - virtual QMediaControl* control(const char *name) const = 0; - -#ifndef QT_NO_MEMBER_TEMPLATES - template inline T control() const { - if (QObject *object = control(qmediacontrol_iid())) { - return qobject_cast(object); - } - return 0; - } -#endif - -protected: - QMediaService(QObject* parent); - QMediaService(QMediaServicePrivate &dd, QObject *parent); - - QMediaServicePrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QMediaService) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QABSTRACTMEDIASERVICE_H - diff --git a/src/multimedia/base/qmediaservice_p.h b/src/multimedia/base/qmediaservice_p.h deleted file mode 100644 index 7dbcd8a..0000000 --- a/src/multimedia/base/qmediaservice_p.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QABSTRACTMEDIASERVICE_P_H -#define QABSTRACTMEDIASERVICE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QAudioDeviceControl; - -class QMediaServicePrivate -{ -public: - QMediaServicePrivate(): q_ptr(0) {} - virtual ~QMediaServicePrivate() {} - - QMediaService *q_ptr; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qmediaserviceprovider.cpp b/src/multimedia/base/qmediaserviceprovider.cpp deleted file mode 100644 index b089b39..0000000 --- a/src/multimedia/base/qmediaserviceprovider.cpp +++ /dev/null @@ -1,738 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 -#include -#include "qmediapluginloader_p.h" -#include - -QT_BEGIN_NAMESPACE - -class QMediaServiceProviderHintPrivate : public QSharedData -{ -public: - QMediaServiceProviderHintPrivate(QMediaServiceProviderHint::Type type) - :type(type), features(0) - { - } - - QMediaServiceProviderHintPrivate(const QMediaServiceProviderHintPrivate &other) - :QSharedData(other), - type(other.type), - device(other.device), - mimeType(other.mimeType), - codecs(other.codecs), - features(other.features) - { - } - - ~QMediaServiceProviderHintPrivate() - { - } - - QMediaServiceProviderHint::Type type; - QByteArray device; - QString mimeType; - QStringList codecs; - QMediaServiceProviderHint::Features features; -}; - -/*! - \class QMediaServiceProviderHint - \preliminary - \since 4.7 - \brief The QMediaServiceProviderHint class describes what is required of a QMediaService. - - \ingroup multimedia-serv - - The QMediaServiceProvider class uses hints to select an appropriate media service. -*/ - -/*! - \enum QMediaServiceProviderHint::Feature - - Enumerates features a media service may provide. - - \value LowLatencyPlayback - The service is expected to play simple audio formats, - but playback should start without significant delay. - Such playback service can be used for beeps, ringtones, etc. - - \value RecordingSupport - The service provides audio or video recording functions. - - \value StreamPlayback - The service is capable of playing QIODevice based streams. -*/ - -/*! - \enum QMediaServiceProviderHint::Type - - Enumerates the possible types of media service provider hint. - - \value Null En empty hint, use the default service. - \value ContentType Select media service most suitable for certain content type. - \value Device Select media service which supports certain device. - \value SupportedFeatures Select media service supporting the set of optional features. -*/ - - -/*! - Constructs an empty media service provider hint. -*/ -QMediaServiceProviderHint::QMediaServiceProviderHint() - :d(new QMediaServiceProviderHintPrivate(Null)) -{ -} - -/*! - Constructs a ContentType media service provider hint. - - This type of hint describes a service that is able to play content of a specific MIME \a type - encoded with one or more of the listed \a codecs. -*/ -QMediaServiceProviderHint::QMediaServiceProviderHint(const QString &type, const QStringList& codecs) - :d(new QMediaServiceProviderHintPrivate(ContentType)) -{ - d->mimeType = type; - d->codecs = codecs; -} - -/*! - Constructs a Device media service provider hint. - - This type of hint describes a media service that utilizes a specific \a device. -*/ -QMediaServiceProviderHint::QMediaServiceProviderHint(const QByteArray &device) - :d(new QMediaServiceProviderHintPrivate(Device)) -{ - d->device = device; -} - -/*! - Constructs a SupportedFeatures media service provider hint. - - This type of hint describes a service which supports a specific set of \a features. -*/ -QMediaServiceProviderHint::QMediaServiceProviderHint(QMediaServiceProviderHint::Features features) - :d(new QMediaServiceProviderHintPrivate(SupportedFeatures)) -{ - d->features = features; -} - -/*! - Constructs a copy of the media service provider hint \a other. -*/ -QMediaServiceProviderHint::QMediaServiceProviderHint(const QMediaServiceProviderHint &other) - :d(other.d) -{ -} - -/*! - Destroys a media service provider hint. -*/ -QMediaServiceProviderHint::~QMediaServiceProviderHint() -{ -} - -/*! - Assigns the value \a other to a media service provider hint. -*/ -QMediaServiceProviderHint& QMediaServiceProviderHint::operator=(const QMediaServiceProviderHint &other) -{ - d = other.d; - return *this; -} - -/*! - Identifies if \a other is of equal value to a media service provider hint. - - Returns true if the hints are equal, and false if they are not. -*/ -bool QMediaServiceProviderHint::operator == (const QMediaServiceProviderHint &other) const -{ - return (d == other.d) || - (d->type == other.d->type && - d->device == other.d->device && - d->mimeType == other.d->mimeType && - d->codecs == other.d->codecs && - d->features == other.d->features); -} - -/*! - Identifies if \a other is not of equal value to a media service provider hint. - - Returns true if the hints are not equal, and false if they are. -*/ -bool QMediaServiceProviderHint::operator != (const QMediaServiceProviderHint &other) const -{ - return !(*this == other); -} - -/*! - Returns true if a media service provider is null. -*/ -bool QMediaServiceProviderHint::isNull() const -{ - return d->type == Null; -} - -/*! - Returns the type of a media service provider hint. -*/ -QMediaServiceProviderHint::Type QMediaServiceProviderHint::type() const -{ - return d->type; -} - -/*! - Returns the mime type of the media a service is expected to be able play. -*/ -QString QMediaServiceProviderHint::mimeType() const -{ - return d->mimeType; -} - -/*! - Returns a list of codes a media service is expected to be able to decode. -*/ -QStringList QMediaServiceProviderHint::codecs() const -{ - return d->codecs; -} - -/*! - Returns the name of a device a media service is expected to utilize. -*/ -QByteArray QMediaServiceProviderHint::device() const -{ - return d->device; -} - -/*! - Returns a set of features a media service is expected to provide. -*/ -QMediaServiceProviderHint::Features QMediaServiceProviderHint::features() const -{ - return d->features; -} - - -Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, loader, - (QMediaServiceProviderFactoryInterface_iid, QLatin1String("/mediaservices"), Qt::CaseInsensitive)) - - -class QPluginServiceProvider : public QMediaServiceProvider -{ - QMap pluginMap; - -public: - QMediaService* requestService(const QByteArray &type, const QMediaServiceProviderHint &hint) - { - QString key(QString::fromLatin1(type.constData(),type.length())); - - QListplugins; - foreach (QObject *obj, loader()->instances(key)) { - QMediaServiceProviderPlugin *plugin = - qobject_cast(obj); - if (plugin) - plugins << plugin; - } - - if (!plugins.isEmpty()) { - QMediaServiceProviderPlugin *plugin = 0; - - switch (hint.type()) { - case QMediaServiceProviderHint::Null: - plugin = plugins[0]; - //special case for media player, if low latency was not asked, - //prefer services not offering it, since they are likely to support - //more formats - if (type == QByteArray(Q_MEDIASERVICE_MEDIAPLAYER)) { - foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { - QMediaServiceFeaturesInterface *iface = - qobject_cast(currentPlugin); - - if (!iface || !(iface->supportedFeatures(type) & - QMediaServiceProviderHint::LowLatencyPlayback)) { - plugin = currentPlugin; - break; - } - - } - } - break; - case QMediaServiceProviderHint::SupportedFeatures: - plugin = plugins[0]; - foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { - QMediaServiceFeaturesInterface *iface = - qobject_cast(currentPlugin); - - if (iface) { - if ((iface->supportedFeatures(type) & hint.features()) == hint.features()) { - plugin = currentPlugin; - break; - } - } - } - break; - case QMediaServiceProviderHint::Device: { - foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { - QMediaServiceSupportedDevicesInterface *iface = - qobject_cast(currentPlugin); - - if (!iface) { - // the plugin may support the device, - // but this choice still can be overridden - plugin = currentPlugin; - } else { - if (iface->devices(type).contains(hint.device())) { - plugin = currentPlugin; - break; - } - } - } - } - break; - case QMediaServiceProviderHint::ContentType: { - QtMultimedia::SupportEstimate estimate = QtMultimedia::NotSupported; - foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { - QtMultimedia::SupportEstimate currentEstimate = QtMultimedia::MaybeSupported; - QMediaServiceSupportedFormatsInterface *iface = - qobject_cast(currentPlugin); - - if (iface) - currentEstimate = iface->hasSupport(hint.mimeType(), hint.codecs()); - - if (currentEstimate > estimate) { - estimate = currentEstimate; - plugin = currentPlugin; - - if (currentEstimate == QtMultimedia::PreferredService) - break; - } - } - } - break; - } - - if (plugin != 0) { - QMediaService *service = plugin->create(key); - if (service != 0) - pluginMap.insert(service, plugin); - - return service; - } - } - - qWarning() << "defaultServiceProvider::requestService(): no service found for -" << key; - return 0; - } - - void releaseService(QMediaService *service) - { - if (service != 0) { - QMediaServiceProviderPlugin *plugin = pluginMap.take(service); - - if (plugin != 0) - plugin->release(service); - } - } - - QtMultimedia::SupportEstimate hasSupport(const QByteArray &serviceType, - const QString &mimeType, - const QStringList& codecs, - int flags) const - { - QList instances = loader()->instances( - QString::fromLatin1(serviceType.constData(),serviceType.length())); - - if (instances.isEmpty()) - return QtMultimedia::NotSupported; - - bool allServicesProvideInterface = true; - QtMultimedia::SupportEstimate supportEstimate = QtMultimedia::NotSupported; - - foreach(QObject *obj, instances) { - QMediaServiceSupportedFormatsInterface *iface = - qobject_cast(obj); - - - if (flags) { - QMediaServiceFeaturesInterface *iface = - qobject_cast(obj); - - if (iface) { - QMediaServiceProviderHint::Features features = iface->supportedFeatures(serviceType); - - //if low latency playback was asked, skip services known - //not to provide low latency playback - if ((flags & QMediaPlayer::LowLatency) && - !(features & QMediaServiceProviderHint::LowLatencyPlayback)) - continue; - - //the same for QIODevice based streams support - if ((flags & QMediaPlayer::StreamPlayback) && - !(features & QMediaServiceProviderHint::StreamPlayback)) - continue; - } - } - - if (iface) - supportEstimate = qMax(supportEstimate, iface->hasSupport(mimeType, codecs)); - else - allServicesProvideInterface = false; - } - - //don't return PreferredService - supportEstimate = qMin(supportEstimate, QtMultimedia::ProbablySupported); - - //Return NotSupported only if no services are available of serviceType - //or all the services returned NotSupported, otherwise return at least MaybeSupported - if (!allServicesProvideInterface) - supportEstimate = qMax(QtMultimedia::MaybeSupported, supportEstimate); - - return supportEstimate; - } - - QStringList supportedMimeTypes(const QByteArray &serviceType, int flags) const - { - QList instances = loader()->instances( - QString::fromLatin1(serviceType.constData(),serviceType.length())); - - QStringList supportedTypes; - - foreach(QObject *obj, instances) { - QMediaServiceSupportedFormatsInterface *iface = - qobject_cast(obj); - - - if (flags & QMediaPlayer::LowLatency) { - QMediaServiceFeaturesInterface *iface = - qobject_cast(obj); - - if (iface) { - QMediaServiceProviderHint::Features features = iface->supportedFeatures(serviceType); - - // If low latency playback was asked for, skip MIME types from services known - // not to provide low latency playback - if ((flags & QMediaPlayer::LowLatency) && - !(features & QMediaServiceProviderHint::LowLatencyPlayback)) - continue; - - //the same for QIODevice based streams support - if ((flags & QMediaPlayer::StreamPlayback) && - !(features & QMediaServiceProviderHint::StreamPlayback)) - continue; - } - } - - if (iface) { - supportedTypes << iface->supportedMimeTypes(); - } - } - - // Multiple services may support the same MIME type - supportedTypes.removeDuplicates(); - - return supportedTypes; - } - - QList devices(const QByteArray &serviceType) const - { - QList res; - - foreach(QObject *obj, loader()->instances( - QString::fromLatin1(serviceType.constData(),serviceType.length()))) { - QMediaServiceSupportedDevicesInterface *iface = - qobject_cast(obj); - - if (iface) { - res.append(iface->devices(serviceType)); - } - } - - return res; - } - - QString deviceDescription(const QByteArray &serviceType, const QByteArray &device) - { - foreach(QObject *obj, loader()->instances( - QString::fromLatin1(serviceType.constData(),serviceType.length()))) { - QMediaServiceSupportedDevicesInterface *iface = - qobject_cast(obj); - - if (iface) { - if (iface->devices(serviceType).contains(device)) - return iface->deviceDescription(serviceType, device); - } - } - - return QString(); - } -}; - -Q_GLOBAL_STATIC(QPluginServiceProvider, pluginProvider); - -/*! - \class QMediaServiceProvider - \preliminary - \since 4.7 - \brief The QMediaServiceProvider class provides an abstract allocator for media services. -*/ - -/*! - \fn QMediaServiceProvider::requestService(const QByteArray &type, const QMediaServiceProviderHint &hint) - - Requests an instance of a \a type service which best matches the given \a hint. - - Returns a pointer to the requested service, or a null pointer if there is no suitable service. - - The returned service must be released with releaseService when it is finished with. -*/ - -/*! - \fn QMediaServiceProvider::releaseService(QMediaService *service) - - Releases a media \a service requested with requestService(). -*/ - -/*! - \fn QtMultimedia::SupportEstimate QMediaServiceProvider::hasSupport(const QByteArray &serviceType, const QString &mimeType, const QStringList& codecs, int flags) const - - Returns how confident a media service provider is that is can provide a \a serviceType - service that is able to play media of a specific \a mimeType that is encoded using the listed - \a codecs while adhearing to constraints identified in \a flags. -*/ -QtMultimedia::SupportEstimate QMediaServiceProvider::hasSupport(const QByteArray &serviceType, - const QString &mimeType, - const QStringList& codecs, - int flags) const -{ - Q_UNUSED(serviceType); - Q_UNUSED(mimeType); - Q_UNUSED(codecs); - Q_UNUSED(flags); - - return QtMultimedia::MaybeSupported; -} - -/*! - \fn QStringList QMediaServiceProvider::supportedMimeTypes(const QByteArray &serviceType, int flags) const - - Returns a list of MIME types supported by the service provider for the specified \a serviceType. - - The resultant list is restricted to MIME types which can be supported given the constraints in \a flags. -*/ -QStringList QMediaServiceProvider::supportedMimeTypes(const QByteArray &serviceType, int flags) const -{ - Q_UNUSED(serviceType); - Q_UNUSED(flags); - - return QStringList(); -} - -/*! - Returns the list of devices related to \a service type. -*/ -QList QMediaServiceProvider::devices(const QByteArray &service) const -{ - Q_UNUSED(service); - return QList(); -} - -/*! - Returns the description of \a device related to \a serviceType, - suitable to be displayed to user. -*/ -QString QMediaServiceProvider::deviceDescription(const QByteArray &serviceType, const QByteArray &device) -{ - Q_UNUSED(serviceType); - Q_UNUSED(device); - return QString(); -} - - -#ifdef QT_BUILD_INTERNAL - -static QMediaServiceProvider *qt_defaultMediaServiceProvider = 0; - -/*! - Sets a media service \a provider as the default. - - \internal -*/ -void QMediaServiceProvider::setDefaultServiceProvider(QMediaServiceProvider *provider) -{ - qt_defaultMediaServiceProvider = provider; -} - -#endif - -/*! - Returns a default provider of media services. -*/ -QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider() -{ -#ifdef QT_BUILD_INTERNAL - return qt_defaultMediaServiceProvider != 0 - ? qt_defaultMediaServiceProvider - : static_cast(pluginProvider()); -#else - return pluginProvider(); -#endif -} - -/*! - \class QMediaServiceProviderPlugin - \preliminary - \since 4.7 - \brief The QMediaServiceProviderPlugin class interface provides an interface for QMediaService - plug-ins. - - A media service provider plug-in may implement one or more of - QMediaServiceSupportedFormatsInterface, QMediaServiceSupportedDevicesInterface, - and QMediaServiceFeaturesInterface to identify the features it supports. -*/ - -/*! - \fn QMediaServiceProviderPlugin::keys() const - - Returns a list of keys for media services a plug-in can create. -*/ - -/*! - \fn QMediaServiceProviderPlugin::create(const QString &key) - - Constructs a new instance of the QMediaService identified by \a key. - - The QMediaService returned must be destroyed with release(). -*/ - -/*! - \fn QMediaServiceProviderPlugin::release(QMediaService *service) - - Destroys a media \a service constructed with create(). -*/ - - -/*! - \class QMediaServiceSupportedFormatsInterface - \brief The QMediaServiceSupportedFormatsInterface class interface - identifies if a media service plug-in supports a media format. - \since 4.7 - - A QMediaServiceProviderPlugin may implement this interface. -*/ - -/*! - \fn QMediaServiceSupportedFormatsInterface::~QMediaServiceSupportedFormatsInterface() - - Destroys a media service supported formats interface. -*/ - -/*! - \fn QMediaServiceSupportedFormatsInterface::hasSupport(const QString &mimeType, const QStringList& codecs) const - - Returns the level of support a media service plug-in has for a \a mimeType and set of \a codecs. -*/ - -/*! - \fn QMediaServiceSupportedFormatsInterface::supportedMimeTypes() const - - Returns a list of MIME types supported by the media service plug-in. -*/ - -/*! - \class QMediaServiceSupportedDevicesInterface - \brief The QMediaServiceSupportedDevicesInterface class interface - identifies the devices supported by a media service plug-in. - \since 4.7 - - A QMediaServiceProviderPlugin may implement this interface. -*/ - -/*! - \fn QMediaServiceSupportedDevicesInterface::~QMediaServiceSupportedDevicesInterface() - - Destroys a media service supported devices interface. -*/ - -/*! - \fn QMediaServiceSupportedDevicesInterface::devices(const QByteArray &service) const - - Returns a list of devices supported by a plug-in \a service. -*/ - -/*! - \fn QMediaServiceSupportedDevicesInterface::deviceDescription(const QByteArray &service, const QByteArray &device) - - Returns a description of a \a device supported by a plug-in \a service. -*/ - -/*! - \class QMediaServiceFeaturesInterface - \brief The QMediaServiceFeaturesInterface class interface identifies - features supported by a media service plug-in. - \since 4.7 - - A QMediaServiceProviderPlugin may implement this interface. -*/ - -/*! - \fn QMediaServiceFeaturesInterface::~QMediaServiceFeaturesInterface() - - Destroys a media service features interface. -*/ -/*! - \fn QMediaServiceFeaturesInterface::supportedFeatures(const QByteArray &service) const - - Returns a set of features supported by a plug-in \a service. -*/ - -QT_END_NAMESPACE - -#include "moc_qmediaserviceprovider.cpp" -#include "moc_qmediaserviceproviderplugin.cpp" diff --git a/src/multimedia/base/qmediaserviceprovider.h b/src/multimedia/base/qmediaserviceprovider.h deleted file mode 100644 index 6e31493..0000000 --- a/src/multimedia/base/qmediaserviceprovider.h +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIASERVICEPROVIDER_H -#define QMEDIASERVICEPROVIDER_H - -#include -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QMediaService; - -class QMediaServiceProviderHintPrivate; -class Q_MULTIMEDIA_EXPORT QMediaServiceProviderHint -{ -public: - enum Type { Null, ContentType, Device, SupportedFeatures }; - - enum Feature { - LowLatencyPlayback = 0x01, - RecordingSupport = 0x02, - StreamPlayback = 0x04 - }; - Q_DECLARE_FLAGS(Features, Feature) - - QMediaServiceProviderHint(); - QMediaServiceProviderHint(const QString &mimeType, const QStringList& codecs); - QMediaServiceProviderHint(const QByteArray &device); - QMediaServiceProviderHint(Features features); - QMediaServiceProviderHint(const QMediaServiceProviderHint &other); - ~QMediaServiceProviderHint(); - - QMediaServiceProviderHint& operator=(const QMediaServiceProviderHint &other); - - bool operator == (const QMediaServiceProviderHint &other) const; - bool operator != (const QMediaServiceProviderHint &other) const; - - bool isNull() const; - - Type type() const; - - QString mimeType() const; - QStringList codecs() const; - - QByteArray device() const; - - Features features() const; - - //to be extended, if necessary - -private: - QSharedDataPointer d; -}; - -class Q_MULTIMEDIA_EXPORT QMediaServiceProvider : public QObject -{ - Q_OBJECT - -public: - virtual QMediaService* requestService(const QByteArray &type, const QMediaServiceProviderHint &hint = QMediaServiceProviderHint()) = 0; - virtual void releaseService(QMediaService *service) = 0; - - virtual QtMultimedia::SupportEstimate hasSupport(const QByteArray &serviceType, - const QString &mimeType, - const QStringList& codecs, - int flags = 0) const; - virtual QStringList supportedMimeTypes(const QByteArray &serviceType, int flags = 0) const; - - virtual QList devices(const QByteArray &serviceType) const; - virtual QString deviceDescription(const QByteArray &serviceType, const QByteArray &device); - - static QMediaServiceProvider* defaultServiceProvider(); - -#ifdef QT_BUILD_INTERNAL - static void setDefaultServiceProvider(QMediaServiceProvider *provider); -#endif -}; - -/*! - Service with support for media playback - Required Controls: QMediaPlayerControl - Optional Controls: QMediaPlaylistControl, QAudioDeviceControl - Video Output Controls (used by QWideoWidget and QGraphicsVideoItem): - Required: QVideoOutputControl - Optional: QVideoWindowControl, QVideoRendererControl, QVideoWidgetControl -*/ -#define Q_MEDIASERVICE_MEDIAPLAYER "com.nokia.qt.mediaplayer" - -/*! - Service with support for recording from audio sources - Required Controls: QAudioDeviceControl - Recording Controls (QMediaRecorder): - Required: QMediaRecorderControl - Recommended: QAudioEncoderControl - Optional: QMediaContainerControl -*/ -#define Q_MEDIASERVICE_AUDIOSOURCE "com.nokia.qt.audiosource" - -/*! - Service with support for camera use. - Required Controls: QCameraControl - Optional Controls: QCameraExposureControl, QCameraFocusControl, QImageProcessingControl - Still Capture Controls: QImageCaptureControl - Recording Controls (QMediaRecorder): - Required: QMediaRecorderControl - Recommended: QAudioEncoderControl, QVideoEncoderControl, QMediaContainerControl - Viewfinder Video Output Controls (used by QWideoWidget and QGraphicsVideoItem): - Required: QVideoOutputControl - Optional: QVideoWindowControl, QVideoRendererControl, QVideoWidgetControl -*/ -#define Q_MEDIASERVICE_CAMERA "com.nokia.qt.camera" - -/*! - Service with support for radio tuning. - Required Controls: QRadioTunerControl - Recording Controls (Optional, used by QMediaRecorder): - Required: QMediaRecorderControl - Recommended: QAudioEncoderControl - Optional: QMediaContainerControl -*/ -#define Q_MEDIASERVICE_RADIO "com.nokia.qt.radio" - - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIASERVICEPROVIDER_H diff --git a/src/multimedia/base/qmediaserviceproviderplugin.h b/src/multimedia/base/qmediaserviceproviderplugin.h deleted file mode 100644 index b1e728b..0000000 --- a/src/multimedia/base/qmediaserviceproviderplugin.h +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIASERVICEPROVIDERPLUGIN_H -#define QMEDIASERVICEPROVIDERPLUGIN_H - -#include -#include -#include - -#include - -#ifdef Q_MOC_RUN -# pragma Q_MOC_EXPAND_MACROS -#endif - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QMediaService; - - -struct Q_MULTIMEDIA_EXPORT QMediaServiceProviderFactoryInterface : public QFactoryInterface -{ - virtual QStringList keys() const = 0; - virtual QMediaService* create(QString const& key) = 0; - virtual void release(QMediaService *service) = 0; -}; - -#define QMediaServiceProviderFactoryInterface_iid \ - "com.nokia.Qt.QMediaServiceProviderFactoryInterface/1.0" -Q_DECLARE_INTERFACE(QMediaServiceProviderFactoryInterface, QMediaServiceProviderFactoryInterface_iid) - - -struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedFormatsInterface -{ - virtual ~QMediaServiceSupportedFormatsInterface() {} - virtual QtMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const = 0; - virtual QStringList supportedMimeTypes() const = 0; -}; - -#define QMediaServiceSupportedFormatsInterface_iid \ - "com.nokia.Qt.QMediaServiceSupportedFormatsInterface/1.0" -Q_DECLARE_INTERFACE(QMediaServiceSupportedFormatsInterface, QMediaServiceSupportedFormatsInterface_iid) - - -struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedDevicesInterface -{ - virtual ~QMediaServiceSupportedDevicesInterface() {} - virtual QList devices(const QByteArray &service) const = 0; - virtual QString deviceDescription(const QByteArray &service, const QByteArray &device) = 0; -}; - -#define QMediaServiceSupportedDevicesInterface_iid \ - "com.nokia.Qt.QMediaServiceSupportedDevicesInterface/1.0" -Q_DECLARE_INTERFACE(QMediaServiceSupportedDevicesInterface, QMediaServiceSupportedDevicesInterface_iid) - - -struct Q_MULTIMEDIA_EXPORT QMediaServiceFeaturesInterface -{ - virtual ~QMediaServiceFeaturesInterface() {} - virtual QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const = 0; -}; - -#define QMediaServiceFeaturesInterface_iid \ - "com.nokia.Qt.QMediaServiceFeaturesInterface/1.0" -Q_DECLARE_INTERFACE(QMediaServiceFeaturesInterface, QMediaServiceFeaturesInterface_iid) - -class Q_MULTIMEDIA_EXPORT QMediaServiceProviderPlugin : public QObject, public QMediaServiceProviderFactoryInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceProviderFactoryInterface:QFactoryInterface) - -public: - virtual QStringList keys() const = 0; - virtual QMediaService* create(const QString& key) = 0; - virtual void release(QMediaService *service) = 0; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIASERVICEPROVIDERPLUGIN_H diff --git a/src/multimedia/base/qmediatimerange.cpp b/src/multimedia/base/qmediatimerange.cpp deleted file mode 100644 index e1cea7e..0000000 --- a/src/multimedia/base/qmediatimerange.cpp +++ /dev/null @@ -1,708 +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 - - -QT_BEGIN_NAMESPACE - -/*! - \class QMediaTimeInterval - \brief The QMediaTimeInterval class represents a time interval with integer precision. - \ingroup multimedia - \since 4.7 - - An interval is specified by an inclusive start() and end() time. - These must be set in the constructor, as this is an immutable class. - The specific units of time represented by the class have not been defined - - it is suitable for any times which can be represented by a signed 64 bit integer. - - The isNormal() method determines if a time interval is normal - (a normal time interval has start() <= end()). An abnormal interval can be converted - in to a normal interval by calling the normalized() method. - - The contains() method determines if a specified time lies within - the time interval. - - The translated() method returns a time interval which has been translated - forwards or backwards through time by a specified offset. - - \sa QMediaTimeRange -*/ - -/*! - \fn QMediaTimeInterval::QMediaTimeInterval() - - Constructs an empty interval. -*/ -QMediaTimeInterval::QMediaTimeInterval() - : s(0) - , e(0) -{ - -} - -/*! - \fn QMediaTimeInterval::QMediaTimeInterval(qint64 start, qint64 end) - - Constructs an interval with the specified \a start and \a end times. -*/ -QMediaTimeInterval::QMediaTimeInterval(qint64 start, qint64 end) - : s(start) - , e(end) -{ - -} - -/*! - \fn QMediaTimeInterval::QMediaTimeInterval(const QMediaTimeInterval &other) - - Constructs an interval by taking a copy of \a other. -*/ -QMediaTimeInterval::QMediaTimeInterval(const QMediaTimeInterval &other) - : s(other.s) - , e(other.e) -{ - -} - -/*! - \fn QMediaTimeInterval::start() const - - Returns the start time of the interval. - - \sa end() -*/ -qint64 QMediaTimeInterval::start() const -{ - return s; -} - -/*! - \fn QMediaTimeInterval::end() const - - Returns the end time of the interval. - - \sa start() -*/ -qint64 QMediaTimeInterval::end() const -{ - return e; -} - -/*! - \fn QMediaTimeInterval::contains(qint64 time) const - - Returns true if the time interval contains the specified \a time. - That is, start() <= time <= end(). -*/ -bool QMediaTimeInterval::contains(qint64 time) const -{ - return isNormal() ? (s <= time && time <= e) - : (e <= time && time <= s); -} - -/*! - \fn QMediaTimeInterval::isNormal() const - - Returns true if this time interval is normal. - A normal time interval has start() <= end(). - - \sa normalized() -*/ -bool QMediaTimeInterval::isNormal() const -{ - return s <= e; -} - -/*! - \fn QMediaTimeInterval::normalized() const - - Returns a normalized version of this interval. - - If the start() time of the interval is greater than the end() time, - then the returned interval has the start and end times swapped. -*/ -QMediaTimeInterval QMediaTimeInterval::normalized() const -{ - if(s > e) - return QMediaTimeInterval(e, s); - - return *this; -} - -/*! - \fn QMediaTimeInterval::translated(qint64 offset) const - - Returns a copy of this time interval, translated by a value of \a offset. - An interval can be moved forward through time with a positive offset, or backward - through time with a negative offset. -*/ -QMediaTimeInterval QMediaTimeInterval::translated(qint64 offset) const -{ - return QMediaTimeInterval(s + offset, e + offset); -} - -/*! - \fn operator==(const QMediaTimeInterval &a, const QMediaTimeInterval &b) - \relates QMediaTimeRange - - Returns true if \a a is exactly equal to \a b. -*/ -bool operator==(const QMediaTimeInterval &a, const QMediaTimeInterval &b) -{ - return a.start() == b.start() && a.end() == b.end(); -} - -/*! - \fn operator!=(const QMediaTimeInterval &a, const QMediaTimeInterval &b) - \relates QMediaTimeRange - - Returns true if \a a is not exactly equal to \a b. -*/ -bool operator!=(const QMediaTimeInterval &a, const QMediaTimeInterval &b) -{ - return a.start() != b.start() || a.end() != b.end(); -} - -class QMediaTimeRangePrivate : public QSharedData -{ -public: - - QMediaTimeRangePrivate(); - QMediaTimeRangePrivate(const QMediaTimeRangePrivate &other); - QMediaTimeRangePrivate(const QMediaTimeInterval &interval); - - QList intervals; - - void addInterval(const QMediaTimeInterval &interval); - void removeInterval(const QMediaTimeInterval &interval); -}; - -QMediaTimeRangePrivate::QMediaTimeRangePrivate() - : QSharedData() -{ - -} - -QMediaTimeRangePrivate::QMediaTimeRangePrivate(const QMediaTimeRangePrivate &other) - : QSharedData() - , intervals(other.intervals) -{ - -} - -QMediaTimeRangePrivate::QMediaTimeRangePrivate(const QMediaTimeInterval &interval) - : QSharedData() -{ - if(interval.isNormal()) - intervals << interval; -} - -void QMediaTimeRangePrivate::addInterval(const QMediaTimeInterval &interval) -{ - // Handle normalized intervals only - if(!interval.isNormal()) - return; - - // Find a place to insert the interval - int i; - for (i = 0; i < intervals.count(); i++) { - // Insert before this element - if(interval.s < intervals[i].s) { - intervals.insert(i, interval); - break; - } - } - - // Interval needs to be added to the end of the list - if (i == intervals.count()) - intervals.append(interval); - - // Do we need to correct the element before us? - if(i > 0 && intervals[i - 1].e >= interval.s - 1) - i--; - - // Merge trailing ranges - while (i < intervals.count() - 1 - && intervals[i].e >= intervals[i + 1].s - 1) { - intervals[i].e = qMax(intervals[i].e, intervals[i + 1].e); - intervals.removeAt(i + 1); - } -} - -void QMediaTimeRangePrivate::removeInterval(const QMediaTimeInterval &interval) -{ - // Handle normalized intervals only - if(!interval.isNormal()) - return; - - for (int i = 0; i < intervals.count(); i++) { - QMediaTimeInterval r = intervals[i]; - - if (r.e < interval.s) { - // Before the removal interval - continue; - } else if (interval.e < r.s) { - // After the removal interval - stop here - break; - } else if (r.s < interval.s && interval.e < r.e) { - // Split case - a single range has a chunk removed - intervals[i].e = interval.s -1; - addInterval(QMediaTimeInterval(interval.e + 1, r.e)); - break; - } else if (r.s < interval.s) { - // Trimming Tail Case - intervals[i].e = interval.s - 1; - } else if (interval.e < r.e) { - // Trimming Head Case - we can stop after this - intervals[i].s = interval.e + 1; - break; - } else { - // Complete coverage case - intervals.removeAt(i); - --i; - } - } -} - -/*! - \class QMediaTimeRange - \brief The QMediaTimeRange class represents a set of zero or more disjoint - time intervals. - \ingroup multimedia - \since 4.7 - - \reentrant - - The earliestTime(), latestTime(), intervals() and isEmpty() - methods are used to get information about the current time range. - - The addInterval(), removeInterval() and clear() methods are used to modify - the current time range. - - When adding or removing intervals from the time range, existing intervals - within the range may be expanded, trimmed, deleted, merged or split to ensure - that all intervals within the time range remain distinct and disjoint. As a - consequence, all intervals added or removed from a time range must be - \l{QMediaTimeInterval::isNormal()}{normal}. - - \sa QMediaTimeInterval -*/ - -/*! - \fn QMediaTimeRange::QMediaTimeRange() - - Constructs an empty time range. -*/ -QMediaTimeRange::QMediaTimeRange() - : d(new QMediaTimeRangePrivate) -{ - -} - -/*! - \fn QMediaTimeRange::QMediaTimeRange(qint64 start, qint64 end) - - Constructs a time range that contains an initial interval from - \a start to \a end inclusive. - - If the interval is not \l{QMediaTimeInterval::isNormal()}{normal}, - the resulting time range will be empty. - - \sa addInterval() -*/ -QMediaTimeRange::QMediaTimeRange(qint64 start, qint64 end) - : d(new QMediaTimeRangePrivate(QMediaTimeInterval(start, end))) -{ - -} - -/*! - \fn QMediaTimeRange::QMediaTimeRange(const QMediaTimeInterval &interval) - - Constructs a time range that contains an intitial interval, \a interval. - - If \a interval is not \l{QMediaTimeInterval::isNormal()}{normal}, - the resulting time range will be empty. - - \sa addInterval() -*/ -QMediaTimeRange::QMediaTimeRange(const QMediaTimeInterval &interval) - : d(new QMediaTimeRangePrivate(interval)) -{ - -} - -/*! - \fn QMediaTimeRange::QMediaTimeRange(const QMediaTimeRange &range) - - Constructs a time range by copying another time \a range. -*/ -QMediaTimeRange::QMediaTimeRange(const QMediaTimeRange &range) - : d(range.d) -{ - -} - -/*! - \fn QMediaTimeRange::~QMediaTimeRange() - - Destructor. -*/ -QMediaTimeRange::~QMediaTimeRange() -{ - -} - -/*! - \fn QMediaTimeRange::operator=(const QMediaTimeRange &other) - - Takes a copy of the \a other time range and returns itself. -*/ -QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeRange &other) -{ - d = other.d; - return *this; -} - -/*! - \fn QMediaTimeRange::operator=(const QMediaTimeInterval &interval) - - Sets the time range to a single continuous interval, \a interval. -*/ -QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeInterval &interval) -{ - d = new QMediaTimeRangePrivate(interval); - return *this; -} - -/*! - \fn QMediaTimeRange::earliestTime() const - - Returns the earliest time within the time range. - - For empty time ranges, this value is equal to zero. - - \sa latestTime() -*/ -qint64 QMediaTimeRange::earliestTime() const -{ - if (!d->intervals.isEmpty()) - return d->intervals[0].s; - - return 0; -} - -/*! - \fn QMediaTimeRange::latestTime() const - - Returns the latest time within the time range. - - For empty time ranges, this value is equal to zero. - - \sa earliestTime() -*/ -qint64 QMediaTimeRange::latestTime() const -{ - if (!d->intervals.isEmpty()) - return d->intervals[d->intervals.count() - 1].e; - - return 0; -} - -/*! - \fn QMediaTimeRange::addInterval(qint64 start, qint64 end) - \overload - - Adds the interval specified by \a start and \a end - to the time range. - - \sa addInterval() -*/ -void QMediaTimeRange::addInterval(qint64 start, qint64 end) -{ - d->addInterval(QMediaTimeInterval(start, end)); -} - -/*! - \fn QMediaTimeRange::addInterval(const QMediaTimeInterval &interval) - - Adds the specified \a interval to the time range. - - Adding intervals which are not \l{QMediaTimeInterval::isNormal()}{normal} - is invalid, and will be ignored. - - If the specified interval is adjacent to, or overlaps existing - intervals within the time range, these intervals will be merged. - - This operation takes \l{linear time} - - \sa removeInterval() -*/ -void QMediaTimeRange::addInterval(const QMediaTimeInterval &interval) -{ - d->addInterval(interval); -} - -/*! - \fn QMediaTimeRange::addTimeRange(const QMediaTimeRange &range) - - Adds each of the intervals in \a range to this time range. - - Equivalent to calling addInterval() for each interval in \a range. -*/ -void QMediaTimeRange::addTimeRange(const QMediaTimeRange &range) -{ - foreach(const QMediaTimeInterval &i, range.intervals()) { - d->addInterval(i); - } -} - -/*! - \fn QMediaTimeRange::removeInterval(qint64 start, qint64 end) - \overload - - Removes the interval specified by \a start and \a end - from the time range. - - \sa removeInterval() -*/ -void QMediaTimeRange::removeInterval(qint64 start, qint64 end) -{ - d->removeInterval(QMediaTimeInterval(start, end)); -} - -/*! - \fn QMediaTimeRange::removeInterval(const QMediaTimeInterval &interval) - - Removes the specified \a interval from the time range. - - Removing intervals which are not \l{QMediaTimeInterval::isNormal()}{normal} - is invalid, and will be ignored. - - Intervals within the time range will be trimmed, split or deleted - such that no intervals within the time range include any part of the - target interval. - - This operation takes \l{linear time} - - \sa addInterval() -*/ -void QMediaTimeRange::removeInterval(const QMediaTimeInterval &interval) -{ - d->removeInterval(interval); -} - -/*! - \fn QMediaTimeRange::removeTimeRange(const QMediaTimeRange &range) - - Removes each of the intervals in \a range from this time range. - - Equivalent to calling removeInterval() for each interval in \a range. -*/ -void QMediaTimeRange::removeTimeRange(const QMediaTimeRange &range) -{ - foreach(const QMediaTimeInterval &i, range.intervals()) { - d->removeInterval(i); - } -} - -/*! - \fn QMediaTimeRange::operator+=(const QMediaTimeRange &other) - - Adds each interval in \a other to the time range and returns the result. -*/ -QMediaTimeRange& QMediaTimeRange::operator+=(const QMediaTimeRange &other) -{ - addTimeRange(other); - return *this; -} - -/*! - \fn QMediaTimeRange::operator+=(const QMediaTimeInterval &interval) - - Adds the specified \a interval to the time range and returns the result. -*/ -QMediaTimeRange& QMediaTimeRange::operator+=(const QMediaTimeInterval &interval) -{ - addInterval(interval); - return *this; -} - -/*! - \fn QMediaTimeRange::operator-=(const QMediaTimeRange &other) - - Removes each interval in \a other from the time range and returns the result. -*/ -QMediaTimeRange& QMediaTimeRange::operator-=(const QMediaTimeRange &other) -{ - removeTimeRange(other); - return *this; -} - -/*! - \fn QMediaTimeRange::operator-=(const QMediaTimeInterval &interval) - - Removes the specified \a interval from the time range and returns the result. -*/ -QMediaTimeRange& QMediaTimeRange::operator-=(const QMediaTimeInterval &interval) -{ - removeInterval(interval); - return *this; -} - -/*! - \fn QMediaTimeRange::clear() - - Removes all intervals from the time range. - - \sa removeInterval() -*/ -void QMediaTimeRange::clear() -{ - d->intervals.clear(); -} - -/*! - \fn QMediaTimeRange::intervals() const - - Returns the list of intervals covered by this time range. -*/ -QList QMediaTimeRange::intervals() const -{ - return d->intervals; -} - -/*! - \fn QMediaTimeRange::isEmpty() const - - Returns true if there are no intervals within the time range. - - \sa intervals() -*/ -bool QMediaTimeRange::isEmpty() const -{ - return d->intervals.isEmpty(); -} - -/*! - \fn QMediaTimeRange::isContinuous() const - - Returns true if the time range consists of a continuous interval. - That is, there is one or fewer disjoint intervals within the time range. -*/ -bool QMediaTimeRange::isContinuous() const -{ - return (d->intervals.count() <= 1); -} - -/*! - \fn QMediaTimeRange::contains(qint64 time) const - - Returns true if the specified \a time lies within the time range. -*/ -bool QMediaTimeRange::contains(qint64 time) const -{ - for (int i = 0; i < d->intervals.count(); i++) { - if (d->intervals[i].contains(time)) - return true; - - if (time < d->intervals[i].s) - break; - } - - return false; -} - -/*! - \fn operator==(const QMediaTimeRange &a, const QMediaTimeRange &b) - \relates QMediaTimeRange - - Returns true if all intervals in \a a are present in \a b. -*/ -bool operator==(const QMediaTimeRange &a, const QMediaTimeRange &b) -{ - if (a.intervals().count() != b.intervals().count()) - return false; - - for (int i = 0; i < a.intervals().count(); i++) - { - if(a.intervals()[i] != b.intervals()[i]) - return false; - } - - return true; -} - -/*! - \fn operator!=(const QMediaTimeRange &a, const QMediaTimeRange &b) - \relates QMediaTimeRange - - Returns true if one or more intervals in \a a are not present in \a b. -*/ -bool operator!=(const QMediaTimeRange &a, const QMediaTimeRange &b) -{ - return !(a == b); -} - -/*! - \fn operator+(const QMediaTimeRange &r1, const QMediaTimeRange &r2) - - Returns a time range containing the union between \a r1 and \a r2. - */ -QMediaTimeRange operator+(const QMediaTimeRange &r1, const QMediaTimeRange &r2) -{ - return (QMediaTimeRange(r1) += r2); -} - -/*! - \fn operator-(const QMediaTimeRange &r1, const QMediaTimeRange &r2) - - Returns a time range containing \a r2 subtracted from \a r1. - */ -QMediaTimeRange operator-(const QMediaTimeRange &r1, const QMediaTimeRange &r2) -{ - return (QMediaTimeRange(r1) -= r2); -} - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qmediatimerange.h b/src/multimedia/base/qmediatimerange.h deleted file mode 100644 index a65629e..0000000 --- a/src/multimedia/base/qmediatimerange.h +++ /dev/null @@ -1,135 +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 QMEDIATIMERANGE_H -#define QMEDIATIMERANGE_H - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QMediaTimeRangePrivate; - -class Q_MULTIMEDIA_EXPORT QMediaTimeInterval -{ -public: - QMediaTimeInterval(); - QMediaTimeInterval(qint64 start, qint64 end); - QMediaTimeInterval(const QMediaTimeInterval&); - - qint64 start() const; - qint64 end() const; - - bool contains(qint64 time) const; - - bool isNormal() const; - QMediaTimeInterval normalized() const; - QMediaTimeInterval translated(qint64 offset) const; - -private: - friend class QMediaTimeRangePrivate; - friend class QMediaTimeRange; - - qint64 s; - qint64 e; -}; - -Q_MULTIMEDIA_EXPORT bool operator==(const QMediaTimeInterval&, const QMediaTimeInterval&); -Q_MULTIMEDIA_EXPORT bool operator!=(const QMediaTimeInterval&, const QMediaTimeInterval&); - -class Q_MULTIMEDIA_EXPORT QMediaTimeRange -{ -public: - - QMediaTimeRange(); - QMediaTimeRange(qint64 start, qint64 end); - QMediaTimeRange(const QMediaTimeInterval&); - QMediaTimeRange(const QMediaTimeRange &range); - ~QMediaTimeRange(); - - QMediaTimeRange &operator=(const QMediaTimeRange&); - QMediaTimeRange &operator=(const QMediaTimeInterval&); - - qint64 earliestTime() const; - qint64 latestTime() const; - - QList intervals() const; - bool isEmpty() const; - bool isContinuous() const; - - bool contains(qint64 time) const; - - void addInterval(qint64 start, qint64 end); - void addInterval(const QMediaTimeInterval &interval); - void addTimeRange(const QMediaTimeRange&); - - void removeInterval(qint64 start, qint64 end); - void removeInterval(const QMediaTimeInterval &interval); - void removeTimeRange(const QMediaTimeRange&); - - QMediaTimeRange& operator+=(const QMediaTimeRange&); - QMediaTimeRange& operator+=(const QMediaTimeInterval&); - QMediaTimeRange& operator-=(const QMediaTimeRange&); - QMediaTimeRange& operator-=(const QMediaTimeInterval&); - - void clear(); - -private: - QSharedDataPointer d; -}; - -Q_MULTIMEDIA_EXPORT bool operator==(const QMediaTimeRange&, const QMediaTimeRange&); -Q_MULTIMEDIA_EXPORT bool operator!=(const QMediaTimeRange&, const QMediaTimeRange&); -Q_MULTIMEDIA_EXPORT QMediaTimeRange operator+(const QMediaTimeRange&, const QMediaTimeRange&); -Q_MULTIMEDIA_EXPORT QMediaTimeRange operator-(const QMediaTimeRange&, const QMediaTimeRange&); - - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIATIMERANGE_H diff --git a/src/multimedia/base/qmetadatacontrol.cpp b/src/multimedia/base/qmetadatacontrol.cpp deleted file mode 100644 index 28a82ec..0000000 --- a/src/multimedia/base/qmetadatacontrol.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediacontrol_p.h" - - -QT_BEGIN_NAMESPACE - - -/*! - \class QMetaDataControl - \ingroup multimedia-serv - \since 4.7 - \preliminary - \brief The QMetaDataControl class provides access to the meta-data of a - QMediaService's media. - - If a QMediaService can provide read or write access to the meta-data of - its current media it will implement QMetaDataControl. This control - provides functions for both retrieving and setting meta-data values. - Meta-data may be addressed by the well defined keys in the - QtMultimedia::MetaData enumeration using the metaData() functions, or by - string keys using the extendedMetaData() functions. - - The functionality provided by this control is exposed to application - code by the meta-data members of QMediaObject, and so meta-data access - is potentially available in any of the media object classes. Any media - service may implement QMetaDataControl. - - The interface name of QMetaDataControl is \c com.nokia.Qt.QMetaDataControl/1.0 as - defined in QMetaDataControl_iid. - - \sa QMediaService::control(), QMediaObject -*/ - -/*! - \macro QMetaDataControl_iid - - \c com.nokia.Qt.QMetaDataControl/1.0 - - Defines the interface name of the QMetaDataControl class. - - \relates QMetaDataControl -*/ - -/*! - Construct a QMetaDataControl with \a parent. This class is meant as a base class - for service specific meta data providers so this constructor is protected. -*/ - -QMetaDataControl::QMetaDataControl(QObject *parent): - QMediaControl(*new QMediaControlPrivate, parent) -{ -} - -/*! - Destroy the meta-data object. -*/ - -QMetaDataControl::~QMetaDataControl() -{ -} - -/*! - \fn bool QMetaDataControl::isMetaDataAvailable() const - - Identifies if meta-data is available from a media service. - - Returns true if the meta-data is available and false otherwise. -*/ - -/*! - \fn bool QMetaDataControl::isWritable() const - - Identifies if a media service's meta-data can be edited. - - Returns true if the meta-data is writable and false otherwise. -*/ - -/*! - \fn QVariant QMetaDataControl::metaData(QtMultimedia::MetaData key) const - - Returns the meta-data for the given \a key. -*/ - -/*! - \fn void QMetaDataControl::setMetaData(QtMultimedia::MetaData key, const QVariant &value) - - Sets the \a value of the meta-data element with the given \a key. -*/ - -/*! - \fn QMetaDataControl::availableMetaData() const - - Returns a list of keys there is meta-data available for. -*/ - -/*! - \fn QMetaDataControl::extendedMetaData(const QString &key) const - - Returns the metaData for an abitrary string \a key. - - The valid selection of keys for extended meta-data is determined by the provider and the meaning - and type may differ between providers. -*/ - -/*! - \fn QMetaDataControl::setExtendedMetaData(const QString &key, const QVariant &value) - - Change the value of the meta-data element with an abitrary string \a key to \a value. - - The valid selection of keys for extended meta-data is determined by the provider and the meaning - and type may differ between providers. -*/ - -/*! - \fn QMetaDataControl::availableExtendedMetaData() const - - Returns a list of keys there is extended meta-data available for. -*/ - - -/*! - \fn void QMetaDataControl::metaDataChanged() - - Signal the changes of meta-data. -*/ - -/*! - \fn void QMetaDataControl::metaDataAvailableChanged(bool available) - - Signal the availability of meta-data has changed, \a available will - be true if the multimedia object has meta-data. -*/ - -/*! - \fn void QMetaDataControl::writableChanged(bool writable) - - Signal a change in the writable status of meta-data, \a writable will be - true if meta-data elements can be added or adjusted. -*/ - -#include "moc_qmetadatacontrol.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qmetadatacontrol.h b/src/multimedia/base/qmetadatacontrol.h deleted file mode 100644 index 8e18c16..0000000 --- a/src/multimedia/base/qmetadatacontrol.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMETADATACONTROL_H -#define QMETADATACONTROL_H - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class Q_MULTIMEDIA_EXPORT QMetaDataControl : public QMediaControl -{ - Q_OBJECT - -public: - ~QMetaDataControl(); - - virtual bool isWritable() const = 0; - virtual bool isMetaDataAvailable() const = 0; - - virtual QVariant metaData(QtMultimedia::MetaData key) const = 0; - virtual void setMetaData(QtMultimedia::MetaData key, const QVariant &value) = 0; - virtual QList availableMetaData() const = 0; - - virtual QVariant extendedMetaData(const QString &key) const = 0; - virtual void setExtendedMetaData(const QString &key, const QVariant &value) = 0; - virtual QStringList availableExtendedMetaData() const = 0; - -Q_SIGNALS: - void metaDataChanged(); - - void writableChanged(bool writable); - void metaDataAvailableChanged(bool available); - -protected: - QMetaDataControl(QObject *parent = 0); -}; - -#define QMetaDataControl_iid "com.nokia.Qt.QMetaDataControl/1.0" -Q_MEDIA_DECLARE_CONTROL(QMetaDataControl, QMetaDataControl_iid) - -QT_END_NAMESPACE - -QT_END_HEADER - - -#endif // QMETADATAPROVIDER_H diff --git a/src/multimedia/base/qpaintervideosurface.cpp b/src/multimedia/base/qpaintervideosurface.cpp deleted file mode 100644 index 2fe941b..0000000 --- a/src/multimedia/base/qpaintervideosurface.cpp +++ /dev/null @@ -1,1565 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qpaintervideosurface_p.h" -#include "qpaintervideosurface_mac_p.h" - -#include - -#include -#include -#include - -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) -#include -#endif - -#include - - -QT_BEGIN_NAMESPACE - -QVideoSurfacePainter::~QVideoSurfacePainter() -{ -} - -class QVideoSurfaceRasterPainter : public QVideoSurfacePainter -{ -public: - QVideoSurfaceRasterPainter(); - - QList supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const; - - bool isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const; - - QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format); - void stop(); - - QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame); - - QAbstractVideoSurface::Error paint( - const QRectF &target, QPainter *painter, const QRectF &source); - - void updateColors(int brightness, int contrast, int hue, int saturation); - -private: - QList m_imagePixelFormats; - QVideoFrame m_frame; - QSize m_imageSize; - QImage::Format m_imageFormat; - QVideoSurfaceFormat::Direction m_scanLineDirection; -}; - -QVideoSurfaceRasterPainter::QVideoSurfaceRasterPainter() - : m_imageFormat(QImage::Format_Invalid) - , m_scanLineDirection(QVideoSurfaceFormat::TopToBottom) -{ - m_imagePixelFormats - << QVideoFrame::Format_RGB32 -#ifndef QT_OPENGL_ES // The raster formats should be a subset of the GL formats. - << QVideoFrame::Format_RGB24 -#endif - << QVideoFrame::Format_ARGB32 - << QVideoFrame::Format_RGB565; -} - -QList QVideoSurfaceRasterPainter::supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const -{ - return handleType == QAbstractVideoBuffer::NoHandle - ? m_imagePixelFormats - : QList(); -} - -bool QVideoSurfaceRasterPainter::isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const -{ - return format.handleType() == QAbstractVideoBuffer::NoHandle - && m_imagePixelFormats.contains(format.pixelFormat()) - && !format.frameSize().isEmpty(); -} - -QAbstractVideoSurface::Error QVideoSurfaceRasterPainter::start(const QVideoSurfaceFormat &format) -{ - m_frame = QVideoFrame(); - m_imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()); - m_imageSize = format.frameSize(); - m_scanLineDirection = format.scanLineDirection(); - - return format.handleType() == QAbstractVideoBuffer::NoHandle - && m_imageFormat != QImage::Format_Invalid - && !m_imageSize.isEmpty() - ? QAbstractVideoSurface::NoError - : QAbstractVideoSurface::UnsupportedFormatError; -} - -void QVideoSurfaceRasterPainter::stop() -{ - m_frame = QVideoFrame(); -} - -QAbstractVideoSurface::Error QVideoSurfaceRasterPainter::setCurrentFrame(const QVideoFrame &frame) -{ - m_frame = frame; - - return QAbstractVideoSurface::NoError; -} - -QAbstractVideoSurface::Error QVideoSurfaceRasterPainter::paint( - const QRectF &target, QPainter *painter, const QRectF &source) -{ - if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) { - QImage image( - m_frame.bits(), - m_imageSize.width(), - m_imageSize.height(), - m_frame.bytesPerLine(), - m_imageFormat); - - if (m_scanLineDirection == QVideoSurfaceFormat::BottomToTop) { - const QTransform oldTransform = painter->transform(); - - painter->scale(1, -1); - painter->translate(0, -target.bottom()); - painter->drawImage( - QRectF(target.x(), 0, target.width(), target.height()), image, source); - painter->setTransform(oldTransform); - } else { - painter->drawImage(target, image, source); - } - - m_frame.unmap(); - } else if (m_frame.isValid()) { - return QAbstractVideoSurface::IncorrectFormatError; - } else { - painter->fillRect(target, Qt::black); - } - return QAbstractVideoSurface::NoError; -} - -void QVideoSurfaceRasterPainter::updateColors(int, int, int, int) -{ -} - -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - -#ifndef Q_WS_MAC -# ifndef APIENTRYP -# ifdef APIENTRY -# define APIENTRYP APIENTRY * -# else -# define APIENTRY -# define APIENTRYP * -# endif -# endif -#else -# define APIENTRY -# define APIENTRYP * -#endif - -#ifndef GL_TEXTURE0 -# define GL_TEXTURE0 0x84C0 -# define GL_TEXTURE1 0x84C1 -# define GL_TEXTURE2 0x84C2 -#endif -#ifndef GL_PROGRAM_ERROR_STRING_ARB -# define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#endif - -#ifndef GL_UNSIGNED_SHORT_5_6_5 -# define GL_UNSIGNED_SHORT_5_6_5 33635 -#endif - -class QVideoSurfaceGLPainter : public QVideoSurfacePainter -{ -public: - QVideoSurfaceGLPainter(QGLContext *context); - ~QVideoSurfaceGLPainter(); - QList supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const; - - bool isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const; - - QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame); - - void updateColors(int brightness, int contrast, int hue, int saturation); - -protected: - void initRgbTextureInfo(GLenum internalFormat, GLuint format, GLenum type, const QSize &size); - void initYuv420PTextureInfo(const QSize &size); - void initYv12TextureInfo(const QSize &size); - -#ifndef QT_OPENGL_ES - typedef void (APIENTRY *_glActiveTexture) (GLenum); - _glActiveTexture glActiveTexture; -#endif - - QList m_imagePixelFormats; - QList m_glPixelFormats; - QMatrix4x4 m_colorMatrix; - QVideoFrame m_frame; - - QGLContext *m_context; - QAbstractVideoBuffer::HandleType m_handleType; - QVideoSurfaceFormat::Direction m_scanLineDirection; - GLenum m_textureFormat; - GLuint m_textureInternalFormat; - GLenum m_textureType; - int m_textureCount; - GLuint m_textureIds[3]; - int m_textureWidths[3]; - int m_textureHeights[3]; - int m_textureOffsets[3]; - bool m_yuv; -}; - -QVideoSurfaceGLPainter::QVideoSurfaceGLPainter(QGLContext *context) - : m_context(context) - , m_handleType(QAbstractVideoBuffer::NoHandle) - , m_scanLineDirection(QVideoSurfaceFormat::TopToBottom) - , m_textureFormat(0) - , m_textureInternalFormat(0) - , m_textureType(0) - , m_textureCount(0) - , m_yuv(false) -{ -#ifndef QT_OPENGL_ES - glActiveTexture = (_glActiveTexture)m_context->getProcAddress(QLatin1String("glActiveTexture")); -#endif -} - -QVideoSurfaceGLPainter::~QVideoSurfaceGLPainter() -{ -} - -QList QVideoSurfaceGLPainter::supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const -{ - switch (handleType) { - case QAbstractVideoBuffer::NoHandle: - return m_imagePixelFormats; - case QAbstractVideoBuffer::GLTextureHandle: - return m_glPixelFormats; - default: - return QList(); - } -} - -bool QVideoSurfaceGLPainter::isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const -{ - if (format.frameSize().isEmpty()) { - return false; - } else { - switch (format.handleType()) { - case QAbstractVideoBuffer::NoHandle: - return m_imagePixelFormats.contains(format.pixelFormat()); - case QAbstractVideoBuffer::GLTextureHandle: - return m_glPixelFormats.contains(format.pixelFormat()); - default: - return false; - } - } -} - -QAbstractVideoSurface::Error QVideoSurfaceGLPainter::setCurrentFrame(const QVideoFrame &frame) -{ - m_frame = frame; - - if (m_handleType == QAbstractVideoBuffer::GLTextureHandle) { - m_textureIds[0] = frame.handle().toInt(); - } else if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) { - m_context->makeCurrent(); - - for (int i = 0; i < m_textureCount; ++i) { - glBindTexture(GL_TEXTURE_2D, m_textureIds[i]); - glTexImage2D( - GL_TEXTURE_2D, - 0, - m_textureInternalFormat, - m_textureWidths[i], - m_textureHeights[i], - 0, - m_textureFormat, - m_textureType, - m_frame.bits() + m_textureOffsets[i]); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - } - m_frame.unmap(); - } else if (m_frame.isValid()) { - return QAbstractVideoSurface::IncorrectFormatError; - } - - return QAbstractVideoSurface::NoError; -} - -void QVideoSurfaceGLPainter::updateColors(int brightness, int contrast, int hue, int saturation) -{ - const qreal b = brightness / 200.0; - const qreal c = contrast / 100.0 + 1.0; - const qreal h = hue / 100.0; - const qreal s = saturation / 100.0 + 1.0; - - const qreal cosH = qCos(M_PI * h); - const qreal sinH = qSin(M_PI * h); - - const qreal h11 = 0.787 * cosH - 0.213 * sinH + 0.213; - const qreal h21 = -0.213 * cosH + 0.143 * sinH + 0.213; - const qreal h31 = -0.213 * cosH - 0.787 * sinH + 0.213; - - const qreal h12 = -0.715 * cosH - 0.715 * sinH + 0.715; - const qreal h22 = 0.285 * cosH + 0.140 * sinH + 0.715; - const qreal h32 = -0.715 * cosH + 0.715 * sinH + 0.715; - - const qreal h13 = -0.072 * cosH + 0.928 * sinH + 0.072; - const qreal h23 = -0.072 * cosH - 0.283 * sinH + 0.072; - const qreal h33 = 0.928 * cosH + 0.072 * sinH + 0.072; - - const qreal sr = (1.0 - s) * 0.3086; - const qreal sg = (1.0 - s) * 0.6094; - const qreal sb = (1.0 - s) * 0.0820; - - const qreal sr_s = sr + s; - const qreal sg_s = sg + s; - const qreal sb_s = sr + s; - - const float m4 = (s + sr + sg + sb) * (0.5 - 0.5 * c + b); - - m_colorMatrix(0, 0) = c * (sr_s * h11 + sg * h21 + sb * h31); - m_colorMatrix(0, 1) = c * (sr_s * h12 + sg * h22 + sb * h32); - m_colorMatrix(0, 2) = c * (sr_s * h13 + sg * h23 + sb * h33); - m_colorMatrix(0, 3) = m4; - - m_colorMatrix(1, 0) = c * (sr * h11 + sg_s * h21 + sb * h31); - m_colorMatrix(1, 1) = c * (sr * h12 + sg_s * h22 + sb * h32); - m_colorMatrix(1, 2) = c * (sr * h13 + sg_s * h23 + sb * h33); - m_colorMatrix(1, 3) = m4; - - m_colorMatrix(2, 0) = c * (sr * h11 + sg * h21 + sb_s * h31); - m_colorMatrix(2, 1) = c * (sr * h12 + sg * h22 + sb_s * h32); - m_colorMatrix(2, 2) = c * (sr * h13 + sg * h23 + sb_s * h33); - m_colorMatrix(2, 3) = m4; - - m_colorMatrix(3, 0) = 0.0; - m_colorMatrix(3, 1) = 0.0; - m_colorMatrix(3, 2) = 0.0; - m_colorMatrix(3, 3) = 1.0; - - if (m_yuv) { - m_colorMatrix = m_colorMatrix * QMatrix4x4( - 1.0, 0.000, 1.140, -0.5700, - 1.0, -0.394, -0.581, 0.4875, - 1.0, 2.028, 0.000, -1.0140, - 0.0, 0.000, 0.000, 1.0000); - } -} - -void QVideoSurfaceGLPainter::initRgbTextureInfo( - GLenum internalFormat, GLuint format, GLenum type, const QSize &size) -{ - m_yuv = false; - m_textureInternalFormat = internalFormat; - m_textureFormat = format; - m_textureType = type; - m_textureCount = 1; - m_textureWidths[0] = size.width(); - m_textureHeights[0] = size.height(); - m_textureOffsets[0] = 0; -} - -void QVideoSurfaceGLPainter::initYuv420PTextureInfo(const QSize &size) -{ - int w = (size.width() + 3) & ~3; - int w2 = (size.width()/2 + 3) & ~3; - - m_yuv = true; - m_textureInternalFormat = GL_LUMINANCE; - m_textureFormat = GL_LUMINANCE; - m_textureType = GL_UNSIGNED_BYTE; - m_textureCount = 3; - m_textureWidths[0] = size.width(); - m_textureHeights[0] = size.height(); - m_textureOffsets[0] = 0; - m_textureWidths[1] = size.width() / 2; - m_textureHeights[1] = size.height() / 2; - m_textureOffsets[1] = w * size.height(); - m_textureWidths[2] = size.width() / 2; - m_textureHeights[2] = size.height() / 2; - m_textureOffsets[2] = w * size.height() + w2 * (size.height() / 2); -} - -void QVideoSurfaceGLPainter::initYv12TextureInfo(const QSize &size) -{ - int w = (size.width() + 3) & ~3; - int w2 = (size.width()/2 + 3) & ~3; - - m_yuv = true; - m_textureInternalFormat = GL_LUMINANCE; - m_textureFormat = GL_LUMINANCE; - m_textureType = GL_UNSIGNED_BYTE; - m_textureCount = 3; - m_textureWidths[0] = size.width(); - m_textureHeights[0] = size.height(); - m_textureOffsets[0] = 0; - m_textureWidths[1] = size.width() / 2; - m_textureHeights[1] = size.height() / 2; - m_textureOffsets[1] = w * size.height() + w2 * (size.height() / 2); - m_textureWidths[2] = size.width() / 2; - m_textureHeights[2] = size.height() / 2; - m_textureOffsets[2] = w * size.height(); -} - -#ifndef QT_OPENGL_ES - -# ifndef GL_FRAGMENT_PROGRAM_ARB -# define GL_FRAGMENT_PROGRAM_ARB 0x8804 -# define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -# endif - -// Paints an RGB32 frame -static const char *qt_arbfp_xrgbShaderProgram = - "!!ARBfp1.0\n" - "PARAM matrix[4] = { program.local[0..2]," - "{ 0.0, 0.0, 0.0, 1.0 } };\n" - "TEMP xrgb;\n" - "TEX xrgb.xyz, fragment.texcoord[0], texture[0], 2D;\n" - "MOV xrgb.w, matrix[3].w;\n" - "DP4 result.color.x, xrgb.zyxw, matrix[0];\n" - "DP4 result.color.y, xrgb.zyxw, matrix[1];\n" - "DP4 result.color.z, xrgb.zyxw, matrix[2];\n" - "END"; - -// Paints an ARGB frame. -static const char *qt_arbfp_argbShaderProgram = - "!!ARBfp1.0\n" - "PARAM matrix[4] = { program.local[0..2]," - "{ 0.0, 0.0, 0.0, 1.0 } };\n" - "TEMP argb;\n" - "TEX argb, fragment.texcoord[0], texture[0], 2D;\n" - "MOV argb.w, matrix[3].w;\n" - "DP4 result.color.x, argb.zyxw, matrix[0];\n" - "DP4 result.color.y, argb.zyxw, matrix[1];\n" - "DP4 result.color.z, argb.zyxw, matrix[2];\n" - "TEX result.color.w, fragment.texcoord[0], texture, 2D;\n" - "END"; - -// Paints an RGB(A) frame. -static const char *qt_arbfp_rgbShaderProgram = - "!!ARBfp1.0\n" - "PARAM matrix[4] = { program.local[0..2]," - "{ 0.0, 0.0, 0.0, 1.0 } };\n" - "TEMP rgb;\n" - "TEX rgb, fragment.texcoord[0], texture[0], 2D;\n" - "MOV rgb.w, matrix[3].w;\n" - "DP4 result.color.x, rgb, matrix[0];\n" - "DP4 result.color.y, rgb, matrix[1];\n" - "DP4 result.color.z, rgb, matrix[2];\n" - "TEX result.color.w, fragment.texcoord[0], texture, 2D;\n" - "END"; - -// Paints a YUV420P or YV12 frame. -static const char *qt_arbfp_yuvPlanarShaderProgram = - "!!ARBfp1.0\n" - "PARAM matrix[4] = { program.local[0..2]," - "{ 0.0, 0.0, 0.0, 1.0 } };\n" - "TEMP yuv;\n" - "TEX yuv.x, fragment.texcoord[0], texture[0], 2D;\n" - "TEX yuv.y, fragment.texcoord[0], texture[1], 2D;\n" - "TEX yuv.z, fragment.texcoord[0], texture[2], 2D;\n" - "MOV yuv.w, matrix[3].w;\n" - "DP4 result.color.x, yuv, matrix[0];\n" - "DP4 result.color.y, yuv, matrix[1];\n" - "DP4 result.color.z, yuv, matrix[2];\n" - "END"; - -// Paints a YUV444 frame. -static const char *qt_arbfp_xyuvShaderProgram = - "!!ARBfp1.0\n" - "PARAM matrix[4] = { program.local[0..2]," - "{ 0.0, 0.0, 0.0, 1.0 } };\n" - "TEMP ayuv;\n" - "TEX ayuv, fragment.texcoord[0], texture[0], 2D;\n" - "MOV ayuv.x, matrix[3].w;\n" - "DP4 result.color.x, ayuv.yzwx, matrix[0];\n" - "DP4 result.color.y, ayuv.yzwx, matrix[1];\n" - "DP4 result.color.z, ayuv.yzwx, matrix[2];\n" - "END"; - -// Paints a AYUV444 frame. -static const char *qt_arbfp_ayuvShaderProgram = - "!!ARBfp1.0\n" - "PARAM matrix[4] = { program.local[0..2]," - "{ 0.0, 0.0, 0.0, 1.0 } };\n" - "TEMP ayuv;\n" - "TEX ayuv, fragment.texcoord[0], texture[0], 2D;\n" - "MOV ayuv.x, matrix[3].w;\n" - "DP4 result.color.x, ayuv.yzwx, matrix[0];\n" - "DP4 result.color.y, ayuv.yzwx, matrix[1];\n" - "DP4 result.color.z, ayuv.yzwx, matrix[2];\n" - "TEX result.color.w, fragment.texcoord[0], texture, 2D;\n" - "END"; - -class QVideoSurfaceArbFpPainter : public QVideoSurfaceGLPainter -{ -public: - QVideoSurfaceArbFpPainter(QGLContext *context); - - QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format); - void stop(); - - QAbstractVideoSurface::Error paint( - const QRectF &target, QPainter *painter, const QRectF &source); - -private: - typedef void (APIENTRY *_glProgramStringARB) (GLenum, GLenum, GLsizei, const GLvoid *); - typedef void (APIENTRY *_glBindProgramARB) (GLenum, GLuint); - typedef void (APIENTRY *_glDeleteProgramsARB) (GLsizei, const GLuint *); - typedef void (APIENTRY *_glGenProgramsARB) (GLsizei, GLuint *); - typedef void (APIENTRY *_glProgramLocalParameter4fARB) ( - GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); - typedef void (APIENTRY *_glActiveTexture) (GLenum); - - _glProgramStringARB glProgramStringARB; - _glBindProgramARB glBindProgramARB; - _glDeleteProgramsARB glDeleteProgramsARB; - _glGenProgramsARB glGenProgramsARB; - _glProgramLocalParameter4fARB glProgramLocalParameter4fARB; - - GLuint m_programId; - QSize m_frameSize; -}; - -QVideoSurfaceArbFpPainter::QVideoSurfaceArbFpPainter(QGLContext *context) - : QVideoSurfaceGLPainter(context) - , m_programId(0) -{ - glProgramStringARB = (_glProgramStringARB) m_context->getProcAddress( - QLatin1String("glProgramStringARB")); - glBindProgramARB = (_glBindProgramARB) m_context->getProcAddress( - QLatin1String("glBindProgramARB")); - glDeleteProgramsARB = (_glDeleteProgramsARB) m_context->getProcAddress( - QLatin1String("glDeleteProgramsARB")); - glGenProgramsARB = (_glGenProgramsARB) m_context->getProcAddress( - QLatin1String("glGenProgramsARB")); - glProgramLocalParameter4fARB = (_glProgramLocalParameter4fARB) m_context->getProcAddress( - QLatin1String("glProgramLocalParameter4fARB")); - - m_imagePixelFormats - << QVideoFrame::Format_RGB32 - << QVideoFrame::Format_BGR32 - << QVideoFrame::Format_ARGB32 - << QVideoFrame::Format_RGB24 - << QVideoFrame::Format_BGR24 - << QVideoFrame::Format_RGB565 - << QVideoFrame::Format_AYUV444 - << QVideoFrame::Format_YUV444 - << QVideoFrame::Format_YV12 - << QVideoFrame::Format_YUV420P; - m_glPixelFormats - << QVideoFrame::Format_RGB32 - << QVideoFrame::Format_ARGB32; -} - -QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::start(const QVideoSurfaceFormat &format) -{ - Q_ASSERT(m_textureCount == 0); - - QAbstractVideoSurface::Error error = QAbstractVideoSurface::NoError; - - m_context->makeCurrent(); - - const char *program = 0; - - if (format.handleType() == QAbstractVideoBuffer::NoHandle) { - switch (format.pixelFormat()) { - case QVideoFrame::Format_RGB32: - initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - program = qt_arbfp_xrgbShaderProgram; - break; - case QVideoFrame::Format_BGR32: - initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - program = qt_arbfp_rgbShaderProgram; - break; - case QVideoFrame::Format_ARGB32: - initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - program = qt_arbfp_argbShaderProgram; - break; - case QVideoFrame::Format_RGB24: - initRgbTextureInfo(GL_RGB8, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - program = qt_arbfp_rgbShaderProgram; - break; - case QVideoFrame::Format_BGR24: - initRgbTextureInfo(GL_RGB8, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - program = qt_arbfp_xrgbShaderProgram; - break; - case QVideoFrame::Format_RGB565: - initRgbTextureInfo(GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, format.frameSize()); - program = qt_arbfp_rgbShaderProgram; - break; - case QVideoFrame::Format_YUV444: - initRgbTextureInfo(GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, format.frameSize()); - program = qt_arbfp_xyuvShaderProgram; - m_yuv = true; - break; - case QVideoFrame::Format_AYUV444: - initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - program = qt_arbfp_ayuvShaderProgram; - m_yuv = true; - break; - case QVideoFrame::Format_YV12: - initYv12TextureInfo(format.frameSize()); - program = qt_arbfp_yuvPlanarShaderProgram; - break; - case QVideoFrame::Format_YUV420P: - initYuv420PTextureInfo(format.frameSize()); - program = qt_arbfp_yuvPlanarShaderProgram; - break; - default: - break; - } - } else if (format.handleType() == QAbstractVideoBuffer::GLTextureHandle) { - switch (format.pixelFormat()) { - case QVideoFrame::Format_RGB32: - case QVideoFrame::Format_ARGB32: - m_yuv = false; - m_textureCount = 1; - program = qt_arbfp_rgbShaderProgram; - break; - default: - break; - } - } - - if (!program) { - error = QAbstractVideoSurface::UnsupportedFormatError; - } else { - glGenProgramsARB(1, &m_programId); - - GLenum glError = glGetError(); - if (glError != GL_NO_ERROR) { - qWarning("QPainterVideoSurface: ARBfb Shader allocation error %x", int(glError)); - m_textureCount = 0; - m_programId = 0; - - error = QAbstractVideoSurface::ResourceError; - } else { - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_programId); - glProgramStringARB( - GL_FRAGMENT_PROGRAM_ARB, - GL_PROGRAM_FORMAT_ASCII_ARB, - qstrlen(program), - reinterpret_cast(program)); - - if ((glError = glGetError()) != GL_NO_ERROR) { - const GLubyte* errorString = glGetString(GL_PROGRAM_ERROR_STRING_ARB); - - qWarning("QPainterVideoSurface: ARBfp Shader compile error %x, %s", - int(glError), - reinterpret_cast(errorString)); - glDeleteProgramsARB(1, &m_programId); - - m_textureCount = 0; - m_programId = 0; - - error = QAbstractVideoSurface::ResourceError; - } else { - m_handleType = format.handleType(); - m_scanLineDirection = format.scanLineDirection(); - m_frameSize = format.frameSize(); - - if (m_handleType == QAbstractVideoBuffer::NoHandle) - glGenTextures(m_textureCount, m_textureIds); - } - } - } - - return error; -} - -void QVideoSurfaceArbFpPainter::stop() -{ - m_context->makeCurrent(); - - if (m_handleType != QAbstractVideoBuffer::GLTextureHandle) - glDeleteTextures(m_textureCount, m_textureIds); - glDeleteProgramsARB(1, &m_programId); - - m_textureCount = 0; - m_programId = 0; - m_handleType = QAbstractVideoBuffer::NoHandle; -} - -QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::paint( - const QRectF &target, QPainter *painter, const QRectF &source) -{ - if (m_frame.isValid()) { - bool stencilTestEnabled = glIsEnabled(GL_STENCIL_TEST); - bool scissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST); - - painter->beginNativePainting(); - - if (stencilTestEnabled) - glEnable(GL_STENCIL_TEST); - if (scissorTestEnabled) - glEnable(GL_SCISSOR_TEST); - - const float txLeft = source.left() / m_frameSize.width(); - const float txRight = source.right() / m_frameSize.width(); - const float txTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? source.top() / m_frameSize.height() - : source.bottom() / m_frameSize.height(); - const float txBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? source.bottom() / m_frameSize.height() - : source.top() / m_frameSize.height(); - - - const float tx_array[] = - { - txLeft , txBottom, - txRight, txBottom, - txLeft , txTop, - txRight, txTop - }; - const float v_array[] = - { - float(target.left()) , float(target.bottom() + 1), - float(target.right() + 1), float(target.bottom() + 1), - float(target.left()) , float(target.top()), - float(target.right() + 1), float(target.top()) - }; - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_programId); - - glProgramLocalParameter4fARB( - GL_FRAGMENT_PROGRAM_ARB, - 0, - m_colorMatrix(0, 0), - m_colorMatrix(0, 1), - m_colorMatrix(0, 2), - m_colorMatrix(0, 3)); - glProgramLocalParameter4fARB( - GL_FRAGMENT_PROGRAM_ARB, - 1, - m_colorMatrix(1, 0), - m_colorMatrix(1, 1), - m_colorMatrix(1, 2), - m_colorMatrix(1, 3)); - glProgramLocalParameter4fARB( - GL_FRAGMENT_PROGRAM_ARB, - 2, - m_colorMatrix(2, 0), - m_colorMatrix(2, 1), - m_colorMatrix(2, 2), - m_colorMatrix(2, 3)); - - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, m_textureIds[0]); - - if (m_textureCount == 3) { - glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, m_textureIds[1]); - glActiveTexture(GL_TEXTURE2); - glBindTexture(GL_TEXTURE_2D, m_textureIds[2]); - glActiveTexture(GL_TEXTURE0); - } - - glVertexPointer(2, GL_FLOAT, 0, v_array); - glTexCoordPointer(2, GL_FLOAT, 0, tx_array); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_VERTEX_ARRAY); - glDisable(GL_FRAGMENT_PROGRAM_ARB); - - painter->endNativePainting(); - } - return QAbstractVideoSurface::NoError; -} - -#endif - -static const char *qt_glsl_vertexShaderProgram = - "attribute highp vec4 vertexCoordArray;\n" - "attribute highp vec2 textureCoordArray;\n" - "uniform highp mat4 positionMatrix;\n" - "varying highp vec2 textureCoord;\n" - "void main(void)\n" - "{\n" - " gl_Position = positionMatrix * vertexCoordArray;\n" - " textureCoord = textureCoordArray;\n" - "}\n"; - -// Paints an RGB32 frame -static const char *qt_glsl_xrgbShaderProgram = - "uniform sampler2D texRgb;\n" - "uniform mediump mat4 colorMatrix;\n" - "varying highp vec2 textureCoord;\n" - "void main(void)\n" - "{\n" - " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).bgr, 1.0);\n" - " gl_FragColor = colorMatrix * color;\n" - "}\n"; - -// Paints an ARGB frame. -static const char *qt_glsl_argbShaderProgram = - "uniform sampler2D texRgb;\n" - "uniform mediump mat4 colorMatrix;\n" - "varying highp vec2 textureCoord;\n" - "void main(void)\n" - "{\n" - " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).bgr, 1.0);\n" - " color = colorMatrix * color;\n" - " gl_FragColor = vec4(color.rgb, texture2D(texRgb, textureCoord.st).a);\n" - "}\n"; - -// Paints an RGB(A) frame. -static const char *qt_glsl_rgbShaderProgram = - "uniform sampler2D texRgb;\n" - "uniform mediump mat4 colorMatrix;\n" - "varying highp vec2 textureCoord;\n" - "void main(void)\n" - "{\n" - " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).rgb, 1.0);\n" - " color = colorMatrix * color;\n" - " gl_FragColor = vec4(color.rgb, texture2D(texRgb, textureCoord.st).a);\n" - "}\n"; - -// Paints a YUV420P or YV12 frame. -static const char *qt_glsl_yuvPlanarShaderProgram = - "uniform sampler2D texY;\n" - "uniform sampler2D texU;\n" - "uniform sampler2D texV;\n" - "uniform mediump mat4 colorMatrix;\n" - "varying highp vec2 textureCoord;\n" - "void main(void)\n" - "{\n" - " highp vec4 color = vec4(\n" - " texture2D(texY, textureCoord.st).r,\n" - " texture2D(texU, textureCoord.st).r,\n" - " texture2D(texV, textureCoord.st).r,\n" - " 1.0);\n" - " gl_FragColor = colorMatrix * color;\n" - "}\n"; - -// Paints a YUV444 frame. -static const char *qt_glsl_xyuvShaderProgram = - "uniform sampler2D texRgb;\n" - "uniform mediump mat4 colorMatrix;\n" - "varying highp vec2 textureCoord;\n" - "void main(void)\n" - "{\n" - " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).gba, 1.0);\n" - " gl_FragColor = colorMatrix * color;\n" - "}\n"; - -// Paints a AYUV444 frame. -static const char *qt_glsl_ayuvShaderProgram = - "uniform sampler2D texRgb;\n" - "uniform mediump mat4 colorMatrix;\n" - "varying highp vec2 textureCoord;\n" - "void main(void)\n" - "{\n" - " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).gba, 1.0);\n" - " color = colorMatrix * color;\n" - " gl_FragColor = vec4(color.rgb, texture2D(texRgb, textureCoord.st).r);\n" - "}\n"; - -class QVideoSurfaceGlslPainter : public QVideoSurfaceGLPainter -{ -public: - QVideoSurfaceGlslPainter(QGLContext *context); - - QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format); - void stop(); - - QAbstractVideoSurface::Error paint( - const QRectF &target, QPainter *painter, const QRectF &source); - -private: - QGLShaderProgram m_program; - QSize m_frameSize; -}; - -QVideoSurfaceGlslPainter::QVideoSurfaceGlslPainter(QGLContext *context) - : QVideoSurfaceGLPainter(context) - , m_program(context) -{ - m_imagePixelFormats - << QVideoFrame::Format_RGB32 - << QVideoFrame::Format_BGR32 - << QVideoFrame::Format_ARGB32 -#ifndef QT_OPENGL_ES - << QVideoFrame::Format_RGB24 - << QVideoFrame::Format_BGR24 -#endif - << QVideoFrame::Format_RGB565 - << QVideoFrame::Format_YUV444 - << QVideoFrame::Format_AYUV444 - << QVideoFrame::Format_YV12 - << QVideoFrame::Format_YUV420P; - m_glPixelFormats - << QVideoFrame::Format_RGB32 - << QVideoFrame::Format_ARGB32; -} - -QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::start(const QVideoSurfaceFormat &format) -{ - Q_ASSERT(m_textureCount == 0); - - QAbstractVideoSurface::Error error = QAbstractVideoSurface::NoError; - - m_context->makeCurrent(); - - const char *fragmentProgram = 0; - - if (format.handleType() == QAbstractVideoBuffer::NoHandle) { - switch (format.pixelFormat()) { - case QVideoFrame::Format_RGB32: - initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - fragmentProgram = qt_glsl_xrgbShaderProgram; - break; - case QVideoFrame::Format_BGR32: - initRgbTextureInfo(GL_RGB, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - fragmentProgram = qt_glsl_rgbShaderProgram; - break; - case QVideoFrame::Format_ARGB32: - initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - fragmentProgram = qt_glsl_argbShaderProgram; - break; -#ifndef QT_OPENGL_ES - case QVideoFrame::Format_RGB24: - initRgbTextureInfo(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, format.frameSize()); - fragmentProgram = qt_glsl_rgbShaderProgram; - break; - case QVideoFrame::Format_BGR24: - initRgbTextureInfo(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, format.frameSize()); - fragmentProgram = qt_glsl_argbShaderProgram; - break; -#endif - case QVideoFrame::Format_RGB565: - initRgbTextureInfo(GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, format.frameSize()); - fragmentProgram = qt_glsl_rgbShaderProgram; - break; - case QVideoFrame::Format_YUV444: - initRgbTextureInfo(GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, format.frameSize()); - fragmentProgram = qt_glsl_xyuvShaderProgram; - m_yuv = true; - break; - case QVideoFrame::Format_AYUV444: - initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); - fragmentProgram = qt_glsl_ayuvShaderProgram; - m_yuv = true; - break; - case QVideoFrame::Format_YV12: - initYv12TextureInfo(format.frameSize()); - fragmentProgram = qt_glsl_yuvPlanarShaderProgram; - break; - case QVideoFrame::Format_YUV420P: - initYuv420PTextureInfo(format.frameSize()); - fragmentProgram = qt_glsl_yuvPlanarShaderProgram; - break; - default: - break; - } - } else if (format.handleType() == QAbstractVideoBuffer::GLTextureHandle) { - switch (format.pixelFormat()) { - case QVideoFrame::Format_RGB32: - case QVideoFrame::Format_ARGB32: - m_yuv = false; - m_textureCount = 1; - fragmentProgram = qt_glsl_rgbShaderProgram; - break; - default: - break; - } - } - - if (!fragmentProgram) { - error = QAbstractVideoSurface::UnsupportedFormatError; - } else if (!m_program.addShaderFromSourceCode(QGLShader::Vertex, qt_glsl_vertexShaderProgram)) { - qWarning("QPainterVideoSurface: Vertex shader compile error %s", - qPrintable(m_program.log())); - error = QAbstractVideoSurface::ResourceError; - } else if (!m_program.addShaderFromSourceCode(QGLShader::Fragment, fragmentProgram)) { - qWarning("QPainterVideoSurface: Shader compile error %s", qPrintable(m_program.log())); - error = QAbstractVideoSurface::ResourceError; - m_program.removeAllShaders(); - } else if(!m_program.link()) { - qWarning("QPainterVideoSurface: Shader link error %s", qPrintable(m_program.log())); - m_program.removeAllShaders(); - error = QAbstractVideoSurface::ResourceError; - } else { - m_handleType = format.handleType(); - m_scanLineDirection = format.scanLineDirection(); - m_frameSize = format.frameSize(); - - if (m_handleType == QAbstractVideoBuffer::NoHandle) - glGenTextures(m_textureCount, m_textureIds); - } - - return error; -} - -void QVideoSurfaceGlslPainter::stop() -{ - m_context->makeCurrent(); - - if (m_handleType != QAbstractVideoBuffer::GLTextureHandle) - glDeleteTextures(m_textureCount, m_textureIds); - m_program.removeAllShaders(); - - m_textureCount = 0; - m_handleType = QAbstractVideoBuffer::NoHandle; -} - -QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint( - const QRectF &target, QPainter *painter, const QRectF &source) -{ - if (m_frame.isValid()) { - bool stencilTestEnabled = glIsEnabled(GL_STENCIL_TEST); - bool scissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST); - - painter->beginNativePainting(); - - if (stencilTestEnabled) - glEnable(GL_STENCIL_TEST); - if (scissorTestEnabled) - glEnable(GL_SCISSOR_TEST); - - const int width = QGLContext::currentContext()->device()->width(); - const int height = QGLContext::currentContext()->device()->height(); - - const QTransform transform = painter->deviceTransform(); - - const GLfloat wfactor = 2.0 / width; - const GLfloat hfactor = -2.0 / height; - - const GLfloat positionMatrix[4][4] = - { - { - /*(0,0)*/ GLfloat(wfactor * transform.m11() - transform.m13()), - /*(0,1)*/ GLfloat(hfactor * transform.m12() + transform.m13()), - /*(0,2)*/ 0.0, - /*(0,3)*/ GLfloat(transform.m13()) - }, { - /*(1,0)*/ GLfloat(wfactor * transform.m21() - transform.m23()), - /*(1,1)*/ GLfloat(hfactor * transform.m22() + transform.m23()), - /*(1,2)*/ 0.0, - /*(1,3)*/ GLfloat(transform.m23()) - }, { - /*(2,0)*/ 0.0, - /*(2,1)*/ 0.0, - /*(2,2)*/ -1.0, - /*(2,3)*/ 0.0 - }, { - /*(3,0)*/ GLfloat(wfactor * transform.dx() - transform.m33()), - /*(3,1)*/ GLfloat(hfactor * transform.dy() + transform.m33()), - /*(3,2)*/ 0.0, - /*(3,3)*/ GLfloat(transform.m33()) - } - }; - - const GLfloat vertexCoordArray[] = - { - GLfloat(target.left()) , GLfloat(target.bottom() + 1), - GLfloat(target.right() + 1), GLfloat(target.bottom() + 1), - GLfloat(target.left()) , GLfloat(target.top()), - GLfloat(target.right() + 1), GLfloat(target.top()) - }; - - const GLfloat txLeft = source.left() / m_frameSize.width(); - const GLfloat txRight = source.right() / m_frameSize.width(); - const GLfloat txTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? source.top() / m_frameSize.height() - : source.bottom() / m_frameSize.height(); - const GLfloat txBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? source.bottom() / m_frameSize.height() - : source.top() / m_frameSize.height(); - - const GLfloat textureCoordArray[] = - { - txLeft , txBottom, - txRight, txBottom, - txLeft , txTop, - txRight, txTop - }; - - m_program.bind(); - - m_program.enableAttributeArray("vertexCoordArray"); - m_program.enableAttributeArray("textureCoordArray"); - m_program.setAttributeArray("vertexCoordArray", vertexCoordArray, 2); - m_program.setAttributeArray("textureCoordArray", textureCoordArray, 2); - m_program.setUniformValue("positionMatrix", positionMatrix); - - if (m_textureCount == 3) { - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, m_textureIds[0]); - glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, m_textureIds[1]); - glActiveTexture(GL_TEXTURE2); - glBindTexture(GL_TEXTURE_2D, m_textureIds[2]); - glActiveTexture(GL_TEXTURE0); - - m_program.setUniformValue("texY", GLint(0)); - m_program.setUniformValue("texU", GLint(1)); - m_program.setUniformValue("texV", GLint(2)); - } else { - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, m_textureIds[0]); - - m_program.setUniformValue("texRgb", GLint(0)); - } - m_program.setUniformValue("colorMatrix", m_colorMatrix); - - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - - m_program.release(); - - painter->endNativePainting(); - } - return QAbstractVideoSurface::NoError; -} - -#endif - -/*! - \class QPainterVideoSurface - \internal -*/ - -/*! -*/ -QPainterVideoSurface::QPainterVideoSurface(QObject *parent) - : QAbstractVideoSurface(parent) - , m_painter(0) -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - , m_glContext(0) - , m_shaderTypes(NoShaders) - , m_shaderType(NoShaders) -#endif - , m_brightness(0) - , m_contrast(0) - , m_hue(0) - , m_saturation(0) - , m_pixelFormat(QVideoFrame::Format_Invalid) - , m_colorsDirty(true) - , m_ready(false) -{ -} - -/*! -*/ -QPainterVideoSurface::~QPainterVideoSurface() -{ - if (isActive()) - m_painter->stop(); - - delete m_painter; -} - -/*! -*/ -QList QPainterVideoSurface::supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const -{ - if (!m_painter) - const_cast(this)->createPainter(); - - return m_painter->supportedPixelFormats(handleType); -} - -/*! -*/ -bool QPainterVideoSurface::isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const -{ - if (!m_painter) - const_cast(this)->createPainter(); - - return m_painter->isFormatSupported(format, similar); -} - -/*! -*/ -bool QPainterVideoSurface::start(const QVideoSurfaceFormat &format) -{ - if (isActive()) - m_painter->stop(); - - if (!m_painter) - createPainter(); - - if (format.frameSize().isEmpty()) { - setError(UnsupportedFormatError); - } else { - QAbstractVideoSurface::Error error = m_painter->start(format); - - if (error != QAbstractVideoSurface::NoError) { - setError(error); - } else { - m_pixelFormat = format.pixelFormat(); - m_frameSize = format.frameSize(); - m_sourceRect = format.viewport(); - m_colorsDirty = true; - m_ready = true; - - return QAbstractVideoSurface::start(format); - } - } - - QAbstractVideoSurface::stop(); - - return false; -} - -/*! -*/ -void QPainterVideoSurface::stop() -{ - if (isActive()) { - m_painter->stop(); - m_ready = false; - - QAbstractVideoSurface::stop(); - } -} - -/*! -*/ -bool QPainterVideoSurface::present(const QVideoFrame &frame) -{ - if (!m_ready) { - if (!isActive()) - setError(StoppedError); - } else if (frame.isValid() - && (frame.pixelFormat() != m_pixelFormat || frame.size() != m_frameSize)) { - setError(IncorrectFormatError); - - stop(); - } else { - QAbstractVideoSurface::Error error = m_painter->setCurrentFrame(frame); - - if (error != QAbstractVideoSurface::NoError) { - setError(error); - - stop(); - } else { - m_ready = false; - - emit frameChanged(); - - return true; - } - } - return false; -} - -/*! -*/ -int QPainterVideoSurface::brightness() const -{ - return m_brightness; -} - -/*! -*/ -void QPainterVideoSurface::setBrightness(int brightness) -{ - m_brightness = brightness; - - m_colorsDirty = true; -} - -/*! -*/ -int QPainterVideoSurface::contrast() const -{ - return m_contrast; -} - -/*! -*/ -void QPainterVideoSurface::setContrast(int contrast) -{ - m_contrast = contrast; - - m_colorsDirty = true; -} - -/*! -*/ -int QPainterVideoSurface::hue() const -{ - return m_hue; -} - -/*! -*/ -void QPainterVideoSurface::setHue(int hue) -{ - m_hue = hue; - - m_colorsDirty = true; -} - -/*! -*/ -int QPainterVideoSurface::saturation() const -{ - return m_saturation; -} - -/*! -*/ -void QPainterVideoSurface::setSaturation(int saturation) -{ - m_saturation = saturation; - - m_colorsDirty = true; -} - -/*! -*/ -bool QPainterVideoSurface::isReady() const -{ - return m_ready; -} - -/*! -*/ -void QPainterVideoSurface::setReady(bool ready) -{ - m_ready = ready; -} - -/*! -*/ -void QPainterVideoSurface::paint(QPainter *painter, const QRectF &target, const QRectF &source) -{ - if (!isActive()) { - painter->fillRect(target, QBrush(Qt::black)); - } else { - if (m_colorsDirty) { - m_painter->updateColors(m_brightness, m_contrast, m_hue, m_saturation); - m_colorsDirty = false; - } - - const QRectF sourceRect( - m_sourceRect.x() + m_sourceRect.width() * source.x(), - m_sourceRect.y() + m_sourceRect.height() * source.y(), - m_sourceRect.width() * source.width(), - m_sourceRect.height() * source.height()); - - QAbstractVideoSurface::Error error = m_painter->paint(target, painter, sourceRect); - - if (error != QAbstractVideoSurface::NoError) { - setError(error); - - stop(); - } - } -} - -/*! - \fn QPainterVideoSurface::frameChanged() -*/ - -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - -/*! -*/ -const QGLContext *QPainterVideoSurface::glContext() const -{ - return m_glContext; -} - -/*! -*/ -void QPainterVideoSurface::setGLContext(QGLContext *context) -{ - if (m_glContext == context) - return; - - m_glContext = context; - - m_shaderTypes = NoShaders; - - if (m_glContext) { - m_glContext->makeCurrent(); - - const QByteArray extensions(reinterpret_cast(glGetString(GL_EXTENSIONS))); -#ifndef QT_OPENGL_ES - - if (extensions.contains("ARB_fragment_program")) - m_shaderTypes |= FragmentProgramShader; -#endif - - if (QGLShaderProgram::hasOpenGLShaderPrograms(m_glContext) - && extensions.contains("ARB_shader_objects")) - m_shaderTypes |= GlslShader; - } - - ShaderType type = (m_shaderType & m_shaderTypes) - ? m_shaderType - : NoShaders; - - if (type != m_shaderType || type != NoShaders) { - m_shaderType = type; - - if (isActive()) { - m_painter->stop(); - delete m_painter; - m_painter = 0; - m_ready = false; - - setError(ResourceError); - QAbstractVideoSurface::stop(); - } - emit supportedFormatsChanged(); - } -} - -/*! - \enum QPainterVideoSurface::ShaderType - - \value NoShaders - \value FragmentProgramShader - \value HlslShader -*/ - -/*! - \typedef QPainterVideoSurface::ShaderTypes -*/ - -/*! -*/ -QPainterVideoSurface::ShaderTypes QPainterVideoSurface::supportedShaderTypes() const -{ - return m_shaderTypes; -} - -/*! -*/ -QPainterVideoSurface::ShaderType QPainterVideoSurface::shaderType() const -{ - return m_shaderType; -} - -/*! -*/ -void QPainterVideoSurface::setShaderType(ShaderType type) -{ - if (!(type & m_shaderTypes)) - type = NoShaders; - - if (type != m_shaderType) { - m_shaderType = type; - - if (isActive()) { - m_painter->stop(); - delete m_painter; - m_painter = 0; - m_ready = false; - - setError(ResourceError); - QAbstractVideoSurface::stop(); - } else { - delete m_painter; - m_painter = 0; - } - emit supportedFormatsChanged(); - } -} - -#endif - -void QPainterVideoSurface::createPainter() -{ - Q_ASSERT(!m_painter); - -#ifdef Q_WS_MAC - if (m_glContext) - m_glContext->makeCurrent(); - - m_painter = new QVideoSurfaceCoreGraphicsPainter(m_glContext != 0); - return; -#endif - -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - switch (m_shaderType) { -#ifndef QT_OPENGL_ES - case FragmentProgramShader: - Q_ASSERT(m_glContext); - m_glContext->makeCurrent(); - m_painter = new QVideoSurfaceArbFpPainter(m_glContext); - break; -#endif - case GlslShader: - Q_ASSERT(m_glContext); - m_glContext->makeCurrent(); - m_painter = new QVideoSurfaceGlslPainter(m_glContext); - break; - default: - m_painter = new QVideoSurfaceRasterPainter; - break; - } -#else - m_painter = new QVideoSurfaceRasterPainter; -#endif -} - -QT_END_NAMESPACE - -#include "moc_qpaintervideosurface_p.cpp" - - diff --git a/src/multimedia/base/qpaintervideosurface_mac.mm b/src/multimedia/base/qpaintervideosurface_mac.mm deleted file mode 100644 index 1154f86..0000000 --- a/src/multimedia/base/qpaintervideosurface_mac.mm +++ /dev/null @@ -1,283 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qpaintervideosurface_mac_p.h" - -#include - -#include - -#include -#include -#include - -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -extern CGContextRef qt_mac_cg_context(const QPaintDevice *pdev); //qpaintdevice_mac.cpp - -QVideoSurfaceCoreGraphicsPainter::QVideoSurfaceCoreGraphicsPainter(bool glSupported) - : ciContext(0) - , m_imageFormat(QImage::Format_Invalid) - , m_scanLineDirection(QVideoSurfaceFormat::TopToBottom) -{ - //qDebug() << "QVideoSurfaceCoreGraphicsPainter, GL supported:" << glSupported; - ciContext = 0; - m_imagePixelFormats - << QVideoFrame::Format_RGB32; - - m_supportedHandles - << QAbstractVideoBuffer::NoHandle - << QAbstractVideoBuffer::CoreImageHandle; - - if (glSupported) - m_supportedHandles << QAbstractVideoBuffer::GLTextureHandle; -} - -QVideoSurfaceCoreGraphicsPainter::~QVideoSurfaceCoreGraphicsPainter() -{ - [(CIContext*)ciContext release]; -} - -QList QVideoSurfaceCoreGraphicsPainter::supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const -{ - return m_supportedHandles.contains(handleType) - ? m_imagePixelFormats - : QList(); -} - -bool QVideoSurfaceCoreGraphicsPainter::isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const -{ - return m_supportedHandles.contains(format.handleType()) - && m_imagePixelFormats.contains(format.pixelFormat()) - && !format.frameSize().isEmpty(); -} - -QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::start(const QVideoSurfaceFormat &format) -{ - m_frame = QVideoFrame(); - m_imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()); - m_imageSize = format.frameSize(); - m_scanLineDirection = format.scanLineDirection(); - - return m_supportedHandles.contains(format.handleType()) - && m_imageFormat != QImage::Format_Invalid - && !m_imageSize.isEmpty() - ? QAbstractVideoSurface::NoError - : QAbstractVideoSurface::UnsupportedFormatError; -} - -void QVideoSurfaceCoreGraphicsPainter::stop() -{ - m_frame = QVideoFrame(); -} - -QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::setCurrentFrame(const QVideoFrame &frame) -{ - m_frame = frame; - - return QAbstractVideoSurface::NoError; -} - -QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::paint( - const QRectF &target, QPainter *painter, const QRectF &source) -{ - if (m_frame.handleType() == QAbstractVideoBuffer::CoreImageHandle) { - if (painter->paintEngine()->type() == QPaintEngine::CoreGraphics ) { - - CIImage *img = (CIImage*)(m_frame.handle().value()); - - if (img) { - CGContextRef cgContext = qt_mac_cg_context(painter->device()); - - if (cgContext) { - painter->beginNativePainting(); - - CGRect sRect = CGRectMake(source.x(), source.y(), source.width(), source.height()); - CGRect dRect = CGRectMake(target.x(), target.y(), target.width(), target.height()); - - NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithCIImage:img]; - - if (m_scanLineDirection == QVideoSurfaceFormat::TopToBottom) { - CGContextSaveGState( cgContext ); - CGContextTranslateCTM(cgContext, 0, dRect.origin.y + CGRectGetMaxY(dRect)); - CGContextScaleCTM(cgContext, 1, -1); - -#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4) - if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_4) { - CGContextDrawImage(cgContext, dRect, [bitmap CGImage]); - } -#endif - - CGContextRestoreGState(cgContext); - } else { -#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4) - if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_4) { - CGContextDrawImage(cgContext, dRect, [bitmap CGImage]); - } -#endif - } - - [bitmap release]; - - painter->endNativePainting(); - - return QAbstractVideoSurface::NoError; - } - } - } else if (painter->paintEngine()->type() == QPaintEngine::OpenGL2 || - painter->paintEngine()->type() == QPaintEngine::OpenGL) { - CIImage *img = (CIImage*)(m_frame.handle().value()); - - if (img) { - CGLContextObj cglContext = CGLGetCurrentContext(); - - if (cglContext) { - - if (!ciContext) { - CGLContextObj cglContext = CGLGetCurrentContext(); - NSOpenGLPixelFormat *nsglPixelFormat = [NSOpenGLView defaultPixelFormat]; - CGLPixelFormatObj cglPixelFormat = static_cast([nsglPixelFormat CGLPixelFormatObj]); - - ciContext = [CIContext contextWithCGLContext:cglContext - pixelFormat:cglPixelFormat - options:nil]; - - [(CIContext*)ciContext retain]; - } - - CGRect sRect = CGRectMake(source.x(), source.y(), source.width(), source.height()); - CGRect dRect = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom ? - CGRectMake(target.x(), target.y()+target.height(), target.width(), -target.height()) : - CGRectMake(target.x(), target.y(), target.width(), target.height()); - - - painter->beginNativePainting(); - - [(CIContext*)ciContext drawImage:img inRect:dRect fromRect:sRect]; - - painter->endNativePainting(); - - return QAbstractVideoSurface::NoError; - } - } - } - } - - if (m_frame.handleType() == QAbstractVideoBuffer::GLTextureHandle && - (painter->paintEngine()->type() == QPaintEngine::OpenGL2 || - painter->paintEngine()->type() == QPaintEngine::OpenGL)) { - - painter->beginNativePainting(); - GLuint texture = m_frame.handle().toUInt(); - - glDisable(GL_CULL_FACE); - glEnable(GL_TEXTURE_2D); - - glBindTexture(GL_TEXTURE_2D, texture); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - const float txLeft = source.left() / m_frame.width(); - const float txRight = source.right() / m_frame.width(); - const float txTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? source.top() / m_frame.height() - : source.bottom() / m_frame.height(); - const float txBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom - ? source.bottom() / m_frame.height() - : source.top() / m_frame.height(); - - glBegin(GL_QUADS); - QRectF rect = target; - glTexCoord2f(txLeft, txBottom); - glVertex2f(rect.topLeft().x(), rect.topLeft().y()); - glTexCoord2f(txRight, txBottom); - glVertex2f(rect.topRight().x() + 1, rect.topRight().y()); - glTexCoord2f(txRight, txTop); - glVertex2f(rect.bottomRight().x() + 1, rect.bottomRight().y() + 1); - glTexCoord2f(txLeft, txTop); - glVertex2f(rect.bottomLeft().x(), rect.bottomLeft().y() + 1); - glEnd(); - painter->endNativePainting(); - - return QAbstractVideoSurface::NoError; - } - - //fallback case, software rendering - if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) { - QImage image( - m_frame.bits(), - m_imageSize.width(), - m_imageSize.height(), - m_frame.bytesPerLine(), - m_imageFormat); - - if (m_scanLineDirection == QVideoSurfaceFormat::BottomToTop) { - const QTransform oldTransform = painter->transform(); - - painter->scale(1, -1); - painter->translate(0, -target.bottom()); - painter->drawImage( - QRectF(target.x(), 0, target.width(), target.height()), image, source); - painter->setTransform(oldTransform); - } else { - painter->drawImage(target, image, source); - } - - m_frame.unmap(); - } else { - painter->fillRect(target, Qt::black); - } - return QAbstractVideoSurface::NoError; -} - -void QVideoSurfaceCoreGraphicsPainter::updateColors(int, int, int, int) -{ -} - -QT_END_NAMESPACE diff --git a/src/multimedia/base/qpaintervideosurface_mac_p.h b/src/multimedia/base/qpaintervideosurface_mac_p.h deleted file mode 100644 index 64442ed..0000000 --- a/src/multimedia/base/qpaintervideosurface_mac_p.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QPAINTERVIDEOSURFACE_MAC_P_H -#define QPAINTERVIDEOSURFACE_MAC_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qpaintervideosurface_p.h" -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QVideoSurfaceCoreGraphicsPainter : public QVideoSurfacePainter -{ -public: - QVideoSurfaceCoreGraphicsPainter(bool glSupported); - ~QVideoSurfaceCoreGraphicsPainter(); - - QList supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const; - - bool isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const; - - QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format); - void stop(); - - QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame); - - QAbstractVideoSurface::Error paint( - const QRectF &target, QPainter *painter, const QRectF &source); - - void updateColors(int brightness, int contrast, int hue, int saturation); - -private: - void* ciContext; - QList m_imagePixelFormats; - QVideoFrame m_frame; - QSize m_imageSize; - QImage::Format m_imageFormat; - QVector m_supportedHandles; - QVideoSurfaceFormat::Direction m_scanLineDirection; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qpaintervideosurface_p.h b/src/multimedia/base/qpaintervideosurface_p.h deleted file mode 100644 index caba3ba..0000000 --- a/src/multimedia/base/qpaintervideosurface_p.h +++ /dev/null @@ -1,178 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QPAINTERVIDEOSURFACE_P_H -#define QPAINTERVIDEOSURFACE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QGLContext; - -class QVideoSurfacePainter -{ -public: - virtual ~QVideoSurfacePainter(); - - virtual QList supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const = 0; - - virtual bool isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const = 0; - - virtual QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format) = 0; - virtual void stop() = 0; - - virtual QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame) = 0; - - virtual QAbstractVideoSurface::Error paint( - const QRectF &target, QPainter *painter, const QRectF &source) = 0; - - virtual void updateColors(int brightness, int contrast, int hue, int saturation) = 0; -}; - -class Q_MULTIMEDIA_EXPORT QPainterVideoSurface : public QAbstractVideoSurface -{ - Q_OBJECT -public: - explicit QPainterVideoSurface(QObject *parent = 0); - ~QPainterVideoSurface(); - - QList supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const; - - bool isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar = 0) const; - - bool start(const QVideoSurfaceFormat &format); - void stop(); - - bool present(const QVideoFrame &frame); - - int brightness() const; - void setBrightness(int brightness); - - int contrast() const; - void setContrast(int contrast); - - int hue() const; - void setHue(int hue); - - int saturation() const; - void setSaturation(int saturation); - - bool isReady() const; - void setReady(bool ready); - - void paint(QPainter *painter, const QRectF &target, const QRectF &source = QRectF(0, 0, 1, 1)); - -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - const QGLContext *glContext() const; - void setGLContext(QGLContext *context); - - enum ShaderType - { - NoShaders = 0x00, - FragmentProgramShader = 0x01, - GlslShader = 0x02 - }; - - Q_DECLARE_FLAGS(ShaderTypes, ShaderType) - - ShaderTypes supportedShaderTypes() const; - - ShaderType shaderType() const; - void setShaderType(ShaderType type); -#endif - -Q_SIGNALS: - void frameChanged(); - -private: - void createPainter(); - - QVideoSurfacePainter *m_painter; -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - QGLContext *m_glContext; - ShaderTypes m_shaderTypes; - ShaderType m_shaderType; -#endif - int m_brightness; - int m_contrast; - int m_hue; - int m_saturation; - - QVideoFrame::PixelFormat m_pixelFormat; - QSize m_frameSize; - QRect m_sourceRect; - bool m_colorsDirty; - bool m_ready; -}; - -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) -Q_DECLARE_OPERATORS_FOR_FLAGS(QPainterVideoSurface::ShaderTypes) -#endif - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qtmedianamespace.h b/src/multimedia/base/qtmedianamespace.h deleted file mode 100644 index 1e04da8..0000000 --- a/src/multimedia/base/qtmedianamespace.h +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QTMEDIANAMESPACE_H -#define QTMEDIANAMESPACE_H - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -namespace QtMultimedia -{ - enum MetaData - { - // Common - Title, - SubTitle, - Author, - Comment, - Description, - Category, - Genre, - Year, - Date, - UserRating, - Keywords, - Language, - Publisher, - Copyright, - ParentalRating, - RatingOrganisation, - - // Media - Size, - MediaType, - Duration, - - // Audio - AudioBitRate, - AudioCodec, - AverageLevel, - ChannelCount, - PeakValue, - SampleRate, - - // Music - AlbumTitle, - AlbumArtist, - ContributingArtist, - Composer, - Conductor, - Lyrics, - Mood, - TrackNumber, - TrackCount, - - CoverArtUrlSmall, - CoverArtUrlLarge, - - // Image/Video - Resolution, - PixelAspectRatio, - - // Video - VideoFrameRate, - VideoBitRate, - VideoCodec, - - PosterUrl, - - // Movie - ChapterNumber, - Director, - LeadPerformer, - Writer, - - // Photos - CameraManufacturer, - CameraModel, - Event, - Subject, - Orientation, - ExposureTime, - FNumber, - ExposureProgram, - ISOSpeedRatings, - ExposureBiasValue, - DateTimeOriginal, - DateTimeDigitized, - SubjectDistance, - MeteringMode, - LightSource, - Flash, - FocalLength, - ExposureMode, - WhiteBalance, - DigitalZoomRatio, - FocalLengthIn35mmFilm, - SceneCaptureType, - GainControl, - Contrast, - Saturation, - Sharpness, - DeviceSettingDescription, - - PosterImage, - CoverArtImage, - ThumbnailImage - - }; - - enum SupportEstimate - { - NotSupported, - MaybeSupported, - ProbablySupported, - PreferredService - }; - - enum EncodingQuality - { - VeryLowQuality, - LowQuality, - NormalQuality, - HighQuality, - VeryHighQuality - }; - - enum EncodingMode - { - ConstantQualityEncoding, - ConstantBitRateEncoding, - AverageBitRateEncoding, - TwoPassEncoding - }; - - enum AvailabilityError - { - NoError, - ServiceMissingError, - BusyError, - ResourceError - }; - -} - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qtmedianamespace.qdoc b/src/multimedia/base/qtmedianamespace.qdoc deleted file mode 100644 index 277b1a5..0000000 --- a/src/multimedia/base/qtmedianamespace.qdoc +++ /dev/null @@ -1,214 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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$ -** -****************************************************************************/ - -/*! - \namespace QtMultimedia - \ingroup multimedia - - \brief The QtMultimedia namespace contains miscellaneous identifiers used - throughout the Qt Multimedia library. -*/ - -/*! - \enum QtMultimedia::MetaData - - This enum provides identifiers for meta-data attributes. - - Common attributes - \value Title The title of the media. QString. - \value SubTitle The sub-title of the media. QString. - \value Author The authors of the media. QStringList. - \value Comment A user comment about the media. QString. - \value Description A description of the media. QString - \value Category The category of the media. QStringList. - \value Genre The genre of the media. QStringList. - \value Year The year of release of the media. int. - \value Date The date of the media. QDate. - \value UserRating A user rating of the media. int [0..100]. - \value Keywords A list of keywords describing the media. QStringList. - \value Language The language of media, as an ISO 639-2 code. - - \value Publisher The publisher of the media. QString. - \value Copyright The media's copyright notice. QString. - \value ParentalRating The parental rating of the media. QString. - \value RatingOrganisation The organisation responsible for the parental rating of the media. - QString. - - Media attributes - \value Size The size in bytes of the media. qint64 - \value MediaType The type of the media (audio, video, etc). QString. - \value Duration The duration in millseconds of the media. qint64. - - Audio attributes - \value AudioBitRate The bit rate of the media's audio stream in bits per second. int. - \value AudioCodec The codec of the media's audio stream. QString. - \value AverageLevel The average volume level of the media. int. - \value ChannelCount The number of channels in the media's audio stream. int. - \value PeakValue The peak volume of the media's audio stream. int - \value SampleRate The sample rate of the media's audio stream in hertz. int - - Music attributes - \value AlbumTitle The title of the album the media belongs to. QString. - \value AlbumArtist The principal artist of the album the media belongs to. QString. - \value ContributingArtist The artists contributing to the media. QStringList. - \value Composer The composer of the media. QStringList. - \value Conductor The conductor of the media. QString. - \value Lyrics The lyrics to the media. QString. - \value Mood The mood of the media. QString. - \value TrackNumber The track number of the media. int. - \value TrackCount The number of tracks on the album containing the media. int. - - \value CoverArtUrlSmall The URL of a small cover art image. QUrl. - \value CoverArtUrlLarge The URL of a large cover art image. QUrl. - \value CoverArtImage An embedded cover art image. QImage. - - Image and video attributes - \value Resolution The dimensions of an image or video. QSize. - \value PixelAspectRatio The pixel aspect ratio of an image or video. QSize. - - Video attributes - \value VideoFrameRate The frame rate of the media's video stream. qreal. - \value VideoBitRate The bit rate of the media's video stream in bits per second. int. - \value VideoCodec The codec of the media's video stream. QString. - - \value PosterUrl The URL of a poster image. QUrl. - \value PosterImage An embedded poster image. QImage. - - Movie attributes - \value ChapterNumber The chapter number of the media. int. - \value Director The director of the media. QString. - \value LeadPerformer The lead performer in the media. QStringList. - \value Writer The writer of the media. QStringList. - - Photo attributes. - \value CameraManufacturer The manufacturer of the camera used to capture the media. QString. - \value CameraModel The model of the camera used to capture the media. QString. - \value Event The event during which the media was captured. QString. - \value Subject The subject of the media. QString. - \value Orientation Orientation of image. - \value ExposureTime Exposure time, given in seconds. - \value FNumber The F Number. - \value ExposureProgram - The class of the program used by the camera to set exposure when the picture is taken. - \value ISOSpeedRatings - Indicates the ISO Speed and ISO Latitude of the camera or input device as specified in ISO 12232. - \value ExposureBiasValue - The exposure bias. - The unit is the APEX (Additive System of Photographic Exposure) setting. - \value DateTimeOriginal The date and time when the original image data was generated. - \value DateTimeDigitized The date and time when the image was stored as digital data. - \value SubjectDistance The distance to the subject, given in meters. - \value MeteringMode The metering mode. - \value LightSource - The kind of light source. - \value Flash - Status of flash when the image was shot. - \value FocalLength - The actual focal length of the lens, in mm. - \value ExposureMode - Indicates the exposure mode set when the image was shot. - \value WhiteBalance - Indicates the white balance mode set when the image was shot. - \value DigitalZoomRatio - Indicates the digital zoom ratio when the image was shot. - \value FocalLengthIn35mmFilm - Indicates the equivalent focal length assuming a 35mm film camera, in mm. - \value SceneCaptureType - Indicates the type of scene that was shot. - It can also be used to record the mode in which the image was shot. - \value GainControl - Indicates the degree of overall image gain adjustment. - \value Contrast - Indicates the direction of contrast processing applied by the camera when the image was shot. - \value Saturation - Indicates the direction of saturation processing applied by the camera when the image was shot. - \value Sharpness - Indicates the direction of sharpness processing applied by the camera when the image was shot. - \value DeviceSettingDescription - Exif tag, indicates information on the picture-taking conditions of a particular camera model. QString - - \value ThumbnailImage An embedded thumbnail image. QImage. -*/ - -/*! - \enum QtMultimedia::SupportEstimate - - Enumerates the levels of support a media service provider may have for a feature. - - \value NotSupported The feature is not supported. - \value MaybeSupported The feature may be supported. - \value ProbablySupported The feature is probably supported. - \value PreferredService The service is the preferred provider of a service. -*/ - -/*! - \enum QtMultimedia::EncodingQuality - - Enumerates quality encoding levels. - - \value VeryLowQuality - \value LowQuality - \value NormalQuality - \value HighQuality - \value VeryHighQuality -*/ - -/*! - \enum QtMultimedia::EncodingMode - - Enumerates encoding modes. - - \value ConstantQualityEncoding - \value ConstantBitRateEncoding - \value AverageBitRateEncoding - \value TwoPassEncoding -*/ - -/*! - \enum QtMultimedia::AvailabilityError - - Enumerates Service status errors. - - \value NoError - \value ServiceMissingError - \value ResourceError - \value BusyError -*/ diff --git a/src/multimedia/base/qvideodevicecontrol.cpp b/src/multimedia/base/qvideodevicecontrol.cpp deleted file mode 100644 index c0fe9a8..0000000 --- a/src/multimedia/base/qvideodevicecontrol.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -/*! - \class QVideoDeviceControl - \preliminary - \since 4.7 - \brief The QVideoDeviceControl class provides an video device selector media control. - \ingroup multimedia-serv - - The QVideoDeviceControl class provides descriptions of the video devices - available on a system and allows one to be selected as the endpoint of - a media service. - - The interface name of QVideoDeviceControl is \c com.nokia.Qt.VideoDeviceControl as - defined in QVideoDeviceControl_iid. -*/ - -/*! - \macro QVideoDeviceControl_iid - - \c com.nokia.Qt.VideoDeviceControl - - Defines the interface name of the QVideoDeviceControl class. - - \relates QVideoDeviceControl -*/ - -/*! - Constructs a video device control with the given \a parent. -*/ -QVideoDeviceControl::QVideoDeviceControl(QObject *parent) - :QMediaControl(parent) -{ -} - -/*! - Destroys a video device control. -*/ -QVideoDeviceControl::~QVideoDeviceControl() -{ -} - -/*! - \fn QVideoDeviceControl::deviceCount() const - - Returns the number of available video devices; -*/ - -/*! - \fn QVideoDeviceControl::deviceName(int index) const - - Returns the name of the video device at \a index. -*/ - -/*! - \fn QVideoDeviceControl::deviceDescription(int index) const - - Returns a description of the video device at \a index. -*/ - -/*! - \fn QVideoDeviceControl::deviceIcon(int index) const - - Returns an icon for the video device at \a index. -*/ - -/*! - \fn QVideoDeviceControl::defaultDevice() const - - Returns the index of the default video device. -*/ - -/*! - \fn QVideoDeviceControl::selectedDevice() const - - Returns the index of the selected video device. -*/ - -/*! - \fn QVideoDeviceControl::setSelectedDevice(int index) - - Sets the selected video device \a index. -*/ - -/*! - \fn QVideoDeviceControl::devicesChanged() - - Signals that the list of available video devices has changed. -*/ - -/*! - \fn QVideoDeviceControl::selectedDeviceChanged(int index) - - Signals that the selected video device \a index has changed. -*/ - -/*! - \fn QVideoDeviceControl::selectedDeviceChanged(const QString &name) - - Signals that the selected video device \a name has changed. -*/ - -QT_END_NAMESPACE - -QT_END_HEADER - -#include "moc_qvideodevicecontrol.cpp" - - diff --git a/src/multimedia/base/qvideodevicecontrol.h b/src/multimedia/base/qvideodevicecontrol.h deleted file mode 100644 index ce99fd1..0000000 --- a/src/multimedia/base/qvideodevicecontrol.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QVIDEODEVICECONTROL_H -#define QVIDEODEVICECONTROL_H - -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class Q_MULTIMEDIA_EXPORT QVideoDeviceControl : public QMediaControl -{ - Q_OBJECT - -public: - virtual ~QVideoDeviceControl(); - - virtual int deviceCount() const = 0; - - virtual QString deviceName(int index) const = 0; - virtual QString deviceDescription(int index) const = 0; - virtual QIcon deviceIcon(int index) const = 0; - - virtual int defaultDevice() const = 0; - virtual int selectedDevice() const = 0; - -public Q_SLOTS: - virtual void setSelectedDevice(int index) = 0; - -Q_SIGNALS: - void selectedDeviceChanged(int index); - void selectedDeviceChanged(const QString &deviceName); - void devicesChanged(); - -protected: - QVideoDeviceControl(QObject *parent = 0); -}; - -#define QVideoDeviceControl_iid "com.nokia.Qt.QVideoDeviceControl/1.0" -Q_MEDIA_DECLARE_CONTROL(QVideoDeviceControl, QVideoDeviceControl_iid) - - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QVIDEODEVICECONTROL_H diff --git a/src/multimedia/base/qvideooutputcontrol.cpp b/src/multimedia/base/qvideooutputcontrol.cpp deleted file mode 100644 index 58f1527..0000000 --- a/src/multimedia/base/qvideooutputcontrol.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 - - -QT_BEGIN_NAMESPACE - -/*! - \class QVideoOutputControl - \preliminary - \since 4.7 - \brief The QVideoOutputControl class provides a means of selecting the - active video output control. - - \ingroup multimedia-serv - - There are multiple controls which a QMediaService may use to output - video ony one of which may be active at one time, QVideoOutputControl - is the means by which this active control is selected. - - The possible output controls are QVideoRendererControl, - QVideoWindowControl, and QVideoWidgetControl. - - The interface name of QVideoOutputControl is \c com.nokia.Qt.QVideoOutputControl/1.0 as - defined in QVideoOutputControl_iid. - - \sa QMediaService::control(), QVideoWidget, QVideoRendererControl, - QVideoWindowControl, QVideoWidgetControl -*/ - -/*! - \macro QVideoOutputControl_iid - - \c com.nokia.Qt.QVideoOutputControl/1.0 - - Defines the interface name of the QVideoOutputControl class. - - \relates QVideoOutputControl -*/ - -/*! - \enum QVideoOutputControl::Output - - Identifies the possible render targets of a video output. - - \value NoOutput Video is not rendered. - \value WindowOutput Video is rendered to the target of a QVideoWindowControl. - \value RendererOutput Video is rendered to the target of a QVideoRendererControl. - \value WidgetOutput Video is rendered to a QWidget provided by QVideoWidgetControl. - \value UserOutput Start value for user defined video targets. - \value MaxUserOutput End value for user defined video targets. -*/ - -/*! - Constructs a new video output control with the given \a parent. -*/ -QVideoOutputControl::QVideoOutputControl(QObject *parent) - : QMediaControl(parent) -{ -} - -/*! - Destroys a video output control. -*/ -QVideoOutputControl::~QVideoOutputControl() -{ -} - -/*! - \fn QList QVideoOutputControl::availableOutputs() const - - Returns a list of available video output targets. -*/ - -/*! - \fn QVideoOutputControl::output() const - - Returns the current video output target. -*/ - -/*! - \fn QVideoOutputControl::setOutput(Output output) - - Sets the current video \a output target. -*/ - -/*! - \fn QVideoOutputControl::availableOutputsChanged(const QList &outputs) - - Signals that available set of video \a outputs has changed. -*/ - -#include "moc_qvideooutputcontrol.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qvideooutputcontrol.h b/src/multimedia/base/qvideooutputcontrol.h deleted file mode 100644 index 805da58..0000000 --- a/src/multimedia/base/qvideooutputcontrol.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QVIDEOOUTPUTCONTROL_H -#define QVIDEOOUTPUTCONTROL_H - -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class Q_MULTIMEDIA_EXPORT QVideoOutputControl : public QMediaControl -{ - Q_OBJECT - -public: - enum Output - { - NoOutput, - WindowOutput, - RendererOutput, - WidgetOutput, - UserOutput = 100, - MaxUserOutput = 1000 - }; - - ~QVideoOutputControl(); - - virtual QList availableOutputs() const = 0; - - virtual Output output() const = 0; - virtual void setOutput(Output output) = 0; - -Q_SIGNALS: - void availableOutputsChanged(const QList &outputs); - -protected: - QVideoOutputControl(QObject *parent = 0); -}; - -#define QVideoOutputControl_iid "com.nokia.Qt.QVideoOutputControl/1.0" -Q_MEDIA_DECLARE_CONTROL(QVideoOutputControl, QVideoOutputControl_iid) - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qvideorenderercontrol.cpp b/src/multimedia/base/qvideorenderercontrol.cpp deleted file mode 100644 index a34ef9b..0000000 --- a/src/multimedia/base/qvideorenderercontrol.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediacontrol_p.h" - - -QT_BEGIN_NAMESPACE - -/*! - \class QVideoRendererControl - \preliminary - \since 4.7 - \brief The QVideoRendererControl class provides a control for rendering - to a video surface. - - \ingroup multimedia-serv - - Using the surface() property of QVideoRendererControl a QAbstractVideoSurface - may be set as the video render target of a QMediaService. - - \code - QVideoRendererControl *rendererControl = mediaService->control(); - rendererControl->setSurface(myVideoSurface); - \endcode - - QVideoRendererControl is one of number of possible video output controls, - in order to receive video it must be made the active video output - control by setting the output property of QVideoOutputControl to - \l {QVideoOutputControl::RendererOutput}{RendererOutput}. Consequently any - QMediaService that implements QVideoRendererControl must also implement - QVideoOutputControl. - - \code - QVideoOutputControl *outputControl = mediaService->control(); - outputControl->setOutput(QVideoOutputControl::RendererOutput); - \endcode - - The interface name of QVideoRendererControl is \c com.nokia.Qt.QVideoRendererControl/1.0 as - defined in QVideoRendererControl_iid. - - \sa QMediaService::control(), QVideoOutputControl, QVideoWidget -*/ - -/*! - \macro QVideoRendererControl_iid - - \c com.nokia.Qt.QVideoRendererControl/1.0 - - Defines the interface name of the QVideoRendererControl class. - - \relates QVideoRendererControl -*/ - -/*! - Constructs a new video renderer media end point with the given \a parent. -*/ -QVideoRendererControl::QVideoRendererControl(QObject *parent) - : QMediaControl(parent) -{ -} - -/*! - Destroys a video renderer media end point. -*/ -QVideoRendererControl::~QVideoRendererControl() -{ -} - -/*! - \fn QVideoRendererControl::surface() const - - Returns the surface a video producer renders to. -*/ - -/*! - \fn QVideoRendererControl::setSurface(QAbstractVideoSurface *surface) - - Sets the \a surface a video producer renders to. -*/ - -#include "moc_qvideorenderercontrol.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qvideorenderercontrol.h b/src/multimedia/base/qvideorenderercontrol.h deleted file mode 100644 index f5ba83e..0000000 --- a/src/multimedia/base/qvideorenderercontrol.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QVIDEORENDERERCONTROL_H -#define QVIDEORENDERERCONTROL_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QAbstractVideoSurface; - -class Q_MULTIMEDIA_EXPORT QVideoRendererControl : public QMediaControl -{ - Q_OBJECT - -public: - ~QVideoRendererControl(); - - virtual QAbstractVideoSurface *surface() const = 0; - virtual void setSurface(QAbstractVideoSurface *surface) = 0; - -protected: - QVideoRendererControl(QObject *parent = 0); -}; - -#define QVideoRendererControl_iid "com.nokia.Qt.QVideoRendererControl/1.0" -Q_MEDIA_DECLARE_CONTROL(QVideoRendererControl, QVideoRendererControl_iid) - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QVIDEORENDERERCONTROL_H diff --git a/src/multimedia/base/qvideowidget.cpp b/src/multimedia/base/qvideowidget.cpp deleted file mode 100644 index b791abd..0000000 --- a/src/multimedia/base/qvideowidget.cpp +++ /dev/null @@ -1,944 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qvideowidget_p.h" - -#include -#include -#include -#include -#include - -#include "qpaintervideosurface_p.h" -#include -#include -#include - -#include -#include -#include -#include -#include - - -QT_BEGIN_NAMESPACE - -QVideoWidgetControlBackend::QVideoWidgetControlBackend( - QVideoWidgetControl *control, QWidget *widget) - : m_widgetControl(control) -{ - connect(control, SIGNAL(brightnessChanged(int)), widget, SLOT(_q_brightnessChanged(int))); - connect(control, SIGNAL(contrastChanged(int)), widget, SLOT(_q_contrastChanged(int))); - connect(control, SIGNAL(hueChanged(int)), widget, SLOT(_q_hueChanged(int))); - connect(control, SIGNAL(saturationChanged(int)), widget, SLOT(_q_saturationChanged(int))); - connect(control, SIGNAL(fullScreenChanged(bool)), widget, SLOT(_q_fullScreenChanged(bool))); - - QBoxLayout *layout = new QVBoxLayout; - layout->setMargin(0); - layout->setSpacing(0); - layout->addWidget(control->videoWidget()); - - widget->setLayout(layout); -} - -void QVideoWidgetControlBackend::setBrightness(int brightness) -{ - m_widgetControl->setBrightness(brightness); -} - -void QVideoWidgetControlBackend::setContrast(int contrast) -{ - m_widgetControl->setContrast(contrast); -} - -void QVideoWidgetControlBackend::setHue(int hue) -{ - m_widgetControl->setHue(hue); -} - -void QVideoWidgetControlBackend::setSaturation(int saturation) -{ - m_widgetControl->setSaturation(saturation); -} - -void QVideoWidgetControlBackend::setFullScreen(bool fullScreen) -{ - m_widgetControl->setFullScreen(fullScreen); -} - - -Qt::AspectRatioMode QVideoWidgetControlBackend::aspectRatioMode() const -{ - return m_widgetControl->aspectRatioMode(); -} - -void QVideoWidgetControlBackend::setAspectRatioMode(Qt::AspectRatioMode mode) -{ - m_widgetControl->setAspectRatioMode(mode); -} - -QRendererVideoWidgetBackend::QRendererVideoWidgetBackend( - QVideoRendererControl *control, QWidget *widget) - : m_rendererControl(control) - , m_widget(widget) - , m_surface(new QPainterVideoSurface) - , m_aspectRatioMode(Qt::KeepAspectRatio) - , m_updatePaintDevice(true) -{ - connect(this, SIGNAL(brightnessChanged(int)), m_widget, SLOT(_q_brightnessChanged(int))); - connect(this, SIGNAL(contrastChanged(int)), m_widget, SLOT(_q_contrastChanged(int))); - connect(this, SIGNAL(hueChanged(int)), m_widget, SLOT(_q_hueChanged(int))); - connect(this, SIGNAL(saturationChanged(int)), m_widget, SLOT(_q_saturationChanged(int))); - connect(m_surface, SIGNAL(frameChanged()), this, SLOT(frameChanged())); - connect(m_surface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), - this, SLOT(formatChanged(QVideoSurfaceFormat))); - - m_rendererControl->setSurface(m_surface); -} - -QRendererVideoWidgetBackend::~QRendererVideoWidgetBackend() -{ - delete m_surface; -} - -void QRendererVideoWidgetBackend::clearSurface() -{ - m_rendererControl->setSurface(0); -} - -void QRendererVideoWidgetBackend::setBrightness(int brightness) -{ - m_surface->setBrightness(brightness); - - emit brightnessChanged(brightness); -} - -void QRendererVideoWidgetBackend::setContrast(int contrast) -{ - m_surface->setContrast(contrast); - - emit contrastChanged(contrast); -} - -void QRendererVideoWidgetBackend::setHue(int hue) -{ - m_surface->setHue(hue); - - emit hueChanged(hue); -} - -void QRendererVideoWidgetBackend::setSaturation(int saturation) -{ - m_surface->setSaturation(saturation); - - emit saturationChanged(saturation); -} - -Qt::AspectRatioMode QRendererVideoWidgetBackend::aspectRatioMode() const -{ - return m_aspectRatioMode; -} - -void QRendererVideoWidgetBackend::setAspectRatioMode(Qt::AspectRatioMode mode) -{ - m_aspectRatioMode = mode; - - m_widget->updateGeometry(); -} - -void QRendererVideoWidgetBackend::setFullScreen(bool) -{ -} - -QSize QRendererVideoWidgetBackend::sizeHint() const -{ - return m_surface->surfaceFormat().sizeHint(); -} - -void QRendererVideoWidgetBackend::showEvent() -{ -} - -void QRendererVideoWidgetBackend::hideEvent(QHideEvent *) -{ -#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - m_updatePaintDevice = true; - m_surface->setGLContext(0); -#endif -} - -void QRendererVideoWidgetBackend::resizeEvent(QResizeEvent *) -{ - updateRects(); -} - -void QRendererVideoWidgetBackend::moveEvent(QMoveEvent *) -{ -} - -void QRendererVideoWidgetBackend::paintEvent(QPaintEvent *event) -{ - QPainter painter(m_widget); - - if (m_widget->testAttribute(Qt::WA_OpaquePaintEvent)) { - QRegion borderRegion = event->region(); - borderRegion = borderRegion.subtracted(m_boundingRect); - - QBrush brush = m_widget->palette().window(); - - QVector rects = borderRegion.rects(); - for (QVector::iterator it = rects.begin(), end = rects.end(); it != end; ++it) { - painter.fillRect(*it, brush); - } - } - - if (m_surface->isActive() && m_boundingRect.intersects(event->rect())) { - m_surface->paint(&painter, m_boundingRect, m_sourceRect); - - m_surface->setReady(true); - } else { - #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) - if (m_updatePaintDevice && (painter.paintEngine()->type() == QPaintEngine::OpenGL - || painter.paintEngine()->type() == QPaintEngine::OpenGL2)) { - m_updatePaintDevice = false; - - m_surface->setGLContext(const_cast(QGLContext::currentContext())); - if (m_surface->supportedShaderTypes() & QPainterVideoSurface::GlslShader) { - m_surface->setShaderType(QPainterVideoSurface::GlslShader); - } else { - m_surface->setShaderType(QPainterVideoSurface::FragmentProgramShader); - } - } -#endif - } - -} - -void QRendererVideoWidgetBackend::formatChanged(const QVideoSurfaceFormat &format) -{ - m_nativeSize = format.sizeHint(); - - updateRects(); - - m_widget->updateGeometry(); - m_widget->update(); -} - -void QRendererVideoWidgetBackend::frameChanged() -{ - m_widget->update(m_boundingRect); -} - -void QRendererVideoWidgetBackend::updateRects() -{ - QRect rect = m_widget->rect(); - - if (m_nativeSize.isEmpty()) { - m_boundingRect = QRect(); - } else if (m_aspectRatioMode == Qt::IgnoreAspectRatio) { - m_boundingRect = rect; - m_sourceRect = QRectF(0, 0, 1, 1); - } else if (m_aspectRatioMode == Qt::KeepAspectRatio) { - QSize size = m_nativeSize; - size.scale(rect.size(), Qt::KeepAspectRatio); - - m_boundingRect = QRect(0, 0, size.width(), size.height()); - m_boundingRect.moveCenter(rect.center()); - - m_sourceRect = QRectF(0, 0, 1, 1); - } else if (m_aspectRatioMode == Qt::KeepAspectRatioByExpanding) { - m_boundingRect = rect; - - QSizeF size = rect.size(); - size.scale(m_nativeSize, Qt::KeepAspectRatio); - - m_sourceRect = QRectF( - 0, 0, size.width() / m_nativeSize.width(), size.height() / m_nativeSize.height()); - m_sourceRect.moveCenter(QPointF(0.5, 0.5)); - } -} - -QWindowVideoWidgetBackend::QWindowVideoWidgetBackend(QVideoWindowControl *control, QWidget *widget) - : m_windowControl(control) - , m_widget(widget) - , m_aspectRatioMode(Qt::KeepAspectRatio) -{ - connect(control, SIGNAL(brightnessChanged(int)), m_widget, SLOT(_q_brightnessChanged(int))); - connect(control, SIGNAL(contrastChanged(int)), m_widget, SLOT(_q_contrastChanged(int))); - connect(control, SIGNAL(hueChanged(int)), m_widget, SLOT(_q_hueChanged(int))); - connect(control, SIGNAL(saturationChanged(int)), m_widget, SLOT(_q_saturationChanged(int))); - connect(control, SIGNAL(fullScreenChanged(bool)), m_widget, SLOT(_q_fullScreenChanged(bool))); - connect(control, SIGNAL(nativeSizeChanged()), m_widget, SLOT(_q_dimensionsChanged())); -} - -QWindowVideoWidgetBackend::~QWindowVideoWidgetBackend() -{ -} - -void QWindowVideoWidgetBackend::setBrightness(int brightness) -{ - m_windowControl->setBrightness(brightness); -} - -void QWindowVideoWidgetBackend::setContrast(int contrast) -{ - m_windowControl->setContrast(contrast); -} - -void QWindowVideoWidgetBackend::setHue(int hue) -{ - m_windowControl->setHue(hue); -} - -void QWindowVideoWidgetBackend::setSaturation(int saturation) -{ - m_windowControl->setSaturation(saturation); -} - -void QWindowVideoWidgetBackend::setFullScreen(bool fullScreen) -{ - m_windowControl->setFullScreen(fullScreen); -} - -Qt::AspectRatioMode QWindowVideoWidgetBackend::aspectRatioMode() const -{ - return m_windowControl->aspectRatioMode(); -} - -void QWindowVideoWidgetBackend::setAspectRatioMode(Qt::AspectRatioMode mode) -{ - m_windowControl->setAspectRatioMode(mode); -} - -QSize QWindowVideoWidgetBackend::sizeHint() const -{ - return m_windowControl->nativeSize(); -} - -void QWindowVideoWidgetBackend::showEvent() -{ - m_windowControl->setWinId(m_widget->winId()); - - m_windowControl->setDisplayRect(m_widget->rect()); -} - -void QWindowVideoWidgetBackend::hideEvent(QHideEvent *) -{ -} - -void QWindowVideoWidgetBackend::moveEvent(QMoveEvent *) -{ - m_windowControl->setDisplayRect(m_widget->rect()); -} - -void QWindowVideoWidgetBackend::resizeEvent(QResizeEvent *) -{ - m_windowControl->setDisplayRect(m_widget->rect()); -} - -void QWindowVideoWidgetBackend::paintEvent(QPaintEvent *event) -{ - if (m_widget->testAttribute(Qt::WA_OpaquePaintEvent)) { - QPainter painter(m_widget); - - painter.fillRect(event->rect(), m_widget->palette().window()); - } - - m_windowControl->repaint(); - - event->accept(); -} - -void QVideoWidgetPrivate::setCurrentControl(QVideoWidgetControlInterface *control) -{ - if (currentControl != control) { - currentControl = control; - - currentControl->setBrightness(brightness); - currentControl->setContrast(contrast); - currentControl->setHue(hue); - currentControl->setSaturation(saturation); - currentControl->setAspectRatioMode(aspectRatioMode); - } -} - -void QVideoWidgetPrivate::show() -{ - if (outputControl) { - if (widgetBackend != 0) { - setCurrentControl(widgetBackend); - outputControl->setOutput(QVideoOutputControl::WidgetOutput); - } else if (windowBackend != 0 && (q_func()->window() == 0 - || !q_func()->window()->testAttribute(Qt::WA_DontShowOnScreen))) { - windowBackend->showEvent(); - currentBackend = windowBackend; - setCurrentControl(windowBackend); - outputControl->setOutput(QVideoOutputControl::WindowOutput); - } else if (rendererBackend != 0) { - rendererBackend->showEvent(); - currentBackend = rendererBackend; - setCurrentControl(rendererBackend); - outputControl->setOutput(QVideoOutputControl::RendererOutput); - } else { - outputControl->setOutput(QVideoOutputControl::NoOutput); - } - } -} - -void QVideoWidgetPrivate::clearService() -{ - if (service) { - QObject::disconnect(service, SIGNAL(destroyed()), q_func(), SLOT(_q_serviceDestroyed())); - - if (outputControl) - outputControl->setOutput(QVideoOutputControl::NoOutput); - - if (widgetBackend) { - QLayout *layout = q_func()->layout(); - - for (QLayoutItem *item = layout->takeAt(0); item; item = layout->takeAt(0)) { - item->widget()->setParent(0); - delete item; - } - delete layout; - - delete widgetBackend; - widgetBackend = 0; - } - - delete windowBackend; - windowBackend = 0; - - if (rendererBackend) { - rendererBackend->clearSurface(); - - delete rendererBackend; - rendererBackend = 0; - } - - currentBackend = 0; - currentControl = 0; - outputControl = 0; - service = 0; - } -} - -void QVideoWidgetPrivate::_q_serviceDestroyed() -{ - if (widgetBackend) { - delete q_func()->layout(); - - delete widgetBackend; - widgetBackend = 0; - } - - delete windowBackend; - windowBackend = 0; - - delete rendererBackend; - rendererBackend = 0; - - currentControl = 0; - currentBackend = 0; - outputControl = 0; - service = 0; -} - -void QVideoWidgetPrivate::_q_mediaObjectDestroyed() -{ - mediaObject = 0; - clearService(); -} - -void QVideoWidgetPrivate::_q_brightnessChanged(int b) -{ - if (b != brightness) - emit q_func()->brightnessChanged(brightness = b); -} - -void QVideoWidgetPrivate::_q_contrastChanged(int c) -{ - if (c != contrast) - emit q_func()->contrastChanged(contrast = c); -} - -void QVideoWidgetPrivate::_q_hueChanged(int h) -{ - if (h != hue) - emit q_func()->hueChanged(hue = h); -} - -void QVideoWidgetPrivate::_q_saturationChanged(int s) -{ - if (s != saturation) - emit q_func()->saturationChanged(saturation = s); -} - - -void QVideoWidgetPrivate::_q_fullScreenChanged(bool fullScreen) -{ - if (!fullScreen && q_func()->isFullScreen()) - q_func()->showNormal(); -} - -void QVideoWidgetPrivate::_q_dimensionsChanged() -{ - q_func()->updateGeometry(); - q_func()->update(); -} - -/*! - \class QVideoWidget - \preliminary - \since 4.7 - \brief The QVideoWidget class provides a widget which presents video - produced by a media object. - \ingroup multimedia - - Attaching a QVideoWidget to a QMediaObject allows it to display the - video or image output of that media object. A QVideoWidget is attached - to media object by passing a pointer to the QMediaObject in its - constructor, and detached by destroying the QVideoWidget. - - \code - player = new QMediaPlayer; - - widget = new QVideoWidget(player); - widget->show(); - - player->setMedia(QUrl("http://example.com/movie.mp4")); - player->play(); - \endcode - - \bold {Note}: Only a single display output can be attached to a media - object at one time. - - \sa QMediaObject, QMediaPlayer, QGraphicsVideoItem -*/ - -/*! - Constructs a new video widget. - - The \a parent is passed to QWidget. -*/ -QVideoWidget::QVideoWidget(QWidget *parent) - : QWidget(parent, 0) - , d_ptr(new QVideoWidgetPrivate) -{ - d_ptr->q_ptr = this; -} - -/*! - Destroys a video widget. -*/ -QVideoWidget::~QVideoWidget() -{ - setMediaObject(0); - delete d_ptr; -} - -/*! - \property QVideoWidget::mediaObject - \brief the media object which provides the video displayed by a widget. -*/ - -QMediaObject *QVideoWidget::mediaObject() const -{ - return d_func()->mediaObject; -} - -void QVideoWidget::setMediaObject(QMediaObject *object) -{ - Q_D(QVideoWidget); - - if (object == d->mediaObject) - return; - - if (d->mediaObject) { - disconnect(d->mediaObject, SIGNAL(destroyed()), this, SLOT(_q_mediaObjectDestroyed())); - d->mediaObject->unbind(this); - } - - d->clearService(); - - d->mediaObject = object; - - if (d->mediaObject) { - d->service = d->mediaObject->service(); - - connect(d->mediaObject, SIGNAL(destroyed()), this, SLOT(_q_mediaObjectDestroyed())); - d->mediaObject->bind(this); - } - - if (d->service) { - connect(d->service, SIGNAL(destroyed()), SLOT(_q_serviceDestroyed())); - - d->outputControl = qobject_cast( - d->service->control(QVideoOutputControl_iid)); - - QVideoWidgetControl *widgetControl = qobject_cast( - d->service->control(QVideoWidgetControl_iid)); - - if (widgetControl != 0) { - d->widgetBackend = new QVideoWidgetControlBackend(widgetControl, this); - } else { - QVideoWindowControl *windowControl = qobject_cast( - d->service->control(QVideoWindowControl_iid)); - - if (windowControl != 0) - d->windowBackend = new QWindowVideoWidgetBackend(windowControl, this); - - QVideoRendererControl *rendererControl = qobject_cast( - d->service->control(QVideoRendererControl_iid)); - - if (rendererControl != 0) - d->rendererBackend = new QRendererVideoWidgetBackend(rendererControl, this); - } - - if (isVisible()) - d->show(); - } -} - -/*! - \property QVideoWidget::aspectRatioMode - \brief how video is scaled with respect to its aspect ratio. -*/ - -Qt::AspectRatioMode QVideoWidget::aspectRatioMode() const -{ - return d_func()->aspectRatioMode; -} - -void QVideoWidget::setAspectRatioMode(Qt::AspectRatioMode mode) -{ - Q_D(QVideoWidget); - - if (d->currentControl) { - d->currentControl->setAspectRatioMode(mode); - d->aspectRatioMode = d->currentControl->aspectRatioMode(); - } else { - d->aspectRatioMode = mode; - } -} - -/*! - \property QVideoWidget::fullScreen - \brief whether video display is confined to a window or is fullScreen. -*/ - -void QVideoWidget::setFullScreen(bool fullScreen) -{ - Q_D(QVideoWidget); - - if (fullScreen) { - Qt::WindowFlags flags = windowFlags(); - - d->nonFullScreenFlags = flags & (Qt::Window | Qt::SubWindow); - flags |= Qt::Window; - flags &= ~Qt::SubWindow; - setWindowFlags(flags); - - showFullScreen(); - } else { - showNormal(); - } -} - -/*! - \fn QVideoWidget::fullScreenChanged(bool fullScreen) - - Signals that the \a fullScreen mode of a video widget has changed. - - \sa fullScreen -*/ - -/*! - \property QVideoWidget::brightness - \brief an adjustment to the brightness of displayed video. - - Valid brightness values range between -100 and 100, the default is 0. -*/ - -int QVideoWidget::brightness() const -{ - return d_func()->brightness; -} - -void QVideoWidget::setBrightness(int brightness) -{ - Q_D(QVideoWidget); - - int boundedBrightness = qBound(-100, brightness, 100); - - if (d->currentControl) - d->currentControl->setBrightness(boundedBrightness); - else if (d->brightness != boundedBrightness) - emit brightnessChanged(d->brightness = boundedBrightness); -} - -/*! - \fn QVideoWidget::brightnessChanged(int brightness) - - Signals that a video widgets's \a brightness adjustment has changed. - - \sa brightness -*/ - -/*! - \property QVideoWidget::contrast - \brief an adjustment to the contrast of displayed video. - - Valid contrast values range between -100 and 100, the default is 0. - -*/ - -int QVideoWidget::contrast() const -{ - return d_func()->contrast; -} - -void QVideoWidget::setContrast(int contrast) -{ - Q_D(QVideoWidget); - - int boundedContrast = qBound(-100, contrast, 100); - - if (d->currentControl) - d->currentControl->setContrast(boundedContrast); - else if (d->contrast != boundedContrast) - emit contrastChanged(d->contrast = boundedContrast); -} - -/*! - \fn QVideoWidget::contrastChanged(int contrast) - - Signals that a video widgets's \a contrast adjustment has changed. - - \sa contrast -*/ - -/*! - \property QVideoWidget::hue - \brief an adjustment to the hue of displayed video. - - Valid hue values range between -100 and 100, the default is 0. -*/ - -int QVideoWidget::hue() const -{ - return d_func()->hue; -} - -void QVideoWidget::setHue(int hue) -{ - Q_D(QVideoWidget); - - int boundedHue = qBound(-100, hue, 100); - - if (d->currentControl) - d->currentControl->setHue(boundedHue); - else if (d->hue != boundedHue) - emit hueChanged(d->hue = boundedHue); -} - -/*! - \fn QVideoWidget::hueChanged(int hue) - - Signals that a video widgets's \a hue has changed. - - \sa hue -*/ - -/*! - \property QVideoWidget::saturation - \brief an adjustment to the saturation of displayed video. - - Valid saturation values range between -100 and 100, the default is 0. -*/ - -int QVideoWidget::saturation() const -{ - return d_func()->saturation; -} - -void QVideoWidget::setSaturation(int saturation) -{ - Q_D(QVideoWidget); - - int boundedSaturation = qBound(-100, saturation, 100); - - if (d->currentControl) - d->currentControl->setSaturation(boundedSaturation); - else if (d->saturation != boundedSaturation) - emit saturationChanged(d->saturation = boundedSaturation); - -} - -/*! - \fn QVideoWidget::saturationChanged(int saturation) - - Signals that a video widgets's \a saturation has changed. - - \sa saturation -*/ - -/*! - Returns the size hint for the current back end, - if there is one, or else the size hint from QWidget. - */ -QSize QVideoWidget::sizeHint() const -{ - Q_D(const QVideoWidget); - - if (d->currentBackend) - return d->currentBackend->sizeHint(); - else - return QWidget::sizeHint(); - - -} - -/*! - \reimp - \internal - */ -bool QVideoWidget::event(QEvent *event) -{ - Q_D(QVideoWidget); - - if (event->type() == QEvent::WindowStateChange) { - Qt::WindowFlags flags = windowFlags(); - - if (windowState() & Qt::WindowFullScreen) { - if (d->currentControl) - d->currentControl->setFullScreen(true); - - if (!d->wasFullScreen) - emit fullScreenChanged(d->wasFullScreen = true); - } else { - if (d->currentControl) - d->currentControl->setFullScreen(false); - - if (d->wasFullScreen) { - flags &= ~(Qt::Window | Qt::SubWindow); //clear the flags... - flags |= d->nonFullScreenFlags; //then we reset the flags (window and subwindow) - setWindowFlags(flags); - - emit fullScreenChanged(d->wasFullScreen = false); - } - } - } - return QWidget::event(event); -} - -/*! - Handles the show \a event. - */ -void QVideoWidget::showEvent(QShowEvent *event) -{ - Q_D(QVideoWidget); - - QWidget::showEvent(event); - - d->show(); - -} - -/*! - - Handles the hide \a event. -*/ -void QVideoWidget::hideEvent(QHideEvent *event) -{ - Q_D(QVideoWidget); - - if (d->currentBackend) - d->currentBackend->hideEvent(event); - - QWidget::hideEvent(event); -} - -/*! - Handles the resize \a event. - */ -void QVideoWidget::resizeEvent(QResizeEvent *event) -{ - Q_D(QVideoWidget); - - QWidget::resizeEvent(event); - - if (d->currentBackend) - d->currentBackend->resizeEvent(event); -} - -/*! - Handles the move \a event. - */ -void QVideoWidget::moveEvent(QMoveEvent *event) -{ - Q_D(QVideoWidget); - - if (d->currentBackend) - d->currentBackend->moveEvent(event); -} - -/*! - Handles the paint \a event. - */ -void QVideoWidget::paintEvent(QPaintEvent *event) -{ - Q_D(QVideoWidget); - - if (d->currentBackend) { - d->currentBackend->paintEvent(event); - } else if (testAttribute(Qt::WA_OpaquePaintEvent)) { - QPainter painter(this); - - painter.fillRect(event->rect(), palette().window()); - } -} - -#include "moc_qvideowidget.cpp" -#include "moc_qvideowidget_p.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qvideowidget.h b/src/multimedia/base/qvideowidget.h deleted file mode 100644 index 4b24bcb..0000000 --- a/src/multimedia/base/qvideowidget.h +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QVIDEOWIDGET_H -#define QVIDEOWIDGET_H - -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QMediaObject; - -class QVideoWidgetPrivate; -class Q_MULTIMEDIA_EXPORT QVideoWidget : public QWidget -{ - Q_OBJECT - Q_PROPERTY(QMediaObject* mediaObject READ mediaObject WRITE setMediaObject) - Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged) - Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode NOTIFY aspectRatioModeChanged) - Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) - Q_PROPERTY(int contrast READ contrast WRITE setContrast NOTIFY contrastChanged) - Q_PROPERTY(int hue READ hue WRITE setHue NOTIFY hueChanged) - Q_PROPERTY(int saturation READ saturation WRITE setSaturation NOTIFY saturationChanged) - -public: - QVideoWidget(QWidget *parent = 0); - ~QVideoWidget(); - - QMediaObject *mediaObject() const; - void setMediaObject(QMediaObject *object); - -#ifdef Q_QDOC - bool isFullScreen() const; -#endif - - Qt::AspectRatioMode aspectRatioMode() const; - - int brightness() const; - int contrast() const; - int hue() const; - int saturation() const; - - QSize sizeHint() const; - -public Q_SLOTS: - void setFullScreen(bool fullScreen); - void setAspectRatioMode(Qt::AspectRatioMode mode); - void setBrightness(int brightness); - void setContrast(int contrast); - void setHue(int hue); - void setSaturation(int saturation); - -Q_SIGNALS: - void fullScreenChanged(bool fullScreen); - void brightnessChanged(int brightness); - void contrastChanged(int contrast); - void hueChanged(int hue); - void saturationChanged(int saturation); - -protected: - bool event(QEvent *event); - void showEvent(QShowEvent *event); - void hideEvent(QHideEvent *event); - void resizeEvent(QResizeEvent *event); - void moveEvent(QMoveEvent *event); - void paintEvent(QPaintEvent *event); - -protected: - QVideoWidgetPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QVideoWidget) - Q_PRIVATE_SLOT(d_func(), void _q_serviceDestroyed()) - Q_PRIVATE_SLOT(d_func(), void _q_mediaObjectDestroyed()) - Q_PRIVATE_SLOT(d_func(), void _q_brightnessChanged(int)) - Q_PRIVATE_SLOT(d_func(), void _q_contrastChanged(int)) - Q_PRIVATE_SLOT(d_func(), void _q_hueChanged(int)) - Q_PRIVATE_SLOT(d_func(), void _q_saturationChanged(int)) - Q_PRIVATE_SLOT(d_func(), void _q_fullScreenChanged(bool)) - Q_PRIVATE_SLOT(d_func(), void _q_dimensionsChanged()); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qvideowidget_p.h b/src/multimedia/base/qvideowidget_p.h deleted file mode 100644 index 44fd1cd..0000000 --- a/src/multimedia/base/qvideowidget_p.h +++ /dev/null @@ -1,271 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QVIDEOWIDGET_P_H -#define QVIDEOWIDGET_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -#ifndef QT_NO_OPENGL -#include -#endif - -#include "qpaintervideosurface_p.h" - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QVideoWidgetControlInterface -{ -public: - virtual ~QVideoWidgetControlInterface() {} - - virtual void setBrightness(int brightness) = 0; - virtual void setContrast(int contrast) = 0; - virtual void setHue(int hue) = 0; - virtual void setSaturation(int saturation) = 0; - - virtual void setFullScreen(bool fullScreen) = 0; - - virtual Qt::AspectRatioMode aspectRatioMode() const = 0; - virtual void setAspectRatioMode(Qt::AspectRatioMode mode) = 0; -}; - -class QVideoWidgetBackend : public QObject, public QVideoWidgetControlInterface -{ - Q_OBJECT - -public: - virtual QSize sizeHint() const = 0; - - virtual void showEvent() = 0; - virtual void hideEvent(QHideEvent *event) = 0; - virtual void resizeEvent(QResizeEvent *event) = 0; - virtual void moveEvent(QMoveEvent *event) = 0; - virtual void paintEvent(QPaintEvent *event) = 0; -}; - -class QVideoWidgetControl; - -class QVideoWidgetControlBackend : public QObject, public QVideoWidgetControlInterface -{ - Q_OBJECT -public: - QVideoWidgetControlBackend(QVideoWidgetControl *control, QWidget *widget); - - void setBrightness(int brightness); - void setContrast(int contrast); - void setHue(int hue); - void setSaturation(int saturation); - - void setFullScreen(bool fullScreen); - - Qt::AspectRatioMode aspectRatioMode() const; - void setAspectRatioMode(Qt::AspectRatioMode mode); - -private: - QVideoWidgetControl *m_widgetControl; -}; - - -class QVideoRendererControl; - -class QRendererVideoWidgetBackend : public QVideoWidgetBackend -{ - Q_OBJECT -public: - QRendererVideoWidgetBackend(QVideoRendererControl *control, QWidget *widget); - ~QRendererVideoWidgetBackend(); - - void clearSurface(); - - void setBrightness(int brightness); - void setContrast(int contrast); - void setHue(int hue); - void setSaturation(int saturation); - - void setFullScreen(bool fullScreen); - - Qt::AspectRatioMode aspectRatioMode() const; - void setAspectRatioMode(Qt::AspectRatioMode mode); - - QSize sizeHint() const; - - void showEvent(); - void hideEvent(QHideEvent *event); - void resizeEvent(QResizeEvent *event); - void moveEvent(QMoveEvent *event); - void paintEvent(QPaintEvent *event); - -Q_SIGNALS: - void fullScreenChanged(bool fullScreen); - void brightnessChanged(int brightness); - void contrastChanged(int contrast); - void hueChanged(int hue); - void saturationChanged(int saturation); - -private Q_SLOTS: - void formatChanged(const QVideoSurfaceFormat &format); - void frameChanged(); - -private: - void updateRects(); - - QVideoRendererControl *m_rendererControl; - QWidget *m_widget; - QPainterVideoSurface *m_surface; - Qt::AspectRatioMode m_aspectRatioMode; - QRect m_boundingRect; - QRectF m_sourceRect; - QSize m_nativeSize; - bool m_updatePaintDevice; -}; - -class QVideoWindowControl; - -class QWindowVideoWidgetBackend : public QVideoWidgetBackend -{ - Q_OBJECT -public: - QWindowVideoWidgetBackend(QVideoWindowControl *control, QWidget *widget); - ~QWindowVideoWidgetBackend(); - - void setBrightness(int brightness); - void setContrast(int contrast); - void setHue(int hue); - void setSaturation(int saturation); - - void setFullScreen(bool fullScreen); - - Qt::AspectRatioMode aspectRatioMode() const; - void setAspectRatioMode(Qt::AspectRatioMode mode); - - QSize sizeHint() const; - - void showEvent(); - void hideEvent(QHideEvent *event); - void resizeEvent(QResizeEvent *event); - void moveEvent(QMoveEvent *event); - void paintEvent(QPaintEvent *event); - -private: - QVideoWindowControl *m_windowControl; - QWidget *m_widget; - Qt::AspectRatioMode m_aspectRatioMode; - QSize m_pixelAspectRatio; -}; - -class QMediaService; -class QVideoOutputControl; - -class QVideoWidgetPrivate -{ - Q_DECLARE_PUBLIC(QVideoWidget) -public: - QVideoWidgetPrivate() - : q_ptr(0) - , mediaObject(0) - , service(0) - , outputControl(0) - , widgetBackend(0) - , windowBackend(0) - , rendererBackend(0) - , currentControl(0) - , currentBackend(0) - , brightness(0) - , contrast(0) - , hue(0) - , saturation(0) - , aspectRatioMode(Qt::KeepAspectRatio) - , nonFullScreenFlags(0) - , wasFullScreen(false) - { - } - - QVideoWidget *q_ptr; - QMediaObject *mediaObject; - QMediaService *service; - QVideoOutputControl *outputControl; - QVideoWidgetControlBackend *widgetBackend; - QWindowVideoWidgetBackend *windowBackend; - QRendererVideoWidgetBackend *rendererBackend; - QVideoWidgetControlInterface *currentControl; - QVideoWidgetBackend *currentBackend; - int brightness; - int contrast; - int hue; - int saturation; - Qt::AspectRatioMode aspectRatioMode; - Qt::WindowFlags nonFullScreenFlags; - bool wasFullScreen; - - void setCurrentControl(QVideoWidgetControlInterface *control); - void show(); - void clearService(); - - void _q_serviceDestroyed(); - void _q_mediaObjectDestroyed(); - void _q_brightnessChanged(int brightness); - void _q_contrastChanged(int contrast); - void _q_hueChanged(int hue); - void _q_saturationChanged(int saturation); - void _q_fullScreenChanged(bool fullScreen); - void _q_dimensionsChanged(); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qvideowidgetcontrol.cpp b/src/multimedia/base/qvideowidgetcontrol.cpp deleted file mode 100644 index e8957dc..0000000 --- a/src/multimedia/base/qvideowidgetcontrol.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 "qmediacontrol_p.h" - - -QT_BEGIN_NAMESPACE - -/*! - \class QVideoWidgetControl - \preliminary - \since 4.7 - \brief The QVideoWidgetControl class provides a media control which - implements a video widget. - - \ingroup multimedia-serv - - The videoWidget() property of QVideoWidgetControl provides a pointer to - a video widget implemented by the control's media service. This widget - is owned by the media service and so care should be taken not to delete it. - - \code - QVideoWidgetControl *widgetControl = mediaService->control(); - - layout->addWidget(widgetControl->widget()); - \endcode - - QVideoWidgetControl is one of number of possible video output controls, - in order to receive video it must be made the active video output - control by setting the output property of QVideoOutputControl to \l {QVideoOutputControl::WidgetOutput}{WidgetOutput}. Consequently any - QMediaService that implements QVideoWidgetControl must also implement - QVideoOutputControl. - - The interface name of QVideoWidgetControl is \c com.nokia.Qt.QVideoWidgetControl/1.0 as - defined in QVideoWidgetControl_iid. - - \sa QMediaService::control(), QVideoOutputControl, QVideoWidget -*/ - -/*! - \macro QVideoWidgetControl_iid - - \c com.nokia.Qt.QVideoWidgetControl/1.0 - - Defines the interface name of the QVideoWidgetControl class. - - \relates QVideoWidgetControl -*/ - -/*! - Constructs a new video widget control with the given \a parent. -*/ -QVideoWidgetControl::QVideoWidgetControl(QObject *parent) - :QMediaControl(parent) -{ -} - -/*! - Destroys a video widget control. -*/ -QVideoWidgetControl::~QVideoWidgetControl() -{ -} - -/*! - \fn QVideoWidgetControl::isFullScreen() const - - Returns true if the video is shown using the complete screen. -*/ - -/*! - \fn QVideoWidgetControl::setFullScreen(bool fullScreen) - - Sets whether a video widget is in \a fullScreen mode. -*/ - -/*! - \fn QVideoWidgetControl::fullScreenChanged(bool fullScreen) - - Signals that the \a fullScreen state of a video widget has changed. -*/ - -/*! - \fn QVideoWidgetControl::aspectRatioMode() const - - Returns how video is scaled to fit the widget with respect to its aspect ratio. -*/ - -/*! - \fn QVideoWidgetControl::setAspectRatioMode(Qt::AspectRatioMode mode) - - Sets the aspect ratio \a mode which determines how video is scaled to the fit the widget with - respect to its aspect ratio. -*/ - -/*! - \fn QVideoWidgetControl::brightness() const - - Returns the brightness adjustment applied to a video. - - Valid brightness values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWidgetControl::setBrightness(int brightness) - - Sets a \a brightness adjustment for a video. - - Valid brightness values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWidgetControl::brightnessChanged(int brightness) - - Signals that a video widget's \a brightness adjustment has changed. -*/ - -/*! - \fn QVideoWidgetControl::contrast() const - - Returns the contrast adjustment applied to a video. - - Valid contrast values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWidgetControl::setContrast(int contrast) - - Sets the contrast adjustment for a video widget to \a contrast. - - Valid contrast values range between -100 and 100, the default is 0. -*/ - - -/*! - \fn QVideoWidgetControl::contrastChanged(int contrast) - - Signals that a video widget's \a contrast adjustment has changed. -*/ - -/*! - \fn QVideoWidgetControl::hue() const - - Returns the hue adjustment applied to a video widget. - - Value hue values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWidgetControl::setHue(int hue) - - Sets a \a hue adjustment for a video widget. - - Valid hue values range between -100 and 100, the default is 0. -*/ - - -/*! - \fn QVideoWidgetControl::hueChanged(int hue) - - Signals that a video widget's \a hue adjustment has changed. -*/ - -/*! - \fn QVideoWidgetControl::saturation() const - - Returns the saturation adjustment applied to a video widget. - - Value saturation values range between -100 and 100, the default is 0. -*/ - - -/*! - \fn QVideoWidgetControl::setSaturation(int saturation) - - Sets a \a saturation adjustment for a video widget. - - Valid saturation values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWidgetControl::saturationChanged(int saturation) - - Signals that a video widget's \a saturation adjustment has changed. -*/ - -/*! - \fn QVideoWidgetControl::videoWidget() - - Returns the QWidget. -*/ - -#include "moc_qvideowidgetcontrol.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qvideowidgetcontrol.h b/src/multimedia/base/qvideowidgetcontrol.h deleted file mode 100644 index 4c0a6c6..0000000 --- a/src/multimedia/base/qvideowidgetcontrol.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QVIDEOWIDGETCONTROL_H -#define QVIDEOWIDGETCONTROL_H - -#include - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QVideoWidgetControlPrivate; - -class Q_MULTIMEDIA_EXPORT QVideoWidgetControl : public QMediaControl -{ - Q_OBJECT - -public: - virtual ~QVideoWidgetControl(); - - virtual QWidget *videoWidget() = 0; - - virtual Qt::AspectRatioMode aspectRatioMode() const = 0; - virtual void setAspectRatioMode(Qt::AspectRatioMode mode) = 0; - - virtual bool isFullScreen() const = 0; - virtual void setFullScreen(bool fullScreen) = 0; - - virtual int brightness() const = 0; - virtual void setBrightness(int brightness) = 0; - - virtual int contrast() const = 0; - virtual void setContrast(int contrast) = 0; - - virtual int hue() const = 0; - virtual void setHue(int hue) = 0; - - virtual int saturation() const = 0; - virtual void setSaturation(int saturation) = 0; - -Q_SIGNALS: - void fullScreenChanged(bool fullScreen); - void brightnessChanged(int brightness); - void contrastChanged(int contrast); - void hueChanged(int hue); - void saturationChanged(int saturation); - -protected: - QVideoWidgetControl(QObject *parent = 0); -}; - -#define QVideoWidgetControl_iid "com.nokia.Qt.QVideoWidgetControl/1.0" -Q_MEDIA_DECLARE_CONTROL(QVideoWidgetControl, QVideoWidgetControl_iid) - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/base/qvideowindowcontrol.cpp b/src/multimedia/base/qvideowindowcontrol.cpp deleted file mode 100644 index c74a0d5..0000000 --- a/src/multimedia/base/qvideowindowcontrol.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 - - -QT_BEGIN_NAMESPACE - -/*! - \class QVideoWindowControl - \preliminary - \since 4.7 - \ingroup multimedia-serv - \brief The QVideoWindowControl class provides a media control for rendering video to a window. - - - The winId() property QVideoWindowControl allows a platform specific - window ID to be set as the video render target of a QMediaService. The - displayRect() property is used to set the region of the window the - video should be rendered to, and the aspectRatioMode() property - indicates how the video should be scaled to fit the displayRect(). - - \code - QVideoWindowControl *windowControl = mediaService->control(); - windowControl->setWinId(widget->winId()); - windowControl->setDisplayRect(widget->rect()); - windowControl->setAspectRatioMode(Qt::KeepAspectRatio); - \endcode - - QVideoWindowControl is one of number of possible video output controls, - in order to receive video it must be made the active video output - control by setting the output property of QVideoOutputControl to \l {QVideoOutputControl::WindowOutput}{WindowOutput}. - Consequently any QMediaService that implements QVideoWindowControl must - also implement QVideoOutputControl. - - \code - QVideoOutputControl *outputControl = mediaService->control(); - outputControl->setOutput(QVideoOutputControl::WindowOutput); - \endcode - - The interface name of QVideoWindowControl is \c com.nokia.Qt.QVideoWindowControl/1.0 as - defined in QVideoWindowControl_iid. - - \sa QMediaService::control(), QVideoOutputControl, QVideoWidget -*/ - -/*! - \macro QVideoWindowControl_iid - - \c com.nokia.Qt.QVideoWindowControl/1.0 - - Defines the interface name of the QVideoWindowControl class. - - \relates QVideoWindowControl -*/ - -/*! - Constructs a new video window control with the given \a parent. -*/ -QVideoWindowControl::QVideoWindowControl(QObject *parent) - : QMediaControl(parent) -{ -} - -/*! - Destroys a video window control. -*/ -QVideoWindowControl::~QVideoWindowControl() -{ -} - -/*! - \fn QVideoWindowControl::winId() const - - Returns the ID of the window a video overlay end point renders to. -*/ - -/*! - \fn QVideoWindowControl::setWinId(WId id) - - Sets the \a id of the window a video overlay end point renders to. -*/ - -/*! - \fn QVideoWindowControl::displayRect() const - Returns the sub-rect of a window where video is displayed. -*/ - -/*! - \fn QVideoWindowControl::setDisplayRect(const QRect &rect) - Sets the sub-\a rect of a window where video is displayed. -*/ - -/*! - \fn QVideoWindowControl::isFullScreen() const - - Identifies if a video overlay is a fullScreen overlay. - - Returns true if the video overlay is fullScreen, and false otherwise. -*/ - -/*! - \fn QVideoWindowControl::setFullScreen(bool fullScreen) - - Sets whether a video overlay is a \a fullScreen overlay. -*/ - -/*! - \fn QVideoWindowControl::fullScreenChanged(bool fullScreen) - - Signals that the \a fullScreen state of a video overlay has changed. -*/ - -/*! - \fn QVideoWindowControl::repaint() - - Repaints the last frame. -*/ - -/*! - \fn QVideoWindowControl::nativeSize() const - - Returns a suggested size for the video display based on the resolution and aspect ratio of the - video. -*/ - -/*! - \fn QVideoWindowControl::nativeSizeChanged() - - Signals that the native dimensions of the video have changed. -*/ - - -/*! - \fn QVideoWindowControl::aspectRatioMode() const - - Returns how video is scaled to fit the display region with respect to its aspect ratio. -*/ - -/*! - \fn QVideoWindowControl::setAspectRatioMode(Qt::AspectRatioMode mode) - - Sets the aspect ratio \a mode which determines how video is scaled to the fit the display region - with respect to its aspect ratio. -*/ - -/*! - \fn QVideoWindowControl::brightness() const - - Returns the brightness adjustment applied to a video overlay. - - Valid brightness values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWindowControl::setBrightness(int brightness) - - Sets a \a brightness adjustment for a video overlay. - - Valid brightness values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWindowControl::brightnessChanged(int brightness) - - Signals that a video overlay's \a brightness adjustment has changed. -*/ - -/*! - \fn QVideoWindowControl::contrast() const - - Returns the contrast adjustment applied to a video overlay. - - Valid contrast values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWindowControl::setContrast(int contrast) - - Sets the \a contrast adjustment for a video overlay. - - Valid contrast values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWindowControl::contrastChanged(int contrast) - - Signals that a video overlay's \a contrast adjustment has changed. -*/ - -/*! - \fn QVideoWindowControl::hue() const - - Returns the hue adjustment applied to a video overlay. - - Value hue values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWindowControl::setHue(int hue) - - Sets a \a hue adjustment for a video overlay. - - Valid hue values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWindowControl::hueChanged(int hue) - - Signals that a video overlay's \a hue adjustment has changed. -*/ - -/*! - \fn QVideoWindowControl::saturation() const - - Returns the saturation adjustment applied to a video overlay. - - Value saturation values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWindowControl::setSaturation(int saturation) - Sets a \a saturation adjustment for a video overlay. - - Valid saturation values range between -100 and 100, the default is 0. -*/ - -/*! - \fn QVideoWindowControl::saturationChanged(int saturation) - - Signals that a video overlay's \a saturation adjustment has changed. -*/ - -#include "moc_qvideowindowcontrol.cpp" - -QT_END_NAMESPACE - diff --git a/src/multimedia/base/qvideowindowcontrol.h b/src/multimedia/base/qvideowindowcontrol.h deleted file mode 100644 index 53f7b0e..0000000 --- a/src/multimedia/base/qvideowindowcontrol.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QVIDEOWINDOWCONTROL_H -#define QVIDEOWINDOWCONTROL_H - -#include - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class Q_MULTIMEDIA_EXPORT QVideoWindowControl : public QMediaControl -{ - Q_OBJECT - -public: - ~QVideoWindowControl(); - - virtual WId winId() const = 0; - virtual void setWinId(WId id) = 0; - - virtual QRect displayRect() const = 0; - virtual void setDisplayRect(const QRect &rect) = 0; - - virtual bool isFullScreen() const = 0; - virtual void setFullScreen(bool fullScreen) = 0; - - virtual void repaint() = 0; - - virtual QSize nativeSize() const = 0; - - virtual Qt::AspectRatioMode aspectRatioMode() const = 0; - virtual void setAspectRatioMode(Qt::AspectRatioMode mode) = 0; - - virtual int brightness() const = 0; - virtual void setBrightness(int brightness) = 0; - - virtual int contrast() const = 0; - virtual void setContrast(int contrast) = 0; - - virtual int hue() const = 0; - virtual void setHue(int hue) = 0; - - virtual int saturation() const = 0; - virtual void setSaturation(int saturation) = 0; - -Q_SIGNALS: - void fullScreenChanged(bool fullScreen); - void brightnessChanged(int brightness); - void contrastChanged(int contrast); - void hueChanged(int hue); - void saturationChanged(int saturation); - void nativeSizeChanged(); - -protected: - QVideoWindowControl(QObject *parent = 0); -}; - -#define QVideoWindowControl_iid "com.nokia.Qt.QVideoWindowControl/1.0" -Q_MEDIA_DECLARE_CONTROL(QVideoWindowControl, QVideoWindowControl_iid) - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/effects/effects.pri b/src/multimedia/effects/effects.pri deleted file mode 100644 index 6307255..0000000 --- a/src/multimedia/effects/effects.pri +++ /dev/null @@ -1,26 +0,0 @@ - - -unix:!mac { - contains(QT_CONFIG, pulseaudio) { - DEFINES += QT_MULTIMEDIA_PULSEAUDIO - HEADERS += $$PWD/qsoundeffect_pulse_p.h - SOURCES += $$PWD/qsoundeffect_pulse_p.cpp - QMAKE_CXXFLAGS += $$QT_CFLAGS_PULSEAUDIO - LIBS += $$QT_LIBS_PULSEAUDIO - } else { - DEFINES += QT_MULTIMEDIA_QMEDIAPLAYER - HEADERS += $$PWD/qsoundeffect_qmedia_p.h - SOURCES += $$PWD/qsoundeffect_qmedia_p.cpp - } -} else { - HEADERS += $$PWD/qsoundeffect_qsound_p.h - SOURCES += $$PWD/qsoundeffect_qsound_p.cpp -} - -HEADERS += \ - $$PWD/qsoundeffect_p.h \ - $$PWD/wavedecoder_p.h - -SOURCES += \ - $$PWD/qsoundeffect.cpp \ - $$PWD/wavedecoder_p.cpp diff --git a/src/multimedia/effects/qsoundeffect.cpp b/src/multimedia/effects/qsoundeffect.cpp deleted file mode 100644 index 8a38103..0000000 --- a/src/multimedia/effects/qsoundeffect.cpp +++ /dev/null @@ -1,207 +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 "qsoundeffect_p.h" - -#if defined(QT_MULTIMEDIA_PULSEAUDIO) -#include "qsoundeffect_pulse_p.h" -#elif(QT_MULTIMEDIA_QMEDIAPLAYER) -#include "qsoundeffect_qmedia_p.h" -#else -#include "qsoundeffect_qsound_p.h" -#endif - -QT_BEGIN_NAMESPACE - -/*! - \qmlclass SoundEffect QSoundEffect - \since 4.7 - \brief The SoundEffect element provides a way to play sound effects in qml. - - This element is part of the \bold{Qt.multimedia 4.7} module. - - The following example plays a wav file on mouse click. - - \qml - import Qt 4.6 - import Qt.multimedia 4.7 - - Item { - SoundEffect { - id: playSound - source: "test.wav" - } - MouseArea { - id: playArea - anchors.fill: parent - onPressed: { - playSound.play() - } - } - } - \endqml -*/ - -/*! - \qmlproperty QUrl SoundEffect::source - - This property provides a way to control the sound to play. -*/ - -/*! - \qmlproperty int SoundEffect::loops - - This property provides a way to control the number of times to repeat the sound on each play(). -*/ - -/*! - \qmlproperty int SoundEffect::volume - - This property provides a way to control the volume for playback. -*/ - -/*! - \qmlproperty bool SoundEffect::muted - - This property provides a way to control muting. -*/ - -/*! - \qmlsignal SoundEffect::sourceChanged() - - This handler is called when the source has changed. -*/ - -/*! - \qmlsignal SoundEffect::loopsChanged() - - This handler is called when the number of loops has changes. -*/ - -/*! - \qmlsignal SoundEffect::volumeChanged() - - This handler is called when the volume has changed. -*/ - -/*! - \qmlsignal SoundEffect::mutedChanged() - - This handler is called when the mute state has changed. -*/ - - -QSoundEffect::QSoundEffect(QObject *parent) : - QObject(parent) -{ - d = new QSoundEffectPrivate(this); - connect(d, SIGNAL(volumeChanged()), SIGNAL(volumeChanged())); - connect(d, SIGNAL(mutedChanged()), SIGNAL(mutedChanged())); -} - -QSoundEffect::~QSoundEffect() -{ - d->deleteLater(); -} - -QUrl QSoundEffect::source() const -{ - return d->source(); -} - -void QSoundEffect::setSource(const QUrl &url) -{ - if (d->source() == url) - return; - - d->setSource(url); - - emit sourceChanged(); -} - -int QSoundEffect::loops() const -{ - return d->loopCount(); -} - -void QSoundEffect::setLoops(int loopCount) -{ - if (d->loopCount() == loopCount) - return; - - d->setLoopCount(loopCount); - emit loopsChanged(); -} - -int QSoundEffect::volume() const -{ - return d->volume(); -} - -void QSoundEffect::setVolume(int volume) -{ - if (d->volume() == volume) - return; - - d->setVolume(volume); - emit volumeChanged(); -} - -bool QSoundEffect::isMuted() const -{ - return d->isMuted(); -} - -void QSoundEffect::setMuted(bool muted) -{ - if (d->isMuted() == muted) - return; - - d->setMuted(muted); - emit mutedChanged(); -} - -void QSoundEffect::play() -{ - d->play(); -} - -QT_END_NAMESPACE diff --git a/src/multimedia/effects/qsoundeffect_p.h b/src/multimedia/effects/qsoundeffect_p.h deleted file mode 100644 index 05207a0..0000000 --- a/src/multimedia/effects/qsoundeffect_p.h +++ /dev/null @@ -1,109 +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 QSOUNDEFFECT_H -#define QSOUNDEFFECT_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QSoundEffectPrivate; -class Q_MULTIMEDIA_EXPORT QSoundEffect : public QObject -{ - Q_OBJECT - Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) - Q_PROPERTY(int loops READ loops WRITE setLoops NOTIFY loopsChanged) - Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) - Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) - -public: - explicit QSoundEffect(QObject *parent = 0); - ~QSoundEffect(); - - QUrl source() const; - void setSource(const QUrl &url); - - int loops() const; - void setLoops(int loopCount); - - int volume() const; - void setVolume(int volume); - - bool isMuted() const; - void setMuted(bool muted); - -Q_SIGNALS: - void sourceChanged(); - void loopsChanged(); - void volumeChanged(); - void mutedChanged(); - -public Q_SLOTS: - void play(); - -private: - Q_DISABLE_COPY(QSoundEffect) - QSoundEffectPrivate* d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - - -#endif // QSOUNDEFFECT_H diff --git a/src/multimedia/effects/qsoundeffect_pulse_p.cpp b/src/multimedia/effects/qsoundeffect_pulse_p.cpp deleted file mode 100644 index e379259..0000000 --- a/src/multimedia/effects/qsoundeffect_pulse_p.cpp +++ /dev/null @@ -1,499 +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$ -** -****************************************************************************/ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include - -#include "wavedecoder_p.h" - -#include "qsoundeffect_pulse_p.h" - -#if defined(Q_WS_MAEMO_5) -#include -#endif - -#include - -// Less than ideal -#define PA_SCACHE_ENTRY_SIZE_MAX (1024*1024*16) - -QT_BEGIN_NAMESPACE - -namespace -{ -inline pa_sample_spec audioFormatToSampleSpec(const QAudioFormat &format) -{ - pa_sample_spec spec; - - spec.rate = format.frequency(); - spec.channels = format.channels(); - - if (format.sampleSize() == 8) - spec.format = PA_SAMPLE_U8; - else if (format.sampleSize() == 16) { - switch (format.byteOrder()) { - case QAudioFormat::BigEndian: spec.format = PA_SAMPLE_S16BE; break; - case QAudioFormat::LittleEndian: spec.format = PA_SAMPLE_S16LE; break; - } - } - else if (format.sampleSize() == 32) { - switch (format.byteOrder()) { - case QAudioFormat::BigEndian: spec.format = PA_SAMPLE_S32BE; break; - case QAudioFormat::LittleEndian: spec.format = PA_SAMPLE_S32LE; break; - } - } - - return spec; -} - -class PulseDaemon -{ -public: - PulseDaemon():m_prepared(false) - { - prepare(); - } - - ~PulseDaemon() - { - if (m_prepared) - release(); - } - - inline void lock() - { - pa_threaded_mainloop_lock(m_mainLoop); - } - - inline void unlock() - { - pa_threaded_mainloop_unlock(m_mainLoop); - } - - inline pa_context *context() const - { - return m_context; - } - - int volume() - { - return m_vol; - } - -private: - void prepare() - { - m_vol = 100; - - m_mainLoop = pa_threaded_mainloop_new(); - if (m_mainLoop == 0) { - qWarning("PulseAudioService: unable to create pulseaudio mainloop"); - return; - } - - if (pa_threaded_mainloop_start(m_mainLoop) != 0) { - qWarning("PulseAudioService: unable to start pulseaudio mainloop"); - pa_threaded_mainloop_free(m_mainLoop); - return; - } - - m_mainLoopApi = pa_threaded_mainloop_get_api(m_mainLoop); - - lock(); - m_context = pa_context_new(m_mainLoopApi, QString(QLatin1String("QtPulseAudio:%1")).arg(::getpid()).toAscii().constData()); - -#if defined(Q_WS_MAEMO_5) - pa_context_set_state_callback(m_context, context_state_callback, this); -#endif - if (m_context == 0) { - qWarning("PulseAudioService: Unable to create new pulseaudio context"); - pa_threaded_mainloop_free(m_mainLoop); - return; - } - - if (pa_context_connect(m_context, NULL, (pa_context_flags_t)0, NULL) < 0) { - qWarning("PulseAudioService: pa_context_connect() failed"); - pa_context_unref(m_context); - pa_threaded_mainloop_free(m_mainLoop); - return; - } - unlock(); - - m_prepared = true; - } - - void release() - { - if (!m_prepared) return; - pa_threaded_mainloop_stop(m_mainLoop); - pa_threaded_mainloop_free(m_mainLoop); - m_prepared = false; - } - -#if defined(Q_WS_MAEMO_5) - static void context_state_callback(pa_context *c, void *userdata) - { - PulseDaemon *self = reinterpret_cast(userdata); - switch (pa_context_get_state(c)) { - case PA_CONTEXT_CONNECTING: - case PA_CONTEXT_AUTHORIZING: - case PA_CONTEXT_SETTING_NAME: - break; - case PA_CONTEXT_READY: - pa_ext_stream_restore_set_subscribe_cb(c, &stream_restore_monitor_callback, self); - pa_ext_stream_restore_subscribe(c, 1, NULL, self); - break; - default: - break; - } - } - static void stream_restore_monitor_callback(pa_context *c, void *userdata) - { - PulseDaemon *self = reinterpret_cast(userdata); - pa_ext_stream_restore2_read(c, &stream_restore_info_callback, self); - } - static void stream_restore_info_callback(pa_context *c, const pa_ext_stream_restore2_info *info, - int eol, void *userdata) - { - Q_UNUSED(c) - - PulseDaemon *self = reinterpret_cast(userdata); - - if (!eol) { - if (QString(info->name).startsWith(QLatin1String("sink-input-by-media-role:x-maemo"))) { - const unsigned str_length = 256; - char str[str_length]; - pa_cvolume_snprint(str, str_length, &info->volume); - self->m_vol = QString(str).replace(" ","").replace("%","").mid(2).toInt(); - } - } - } -#endif - - int m_vol; - bool m_prepared; - pa_context *m_context; - pa_threaded_mainloop *m_mainLoop; - pa_mainloop_api *m_mainLoopApi; -}; -} - -Q_GLOBAL_STATIC(PulseDaemon, daemon) - - -QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent): - QObject(parent), - m_retry(false), - m_muted(false), - m_playQueued(false), - m_sampleLoaded(false), - m_volume(100), - m_duration(0), - m_dataUploaded(0), - m_loopCount(1), - m_runningCount(0), - m_reply(0), - m_stream(0), - m_networkAccessManager(0) -{ -} - -QSoundEffectPrivate::~QSoundEffectPrivate() -{ - m_reply->deleteLater(); - unloadSample(); -} - -QUrl QSoundEffectPrivate::source() const -{ - return m_source; -} - -void QSoundEffectPrivate::setSource(const QUrl &url) -{ - if (url.isEmpty()) { - m_source = QUrl(); - unloadSample(); - return; - } - - m_source = url; - - if (m_networkAccessManager == 0) - m_networkAccessManager = new QNetworkAccessManager(this); - - m_stream = m_networkAccessManager->get(QNetworkRequest(m_source)); - - unloadSample(); - loadSample(); -} - -int QSoundEffectPrivate::loopCount() const -{ - return m_loopCount; -} - -void QSoundEffectPrivate::setLoopCount(int loopCount) -{ - m_loopCount = loopCount; -} - -int QSoundEffectPrivate::volume() const -{ - return m_volume; -} - -void QSoundEffectPrivate::setVolume(int volume) -{ - m_volume = volume; -} - -bool QSoundEffectPrivate::isMuted() const -{ - return m_muted; -} - -void QSoundEffectPrivate::setMuted(bool muted) -{ - m_muted = muted; -} - -void QSoundEffectPrivate::play() -{ - if (m_retry) { - m_retry = false; - setSource(m_source); - return; - } - - if (!m_sampleLoaded) { - m_playQueued = true; - return; - } - - m_runningCount += m_loopCount; - - playSample(); -} - -void QSoundEffectPrivate::decoderReady() -{ - if (m_waveDecoder->size() >= PA_SCACHE_ENTRY_SIZE_MAX) { - m_waveDecoder->deleteLater(); - qWarning("QSoundEffect(pulseaudio): Attempting to load to large a sample"); - return; - } - - if (m_name.isNull()) - m_name = QString(QLatin1String("QtPulseSample-%1-%2")).arg(::getpid()).arg(quintptr(this)).toUtf8(); - - pa_sample_spec spec = audioFormatToSampleSpec(m_waveDecoder->audioFormat()); - - daemon()->lock(); - pa_stream *stream = pa_stream_new(daemon()->context(), m_name.constData(), &spec, 0); - pa_stream_set_state_callback(stream, stream_state_callback, this); - pa_stream_set_write_callback(stream, stream_write_callback, this); - pa_stream_connect_upload(stream, (size_t)m_waveDecoder->size()); - m_pulseStream = stream; - daemon()->unlock(); -} - -void QSoundEffectPrivate::decoderError() -{ - qWarning("QSoundEffect(pulseaudio): Error decoding source"); -} - -void QSoundEffectPrivate::checkPlayTime() -{ - int elapsed = m_playbackTime.elapsed(); - - if (elapsed < m_duration) - startTimer(m_duration - elapsed); -} - -void QSoundEffectPrivate::loadSample() -{ - m_sampleLoaded = false; - m_dataUploaded = 0; - m_waveDecoder = new WaveDecoder(m_stream); - connect(m_waveDecoder, SIGNAL(formatKnown()), SLOT(decoderReady())); - connect(m_waveDecoder, SIGNAL(invalidFormat()), SLOT(decoderError())); -} - -void QSoundEffectPrivate::unloadSample() -{ - if (!m_sampleLoaded) - return; - - daemon()->lock(); - pa_context_remove_sample(daemon()->context(), m_name.constData(), NULL, NULL); - daemon()->unlock(); - - m_duration = 0; - m_dataUploaded = 0; - m_sampleLoaded = false; -} - -void QSoundEffectPrivate::uploadSample() -{ - daemon()->lock(); - - size_t bufferSize = qMin(pa_stream_writable_size(m_pulseStream), - size_t(m_waveDecoder->bytesAvailable())); - char buffer[bufferSize]; - - size_t len = 0; - while (len < (m_waveDecoder->size())) { - qint64 read = m_waveDecoder->read(buffer, qMin((int)bufferSize, - (int)(m_waveDecoder->size()-len))); - if (read > 0) { - if (pa_stream_write(m_pulseStream, buffer, size_t(read), 0, 0, PA_SEEK_RELATIVE) == 0) - len += size_t(read); - else - break; - } - } - - m_dataUploaded += len; - pa_stream_set_write_callback(m_pulseStream, NULL, NULL); - - if (m_waveDecoder->size() == m_dataUploaded) { - int err = pa_stream_finish_upload(m_pulseStream); - if(err != 0) { - qWarning("pa_stream_finish_upload() err=%d",err); - pa_stream_disconnect(m_pulseStream); - m_retry = true; - m_playQueued = false; - QMetaObject::invokeMethod(this, "play"); - daemon()->unlock(); - return; - } - m_duration = m_waveDecoder->duration(); - m_waveDecoder->deleteLater(); - m_stream->deleteLater(); - m_sampleLoaded = true; - if (m_playQueued) { - m_playQueued = false; - QMetaObject::invokeMethod(this, "play"); - } - } - daemon()->unlock(); -} - -void QSoundEffectPrivate::playSample() -{ - pa_volume_t volume = PA_VOLUME_NORM; - - daemon()->lock(); -#ifdef Q_WS_MAEMO_5 - volume = PA_VOLUME_NORM / 100 * ((daemon()->volume() + m_volume) / 2); -#endif - pa_operation_unref( - pa_context_play_sample(daemon()->context(), - m_name.constData(), - 0, - volume, - play_callback, - this) - ); - daemon()->unlock(); - - m_playbackTime.start(); -} - -void QSoundEffectPrivate::timerEvent(QTimerEvent *event) -{ - if (m_runningCount > 0) - playSample(); - - killTimer(event->timerId()); -} - -void QSoundEffectPrivate::stream_write_callback(pa_stream *s, size_t length, void *userdata) -{ - Q_UNUSED(length); - - QSoundEffectPrivate *self = reinterpret_cast(userdata); - - QMetaObject::invokeMethod(self, "uploadSample", Qt::QueuedConnection); -} - -void QSoundEffectPrivate::stream_state_callback(pa_stream *s, void *userdata) -{ - switch (pa_stream_get_state(s)) { - case PA_STREAM_CREATING: - case PA_STREAM_READY: - case PA_STREAM_TERMINATED: - break; - - case PA_STREAM_FAILED: - default: - qWarning("QSoundEffect(pulseaudio): Error in pulse audio stream"); - break; - } -} - -void QSoundEffectPrivate::play_callback(pa_context *c, int success, void *userdata) -{ - Q_UNUSED(c); - - QSoundEffectPrivate *self = reinterpret_cast(userdata); - - if (success == 1) { - self->m_runningCount--; - QMetaObject::invokeMethod(self, "checkPlayTime", Qt::QueuedConnection); - } -} - -QT_END_NAMESPACE diff --git a/src/multimedia/effects/qsoundeffect_pulse_p.h b/src/multimedia/effects/qsoundeffect_pulse_p.h deleted file mode 100644 index aff729c..0000000 --- a/src/multimedia/effects/qsoundeffect_pulse_p.h +++ /dev/null @@ -1,137 +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 QSOUNDEFFECT_PULSE_H -#define QSOUNDEFFECT_PULSE_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - - -#include "qsoundeffect_p.h" - -#include -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QNetworkReply; -class QNetworkAccessManager; -class WaveDecoder; - -class QSoundEffectPrivate : public QObject -{ - Q_OBJECT -public: - explicit QSoundEffectPrivate(QObject* parent); - ~QSoundEffectPrivate(); - - QUrl source() const; - void setSource(const QUrl &url); - int loopCount() const; - void setLoopCount(int loopCount); - int volume() const; - void setVolume(int volume); - bool isMuted() const; - void setMuted(bool muted); - -public Q_SLOTS: - void play(); - -Q_SIGNALS: - void volumeChanged(); - void mutedChanged(); - -private Q_SLOTS: - void decoderReady(); - void decoderError(); - void checkPlayTime(); - void uploadSample(); - -private: - void loadSample(); - void unloadSample(); - void playSample(); - - void timerEvent(QTimerEvent *event); - - static void stream_write_callback(pa_stream *s, size_t length, void *userdata); - static void stream_state_callback(pa_stream *s, void *userdata); - static void play_callback(pa_context *c, int success, void *userdata); - - pa_stream *m_pulseStream; - - bool m_retry; - bool m_muted; - bool m_playQueued; - bool m_sampleLoaded; - int m_volume; - int m_duration; - int m_dataUploaded; - int m_loopCount; - int m_runningCount; - QUrl m_source; - QTime m_playbackTime; - QByteArray m_name; - QNetworkReply *m_reply; - WaveDecoder *m_waveDecoder; - QIODevice *m_stream; - QNetworkAccessManager *m_networkAccessManager; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QSOUNDEFFECT_PULSE_H diff --git a/src/multimedia/effects/qsoundeffect_qmedia_p.cpp b/src/multimedia/effects/qsoundeffect_qmedia_p.cpp deleted file mode 100644 index 36c36dd..0000000 --- a/src/multimedia/effects/qsoundeffect_qmedia_p.cpp +++ /dev/null @@ -1,132 +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$ -** -****************************************************************************/ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qsoundeffect_qmedia_p.h" - -#include - -#include -#include - - -QT_BEGIN_NAMESPACE - -QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent): - QObject(parent), - m_loopCount(1), - m_runningCount(0), - m_player(0) -{ - m_player = new QMediaPlayer(this, QMediaPlayer::LowLatency); - connect(m_player, SIGNAL(stateChanged(QMediaPlayer::State)), SLOT(stateChanged(QMediaPlayer::State))); -} - -QSoundEffectPrivate::~QSoundEffectPrivate() -{ -} - -QUrl QSoundEffectPrivate::source() const -{ - return m_player->media().canonicalUrl(); -} - -void QSoundEffectPrivate::setSource(const QUrl &url) -{ - m_player->setMedia(url); -} - -int QSoundEffectPrivate::loopCount() const -{ - return m_loopCount; -} - -void QSoundEffectPrivate::setLoopCount(int loopCount) -{ - m_loopCount = loopCount; -} - -int QSoundEffectPrivate::volume() const -{ - return m_player->volume(); -} - -void QSoundEffectPrivate::setVolume(int volume) -{ - m_player->setVolume(volume); -} - -bool QSoundEffectPrivate::isMuted() const -{ - return m_player->isMuted(); -} - -void QSoundEffectPrivate::setMuted(bool muted) -{ - m_player->setMuted(muted); -} - -void QSoundEffectPrivate::play() -{ - m_runningCount += m_loopCount; - m_player->play(); -} - -void QSoundEffectPrivate::stateChanged(QMediaPlayer::State state) -{ - if (state == QMediaPlayer::StoppedState) { - if (--m_runningCount > 0) - m_player->play(); - } -} - -QT_END_NAMESPACE - diff --git a/src/multimedia/effects/qsoundeffect_qmedia_p.h b/src/multimedia/effects/qsoundeffect_qmedia_p.h deleted file mode 100644 index 6ad9d79..0000000 --- a/src/multimedia/effects/qsoundeffect_qmedia_p.h +++ /dev/null @@ -1,103 +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 QSOUNDEFFECT_QMEDIA_H -#define QSOUNDEFFECT_QMEDIA_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class QSoundEffectPrivate : public QObject -{ - Q_OBJECT -public: - explicit QSoundEffectPrivate(QObject* parent); - ~QSoundEffectPrivate(); - - QUrl source() const; - void setSource(const QUrl &url); - int loopCount() const; - void setLoopCount(int loopCount); - int volume() const; - void setVolume(int volume); - bool isMuted() const; - void setMuted(bool muted); - -public Q_SLOTS: - void play(); - -Q_SIGNALS: - void volumeChanged(); - void mutedChanged(); - -private Q_SLOTS: - void stateChanged(QMediaPlayer::State); - -private: - int m_loopCount; - int m_runningCount; - QMediaPlayer *m_player; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QSOUNDEFFECT_QMEDIA_H diff --git a/src/multimedia/effects/qsoundeffect_qsound_p.cpp b/src/multimedia/effects/qsoundeffect_qsound_p.cpp deleted file mode 100644 index ff30f67..0000000 --- a/src/multimedia/effects/qsoundeffect_qsound_p.cpp +++ /dev/null @@ -1,131 +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$ -** -****************************************************************************/ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qsoundeffect_qsound_p.h" - -#include -#include - - -QT_BEGIN_NAMESPACE - -QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent): - QObject(parent), - m_muted(false), - m_loopCount(1), - m_volume(100), - m_sound(0) -{ -} - -QSoundEffectPrivate::~QSoundEffectPrivate() -{ -} - -QUrl QSoundEffectPrivate::source() const -{ - return m_source; -} - -void QSoundEffectPrivate::setSource(const QUrl &url) -{ - if (url.isEmpty() || url.scheme() != QLatin1String("file")) { - m_source = QUrl(); - return; - } - - if (m_sound != 0) - delete m_sound; - - m_source = url; - m_sound = new QSound(m_source.toLocalFile(), this); - m_sound->setLoops(m_loopCount); -} - -int QSoundEffectPrivate::loopCount() const -{ - return m_loopCount; -} - -void QSoundEffectPrivate::setLoopCount(int lc) -{ - m_loopCount = lc; - if (m_sound) - m_sound->setLoops(lc); -} - -int QSoundEffectPrivate::volume() const -{ - return m_volume; -} - -void QSoundEffectPrivate::setVolume(int v) -{ - m_volume = v; -} - -bool QSoundEffectPrivate::isMuted() const -{ - return m_muted; -} - -void QSoundEffectPrivate::setMuted(bool muted) -{ - m_muted = muted; -} - -void QSoundEffectPrivate::play() -{ - m_sound->play(); -} - -QT_END_NAMESPACE diff --git a/src/multimedia/effects/qsoundeffect_qsound_p.h b/src/multimedia/effects/qsoundeffect_qsound_p.h deleted file mode 100644 index 6fb3cfa..0000000 --- a/src/multimedia/effects/qsoundeffect_qsound_p.h +++ /dev/null @@ -1,102 +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 QSOUNDEFFECT_QSOUND_H -#define QSOUNDEFFECT_QSOUND_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QSound; - -class QSoundEffectPrivate : public QObject -{ - Q_OBJECT -public: - explicit QSoundEffectPrivate(QObject* parent); - ~QSoundEffectPrivate(); - - QUrl source() const; - void setSource(const QUrl &url); - int loopCount() const; - void setLoopCount(int loopCount); - int volume() const; - void setVolume(int volume); - bool isMuted() const; - void setMuted(bool muted); - -public Q_SLOTS: - void play(); - -Q_SIGNALS: - void volumeChanged(); - void mutedChanged(); - -private: - bool m_muted; - int m_loopCount; - int m_volume; - QSound *m_sound; - QUrl m_source; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QSOUNDEFFECT_QSOUND_H diff --git a/src/multimedia/effects/wavedecoder_p.cpp b/src/multimedia/effects/wavedecoder_p.cpp deleted file mode 100644 index b534ded..0000000 --- a/src/multimedia/effects/wavedecoder_p.cpp +++ /dev/null @@ -1,151 +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 "wavedecoder_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -WaveDecoder::WaveDecoder(QIODevice *s, QObject *parent): - QIODevice(parent), - haveFormat(false), - dataSize(0), - remaining(0), - source(s) -{ - open(QIODevice::ReadOnly | QIODevice::Unbuffered); - - if (source->bytesAvailable() >= qint64(sizeof(CombinedHeader) + sizeof(DATAHeader) + sizeof(quint16))) - QTimer::singleShot(0, this, SLOT(handleData())); - else - connect(source, SIGNAL(readyRead()), SLOT(handleData())); -} - -WaveDecoder::~WaveDecoder() -{ -} - -QAudioFormat WaveDecoder::audioFormat() const -{ - return format; -} - -int WaveDecoder::duration() const -{ - return size() * 1000 / (format.sampleSize() / 8) / format.channels() / format.frequency(); -} - -qint64 WaveDecoder::size() const -{ - return haveFormat ? dataSize : 0; -} - -bool WaveDecoder::isSequential() const -{ - return source->isSequential(); -} - -qint64 WaveDecoder::bytesAvailable() const -{ - return haveFormat ? source->bytesAvailable() : 0; -} - -qint64 WaveDecoder::readData(char *data, qint64 maxlen) -{ - return haveFormat ? source->read(data, maxlen) : 0; -} - -qint64 WaveDecoder::writeData(const char *data, qint64 len) -{ - Q_UNUSED(data); - Q_UNUSED(len); - - return -1; -} - -void WaveDecoder::handleData() -{ - if (source->bytesAvailable() < qint64(sizeof(CombinedHeader) + sizeof(DATAHeader) + sizeof(quint16))) - return; - - source->disconnect(SIGNAL(readyRead()), this, SLOT(handleData())); - source->read((char*)&header, sizeof(CombinedHeader)); - - if (qstrncmp(header.riff.descriptor.id, "RIFF", 4) != 0 || - qstrncmp(header.riff.type, "WAVE", 4) != 0 || - qstrncmp(header.wave.descriptor.id, "fmt ", 4) != 0 || - (header.wave.audioFormat != 0 && header.wave.audioFormat != 1)) { - - emit invalidFormat(); - } - else { - DATAHeader dataHeader; - - if (qFromLittleEndian(header.wave.descriptor.size) > sizeof(WAVEHeader)) { - // Extended data available - quint16 extraFormatBytes; - source->peek((char*)&extraFormatBytes, sizeof(quint16)); - extraFormatBytes = qFromLittleEndian(extraFormatBytes); - source->read(sizeof(quint16) + extraFormatBytes); // dump it all - } - - source->read((char*)&dataHeader, sizeof(DATAHeader)); - - int bps = qFromLittleEndian(header.wave.bitsPerSample); - - format.setCodec(QLatin1String("audio/pcm")); - format.setSampleType(bps == 8 ? QAudioFormat::UnSignedInt : QAudioFormat::SignedInt); - format.setByteOrder(QAudioFormat::LittleEndian); - format.setFrequency(qFromLittleEndian(header.wave.sampleRate)); - format.setSampleSize(bps); - format.setChannels(qFromLittleEndian(header.wave.numChannels)); - - dataSize = qFromLittleEndian(dataHeader.descriptor.size); - - haveFormat = true; - connect(source, SIGNAL(readyRead()), SIGNAL(readyRead())); - emit formatKnown(); - } -} - -QT_END_NAMESPACE diff --git a/src/multimedia/effects/wavedecoder_p.h b/src/multimedia/effects/wavedecoder_p.h deleted file mode 100644 index c1892bb..0000000 --- a/src/multimedia/effects/wavedecoder_p.h +++ /dev/null @@ -1,133 +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 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 - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - -class WaveDecoder : public QIODevice -{ - Q_OBJECT - -public: - explicit WaveDecoder(QIODevice *source, QObject *parent = 0); - ~WaveDecoder(); - - QAudioFormat audioFormat() const; - int duration() const; - - qint64 size() const; - bool isSequential() const; - qint64 bytesAvailable() const; - -Q_SIGNALS: - void formatKnown(); - void invalidFormat(); - -private Q_SLOTS: - void handleData(); - -private: - qint64 readData(char *data, qint64 maxlen); - qint64 writeData(const char *data, qint64 len); - - struct chunk - { - char id[4]; - quint32 size; - }; - struct RIFFHeader - { - chunk descriptor; - char type[4]; - }; - struct WAVEHeader - { - chunk descriptor; - quint16 audioFormat; - quint16 numChannels; - quint32 sampleRate; - quint32 byteRate; - quint16 blockAlign; - quint16 bitsPerSample; - }; - struct DATAHeader - { - chunk descriptor; - }; - struct CombinedHeader - { - RIFFHeader riff; - WAVEHeader wave; - }; - - bool haveFormat; - qint64 dataSize; - qint64 remaining; - QAudioFormat format; - QIODevice *source; - CombinedHeader header; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // WAVEDECODER_H diff --git a/src/multimedia/mediaservices/base/base.pri b/src/multimedia/mediaservices/base/base.pri new file mode 100644 index 0000000..49eca49 --- /dev/null +++ b/src/multimedia/mediaservices/base/base.pri @@ -0,0 +1,69 @@ + +QT += network +contains(QT_CONFIG, opengl):QT += opengl + +HEADERS += \ + $$PWD/qmediaresource.h \ + $$PWD/qmediacontent.h \ + $$PWD/qmediaobject.h \ + $$PWD/qmediaobject_p.h \ + $$PWD/qmediapluginloader_p.h \ + $$PWD/qmediaservice.h \ + $$PWD/qmediaservice_p.h \ + $$PWD/qmediaserviceprovider.h \ + $$PWD/qmediaserviceproviderplugin.h \ + $$PWD/qmediacontrol.h \ + $$PWD/qmediacontrol_p.h \ + $$PWD/qmetadatacontrol.h \ + $$PWD/qvideooutputcontrol.h \ + $$PWD/qvideowindowcontrol.h \ + $$PWD/qvideorenderercontrol.h \ + $$PWD/qvideodevicecontrol.h \ + $$PWD/qvideowidgetcontrol.h \ + $$PWD/qvideowidget.h \ + $$PWD/qvideowidget_p.h \ + $$PWD/qgraphicsvideoitem.h \ + $$PWD/qmediaplaylistcontrol.h \ + $$PWD/qmediaplaylist.h \ + $$PWD/qmediaplaylist_p.h \ + $$PWD/qmediaplaylistprovider.h \ + $$PWD/qmediaplaylistprovider_p.h \ + $$PWD/qmediaplaylistioplugin.h \ + $$PWD/qlocalmediaplaylistprovider.h \ + $$PWD/qmediaplaylistnavigator.h \ + $$PWD/qpaintervideosurface_p.h \ + $$PWD/qmediatimerange.h \ + $$PWD/qtmedianamespace.h + +SOURCES += \ + $$PWD/qmediaresource.cpp \ + $$PWD/qmediacontent.cpp \ + $$PWD/qmediaobject.cpp \ + $$PWD/qmediapluginloader.cpp \ + $$PWD/qmediaservice.cpp \ + $$PWD/qmediaserviceprovider.cpp \ + $$PWD/qmediacontrol.cpp \ + $$PWD/qmetadatacontrol.cpp \ + $$PWD/qvideooutputcontrol.cpp \ + $$PWD/qvideowindowcontrol.cpp \ + $$PWD/qvideorenderercontrol.cpp \ + $$PWD/qvideodevicecontrol.cpp \ + $$PWD/qvideowidgetcontrol.cpp \ + $$PWD/qvideowidget.cpp \ + $$PWD/qgraphicsvideoitem.cpp \ + $$PWD/qmediaplaylistcontrol.cpp \ + $$PWD/qmediaplaylist.cpp \ + $$PWD/qmediaplaylistprovider.cpp \ + $$PWD/qmediaplaylistioplugin.cpp \ + $$PWD/qlocalmediaplaylistprovider.cpp \ + $$PWD/qmediaplaylistnavigator.cpp \ + $$PWD/qpaintervideosurface.cpp \ + $$PWD/qmediatimerange.cpp + +mac { + HEADERS += $$PWD/qpaintervideosurface_mac_p.h + OBJECTIVE_SOURCES += $$PWD/qpaintervideosurface_mac.mm + + LIBS += -framework AppKit -framework QuartzCore -framework QTKit + +} diff --git a/src/multimedia/mediaservices/base/qgraphicsvideoitem.cpp b/src/multimedia/mediaservices/base/qgraphicsvideoitem.cpp new file mode 100644 index 0000000..05070f8 --- /dev/null +++ b/src/multimedia/mediaservices/base/qgraphicsvideoitem.cpp @@ -0,0 +1,437 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservies 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 +#include +#include +#include + +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#include +#endif + +QT_BEGIN_NAMESPACE + + +class QGraphicsVideoItemPrivate +{ +public: + QGraphicsVideoItemPrivate() + : q_ptr(0) + , surface(0) + , mediaObject(0) + , service(0) + , outputControl(0) + , rendererControl(0) + , aspectRatioMode(Qt::KeepAspectRatio) + , updatePaintDevice(true) + , rect(0.0, 0.0, 320, 240) + { + } + + QGraphicsVideoItem *q_ptr; + + QPainterVideoSurface *surface; + QMediaObject *mediaObject; + QMediaService *service; + QVideoOutputControl *outputControl; + QVideoRendererControl *rendererControl; + Qt::AspectRatioMode aspectRatioMode; + bool updatePaintDevice; + QRectF rect; + QRectF boundingRect; + QRectF sourceRect; + QSizeF nativeSize; + + void clearService(); + void updateRects(); + + void _q_present(); + void _q_formatChanged(const QVideoSurfaceFormat &format); + void _q_serviceDestroyed(); + void _q_mediaObjectDestroyed(); +}; + +void QGraphicsVideoItemPrivate::clearService() +{ + if (outputControl) { + outputControl->setOutput(QVideoOutputControl::NoOutput); + outputControl = 0; + } + if (rendererControl) { + surface->stop(); + rendererControl->setSurface(0); + rendererControl = 0; + } + if (service) { + QObject::disconnect(service, SIGNAL(destroyed()), q_ptr, SLOT(_q_serviceDestroyed())); + service = 0; + } +} + +void QGraphicsVideoItemPrivate::updateRects() +{ + q_ptr->prepareGeometryChange(); + + if (nativeSize.isEmpty()) { + boundingRect = QRectF(); + } else if (aspectRatioMode == Qt::IgnoreAspectRatio) { + boundingRect = rect; + sourceRect = QRectF(0, 0, 1, 1); + } else if (aspectRatioMode == Qt::KeepAspectRatio) { + QSizeF size = nativeSize; + size.scale(rect.size(), Qt::KeepAspectRatio); + + boundingRect = QRectF(0, 0, size.width(), size.height()); + boundingRect.moveCenter(rect.center()); + + sourceRect = QRectF(0, 0, 1, 1); + } else if (aspectRatioMode == Qt::KeepAspectRatioByExpanding) { + boundingRect = rect; + + QSizeF size = rect.size(); + size.scale(nativeSize, Qt::KeepAspectRatio); + + sourceRect = QRectF( + 0, 0, size.width() / nativeSize.width(), size.height() / nativeSize.height()); + sourceRect.moveCenter(QPointF(0.5, 0.5)); + } +} + +void QGraphicsVideoItemPrivate::_q_present() +{ + if (q_ptr->isObscured()) { + q_ptr->update(boundingRect); + surface->setReady(true); + } else { + q_ptr->update(boundingRect); + } +} + +void QGraphicsVideoItemPrivate::_q_formatChanged(const QVideoSurfaceFormat &format) +{ + nativeSize = format.sizeHint(); + + updateRects(); + + emit q_ptr->nativeSizeChanged(nativeSize); +} + +void QGraphicsVideoItemPrivate::_q_serviceDestroyed() +{ + rendererControl = 0; + outputControl = 0; + service = 0; + + surface->stop(); +} + +void QGraphicsVideoItemPrivate::_q_mediaObjectDestroyed() +{ + mediaObject = 0; + + clearService(); +} + +/*! + \class QGraphicsVideoItem + \brief The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject. + + \since 4.7 + + \ingroup multimedia + + Attaching a QGraphicsVideoItem to a QMediaObject allows it to display + the video or image output of that media object. A QGraphicsVideoItem + is attached to a media object by passing a pointer to the QMediaObject + to the setMediaObject() function. + + \code + player = new QMediaPlayer(this); + + QGraphicsVideoItem *item = new QGraphicsVideoItem; + item->setMediaObject(player); + graphicsView->scence()->addItem(item); + graphicsView->show(); + + player->setMedia(video); + player->play(); + \endcode + + \bold {Note}: Only a single display output can be attached to a media + object at one time. + + \sa QMediaObject, QMediaPlayer, QVideoWidget +*/ + +/*! + Constructs a graphics item that displays video. + + The \a parent is passed to QGraphicsItem. +*/ +QGraphicsVideoItem::QGraphicsVideoItem(QGraphicsItem *parent) + : QGraphicsObject(parent) + , d_ptr(new QGraphicsVideoItemPrivate) +{ + d_ptr->q_ptr = this; + d_ptr->surface = new QPainterVideoSurface; + + connect(d_ptr->surface, SIGNAL(frameChanged()), this, SLOT(_q_present())); + connect(d_ptr->surface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), + this, SLOT(_q_formatChanged(QVideoSurfaceFormat))); +} + +/*! + Destroys a video graphics item. +*/ +QGraphicsVideoItem::~QGraphicsVideoItem() +{ + if (d_ptr->outputControl) + d_ptr->outputControl->setOutput(QVideoOutputControl::NoOutput); + + if (d_ptr->rendererControl) + d_ptr->rendererControl->setSurface(0); + + delete d_ptr->surface; + delete d_ptr; +} + +/*! + \property QGraphicsVideoItem::mediaObject + \brief the media object which provides the video displayed by a graphics + item. +*/ + +QMediaObject *QGraphicsVideoItem::mediaObject() const +{ + return d_func()->mediaObject; +} + +void QGraphicsVideoItem::setMediaObject(QMediaObject *object) +{ + Q_D(QGraphicsVideoItem); + + if (object == d->mediaObject) + return; + + d->clearService(); + + if (d->mediaObject) { + disconnect(d->mediaObject, SIGNAL(destroyed()), this, SLOT(_q_mediaObjectDestroyed())); + d->mediaObject->unbind(this); + } + + d->mediaObject = object; + + if (d->mediaObject) { + d->mediaObject->bind(this); + + connect(d->mediaObject, SIGNAL(destroyed()), this, SLOT(_q_mediaObjectDestroyed())); + + d->service = d->mediaObject->service(); + + if (d->service) { + connect(d->service, SIGNAL(destroyed()), this, SLOT(_q_serviceDestroyed())); + + d->outputControl = qobject_cast( + d->service->control(QVideoOutputControl_iid)); + d->rendererControl = qobject_cast( + d->service->control(QVideoRendererControl_iid)); + + if (d->outputControl != 0 && d->rendererControl != 0) { + d->rendererControl->setSurface(d->surface); + + if (isVisible()) + d->outputControl->setOutput(QVideoOutputControl::RendererOutput); + } + } + } +} + +/*! + \property QGraphicsVideoItem::aspectRatioMode + \brief how a video is scaled to fit the graphics item's size. +*/ + +Qt::AspectRatioMode QGraphicsVideoItem::aspectRatioMode() const +{ + return d_func()->aspectRatioMode; +} + +void QGraphicsVideoItem::setAspectRatioMode(Qt::AspectRatioMode mode) +{ + Q_D(QGraphicsVideoItem); + + d->aspectRatioMode = mode; + d->updateRects(); +} + +/*! + \property QGraphicsVideoItem::offset + \brief the video item's offset. + + QGraphicsVideoItem will draw video using the offset for its top left + corner. +*/ + +QPointF QGraphicsVideoItem::offset() const +{ + return d_func()->rect.topLeft(); +} + +void QGraphicsVideoItem::setOffset(const QPointF &offset) +{ + Q_D(QGraphicsVideoItem); + + d->rect.moveTo(offset); + d->updateRects(); +} + +/*! + \property QGraphicsVideoItem::size + \brief the video item's size. + + QGraphicsVideoItem will draw video scaled to fit size according to its + fillMode. +*/ + +QSizeF QGraphicsVideoItem::size() const +{ + return d_func()->rect.size(); +} + +void QGraphicsVideoItem::setSize(const QSizeF &size) +{ + Q_D(QGraphicsVideoItem); + + d->rect.setSize(size.isValid() ? size : QSizeF(0, 0)); + d->updateRects(); +} + +/*! + \property QGraphicsVideoItem::nativeSize + \brief the native size of the video. +*/ + +QSizeF QGraphicsVideoItem::nativeSize() const +{ + return d_func()->nativeSize; +} + +/*! + \fn QGraphicsVideoItem::nativeSizeChanged(const QSizeF &size) + + Signals that the native \a size of the video has changed. +*/ + +/*! + \reimp +*/ +QRectF QGraphicsVideoItem::boundingRect() const +{ + return d_func()->boundingRect; +} + +/*! + \reimp +*/ +void QGraphicsVideoItem::paint( + QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_D(QGraphicsVideoItem); + + Q_UNUSED(option); + Q_UNUSED(widget); + + if (d->surface && d->surface->isActive()) { + d->surface->paint(painter, d->boundingRect, d->sourceRect); + d->surface->setReady(true); +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) + } else if (d->updatePaintDevice && (painter->paintEngine()->type() == QPaintEngine::OpenGL + || painter->paintEngine()->type() == QPaintEngine::OpenGL2)) { + d->updatePaintDevice = false; + + d->surface->setGLContext(const_cast(QGLContext::currentContext())); + if (d->surface->supportedShaderTypes() & QPainterVideoSurface::GlslShader) { + d->surface->setShaderType(QPainterVideoSurface::GlslShader); + } else { + d->surface->setShaderType(QPainterVideoSurface::FragmentProgramShader); + } +#endif + } +} + +/*! + \reimp + + \internal +*/ +QVariant QGraphicsVideoItem::itemChange(GraphicsItemChange change, const QVariant &value) +{ + return QGraphicsObject::itemChange(change, value); +} + +/*! + \reimp + + \internal +*/ +bool QGraphicsVideoItem::event(QEvent *event) +{ + return QGraphicsObject::event(event); +} + +/*! + \reimp + + \internal +*/ +bool QGraphicsVideoItem::sceneEvent(QEvent *event) +{ + return QGraphicsObject::sceneEvent(event); +} + +QT_END_NAMESPACE +#include "moc_qgraphicsvideoitem.cpp" diff --git a/src/multimedia/mediaservices/base/qgraphicsvideoitem.h b/src/multimedia/mediaservices/base/qgraphicsvideoitem.h new file mode 100644 index 0000000..c0d8f7a --- /dev/null +++ b/src/multimedia/mediaservices/base/qgraphicsvideoitem.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QGRAPHICSVIDEOITEM_H +#define QGRAPHICSVIDEOITEM_H + +#include + +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QVideoSurfaceFormat; + +class QGraphicsVideoItemPrivate; +class Q_MULTIMEDIA_EXPORT QGraphicsVideoItem : public QGraphicsObject +{ + Q_OBJECT + Q_PROPERTY(QMediaObject* mediaObject READ mediaObject WRITE setMediaObject) + Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode) + Q_PROPERTY(QPointF offset READ offset WRITE setOffset) + Q_PROPERTY(QSizeF size READ size WRITE setSize) + Q_PROPERTY(QSizeF nativeSize READ nativeSize NOTIFY nativeSizeChanged) +public: + QGraphicsVideoItem(QGraphicsItem *parent = 0); + ~QGraphicsVideoItem(); + + QMediaObject *mediaObject() const; + void setMediaObject(QMediaObject *object); + + Qt::AspectRatioMode aspectRatioMode() const; + void setAspectRatioMode(Qt::AspectRatioMode mode); + + QPointF offset() const; + void setOffset(const QPointF &offset); + + QSizeF size() const; + void setSize(const QSizeF &size); + + QSizeF nativeSize() const; + + QRectF boundingRect() const; + + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + +Q_SIGNALS: + void nativeSizeChanged(const QSizeF &size); + +protected: + bool event(QEvent *event); + bool sceneEvent(QEvent *event); + + QVariant itemChange(GraphicsItemChange change, const QVariant &value); + + QGraphicsVideoItemPrivate *d_ptr; + +private: + Q_DECLARE_PRIVATE(QGraphicsVideoItem) + Q_PRIVATE_SLOT(d_func(), void _q_present()) + Q_PRIVATE_SLOT(d_func(), void _q_formatChanged(const QVideoSurfaceFormat &)) + Q_PRIVATE_SLOT(d_func(), void _q_serviceDestroyed()) + Q_PRIVATE_SLOT(d_func(), void _q_mediaObjectDestroyed()) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.cpp b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.cpp new file mode 100644 index 0000000..818b285 --- /dev/null +++ b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.cpp @@ -0,0 +1,196 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qmediaplaylistprovider_p.h" +#include + + +QT_BEGIN_NAMESPACE + +class QLocalMediaPlaylistProviderPrivate: public QMediaPlaylistProviderPrivate +{ +public: + QList resources; +}; + +QLocalMediaPlaylistProvider::QLocalMediaPlaylistProvider(QObject *parent) + :QMediaPlaylistProvider(*new QLocalMediaPlaylistProviderPrivate, parent) +{ +} + +QLocalMediaPlaylistProvider::~QLocalMediaPlaylistProvider() +{ +} + +bool QLocalMediaPlaylistProvider::isReadOnly() const +{ + return false; +} + +int QLocalMediaPlaylistProvider::mediaCount() const +{ + return d_func()->resources.size(); +} + +QMediaContent QLocalMediaPlaylistProvider::media(int pos) const +{ + return d_func()->resources.value(pos); +} + +bool QLocalMediaPlaylistProvider::addMedia(const QMediaContent &content) +{ + Q_D(QLocalMediaPlaylistProvider); + + int pos = d->resources.count(); + + emit mediaAboutToBeInserted(pos, pos); + d->resources.append(content); + emit mediaInserted(pos, pos); + + return true; +} + +bool QLocalMediaPlaylistProvider::addMedia(const QList &items) +{ + Q_D(QLocalMediaPlaylistProvider); + + if (items.isEmpty()) + return true; + + int pos = d->resources.count(); + int end = pos+items.count()-1; + + emit mediaAboutToBeInserted(pos, end); + d->resources.append(items); + emit mediaInserted(pos, end); + + return true; +} + + +bool QLocalMediaPlaylistProvider::insertMedia(int pos, const QMediaContent &content) +{ + Q_D(QLocalMediaPlaylistProvider); + + emit mediaAboutToBeInserted(pos, pos); + d->resources.insert(pos, content); + emit mediaInserted(pos,pos); + + return true; +} + +bool QLocalMediaPlaylistProvider::insertMedia(int pos, const QList &items) +{ + Q_D(QLocalMediaPlaylistProvider); + + if (items.isEmpty()) + return true; + + const int last = pos+items.count()-1; + + emit mediaAboutToBeInserted(pos, last); + for (int i=0; iresources.insert(pos+i, items.at(i)); + emit mediaInserted(pos, last); + + return true; +} + +bool QLocalMediaPlaylistProvider::removeMedia(int fromPos, int toPos) +{ + Q_D(QLocalMediaPlaylistProvider); + + Q_ASSERT(fromPos >= 0); + Q_ASSERT(fromPos <= toPos); + Q_ASSERT(toPos < mediaCount()); + + emit mediaAboutToBeRemoved(fromPos, toPos); + d->resources.erase(d->resources.begin()+fromPos, d->resources.begin()+toPos+1); + emit mediaRemoved(fromPos, toPos); + + return true; +} + +bool QLocalMediaPlaylistProvider::removeMedia(int pos) +{ + Q_D(QLocalMediaPlaylistProvider); + + emit mediaAboutToBeRemoved(pos, pos); + d->resources.removeAt(pos); + emit mediaRemoved(pos, pos); + + return true; +} + +bool QLocalMediaPlaylistProvider::clear() +{ + Q_D(QLocalMediaPlaylistProvider); + if (!d->resources.isEmpty()) { + int lastPos = mediaCount()-1; + emit mediaAboutToBeRemoved(0, lastPos); + d->resources.clear(); + emit mediaRemoved(0, lastPos); + } + + return true; +} + +void QLocalMediaPlaylistProvider::shuffle() +{ + Q_D(QLocalMediaPlaylistProvider); + if (!d->resources.isEmpty()) { + QList resources; + + while (!d->resources.isEmpty()) { + resources.append(d->resources.takeAt(qrand() % d->resources.size())); + } + + d->resources = resources; + emit mediaChanged(0, mediaCount()-1); + } + +} + +#include "moc_qlocalmediaplaylistprovider.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h new file mode 100644 index 0000000..73ff82d --- /dev/null +++ b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QLOCALMEDIAPAYLISTPROVIDER_H +#define QLOCALMEDIAPAYLISTPROVIDER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QLocalMediaPlaylistProviderPrivate; +class Q_MULTIMEDIA_EXPORT QLocalMediaPlaylistProvider : public QMediaPlaylistProvider +{ + Q_OBJECT + +public: + QLocalMediaPlaylistProvider(QObject *parent=0); + virtual ~QLocalMediaPlaylistProvider(); + + virtual int mediaCount() const; + virtual QMediaContent media(int pos) const; + + virtual bool isReadOnly() const; + + virtual bool addMedia(const QMediaContent &content); + virtual bool addMedia(const QList &items); + virtual bool insertMedia(int pos, const QMediaContent &content); + virtual bool insertMedia(int pos, const QList &items); + virtual bool removeMedia(int pos); + virtual bool removeMedia(int start, int end); + virtual bool clear(); + +public Q_SLOTS: + virtual void shuffle(); + +private: + Q_DECLARE_PRIVATE(QLocalMediaPlaylistProvider) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QLOCALMEDIAPAYLISTSOURCE_H diff --git a/src/multimedia/mediaservices/base/qmediacontent.cpp b/src/multimedia/mediaservices/base/qmediacontent.cpp new file mode 100644 index 0000000..f89e901 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediacontent.cpp @@ -0,0 +1,242 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 + + +QT_BEGIN_NAMESPACE + + +class QMediaContentPrivate : public QSharedData +{ +public: + QMediaContentPrivate() {} + QMediaContentPrivate(const QMediaResourceList &r): + resources(r) {} + + QMediaContentPrivate(const QMediaContentPrivate &other): + QSharedData(other), + resources(other.resources) + {} + + bool operator==(const QMediaContentPrivate &other) const + { + return resources == other.resources; + } + + QMediaResourceList resources; + +private: + QMediaContentPrivate& operator=(const QMediaContentPrivate &other); +}; + + +/*! + \class QMediaContent + \preliminary + \brief The QMediaContent class provides access to the resources relating to a media content. + \since 4.7 + + \ingroup multimedia + + QMediaContent is used within the multimedia framework as the logical handle + to media content. A QMediaContent object is composed of one or more + \l {QMediaResource}s where each resource provides the URL and format + information of a different encoding of the content. + + A non-null QMediaContent will always have a primary or canonical reference to + the content available through the canonicalUrl() or canonicalResource() + methods, any additional resources are optional. +*/ + + +/*! + Constructs a null QMediaContent. +*/ + +QMediaContent::QMediaContent() +{ +} + +/*! + Constructs a media content with \a url providing a reference to the content. +*/ + +QMediaContent::QMediaContent(const QUrl &url): + d(new QMediaContentPrivate) +{ + d->resources << QMediaResource(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. +*/ + +QMediaContent::QMediaContent(const QMediaResource &resource): + d(new QMediaContentPrivate) +{ + d->resources << resource; +} + +/*! + Constructs a media content with \a resources providing a reference to the content. +*/ + +QMediaContent::QMediaContent(const QMediaResourceList &resources): + d(new QMediaContentPrivate(resources)) +{ +} + +/*! + Constructs a copy of the media content \a other. +*/ + +QMediaContent::QMediaContent(const QMediaContent &other): + d(other.d) +{ +} + +/*! + Destroys the media content object. +*/ + +QMediaContent::~QMediaContent() +{ +} + +/*! + Assigns the value of \a other to this media content. +*/ + +QMediaContent& QMediaContent::operator=(const QMediaContent &other) +{ + d = other.d; + return *this; +} + +/*! + Returns true if \a other is equivalent to this media content; false otherwise. +*/ + +bool QMediaContent::operator==(const QMediaContent &other) const +{ + return (d.constData() == 0 && other.d.constData() == 0) || + (d.constData() != 0 && other.d.constData() != 0 && + *d.constData() == *other.d.constData()); +} + +/*! + Returns true if \a other is not equivalent to this media content; false otherwise. +*/ + +bool QMediaContent::operator!=(const QMediaContent &other) const +{ + return !(*this == other); +} + +/*! + Returns true if this media content is null (uninitialized); false otherwise. +*/ + +bool QMediaContent::isNull() const +{ + return d.constData() == 0; +} + +/*! + Returns a QUrl that represents that canonical resource for this media content. +*/ + +QUrl QMediaContent::canonicalUrl() const +{ + return canonicalResource().url(); +} + +/*! + Returns a QNetworkRequest that represents that canonical resource for this media content. +*/ + +QNetworkRequest QMediaContent::canonicalRequest() const +{ + return canonicalResource().request(); +} + +/*! + Returns a QMediaResource that represents that canonical resource for this media content. +*/ + +QMediaResource QMediaContent::canonicalResource() const +{ + return d.constData() != 0 + ? d->resources.value(0) + : QMediaResource(); +} + +/*! + Returns a list of alternative resources for this media content. The first item in this list + is always the canonical resource. +*/ + +QMediaResourceList QMediaContent::resources() const +{ + return d.constData() != 0 + ? d->resources + : QMediaResourceList(); +} + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qmediacontent.h b/src/multimedia/mediaservices/base/qmediacontent.h new file mode 100644 index 0000000..20f0525 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediacontent.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIACONTENT_H +#define QMEDIACONTENT_H + +#include +#include + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QMediaContentPrivate; +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); + ~QMediaContent(); + + QMediaContent& operator=(const QMediaContent &other); + + bool operator==(const QMediaContent &other) const; + bool operator!=(const QMediaContent &other) const; + + bool isNull() const; + + QUrl canonicalUrl() const; + QNetworkRequest canonicalRequest() const; + QMediaResource canonicalResource() const; + + QMediaResourceList resources() const; + +private: + QSharedDataPointer d; +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QMediaContent) + +QT_END_HEADER + +#endif // QMEDIACONTENT_H diff --git a/src/multimedia/mediaservices/base/qmediacontrol.cpp b/src/multimedia/mediaservices/base/qmediacontrol.cpp new file mode 100644 index 0000000..98db9fe --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediacontrol.cpp @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 + +/*! + \class QMediaControl + \ingroup multimedia-serv + \since 4.7 + + \preliminary + \brief The QMediaControl class provides a base interface for media service controls. + + Media controls provide an interface to individual features provided by a media service. Most + services implement a principal control which exposes the core functionality of the service and + a number optional controls which expose any additional functionality. + + A pointer to a control implemented by a media service can be obtained using the + \l {QMediaService::control()}{control()} member of QMediaService. If the service doesn't + implement a control it will instead return a null pointer. + + \code + QMediaPlayerControl *control = qobject_cast( + service->control("com.nokia.Qt.QMediaPlayerControl/1.0")); + \endcode + + Alternatively if the IId of the control has been declared using Q_MEDIA_DECLARE_CONTROL + the template version of QMediaService::control() can be used to request the service without + explicitly passing the IId. + + \code + QMediaPlayerControl *control = service->control(); + \endcode + + Most application code will not interface directly with a media service's controls, instead the + QMediaObject which owns the service acts as an intermeditary between one or more controls and + the application. + + \sa QMediaService, QMediaObject +*/ + +/*! + \macro Q_MEDIA_DECLARE_CONTROL(Class, IId) + \relates QMediaControl + + The Q_MEDIA_DECLARE_CONTROL macro declares an \a IId for a \a Class that inherits from + QMediaControl. + + Declaring an IId for a QMediaControl allows an instance of that control to be requested from + QMediaService::control() without explicitly passing the IId. + + \code + QMediaPlayerControl *control = service->control(); + \endcode + + \sa QMediaService::control() +*/ + +/*! + Destroys a media control. +*/ + +QMediaControl::~QMediaControl() +{ + delete d_ptr; +} + +/*! + Constructs a media control with the given \a parent. +*/ + +QMediaControl::QMediaControl(QObject *parent) + : QObject(parent) + , d_ptr(new QMediaControlPrivate) +{ + d_ptr->q_ptr = this; +} + +/*! + \internal +*/ + +QMediaControl::QMediaControl(QMediaControlPrivate &dd, QObject *parent) + : QObject(parent) + , d_ptr(&dd) + +{ + d_ptr->q_ptr = this; +} + +#include "moc_qmediacontrol.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qmediacontrol.h b/src/multimedia/mediaservices/base/qmediacontrol.h new file mode 100644 index 0000000..be5d95d --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediacontrol.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QABSTRACTMEDIACONTROL_H +#define QABSTRACTMEDIACONTROL_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QMediaControlPrivate; +class Q_MULTIMEDIA_EXPORT QMediaControl : public QObject +{ + Q_OBJECT + +public: + ~QMediaControl(); + +protected: + QMediaControl(QObject *parent = 0); + QMediaControl(QMediaControlPrivate &dd, QObject *parent = 0); + + QMediaControlPrivate *d_ptr; + +private: + Q_DECLARE_PRIVATE(QMediaControl) +}; + +template const char *qmediacontrol_iid() { return 0; } + +#define Q_MEDIA_DECLARE_CONTROL(Class, IId) \ + template <> inline const char *qmediacontrol_iid() { return IId; } + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTMEDIACONTROL_H diff --git a/src/multimedia/mediaservices/base/qmediacontrol_p.h b/src/multimedia/mediaservices/base/qmediacontrol_p.h new file mode 100644 index 0000000..ad7e947 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediacontrol_p.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QABSTRACTMEDIACONTROL_P_H +#define QABSTRACTMEDIACONTROL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QMediaControl; + +class QMediaControlPrivate +{ +public: + virtual ~QMediaControlPrivate() {} + + QMediaControl *q_ptr; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qmediaobject.cpp b/src/multimedia/mediaservices/base/qmediaobject.cpp new file mode 100644 index 0000000..3d92b12 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaobject.cpp @@ -0,0 +1,419 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservics 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 "qmediaobject_p.h" + +#include +#include + + +QT_BEGIN_NAMESPACE + +void QMediaObjectPrivate::_q_notify() +{ + Q_Q(QMediaObject); + + const QMetaObject* m = q->metaObject(); + + foreach (int pi, notifyProperties) { + QMetaProperty p = m->property(pi); + p.notifySignal().invoke( + q, QGenericArgument(QMetaType::typeName(p.userType()), p.read(q).data())); + } +} + + +/*! + \class QMediaObject + \preliminary + \brief The QMediaObject class provides a common base for multimedia objects. + \since 4.7 + + \ingroup multimedia + + QMediaObject derived classes provide access to the functionality of a + QMediaService. Each media object hosts a QMediaService and uses the + QMediaControl interfaces implemented by the service to implement its + API. Most media objects when constructed will request a new + QMediaService instance from a QMediaServiceProvider, but some like + QMediaRecorder will share a service with another object. + + QMediaObject itself provides an API for accessing a media service's \l {metaData()}{meta-data} and a means of connecting other media objects, + and peripheral classes like QVideoWidget and QMediaPlaylist. + + \sa QMediaService, QMediaControl +*/ + +/*! + Destroys a media object. +*/ + +QMediaObject::~QMediaObject() +{ + delete d_ptr; +} + +/*! + Returns the service availability error state. +*/ + +QtMediaservices::AvailabilityError QMediaObject::availabilityError() const +{ + return QtMediaservices::ServiceMissingError; +} + +/*! + Returns true if the service is available for use. +*/ + +bool QMediaObject::isAvailable() const +{ + return false; +} + +/*! + Returns the media service that provides the functionality of a multimedia object. +*/ + +QMediaService* QMediaObject::service() const +{ + return d_func()->service; +} + +int QMediaObject::notifyInterval() const +{ + return d_func()->notifyTimer->interval(); +} + +void QMediaObject::setNotifyInterval(int milliSeconds) +{ + Q_D(QMediaObject); + + if (d->notifyTimer->interval() != milliSeconds) { + d->notifyTimer->setInterval(milliSeconds); + + emit notifyIntervalChanged(milliSeconds); + } +} + +/*! + \internal +*/ +void QMediaObject::bind(QObject*) +{ +} + +/*! + \internal +*/ +void QMediaObject::unbind(QObject*) +{ +} + + +/*! + Constructs a media object which uses the functionality provided by a media \a service. + + The \a parent is passed to QObject. + + This class is meant as a base class for Multimedia objects so this + constructor is protected. +*/ + +QMediaObject::QMediaObject(QObject *parent, QMediaService *service): + QObject(parent), + d_ptr(new QMediaObjectPrivate) + +{ + Q_D(QMediaObject); + + d->q_ptr = this; + + d->notifyTimer = new QTimer(this); + d->notifyTimer->setInterval(1000); + connect(d->notifyTimer, SIGNAL(timeout()), SLOT(_q_notify())); + + d->service = service; + + setupMetaData(); +} + +/*! + \internal +*/ + +QMediaObject::QMediaObject(QMediaObjectPrivate &dd, QObject *parent, + QMediaService *service): + QObject(parent), + d_ptr(&dd) +{ + Q_D(QMediaObject); + d->q_ptr = this; + + d->notifyTimer = new QTimer(this); + d->notifyTimer->setInterval(1000); + connect(d->notifyTimer, SIGNAL(timeout()), SLOT(_q_notify())); + + d->service = service; + + setupMetaData(); +} + +/*! + Watch the property \a name. The property's notify signal will be emitted + once every notifyInterval milliseconds. + + \sa notifyInterval +*/ + +void QMediaObject::addPropertyWatch(QByteArray const &name) +{ + Q_D(QMediaObject); + + const QMetaObject* m = metaObject(); + + int index = m->indexOfProperty(name.constData()); + + if (index != -1 && m->property(index).hasNotifySignal()) { + d->notifyProperties.insert(index); + + if (!d->notifyTimer->isActive()) + d->notifyTimer->start(); + } +} + +/*! + Remove property \a name from the list of properties whose changes are + regularly signaled. + + \sa notifyInterval +*/ + +void QMediaObject::removePropertyWatch(QByteArray const &name) +{ + Q_D(QMediaObject); + + int index = metaObject()->indexOfProperty(name.constData()); + + if (index != -1) { + d->notifyProperties.remove(index); + + if (d->notifyProperties.isEmpty()) + d->notifyTimer->stop(); + } +} + +/*! + \property QMediaObject::notifyInterval + + The interval at which notifiable properties will update. + + The interval is expressed in milliseconds, the default value is 1000. + + \sa addPropertyWatch(), removePropertyWatch() +*/ + +/*! + \fn void QMediaObject::notifyIntervalChanged(int milliseconds) + + Signal a change in the notify interval period to \a milliseconds. +*/ + +/*! + \property QMediaObject::metaDataAvailable + \brief whether access to a media object's meta-data is available. + + If this is true there is meta-data available, otherwise there is no meta-data available. +*/ + +bool QMediaObject::isMetaDataAvailable() const +{ + Q_D(const QMediaObject); + + return d->metaDataControl + ? d->metaDataControl->isMetaDataAvailable() + : false; +} + +/*! + \fn QMediaObject::metaDataAvailableChanged(bool available) + + Signals that the \a available state of a media object's meta-data has changed. +*/ + +/*! + \property QMediaObject::metaDataWritable + \brief whether a media object's meta-data is writable. + + If this is true the meta-data is writable, otherwise the meta-data is read-only. +*/ + +bool QMediaObject::isMetaDataWritable() const +{ + Q_D(const QMediaObject); + + return d->metaDataControl + ? d->metaDataControl->isWritable() + : false; +} + +/*! + \fn QMediaObject::metaDataWritableChanged(bool writable) + + Signals that the \a writable state of a media object's meta-data has changed. +*/ + +/*! + Returns the value associated with a meta-data \a key. +*/ +QVariant QMediaObject::metaData(QtMediaservices::MetaData key) const +{ + Q_D(const QMediaObject); + + return d->metaDataControl + ? d->metaDataControl->metaData(key) + : QVariant(); +} + +/*! + Sets a \a value for a meta-data \a key. +*/ +void QMediaObject::setMetaData(QtMediaservices::MetaData key, const QVariant &value) +{ + Q_D(QMediaObject); + + if (d->metaDataControl) + d->metaDataControl->setMetaData(key, value); +} + +/*! + Returns a list of keys there is meta-data available for. +*/ +QList QMediaObject::availableMetaData() const +{ + Q_D(const QMediaObject); + + return d->metaDataControl + ? d->metaDataControl->availableMetaData() + : QList(); +} + +/*! + \fn QMediaObject::metaDataChanged() + + Signals that a media object's meta-data has changed. +*/ + +/*! + Returns the value associated with a meta-data \a key. + + The naming and type of extended meta-data is not standardized, so the values and meaning + of keys may vary between backends. +*/ +QVariant QMediaObject::extendedMetaData(const QString &key) const +{ + Q_D(const QMediaObject); + + return d->metaDataControl + ? d->metaDataControl->extendedMetaData(key) + : QVariant(); +} + +/*! + Sets a \a value for a meta-data \a key. + + The naming and type of extended meta-data is not standardized, so the values and meaning + of keys may vary between backends. +*/ +void QMediaObject::setExtendedMetaData(const QString &key, const QVariant &value) +{ + Q_D(QMediaObject); + + if (d->metaDataControl) + d->metaDataControl->setExtendedMetaData(key, value); +} + +/*! + Returns a list of keys there is extended meta-data available for. +*/ +QStringList QMediaObject::availableExtendedMetaData() const +{ + Q_D(const QMediaObject); + + return d->metaDataControl + ? d->metaDataControl->availableExtendedMetaData() + : QStringList(); +} + + +void QMediaObject::setupMetaData() +{ + Q_D(QMediaObject); + + if (d->service != 0) { + d->metaDataControl = + qobject_cast(d->service->control(QMetaDataControl_iid)); + + if (d->metaDataControl) { + connect(d->metaDataControl, SIGNAL(metaDataChanged()), SIGNAL(metaDataChanged())); + connect(d->metaDataControl, + SIGNAL(metaDataAvailableChanged(bool)), + SIGNAL(metaDataAvailableChanged(bool))); + connect(d->metaDataControl, + SIGNAL(writableChanged(bool)), + SIGNAL(metaDataWritableChanged(bool))); + } + } +} + +/*! + \fn QMediaObject::availabilityChanged(bool available) + + Signal emitted when the availability state has changed to \a available +*/ + + +#include "moc_qmediaobject.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qmediaobject.h b/src/multimedia/mediaservices/base/qmediaobject.h new file mode 100644 index 0000000..461e056 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaobject.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QABSTRACTMEDIAOBJECT_H +#define QABSTRACTMEDIAOBJECT_H + +#include +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QMediaService; + +class QMediaObjectPrivate; +class Q_MULTIMEDIA_EXPORT QMediaObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(int notifyInterval READ notifyInterval WRITE setNotifyInterval NOTIFY notifyIntervalChanged) + Q_PROPERTY(bool metaDataAvailable READ isMetaDataAvailable NOTIFY metaDataAvailableChanged) + Q_PROPERTY(bool metaDataWritable READ isMetaDataWritable NOTIFY metaDataWritableChanged) + +public: + ~QMediaObject(); + + virtual bool isAvailable() const; + virtual QtMediaservices::AvailabilityError availabilityError() const; + + virtual QMediaService* service() const; + + int notifyInterval() const; + void setNotifyInterval(int milliSeconds); + + virtual void bind(QObject*); + virtual void unbind(QObject*); + + bool isMetaDataAvailable() const; + bool isMetaDataWritable() const; + + QVariant metaData(QtMediaservices::MetaData key) const; + void setMetaData(QtMediaservices::MetaData key, const QVariant &value); + QList availableMetaData() const; + + QVariant extendedMetaData(const QString &key) const; + void setExtendedMetaData(const QString &key, const QVariant &value); + QStringList availableExtendedMetaData() const; + +Q_SIGNALS: + void notifyIntervalChanged(int milliSeconds); + + void metaDataAvailableChanged(bool available); + void metaDataWritableChanged(bool writable); + void metaDataChanged(); + + void availabilityChanged(bool available); + +protected: + QMediaObject(QObject *parent, QMediaService *service); + QMediaObject(QMediaObjectPrivate &dd, QObject *parent, QMediaService *service); + + void addPropertyWatch(QByteArray const &name); + void removePropertyWatch(QByteArray const &name); + + QMediaObjectPrivate *d_ptr; + +private: + void setupMetaData(); + + Q_DECLARE_PRIVATE(QMediaObject) + Q_PRIVATE_SLOT(d_func(), void _q_notify()) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + + +#endif // QABSTRACTMEDIAOBJECT_H diff --git a/src/multimedia/mediaservices/base/qmediaobject_p.h b/src/multimedia/mediaservices/base/qmediaobject_p.h new file mode 100644 index 0000000..4589f03 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaobject_p.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QABSTRACTMEDIAOBJECT_P_H +#define QABSTRACTMEDIAOBJECT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QMetaDataControl; + +#define Q_DECLARE_NON_CONST_PUBLIC(Class) \ + inline Class* q_func() { return static_cast(q_ptr); } \ + friend class Class; + + +class QMediaObjectPrivate +{ + Q_DECLARE_PUBLIC(QMediaObject) + +public: + QMediaObjectPrivate():metaDataControl(0), notifyTimer(0) {} + virtual ~QMediaObjectPrivate() {} + + void _q_notify(); + + QMediaService *service; + QMetaDataControl *metaDataControl; + QTimer* notifyTimer; + QSet notifyProperties; + + QMediaObject *q_ptr; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qmediaplaylist.cpp b/src/multimedia/mediaservices/base/qmediaplaylist.cpp new file mode 100644 index 0000000..174a8ac --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylist.cpp @@ -0,0 +1,724 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 +#include + +#include +#include "qmediaplaylist_p.h" +#include +#include +#include +#include +#include +#include + +#include "qmediapluginloader_p.h" + + +QT_BEGIN_NAMESPACE + +Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, playlistIOLoader, + (QMediaPlaylistIOInterface_iid, QLatin1String("/playlistformats"), Qt::CaseInsensitive)) + + +/*! + \class QMediaPlaylist + \ingroup multimedia + \since 4.7 + + \preliminary + \brief The QMediaPlaylist class provides a list of media content to play. + + QMediaPlaylist is intended to be used with other media objects, + like QMediaPlayer or QMediaImageViewer. + QMediaPlaylist allows to access the service intrinsic playlist functionality + if available, otherwise it provides the the local memory playlist implementation. + +\code + player = new QMediaPlayer; + + playlist = new QMediaPlaylist; + playlist->setMediaObject(player); + playlist->append(QUrl("http://example.com/movie1.mp4")); + playlist->append(QUrl("http://example.com/movie2.mp4")); + playlist->append(QUrl("http://example.com/movie3.mp4")); + + playlist->setCurrentIndex(1); + + player->play(); +\endcode + + Depending on playlist source implementation, + most of playlist modifcation operations can be asynchronous. + + \sa QMediaContent +*/ + + +/*! + \enum QMediaPlaylist::PlaybackMode + + The QMediaPlaylist::PlaybackMode describes the order items in playlist are played. + + \value CurrentItemOnce The current item is played only once. + + \value CurrentItemInLoop The current item is played in the loop. + + \value Linear Playback starts from the first to the last items and stops. + next item is a null item when the last one is currently playing. + + \value Loop Playback continues from the first item after the last one finished playing. + + \value Random Play items in random order. +*/ + + + +/*! + Create a new playlist object for with the given \a parent. +*/ + +QMediaPlaylist::QMediaPlaylist(QObject *parent) + : QObject(parent) + , d_ptr(new QMediaPlaylistPrivate) +{ + Q_D(QMediaPlaylist); + + d->q_ptr = this; + d->localPlaylistControl = new QLocalMediaPlaylistControl(this); + + setMediaObject(0); +} + +/*! + Destroys the playlist. + */ + +QMediaPlaylist::~QMediaPlaylist() +{ + Q_D(QMediaPlaylist); + + if (d->mediaObject) + d->mediaObject->unbind(this); + + delete d_ptr; +} + +/*! + Returns the QMediaObject that is being used to play the contents of this playlist. +*/ + +QMediaObject *QMediaPlaylist::mediaObject() const +{ + return d_func()->mediaObject; +} + +/*! + If \a mediaObject is null or doesn't have an intrinsic playlist, + internal local memory playlist source will be created. +*/ +void QMediaPlaylist::setMediaObject(QMediaObject *mediaObject) +{ + Q_D(QMediaPlaylist); + + if (mediaObject && mediaObject == d->mediaObject) + return; + + QMediaService *service = mediaObject + ? mediaObject->service() : 0; + + QMediaPlaylistControl *newControl = 0; + + if (service) + newControl = qobject_cast(service->control(QMediaPlaylistControl_iid)); + + if (!newControl) + newControl = d->localPlaylistControl; + + if (d->control != newControl) { + int oldSize = 0; + if (d->control) { + QMediaPlaylistProvider *playlist = d->control->playlistProvider(); + oldSize = playlist->mediaCount(); + disconnect(playlist, SIGNAL(loadFailed(QMediaPlaylist::Error,QString)), + this, SLOT(_q_loadFailed(QMediaPlaylist::Error,QString))); + + disconnect(playlist, SIGNAL(mediaChanged(int,int)), this, SIGNAL(mediaChanged(int,int))); + disconnect(playlist, SIGNAL(mediaAboutToBeInserted(int,int)), this, SIGNAL(mediaAboutToBeInserted(int,int))); + disconnect(playlist, SIGNAL(mediaInserted(int,int)), this, SIGNAL(mediaInserted(int,int))); + disconnect(playlist, SIGNAL(mediaAboutToBeRemoved(int,int)), this, SIGNAL(mediaAboutToBeRemoved(int,int))); + disconnect(playlist, SIGNAL(mediaRemoved(int,int)), this, SIGNAL(mediaRemoved(int,int))); + + disconnect(playlist, SIGNAL(loaded()), this, SIGNAL(loaded())); + + disconnect(d->control, SIGNAL(playbackModeChanged(QMediaPlaylist::PlaybackMode)), + this, SIGNAL(playbackModeChanged(QMediaPlaylist::PlaybackMode))); + disconnect(d->control, SIGNAL(currentIndexChanged(int)), + this, SIGNAL(currentIndexChanged(int))); + disconnect(d->control, SIGNAL(currentMediaChanged(QMediaContent)), + this, SIGNAL(currentMediaChanged(QMediaContent))); + } + + d->control = newControl; + QMediaPlaylistProvider *playlist = d->control->playlistProvider(); + connect(playlist, SIGNAL(loadFailed(QMediaPlaylist::Error,QString)), + this, SLOT(_q_loadFailed(QMediaPlaylist::Error,QString))); + + connect(playlist, SIGNAL(mediaChanged(int,int)), this, SIGNAL(mediaChanged(int,int))); + connect(playlist, SIGNAL(mediaAboutToBeInserted(int,int)), this, SIGNAL(mediaAboutToBeInserted(int,int))); + connect(playlist, SIGNAL(mediaInserted(int,int)), this, SIGNAL(mediaInserted(int,int))); + connect(playlist, SIGNAL(mediaAboutToBeRemoved(int,int)), this, SIGNAL(mediaAboutToBeRemoved(int,int))); + connect(playlist, SIGNAL(mediaRemoved(int,int)), this, SIGNAL(mediaRemoved(int,int))); + + connect(playlist, SIGNAL(loaded()), this, SIGNAL(loaded())); + + connect(d->control, SIGNAL(playbackModeChanged(QMediaPlaylist::PlaybackMode)), + this, SIGNAL(playbackModeChanged(QMediaPlaylist::PlaybackMode))); + connect(d->control, SIGNAL(currentIndexChanged(int)), + this, SIGNAL(currentIndexChanged(int))); + connect(d->control, SIGNAL(currentMediaChanged(QMediaContent)), + this, SIGNAL(currentMediaChanged(QMediaContent))); + + if (oldSize) + emit mediaRemoved(0, oldSize-1); + + if (playlist->mediaCount()) { + emit mediaAboutToBeInserted(0,playlist->mediaCount()-1); + emit mediaInserted(0,playlist->mediaCount()-1); + } + } + + if (d->mediaObject) + d->mediaObject->unbind(this); + + d->mediaObject = mediaObject; + if (d->mediaObject) + d->mediaObject->bind(this); +} + +/*! + \property QMediaPlaylist::playbackMode + + This property defines the order, items in playlist are played. + + \sa QMediaPlaylist::PlaybackMode +*/ + +QMediaPlaylist::PlaybackMode QMediaPlaylist::playbackMode() const +{ + return d_func()->control->playbackMode(); +} + +void QMediaPlaylist::setPlaybackMode(QMediaPlaylist::PlaybackMode mode) +{ + Q_D(QMediaPlaylist); + d->control->setPlaybackMode(mode); +} + +/*! + Returns position of the current media source in the playlist. +*/ +int QMediaPlaylist::currentIndex() const +{ + return d_func()->control->currentIndex(); +} + +/*! + Returns the current media content. +*/ + +QMediaContent QMediaPlaylist::currentMedia() const +{ + return d_func()->playlist()->media(currentIndex()); +} + +/*! + Returns the index of item, which were current after calling next() + \a steps times. + + Returned value depends on the size of playlist, current position + and playback mode. + + \sa QMediaPlaylist::playbackMode +*/ +int QMediaPlaylist::nextIndex(int steps) const +{ + return d_func()->control->nextIndex(steps); +} + +/*! + Returns the index of item, which were current after calling previous() + \a steps times. + + \sa QMediaPlaylist::playbackMode +*/ + +int QMediaPlaylist::previousIndex(int steps) const +{ + return d_func()->control->previousIndex(steps); +} + + +/*! + Returns the number of items in the playlist. + + \sa isEmpty() + */ +int QMediaPlaylist::mediaCount() const +{ + return d_func()->playlist()->mediaCount(); +} + +/*! + Returns true if the playlist contains no items; otherwise returns false. + \sa mediaCount() + */ +bool QMediaPlaylist::isEmpty() const +{ + return mediaCount() == 0; +} + +/*! + Returns true if the playlist can be modified; otherwise returns false. + \sa mediaCount() + */ +bool QMediaPlaylist::isReadOnly() const +{ + return d_func()->playlist()->isReadOnly(); +} + +/*! + Returns the media content at \a index in the playlist. +*/ + +QMediaContent QMediaPlaylist::media(int index) const +{ + return d_func()->playlist()->media(index); +} + +/*! + Append the media \a content to the playlist. + + Returns true if the operation is successfull, other wise return false. + */ +bool QMediaPlaylist::addMedia(const QMediaContent &content) +{ + return d_func()->control->playlistProvider()->addMedia(content); +} + +/*! + Append multiple media content \a items to the playlist. + + Returns true if the operation is successfull, other wise return false. + */ +bool QMediaPlaylist::addMedia(const QList &items) +{ + return d_func()->control->playlistProvider()->addMedia(items); +} + +/*! + Insert the media \a content to the playlist at position \a pos. + + Returns true if the operation is successful, otherwise false. +*/ + +bool QMediaPlaylist::insertMedia(int pos, const QMediaContent &content) +{ + return d_func()->playlist()->insertMedia(pos, content); +} + +/*! + Insert multiple media content \a items to the playlist at position \a pos. + + Returns true if the operation is successful, otherwise false. +*/ + +bool QMediaPlaylist::insertMedia(int pos, const QList &items) +{ + return d_func()->playlist()->insertMedia(pos, items); +} + +/*! + Remove the item from the playlist at position \a pos. + + Returns true if the operation is successfull, other wise return false. + */ +bool QMediaPlaylist::removeMedia(int pos) +{ + Q_D(QMediaPlaylist); + return d->playlist()->removeMedia(pos); +} + +/*! + Remove the items from the playlist from position \a start to \a end inclusive. + + Returns true if the operation is successfull, other wise return false. + */ +bool QMediaPlaylist::removeMedia(int start, int end) +{ + Q_D(QMediaPlaylist); + return d->playlist()->removeMedia(start, end); +} + +/*! + Remove all the items from the playlist. + + Returns true if the operation is successfull, other wise return false. + */ +bool QMediaPlaylist::clear() +{ + Q_D(QMediaPlaylist); + return d->playlist()->clear(); +} + +bool QMediaPlaylistPrivate::readItems(QMediaPlaylistReader *reader) +{ + while (!reader->atEnd()) + playlist()->addMedia(reader->readItem()); + + return true; +} + +bool QMediaPlaylistPrivate::writeItems(QMediaPlaylistWriter *writer) +{ + for (int i=0; imediaCount(); i++) { + if (!writer->writeItem(playlist()->media(i))) + return false; + } + writer->close(); + return true; +} + +/*! + Load playlist from \a location. If \a format is specified, it is used, + otherwise format is guessed from location name and data. + + New items are appended to playlist. + + QMediaPlaylist::loaded() signal is emited if playlist was loaded succesfully, + otherwise the playlist emits loadFailed(). +*/ +void QMediaPlaylist::load(const QUrl &location, const char *format) +{ + Q_D(QMediaPlaylist); + + d->error = NoError; + d->errorString.clear(); + + if (d->playlist()->load(location,format)) + return; + + if (isReadOnly()) { + d->error = AccessDeniedError; + d->errorString = tr("Could not add items to read only playlist."); + emit loadFailed(); + return; + } + + foreach (QString const& key, playlistIOLoader()->keys()) { + QMediaPlaylistIOInterface* plugin = qobject_cast(playlistIOLoader()->instance(key)); + if (plugin && plugin->canRead(location,format)) { + QMediaPlaylistReader *reader = plugin->createReader(location,QByteArray(format)); + if (reader && d->readItems(reader)) { + delete reader; + emit loaded(); + return; + } + delete reader; + } + } + + d->error = FormatNotSupportedError; + d->errorString = tr("Playlist format is not supported"); + emit loadFailed(); + + return; +} + +/*! + Load playlist from QIODevice \a device. If \a format is specified, it is used, + otherwise format is guessed from device data. + + New items are appended to playlist. + + QMediaPlaylist::loaded() signal is emited if playlist was loaded succesfully, + otherwise the playlist emits loadFailed(). +*/ +void QMediaPlaylist::load(QIODevice * device, const char *format) +{ + Q_D(QMediaPlaylist); + + d->error = NoError; + d->errorString.clear(); + + if (d->playlist()->load(device,format)) + return; + + if (isReadOnly()) { + d->error = AccessDeniedError; + d->errorString = tr("Could not add items to read only playlist."); + emit loadFailed(); + return; + } + + foreach (QString const& key, playlistIOLoader()->keys()) { + QMediaPlaylistIOInterface* plugin = qobject_cast(playlistIOLoader()->instance(key)); + if (plugin && plugin->canRead(device,format)) { + QMediaPlaylistReader *reader = plugin->createReader(device,QByteArray(format)); + if (reader && d->readItems(reader)) { + delete reader; + emit loaded(); + return; + } + delete reader; + } + } + + d->error = FormatNotSupportedError; + d->errorString = tr("Playlist format is not supported"); + emit loadFailed(); + + return; +} + +/*! + Save playlist to \a location. If \a format is specified, it is used, + otherwise format is guessed from location name. + + Returns true if playlist was saved succesfully, otherwise returns false. + */ +bool QMediaPlaylist::save(const QUrl &location, const char *format) +{ + Q_D(QMediaPlaylist); + + d->error = NoError; + d->errorString.clear(); + + if (d->playlist()->save(location,format)) + return true; + + QFile file(location.toLocalFile()); + + if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + d->error = AccessDeniedError; + d->errorString = tr("The file could not be accessed."); + return false; + } + + return save(&file, format); +} + +/*! + Save playlist to QIODevice \a device using format \a format. + + Returns true if playlist was saved succesfully, otherwise returns false. +*/ +bool QMediaPlaylist::save(QIODevice * device, const char *format) +{ + Q_D(QMediaPlaylist); + + d->error = NoError; + d->errorString.clear(); + + if (d->playlist()->save(device,format)) + return true; + + foreach (QString const& key, playlistIOLoader()->keys()) { + QMediaPlaylistIOInterface* plugin = qobject_cast(playlistIOLoader()->instance(key)); + if (plugin && plugin->canWrite(device,format)) { + QMediaPlaylistWriter *writer = plugin->createWriter(device,QByteArray(format)); + if (writer && d->writeItems(writer)) { + delete writer; + return true; + } + delete writer; + } + } + + d->error = FormatNotSupportedError; + d->errorString = tr("Playlist format is not supported."); + + return false; +} + +/*! + Returns the last error condition. +*/ +QMediaPlaylist::Error QMediaPlaylist::error() const +{ + return d_func()->error; +} + +/*! + Returns the string describing the last error condition. +*/ +QString QMediaPlaylist::errorString() const +{ + return d_func()->errorString; +} + +/*! + Shuffle items in the playlist. +*/ +void QMediaPlaylist::shuffle() +{ + d_func()->playlist()->shuffle(); +} + + +/*! + Advance to the next media content in playlist. +*/ +void QMediaPlaylist::next() +{ + d_func()->control->next(); +} + +/*! + Return to the previous media content in playlist. +*/ +void QMediaPlaylist::previous() +{ + d_func()->control->previous(); +} + +/*! + Activate media content from playlist at position \a playlistPosition. +*/ + +void QMediaPlaylist::setCurrentIndex(int playlistPosition) +{ + d_func()->control->setCurrentIndex(playlistPosition); +} + +/*! + \fn void QMediaPlaylist::mediaInserted(int start, int end) + + This signal is emitted after media has been inserted into the playlist. + The new items are those between \a start and \a end inclusive. + */ + +/*! + \fn void QMediaPlaylist::mediaRemoved(int start, int end) + + This signal is emitted after media has been removed from the playlist. + The removed items are those between \a start and \a end inclusive. + */ + +/*! + \fn void QMediaPlaylist::mediaChanged(int start, int end) + + This signal is emitted after media has been changed in the playlist + between \a start and \a end positions inclusive. + */ + +/*! + \fn void QMediaPlaylist::currentIndexChanged(int position) + + Signal emitted when playlist position changed to \a position. +*/ + +/*! + \fn void QMediaPlaylist::playbackModeChanged(QMediaPlaylist::PlaybackMode mode) + + Signal emitted when playback mode changed to \a mode. +*/ + +/*! + \fn void QMediaPlaylist::mediaAboutToBeInserted(int start, int end) + + Signal emitted when item to be inserted at \a start and ending at \a end. +*/ + +/*! + \fn void QMediaPlaylist::mediaAboutToBeRemoved(int start, int end) + + Signal emitted when item to de deleted ar \a start and ending at \a end. +*/ + +/*! + \fn void QMediaPlaylist::currentMediaChanged(const QMediaContent &content) + + Signal emitted when current media changes to \a content. +*/ + +/*! + \property QMediaPlaylist::currentIndex + \brief Current position. +*/ + +/*! + \property QMediaPlaylist::currentMedia + \brief Current media content. +*/ + +/*! + \fn QMediaPlaylist::loaded() + + Signal emitted when playlist finished loading. +*/ + +/*! + \fn QMediaPlaylist::loadFailed() + + Signal emitted if failed to load playlist. +*/ + +/*! + \enum QMediaPlaylist::Error + + This enum describes the QMediaPlaylist error codes. + + \value NoError No errors. + \value FormatError Format error. + \value FormatNotSupportedError Format not supported. + \value NetworkError Network error. + \value AccessDeniedError Access denied error. +*/ + +QT_END_NAMESPACE + +#include "moc_qmediaplaylist.cpp" +#include "moc_qmediaplaylist_p.cpp" diff --git a/src/multimedia/mediaservices/base/qmediaplaylist.h b/src/multimedia/mediaservices/base/qmediaplaylist.h new file mode 100644 index 0000000..132b58c --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylist.h @@ -0,0 +1,147 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIAPLAYLIST_H +#define QMEDIAPLAYLIST_H + +#include + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QMediaPlaylistProvider; + +class QMediaPlaylistPrivate; +class Q_MULTIMEDIA_EXPORT QMediaPlaylist : public QObject +{ + Q_OBJECT + Q_PROPERTY(QMediaPlaylist::PlaybackMode playbackMode READ playbackMode WRITE setPlaybackMode NOTIFY playbackModeChanged) + Q_PROPERTY(QMediaContent currentMedia READ currentMedia NOTIFY currentMediaChanged) + Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) + Q_ENUMS(PlaybackMode Error) + +public: + enum PlaybackMode { CurrentItemOnce, CurrentItemInLoop, Linear, Loop, Random }; + enum Error { NoError, FormatError, FormatNotSupportedError, NetworkError, AccessDeniedError }; + + QMediaPlaylist(QObject *parent = 0); + virtual ~QMediaPlaylist(); + + QMediaObject *mediaObject() const; + void setMediaObject(QMediaObject *object); + + PlaybackMode playbackMode() const; + void setPlaybackMode(PlaybackMode mode); + + int currentIndex() const; + QMediaContent currentMedia() const; + + int nextIndex(int steps = 1) const; + int previousIndex(int steps = 1) const; + + QMediaContent media(int index) const; + + int mediaCount() const; + bool isEmpty() const; + bool isReadOnly() const; + + bool addMedia(const QMediaContent &content); + bool addMedia(const QList &items); + bool insertMedia(int index, const QMediaContent &content); + bool insertMedia(int index, const QList &items); + bool removeMedia(int pos); + bool removeMedia(int start, int end); + bool clear(); + + void load(const QUrl &location, const char *format = 0); + void load(QIODevice * device, const char *format = 0); + + bool save(const QUrl &location, const char *format = 0); + bool save(QIODevice * device, const char *format); + + Error error() const; + QString errorString() const; + +public Q_SLOTS: + void shuffle(); + + void next(); + void previous(); + + void setCurrentIndex(int index); + +Q_SIGNALS: + void currentIndexChanged(int index); + void playbackModeChanged(QMediaPlaylist::PlaybackMode mode); + void currentMediaChanged(const QMediaContent&); + + void mediaAboutToBeInserted(int start, int end); + void mediaInserted(int start, int end); + void mediaAboutToBeRemoved(int start, int end); + void mediaRemoved(int start, int end); + void mediaChanged(int start, int end); + + void loaded(); + void loadFailed(); + +protected: + QMediaPlaylistPrivate *d_ptr; + +private: + Q_DECLARE_PRIVATE(QMediaPlaylist) + Q_PRIVATE_SLOT(d_func(), void _q_loadFailed(QMediaPlaylist::Error, const QString &)) +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QMediaPlaylist::PlaybackMode) +Q_DECLARE_METATYPE(QMediaPlaylist::Error) + +QT_END_HEADER + +#endif // QMEDIAPLAYLIST_H diff --git a/src/multimedia/mediaservices/base/qmediaplaylist_p.h b/src/multimedia/mediaservices/base/qmediaplaylist_p.h new file mode 100644 index 0000000..57c2723 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylist_p.h @@ -0,0 +1,172 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIAPLAYLIST_P_H +#define QMEDIAPLAYLIST_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include +#include "qmediaobject_p.h" + +#include + +#ifdef Q_MOC_RUN +# pragma Q_MOC_EXPAND_MACROS +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QMediaPlaylistControl; +class QMediaPlaylistProvider; +class QMediaPlaylistReader; +class QMediaPlaylistWriter; +class QMediaPlayerControl; + +class QMediaPlaylistPrivate +{ + Q_DECLARE_PUBLIC(QMediaPlaylist) +public: + QMediaPlaylistPrivate() + :mediaObject(0), + control(0), + localPlaylistControl(0), + error(QMediaPlaylist::NoError) + { + } + + virtual ~QMediaPlaylistPrivate() {} + + void _q_loadFailed(QMediaPlaylist::Error error, const QString &errorString) + { + this->error = error; + this->errorString = errorString; + + emit q_ptr->loadFailed(); + } + + void _q_mediaObjectDeleted() + { + Q_Q(QMediaPlaylist); + mediaObject = 0; + if (control != localPlaylistControl) + control = 0; + q->setMediaObject(0); + } + + QMediaObject *mediaObject; + + QMediaPlaylistControl *control; + QMediaPlaylistProvider *playlist() const { return control->playlistProvider(); } + + QMediaPlaylistControl *localPlaylistControl; + + bool readItems(QMediaPlaylistReader *reader); + bool writeItems(QMediaPlaylistWriter *writer); + + QMediaPlaylist::Error error; + QString errorString; + + QMediaPlaylist *q_ptr; +}; + + +class QLocalMediaPlaylistControl : public QMediaPlaylistControl +{ + Q_OBJECT +public: + QLocalMediaPlaylistControl(QObject *parent) + :QMediaPlaylistControl(parent) + { + QMediaPlaylistProvider *playlist = new QLocalMediaPlaylistProvider(this); + m_navigator = new QMediaPlaylistNavigator(playlist,this); + m_navigator->setPlaybackMode(QMediaPlaylist::Linear); + + connect(m_navigator, SIGNAL(currentIndexChanged(int)), SIGNAL(currentIndexChanged(int))); + connect(m_navigator, SIGNAL(activated(QMediaContent)), SIGNAL(currentMediaChanged(QMediaContent))); + } + + virtual ~QLocalMediaPlaylistControl() {}; + + QMediaPlaylistProvider* playlistProvider() const { return m_navigator->playlist(); } + bool setPlaylistProvider(QMediaPlaylistProvider *mediaPlaylist) + { + m_navigator->setPlaylist(mediaPlaylist); + emit playlistProviderChanged(); + return true; + } + + int currentIndex() const { return m_navigator->currentIndex(); } + void setCurrentIndex(int position) { m_navigator->jump(position); } + int nextIndex(int steps) const { return m_navigator->nextIndex(steps); } + int previousIndex(int steps) const { return m_navigator->previousIndex(steps); } + + void next() { m_navigator->next(); } + void previous() { m_navigator->previous(); } + + QMediaPlaylist::PlaybackMode playbackMode() const { return m_navigator->playbackMode(); } + void setPlaybackMode(QMediaPlaylist::PlaybackMode mode) { m_navigator->setPlaybackMode(mode); } + +private: + QMediaPlaylistNavigator *m_navigator; +}; + + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIAPLAYLIST_P_H diff --git a/src/multimedia/mediaservices/base/qmediaplaylistcontrol.cpp b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.cpp new file mode 100644 index 0000000..6f3b2fe --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.cpp @@ -0,0 +1,204 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qmediacontrol_p.h" + + +QT_BEGIN_NAMESPACE + +/*! + \class QMediaPlaylistControl + \ingroup multimedia-serv + \since 4.7 + + \preliminary + \brief The QMediaPlaylistControl class provides access to the playlist functionality of a + QMediaService. + + If a QMediaService contains an internal playlist it will implement QMediaPlaylistControl. This + control provides access to the contents of the \l {playlistProvider()}{playlist}, as well as the + \l {currentIndex()}{position} of the current media, and a means of navigating to the + \l {next()}{next} and \l {previous()}{previous} media. + + The functionality provided by the control is exposed to application code through the + QMediaPlaylist class. + + The interface name of QMediaPlaylistControl is \c com.nokia.Qt.QMediaPlaylistControl/1.0 as + defined in QMediaPlaylistControl_iid. + + \sa QMediaService::control(), QMediaPlayer +*/ + +/*! + \macro QMediaPlaylistControl_iid + + \c com.nokia.Qt.QMediaPlaylistControl/1.0 + + Defines the interface name of the QMediaPlaylistControl class. + + \relates QMediaPlaylistControl +*/ + +/*! + Create a new playlist control object with the given \a parent. +*/ +QMediaPlaylistControl::QMediaPlaylistControl(QObject *parent): + QMediaControl(*new QMediaControlPrivate, parent) +{ +} + +/*! + Destroys the playlist control. +*/ +QMediaPlaylistControl::~QMediaPlaylistControl() +{ +} + + +/*! + \fn QMediaPlaylistControl::playlistProvider() const + + Returns the playlist used by this media player. +*/ + +/*! + \fn QMediaPlaylistControl::setPlaylistProvider(QMediaPlaylistProvider *playlist) + + Set the playlist of this media player to \a playlist. + + In many cases it is possible just to use the playlist + constructed by player, but sometimes replacing the whole + playlist allows to avoid copyting of all the items bettween playlists. + + Returns true if player can use this passed playlist; otherwise returns false. + +*/ + +/*! + \fn QMediaPlaylistControl::currentIndex() const + + Returns position of the current media source in the playlist. +*/ + +/*! + \fn QMediaPlaylistControl::setCurrentIndex(int position) + + Jump to the item at the given \a position. +*/ + +/*! + \fn QMediaPlaylistControl::nextIndex(int step) const + + Returns the index of item, which were current after calling next() + \a step times. + + Returned value depends on the size of playlist, current position + and playback mode. + + \sa QMediaPlaylist::playbackMode +*/ + +/*! + \fn QMediaPlaylistControl::previousIndex(int step) const + + Returns the index of item, which were current after calling previous() + \a step times. + + \sa QMediaPlaylist::playbackMode +*/ + +/*! + \fn QMediaPlaylistControl::next() + + Moves to the next item in playlist. +*/ + +/*! + \fn QMediaPlaylistControl::previous() + + Returns to the previous item in playlist. +*/ + +/*! + \fn QMediaPlaylistControl::playbackMode() const + + Returns the playlist navigation mode. + + \sa QMediaPlaylist::PlaybackMode +*/ + +/*! + \fn QMediaPlaylistControl::setPlaybackMode(QMediaPlaylist::PlaybackMode mode) + + Sets the playback \a mode. + + \sa QMediaPlaylist::PlaybackMode +*/ + +/*! + \fn QMediaPlaylistControl::playlistProviderChanged() + + Signal emited when the playlist provider has changed. +*/ + +/*! + \fn QMediaPlaylistControl::currentIndexChanged(int position) + + Signal emited when the playlist \a position is changed. +*/ + +/*! + \fn QMediaPlaylistControl::playbackModeChanged(QMediaPlaylist::PlaybackMode mode) + + Signal emited when the playback \a mode is changed. +*/ + +/*! + \fn QMediaPlaylistControl::currentMediaChanged(const QMediaContent& content) + + Signal emitted when current media changes to \a content. +*/ + +#include "moc_qmediaplaylistcontrol.cpp" +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h new file mode 100644 index 0000000..cf489e3 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIAPLAYLISTCONTROL_H +#define QMEDIAPLAYLISTCONTROL_H + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QMediaPlaylistProvider; + +class Q_MULTIMEDIA_EXPORT QMediaPlaylistControl : public QMediaControl +{ + Q_OBJECT + +public: + virtual ~QMediaPlaylistControl(); + + virtual QMediaPlaylistProvider* playlistProvider() const = 0; + virtual bool setPlaylistProvider(QMediaPlaylistProvider *playlist) = 0; + + virtual int currentIndex() const = 0; + virtual void setCurrentIndex(int position) = 0; + virtual int nextIndex(int steps) const = 0; + virtual int previousIndex(int steps) const = 0; + + virtual void next() = 0; + virtual void previous() = 0; + + virtual QMediaPlaylist::PlaybackMode playbackMode() const = 0; + virtual void setPlaybackMode(QMediaPlaylist::PlaybackMode mode) = 0; + +Q_SIGNALS: + void playlistProviderChanged(); + void currentIndexChanged(int position); + void currentMediaChanged(const QMediaContent&); + void playbackModeChanged(QMediaPlaylist::PlaybackMode mode); + +protected: + QMediaPlaylistControl(QObject* parent = 0); +}; + +#define QMediaPlaylistControl_iid "com.nokia.Qt.QMediaPlaylistControl/1.0" +Q_MEDIA_DECLARE_CONTROL(QMediaPlaylistControl, QMediaPlaylistControl_iid) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIAPLAYLISTCONTROL_H diff --git a/src/multimedia/mediaservices/base/qmediaplaylistioplugin.cpp b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.cpp new file mode 100644 index 0000000..ba5dc81 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.cpp @@ -0,0 +1,192 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 + +QT_BEGIN_NAMESPACE + +/*! + \class QMediaPlaylistReader + \preliminary + \since 4.7 + \brief The QMediaPlaylistReader class provides an interface for reading a playlist file. + + \sa QMediaPlaylistIOPlugin +*/ + +/*! + Destroys a media playlist reader. +*/ +QMediaPlaylistReader::~QMediaPlaylistReader() +{ +} + +/*! + \fn QMediaPlaylistReader::atEnd() const + + Identifies if a playlist reader has reached the end of its input. + + Returns true if the reader has reached the end; and false otherwise. +*/ + +/*! + \fn QMediaPlaylistReader::readItem() + + Reads an item of media from a playlist file. + + Returns the read media, or a null QMediaContent if no more media is available. +*/ + +/*! + \fn QMediaPlaylistReader::close() + + Closes a playlist reader's input device. +*/ + +/*! + \class QMediaPlaylistWriter + \preliminary + \since 4.7 + \brief The QMediaPlaylistWriter class provides an interface for writing a playlist file. + + \sa QMediaPlaylistIOPlugin +*/ + +/*! + Destroys a media playlist writer. +*/ +QMediaPlaylistWriter::~QMediaPlaylistWriter() +{ +} + +/*! + \fn QMediaPlaylistWriter::writeItem(const QMediaContent &media) + + Writes an item of \a media to a playlist file. + + Returns true if the media was written succesfully; and false otherwise. +*/ + +/*! + \fn QMediaPlaylistWriter::close() + + Finalizes the writing of a playlist and closes the output device. +*/ + +/*! + \class QMediaPlaylistIOPlugin + \since 4.7 + \brief The QMediaPlaylistIOPlugin class provides an interface for media playlist I/O plug-ins. +*/ + +/*! + Constructs a media playlist I/O plug-in with the given \a parent. +*/ +QMediaPlaylistIOPlugin::QMediaPlaylistIOPlugin(QObject *parent) + :QObject(parent) +{ +} + +/*! + Destroys a media playlist I/O plug-in. +*/ +QMediaPlaylistIOPlugin::~QMediaPlaylistIOPlugin() +{ +} + +/*! + \fn QMediaPlaylistIOPlugin::canRead(QIODevice *device, const QByteArray &format) const + + Identifies if plug-in can read \a format data from an I/O \a device. + + Returns true if the data can be read; and false otherwise. +*/ + +/*! + \fn QMediaPlaylistIOPlugin::canRead(const QUrl& location, const QByteArray &format) const + + Identifies if a plug-in can read \a format data from a URL \a location. + + Returns true if the data can be read; and false otherwise. +*/ + +/*! + \fn QMediaPlaylistIOPlugin::canWrite(QIODevice *device, const QByteArray &format) const + + Identifies if a plug-in can write \a format data to an I/O \a device. + + Returns true if the data can be written; and false otherwise. +*/ + +/*! + \fn QMediaPlaylistIOPlugin::keys() const + + Returns a list of format keys supported by a plug-in. +*/ + +/*! + \fn QMediaPlaylistIOPlugin::createReader(QIODevice *device, const QByteArray &format) + + Returns a new QMediaPlaylistReader which reads \a format data from an I/O \a device. + + If the device is invalid or the format is unsupported this will return a null pointer. +*/ + +/*! + \fn QMediaPlaylistIOPlugin::createReader(const QUrl& location, const QByteArray &format) + + Returns a new QMediaPlaylistReader which reads \a format data from a URL \a location. + + If the location or the format is unsupported this will return a null pointer. +*/ + +/*! + \fn QMediaPlaylistIOPlugin::createWriter(QIODevice *device, const QByteArray &format) + + Returns a new QMediaPlaylistWriter which writes \a format data to an I/O \a device. + + If the device is invalid or the format is unsupported this will return a null pointer. +*/ + +QT_END_NAMESPACE + +#include "moc_qmediaplaylistioplugin.cpp" + diff --git a/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h new file mode 100644 index 0000000..6bc0418 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIAPLAYLISTIOPLUGIN_H +#define QMEDIAPLAYLISTIOPLUGIN_H + +#include +#include +#include + +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QString; +class QUrl; +class QByteArray; +class QIODevice; +class QStringList; + +class Q_MULTIMEDIA_EXPORT QMediaPlaylistReader +{ +public: + virtual ~QMediaPlaylistReader(); + + virtual bool atEnd() const = 0; + virtual QMediaContent readItem() = 0; + virtual void close() = 0; +}; + +class Q_MULTIMEDIA_EXPORT QMediaPlaylistWriter +{ +public: + virtual ~QMediaPlaylistWriter(); + + virtual bool writeItem(const QMediaContent &content) = 0; + virtual void close() = 0; +}; + +struct Q_MULTIMEDIA_EXPORT QMediaPlaylistIOInterface : public QFactoryInterface +{ + virtual bool canRead(QIODevice *device, const QByteArray &format = QByteArray() ) const = 0; + virtual bool canRead(const QUrl& location, const QByteArray &format = QByteArray()) const = 0; + + virtual bool canWrite(QIODevice *device, const QByteArray &format) const = 0; + + virtual QMediaPlaylistReader *createReader(QIODevice *device, const QByteArray &format = QByteArray()) = 0; + virtual QMediaPlaylistReader *createReader(const QUrl& location, const QByteArray &format = QByteArray()) = 0; + + virtual QMediaPlaylistWriter *createWriter(QIODevice *device, const QByteArray &format) = 0; +}; + +#define QMediaPlaylistIOInterface_iid "com.nokia.Qt.QMediaPlaylistIOInterface" +Q_DECLARE_INTERFACE(QMediaPlaylistIOInterface, QMediaPlaylistIOInterface_iid); + +class Q_MULTIMEDIA_EXPORT QMediaPlaylistIOPlugin : public QObject, public QMediaPlaylistIOInterface +{ + Q_OBJECT + Q_INTERFACES(QMediaPlaylistIOInterface:QFactoryInterface) + +public: + explicit QMediaPlaylistIOPlugin(QObject *parent = 0); + virtual ~QMediaPlaylistIOPlugin(); + + virtual bool canRead(QIODevice *device, const QByteArray &format = QByteArray() ) const = 0; + virtual bool canRead(const QUrl& location, const QByteArray &format = QByteArray()) const = 0; + + virtual bool canWrite(QIODevice *device, const QByteArray &format) const = 0; + + virtual QStringList keys() const = 0; + + virtual QMediaPlaylistReader *createReader(QIODevice *device, const QByteArray &format = QByteArray()) = 0; + virtual QMediaPlaylistReader *createReader(const QUrl& location, const QByteArray &format = QByteArray()) = 0; + + virtual QMediaPlaylistWriter *createWriter(QIODevice *device, const QByteArray &format) = 0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIAPLAYLISTIOPLUGIN_H diff --git a/src/multimedia/mediaservices/base/qmediaplaylistnavigator.cpp b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.cpp new file mode 100644 index 0000000..134ae77 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.cpp @@ -0,0 +1,545 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qmediaobject_p.h" + +#include + +QT_BEGIN_NAMESPACE + +class QMediaPlaylistNullProvider : public QMediaPlaylistProvider +{ +public: + QMediaPlaylistNullProvider() :QMediaPlaylistProvider() {} + virtual ~QMediaPlaylistNullProvider() {} + virtual int mediaCount() const {return 0;} + virtual QMediaContent media(int) const { return QMediaContent(); } +}; + +Q_GLOBAL_STATIC(QMediaPlaylistNullProvider, _q_nullMediaPlaylist) + +class QMediaPlaylistNavigatorPrivate +{ + Q_DECLARE_NON_CONST_PUBLIC(QMediaPlaylistNavigator) +public: + QMediaPlaylistNavigatorPrivate() + :playlist(0), + currentPos(-1), + lastValidPos(-1), + playbackMode(QMediaPlaylist::Linear), + randomPositionsOffset(-1) + { + } + + QMediaPlaylistProvider *playlist; + int currentPos; + int lastValidPos; //to be used with CurrentItemOnce playback mode + QMediaPlaylist::PlaybackMode playbackMode; + QMediaContent currentItem; + + mutable QList randomModePositions; + mutable int randomPositionsOffset; + + int nextItemPos(int steps = 1) const; + int previousItemPos(int steps = 1) const; + + void _q_mediaInserted(int start, int end); + void _q_mediaRemoved(int start, int end); + void _q_mediaChanged(int start, int end); + + QMediaPlaylistNavigator *q_ptr; +}; + + +int QMediaPlaylistNavigatorPrivate::nextItemPos(int steps) const +{ + if (playlist->mediaCount() == 0) + return -1; + + if (steps == 0) + return currentPos; + + switch (playbackMode) { + case QMediaPlaylist::CurrentItemOnce: + return /*currentPos == -1 ? lastValidPos :*/ -1; + case QMediaPlaylist::CurrentItemInLoop: + return currentPos; + case QMediaPlaylist::Linear: + { + int nextPos = currentPos+steps; + return nextPos < playlist->mediaCount() ? nextPos : -1; + } + case QMediaPlaylist::Loop: + return (currentPos+steps) % playlist->mediaCount(); + case QMediaPlaylist::Random: + { + //TODO: limit the history size + + if (randomPositionsOffset == -1) { + randomModePositions.clear(); + randomModePositions.append(currentPos); + randomPositionsOffset = 0; + } + + while (randomModePositions.size() < randomPositionsOffset+steps+1) + randomModePositions.append(-1); + int res = randomModePositions[randomPositionsOffset+steps]; + if (res<0 || res >= playlist->mediaCount()) { + res = qrand() % playlist->mediaCount(); + randomModePositions[randomPositionsOffset+steps] = res; + } + + return res; + } + } + + return -1; +} + +int QMediaPlaylistNavigatorPrivate::previousItemPos(int steps) const +{ + if (playlist->mediaCount() == 0) + return -1; + + if (steps == 0) + return currentPos; + + switch (playbackMode) { + case QMediaPlaylist::CurrentItemOnce: + return /*currentPos == -1 ? lastValidPos :*/ -1; + case QMediaPlaylist::CurrentItemInLoop: + return currentPos; + case QMediaPlaylist::Linear: + { + int prevPos = currentPos == -1 ? playlist->mediaCount() - steps : currentPos - steps; + return prevPos>=0 ? prevPos : -1; + } + case QMediaPlaylist::Loop: + { + int prevPos = currentPos - steps; + while (prevPos<0) + prevPos += playlist->mediaCount(); + return prevPos; + } + case QMediaPlaylist::Random: + { + //TODO: limit the history size + + if (randomPositionsOffset == -1) { + randomModePositions.clear(); + randomModePositions.append(currentPos); + randomPositionsOffset = 0; + } + + while (randomPositionsOffset-steps < 0) { + randomModePositions.prepend(-1); + randomPositionsOffset++; + } + + int res = randomModePositions[randomPositionsOffset-steps]; + if (res<0 || res >= playlist->mediaCount()) { + res = qrand() % playlist->mediaCount(); + randomModePositions[randomPositionsOffset-steps] = res; + } + + return res; + } + } + + return -1; +} + +/*! + \class QMediaPlaylistNavigator + \preliminary + \since 4.7 + \brief The QMediaPlaylistNavigator class provides navigation for a media playlist. + + \sa QMediaPlaylist, QMediaPlaylistProvider +*/ + + +/*! + Constructs a media playlist navigator for a \a playlist. + + The \a parent is passed to QObject. + */ +QMediaPlaylistNavigator::QMediaPlaylistNavigator(QMediaPlaylistProvider *playlist, QObject *parent) + : QObject(parent) + , d_ptr(new QMediaPlaylistNavigatorPrivate) +{ + d_ptr->q_ptr = this; + + setPlaylist(playlist ? playlist : _q_nullMediaPlaylist()); +} + +/*! + Destroys a media playlist navigator. + */ + +QMediaPlaylistNavigator::~QMediaPlaylistNavigator() +{ + delete d_ptr; +} + + +/*! \property QMediaPlaylistNavigator::playbackMode + Contains the playback mode. + */ +QMediaPlaylist::PlaybackMode QMediaPlaylistNavigator::playbackMode() const +{ + return d_func()->playbackMode; +} + +/*! + Sets the playback \a mode. + */ +void QMediaPlaylistNavigator::setPlaybackMode(QMediaPlaylist::PlaybackMode mode) +{ + Q_D(QMediaPlaylistNavigator); + if (d->playbackMode == mode) + return; + + if (mode == QMediaPlaylist::Random) { + d->randomPositionsOffset = 0; + d->randomModePositions.append(d->currentPos); + } else if (d->playbackMode == QMediaPlaylist::Random) { + d->randomPositionsOffset = -1; + d->randomModePositions.clear(); + } + + d->playbackMode = mode; + + emit playbackModeChanged(mode); + emit surroundingItemsChanged(); +} + +/*! + Returns the playlist being navigated. +*/ + +QMediaPlaylistProvider *QMediaPlaylistNavigator::playlist() const +{ + return d_func()->playlist; +} + +/*! + Sets the \a playlist to navigate. +*/ +void QMediaPlaylistNavigator::setPlaylist(QMediaPlaylistProvider *playlist) +{ + Q_D(QMediaPlaylistNavigator); + + if (d->playlist == playlist) + return; + + if (d->playlist) { + d->playlist->disconnect(this); + } + + if (playlist) { + d->playlist = playlist; + } else { + //assign to shared readonly null playlist + d->playlist = _q_nullMediaPlaylist(); + } + + connect(d->playlist, SIGNAL(mediaInserted(int,int)), SLOT(_q_mediaInserted(int,int))); + connect(d->playlist, SIGNAL(mediaRemoved(int,int)), SLOT(_q_mediaRemoved(int,int))); + connect(d->playlist, SIGNAL(mediaChanged(int,int)), SLOT(_q_mediaChanged(int,int))); + + d->randomPositionsOffset = -1; + d->randomModePositions.clear(); + + if (d->currentPos != -1) { + d->currentPos = -1; + emit currentIndexChanged(-1); + } + + if (!d->currentItem.isNull()) { + d->currentItem = QMediaContent(); + emit activated(d->currentItem); //stop playback + } +} + +/*! \property QMediaPlaylistNavigator::currentItem + + Contains the media at the current position in the playlist. + + \sa currentIndex() +*/ + +QMediaContent QMediaPlaylistNavigator::currentItem() const +{ + return itemAt(d_func()->currentPos); +} + +/*! \fn QMediaContent QMediaPlaylistNavigator::nextItem(int steps) const + + Returns the media that is \a steps positions ahead of the current + position in the playlist. + + \sa nextIndex() +*/ +QMediaContent QMediaPlaylistNavigator::nextItem(int steps) const +{ + return itemAt(nextIndex(steps)); +} + +/*! + Returns the media that is \a steps positions behind the current + position in the playlist. + + \sa previousIndex() + */ +QMediaContent QMediaPlaylistNavigator::previousItem(int steps) const +{ + return itemAt(previousIndex(steps)); +} + +/*! + Returns the media at a \a position in the playlist. + */ +QMediaContent QMediaPlaylistNavigator::itemAt(int position) const +{ + return d_func()->playlist->media(position); +} + +/*! \property QMediaPlaylistNavigator::currentIndex + + Contains the position of the current media. + + If no media is current, the property contains -1. + + \sa nextIndex(), previousIndex() +*/ + +int QMediaPlaylistNavigator::currentIndex() const +{ + return d_func()->currentPos; +} + +/*! + Returns a position \a steps ahead of the current position + accounting for the playbackMode(). + + If the position is beyond the end of the playlist, this value + returned is -1. + + \sa currentIndex(), previousIndex(), playbackMode() +*/ + +int QMediaPlaylistNavigator::nextIndex(int steps) const +{ + return d_func()->nextItemPos(steps); +} + +/*! + + Returns a position \a steps behind the current position accounting + for the playbackMode(). + + If the position is prior to the beginning of the playlist this will + return -1. + + \sa currentIndex(), nextIndex(), playbackMode() +*/ +int QMediaPlaylistNavigator::previousIndex(int steps) const +{ + return d_func()->previousItemPos(steps); +} + +/*! + Advances to the next item in the playlist. + + \sa previous(), jump(), playbackMode() + */ +void QMediaPlaylistNavigator::next() +{ + Q_D(QMediaPlaylistNavigator); + + int nextPos = d->nextItemPos(); + + if ( playbackMode() == QMediaPlaylist::Random ) + d->randomPositionsOffset++; + + jump(nextPos); +} + +/*! + Returns to the previous item in the playlist, + + \sa next(), jump(), playbackMode() + */ +void QMediaPlaylistNavigator::previous() +{ + Q_D(QMediaPlaylistNavigator); + + int prevPos = d->previousItemPos(); + if ( playbackMode() == QMediaPlaylist::Random ) + d->randomPositionsOffset--; + + jump(prevPos); +} + +/*! + Jumps to a new \a position in the playlist. + */ +void QMediaPlaylistNavigator::jump(int position) +{ + Q_D(QMediaPlaylistNavigator); + + if (position<-1 || position>=d->playlist->mediaCount()) { + qWarning() << "QMediaPlaylistNavigator: Jump outside playlist range"; + position = -1; + } + + if (position != -1) + d->lastValidPos = position; + + if (playbackMode() == QMediaPlaylist::Random) { + if (d->randomModePositions[d->randomPositionsOffset] != position) { + d->randomModePositions.clear(); + d->randomModePositions.append(position); + d->randomPositionsOffset = 0; + } + } + + if (position != -1) + d->currentItem = d->playlist->media(position); + else + d->currentItem = QMediaContent(); + + if (position != d->currentPos) { + d->currentPos = position; + emit currentIndexChanged(d->currentPos); + emit surroundingItemsChanged(); + } + + emit activated(d->currentItem); +} + +/*! + \internal +*/ +void QMediaPlaylistNavigatorPrivate::_q_mediaInserted(int start, int end) +{ + Q_Q(QMediaPlaylistNavigator); + + if (currentPos >= start) { + currentPos = end-start+1; + q->jump(currentPos); + } + + //TODO: check if they really changed + emit q->surroundingItemsChanged(); +} + +/*! + \internal +*/ +void QMediaPlaylistNavigatorPrivate::_q_mediaRemoved(int start, int end) +{ + Q_Q(QMediaPlaylistNavigator); + + if (currentPos > end) { + currentPos = currentPos - end-start+1; + q->jump(currentPos); + } else if (currentPos >= start) { + //current item was removed + currentPos = qMin(start, playlist->mediaCount()-1); + q->jump(currentPos); + } + + //TODO: check if they really changed + emit q->surroundingItemsChanged(); +} + +/*! + \internal +*/ +void QMediaPlaylistNavigatorPrivate::_q_mediaChanged(int start, int end) +{ + Q_Q(QMediaPlaylistNavigator); + + if (currentPos >= start && currentPos<=end) { + QMediaContent src = playlist->media(currentPos); + if (src != currentItem) { + currentItem = src; + emit q->activated(src); + } + } + + //TODO: check if they really changed + emit q->surroundingItemsChanged(); +} + +/*! + \fn QMediaPlaylistNavigator::activated(const QMediaContent &media) + + Signals that the current \a media has changed. +*/ + +/*! + \fn QMediaPlaylistNavigator::currentIndexChanged(int position) + + Signals the \a position of the current media has changed. +*/ + +/*! + \fn QMediaPlaylistNavigator::playbackModeChanged(QMediaPlaylist::PlaybackMode mode) + + Signals that the playback \a mode has changed. +*/ + +/*! + \fn QMediaPlaylistNavigator::surroundingItemsChanged() + + Signals that media immediately surrounding the current position has changed. +*/ + +#include "moc_qmediaplaylistnavigator.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h new file mode 100644 index 0000000..b6d3d96 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIAPLAYLISTNAVIGATOR_H +#define QMEDIAPLAYLISTNAVIGATOR_H + +#include + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QMediaPlaylistNavigatorPrivate; +class Q_MULTIMEDIA_EXPORT QMediaPlaylistNavigator : public QObject +{ + Q_OBJECT + Q_PROPERTY(QMediaPlaylist::PlaybackMode playbackMode READ playbackMode WRITE setPlaybackMode NOTIFY playbackModeChanged) + Q_PROPERTY(int currentIndex READ currentIndex WRITE jump NOTIFY currentIndexChanged) + Q_PROPERTY(QMediaContent currentItem READ currentItem NOTIFY currentItemChanged) + +public: + QMediaPlaylistNavigator(QMediaPlaylistProvider *playlist, QObject *parent = 0); + virtual ~QMediaPlaylistNavigator(); + + QMediaPlaylistProvider *playlist() const; + void setPlaylist(QMediaPlaylistProvider *playlist); + + QMediaPlaylist::PlaybackMode playbackMode() const; + + QMediaContent currentItem() const; + QMediaContent nextItem(int steps = 1) const; + QMediaContent previousItem(int steps = 1) const; + + QMediaContent itemAt(int position) const; + + int currentIndex() const; + int nextIndex(int steps = 1) const; + int previousIndex(int steps = 1) const; + +public Q_SLOTS: + void next(); + void previous(); + + void jump(int); + + void setPlaybackMode(QMediaPlaylist::PlaybackMode mode); + +Q_SIGNALS: + void activated(const QMediaContent &content); + void currentIndexChanged(int); + void playbackModeChanged(QMediaPlaylist::PlaybackMode mode); + + void surroundingItemsChanged(); + +protected: + QMediaPlaylistNavigatorPrivate *d_ptr; + +private: + Q_DISABLE_COPY(QMediaPlaylistNavigator) + Q_DECLARE_PRIVATE(QMediaPlaylistNavigator) + + Q_PRIVATE_SLOT(d_func(), void _q_mediaInserted(int start, int end)) + Q_PRIVATE_SLOT(d_func(), void _q_mediaRemoved(int start, int end)) + Q_PRIVATE_SLOT(d_func(), void _q_mediaChanged(int start, int end)) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIAPLAYLISTNAVIGATOR_H diff --git a/src/multimedia/mediaservices/base/qmediaplaylistprovider.cpp b/src/multimedia/mediaservices/base/qmediaplaylistprovider.cpp new file mode 100644 index 0000000..c546899 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylistprovider.cpp @@ -0,0 +1,308 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qmediaplaylistprovider_p.h" + + +QT_BEGIN_NAMESPACE + +/*! + \class QMediaPlaylistProvider + \preliminary + \since 4.7 + \brief The QMediaPlaylistProvider class provides an abstract list of media. + + \sa QMediaPlaylist +*/ + +/*! + Constructs a playlist provider with the given \a parent. +*/ +QMediaPlaylistProvider::QMediaPlaylistProvider(QObject *parent) + :QObject(parent), d_ptr(new QMediaPlaylistProviderPrivate) +{ +} + +/*! + \internal +*/ +QMediaPlaylistProvider::QMediaPlaylistProvider(QMediaPlaylistProviderPrivate &dd, QObject *parent) + :QObject(parent), d_ptr(&dd) +{ +} + +/*! + Destroys a playlist provider. +*/ +QMediaPlaylistProvider::~QMediaPlaylistProvider() +{ + delete d_ptr; +} + +/*! + \fn QMediaPlaylistProvider::mediaCount() const; + + Returns the size of playlist. +*/ + +/*! + \fn QMediaPlaylistProvider::media(int index) const; + + Returns the media at \a index in the playlist. + + If the index is invalid this will return a null media content. +*/ + + +/*! + Loads a playlist from from a URL \a location. If no playlist \a format is specified the loader + will inspect the URL or probe the headers to guess the format. + + New items are appended to playlist. + + Returns true if the provider supports the format and loading from the locations URL protocol, + otherwise this will return false. +*/ +bool QMediaPlaylistProvider::load(const QUrl &location, const char *format) +{ + Q_UNUSED(location); + Q_UNUSED(format); + return false; +} + +/*! + Loads a playlist from from an I/O \a device. If no playlist \a format is specified the loader + will probe the headers to guess the format. + + New items are appended to playlist. + + Returns true if the provider supports the format and loading from an I/O device, otherwise this + will return false. +*/ +bool QMediaPlaylistProvider::load(QIODevice * device, const char *format) +{ + Q_UNUSED(device); + Q_UNUSED(format); + return false; +} + +/*! + Saves the contents of a playlist to a URL \a location. If no playlist \a format is specified + the writer will inspect the URL to guess the format. + + Returns true if the playlist was saved succesfully; and false otherwise. + */ +bool QMediaPlaylistProvider::save(const QUrl &location, const char *format) +{ + Q_UNUSED(location); + Q_UNUSED(format); + return false; +} + +/*! + Saves the contents of a playlist to an I/O \a device in the specified \a format. + + Returns true if the playlist was saved succesfully; and false otherwise. +*/ +bool QMediaPlaylistProvider::save(QIODevice * device, const char *format) +{ + Q_UNUSED(device); + Q_UNUSED(format); + return false; +} + +/*! + Returns true if a playlist is read-only; otherwise returns false. +*/ +bool QMediaPlaylistProvider::isReadOnly() const +{ + return true; +} + +/*! + Append \a media to a playlist. + + Returns true if the media was appended; and false otherwise. +*/ +bool QMediaPlaylistProvider::addMedia(const QMediaContent &media) +{ + Q_UNUSED(media); + return false; +} + +/*! + Append multiple media \a items to a playlist. + + Returns true if the media items were appended; and false otherwise. +*/ +bool QMediaPlaylistProvider::addMedia(const QList &items) +{ + foreach(const QMediaContent &item, items) { + if (!addMedia(item)) + return false; + } + + return true; +} + +/*! + Inserts \a media into a playlist at \a position. + + Returns true if the media was inserted; and false otherwise. +*/ +bool QMediaPlaylistProvider::insertMedia(int position, const QMediaContent &media) +{ + Q_UNUSED(position); + Q_UNUSED(media); + return false; +} + +/*! + Inserts multiple media \a items into a playlist at \a position. + + Returns true if the media \a items were inserted; and false otherwise. +*/ +bool QMediaPlaylistProvider::insertMedia(int position, const QList &items) +{ + for (int i=0; i + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QString; + + +class QMediaPlaylistProviderPrivate; +class Q_MULTIMEDIA_EXPORT QMediaPlaylistProvider : public QObject +{ + Q_OBJECT + +public: + QMediaPlaylistProvider(QObject *parent=0); + virtual ~QMediaPlaylistProvider(); + + virtual bool load(const QUrl &location, const char *format = 0); + virtual bool load(QIODevice * device, const char *format = 0); + virtual bool save(const QUrl &location, const char *format = 0); + virtual bool save(QIODevice * device, const char *format); + + virtual int mediaCount() const = 0; + virtual QMediaContent media(int index) const = 0; + + virtual bool isReadOnly() const; + + virtual bool addMedia(const QMediaContent &content); + virtual bool addMedia(const QList &contentList); + virtual bool insertMedia(int index, const QMediaContent &content); + virtual bool insertMedia(int index, const QList &content); + virtual bool removeMedia(int pos); + virtual bool removeMedia(int start, int end); + virtual bool clear(); + +public Q_SLOTS: + virtual void shuffle(); + +Q_SIGNALS: + void mediaAboutToBeInserted(int start, int end); + void mediaInserted(int start, int end); + + void mediaAboutToBeRemoved(int start, int end); + void mediaRemoved(int start, int end); + + void mediaChanged(int start, int end); + + void loaded(); + void loadFailed(QMediaPlaylist::Error, const QString& errorMessage); + +protected: + QMediaPlaylistProviderPrivate *d_ptr; + QMediaPlaylistProvider(QMediaPlaylistProviderPrivate &dd, QObject *parent); + +private: + Q_DECLARE_PRIVATE(QMediaPlaylistProvider) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIAPLAYLISTPROVIDER_H diff --git a/src/multimedia/mediaservices/base/qmediaplaylistprovider_p.h b/src/multimedia/mediaservices/base/qmediaplaylistprovider_p.h new file mode 100644 index 0000000..03f72ac --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaplaylistprovider_p.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIAPLAYLISTPROVIDER_P_H +#define QMEDIAPLAYLISTPROVIDER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QMediaPlaylistProviderPrivate +{ +public: + QMediaPlaylistProviderPrivate() + {} + virtual ~QMediaPlaylistProviderPrivate() + {} +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIAPLAYLISTSOURCE_P_H diff --git a/src/multimedia/mediaservices/base/qmediapluginloader.cpp b/src/multimedia/mediaservices/base/qmediapluginloader.cpp new file mode 100644 index 0000000..a1975ab --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediapluginloader.cpp @@ -0,0 +1,135 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qmediapluginloader_p.h" +#include +#include +#include +#include + +#include + + +QT_BEGIN_NAMESPACE + + +typedef QMap ObjectListMap; +Q_GLOBAL_STATIC(ObjectListMap, staticMediaPlugins); + +QMediaPluginLoader::QMediaPluginLoader(const char *iid, const QString &location, Qt::CaseSensitivity): + m_iid(iid) +{ + m_location = location + QLatin1String("/"); + load(); +} + +QStringList QMediaPluginLoader::keys() const +{ + return m_instances.keys(); +} + +QObject* QMediaPluginLoader::instance(QString const &key) +{ + return m_instances.value(key); +} + +QList QMediaPluginLoader::instances(QString const &key) +{ + return m_instances.values(key); +} + +//to be used for testing purposes only +void QMediaPluginLoader::setStaticPlugins(const QString &location, const QObjectList& objects) +{ + staticMediaPlugins()->insert(location + QLatin1String("/"), objects); +} + +void QMediaPluginLoader::load() +{ + if (!m_instances.isEmpty()) + return; + + if (staticMediaPlugins() && staticMediaPlugins()->contains(m_location)) { + foreach(QObject *o, staticMediaPlugins()->value(m_location)) { + if (o != 0 && o->qt_metacast(m_iid) != 0) { + QFactoryInterface* p = qobject_cast(o); + if (p != 0) { + foreach (QString const &key, p->keys()) + m_instances.insertMulti(key, o); + } + } + } + } else { +#ifndef QT_NO_LIBRARY + QStringList paths = QCoreApplication::libraryPaths(); + + foreach (QString const &path, paths) { + QString pluginPathName(path + m_location); + QDir pluginDir(pluginPathName); + + if (!pluginDir.exists()) + continue; + + foreach (QString pluginLib, pluginDir.entryList(QDir::Files)) { + QPluginLoader loader(pluginPathName + pluginLib); + + QObject *o = loader.instance(); + if (o != 0 && o->qt_metacast(m_iid) != 0) { + QFactoryInterface* p = qobject_cast(o); + if (p != 0) { + foreach (QString const &key, p->keys()) + m_instances.insertMulti(key, o); + } + + continue; + } else { + qWarning() << "QMediaPluginLoader: Failed to load plugin: " << pluginLib << loader.errorString(); + } + delete o; + loader.unload(); + } + } +#endif + } +} + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qmediapluginloader_p.h b/src/multimedia/mediaservices/base/qmediapluginloader_p.h new file mode 100644 index 0000000..194f6ee --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediapluginloader_p.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIAPLUGINLOADER_H +#define QMEDIAPLUGINLOADER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QMediaServiceProviderPlugin; + +class Q_AUTOTEST_EXPORT QMediaPluginLoader +{ +public: + QMediaPluginLoader(const char *iid, + const QString &suffix = QString(), + Qt::CaseSensitivity = Qt::CaseSensitive); + + QStringList keys() const; + QObject* instance(QString const &key); + QList instances(QString const &key); + + static void setStaticPlugins(const QString &location, const QObjectList& objects); + +private: + void load(); + + QByteArray m_iid; + QString m_location; + QMap m_instances; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIAPLUGINLOADER_H diff --git a/src/multimedia/mediaservices/base/qmediaresource.cpp b/src/multimedia/mediaservices/base/qmediaresource.cpp new file mode 100644 index 0000000..9577092 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaresource.cpp @@ -0,0 +1,399 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 + +/*! + \class QMediaResource + \preliminary + \since 4.7 + \brief The QMediaResource class provides a description of a media resource. + \ingroup multimedia + + A media resource is composed of a \l {url()}{URL} containing the + location of the resource and a set of properties that describe the + format of the resource. The properties provide a means to assess a + resource without first attempting to load it, and in situations where + media be represented by multiple alternative representations provide a + means to select the appropriate resource. + + Media made available by a remote services can often be available in + multiple encodings or quality levels, this allows a client to select + an appropriate resource based on considerations such as codecs supported, + network bandwidth, and display constraints. QMediaResource includes + information such as the \l {mimeType()}{MIME type}, \l {audioCodec()}{audio} + and \l {videoCodec()}{video} codecs, \l {audioBitRate()}{audio} and + \l {videoBitRate()}{video} bit rates, and \l {resolution()}{resolution} + so these constraints and others can be evaluated. + + The only mandatory property of a QMediaResource is the url(). + + \sa QMediaContent +*/ + +/*! + \typedef QMediaResourceList + + Synonym for \c QList +*/ + +/*! + Constructs a null media resource. +*/ +QMediaResource::QMediaResource() +{ +} + +/*! + Constructs a media resource with the given \a mimeType from a \a url. +*/ +QMediaResource::QMediaResource(const QUrl &url, const QString &mimeType) +{ + values.insert(Url, url); + values.insert(MimeType, mimeType); +} + +/*! + Constructs a media resource with the given \a mimeType from a network \a request. +*/ +QMediaResource::QMediaResource(const QNetworkRequest &request, const QString &mimeType) +{ + values.insert(Request, QVariant::fromValue(request)); + values.insert(Url, request.url()); + values.insert(MimeType, mimeType); +} + +/*! + Constructs a copy of a media resource \a other. +*/ +QMediaResource::QMediaResource(const QMediaResource &other) + : values(other.values) +{ +} + +/*! + Assigns the value of \a other to a media resource. +*/ +QMediaResource &QMediaResource::operator =(const QMediaResource &other) +{ + values = other.values; + + return *this; +} + +/*! + Destroys a media resource. +*/ +QMediaResource::~QMediaResource() +{ +} + + +/*! + Compares a media resource to \a other. + + Returns true if the resources are identical, and false otherwise. +*/ +bool QMediaResource::operator ==(const QMediaResource &other) const +{ + return values == other.values; +} + +/*! + Compares a media resource to \a other. + + Returns true if they are different, and false otherwise. +*/ +bool QMediaResource::operator !=(const QMediaResource &other) const +{ + return values != other.values; +} + +/*! + Identifies if a media resource is null. + + Returns true if the resource is null, and false otherwise. +*/ +bool QMediaResource::isNull() const +{ + return values.isEmpty(); +} + +/*! + Returns the URL of a media resource. +*/ +QUrl QMediaResource::url() const +{ + return qvariant_cast(values.value(Url)); +} + +/*! + Returns the network request associated with this media resource. +*/ +QNetworkRequest QMediaResource::request() const +{ + if(values.contains(Request)) + return qvariant_cast(values.value(Request)); + + return QNetworkRequest(url()); +} + +/*! + Returns the MIME type of a media resource. + + This may be null if the MIME type is unknown. +*/ +QString QMediaResource::mimeType() const +{ + return qvariant_cast(values.value(MimeType)); +} + +/*! + Returns the language of a media resource as an ISO 639-2 code. + + This may be null if the language is unknown. +*/ +QString QMediaResource::language() const +{ + return qvariant_cast(values.value(Language)); +} + +/*! + Sets the \a language of a media resource. +*/ +void QMediaResource::setLanguage(const QString &language) +{ + if (!language.isNull()) + values.insert(Language, language); + else + values.remove(Language); +} + +/*! + Returns the audio codec of a media resource. + + This may be null if the media resource does not contain an audio stream, or the codec is + unknown. +*/ +QString QMediaResource::audioCodec() const +{ + return qvariant_cast(values.value(AudioCodec)); +} + +/*! + Sets the audio \a codec of a media resource. +*/ +void QMediaResource::setAudioCodec(const QString &codec) +{ + if (!codec.isNull()) + values.insert(AudioCodec, codec); + else + values.remove(AudioCodec); +} + +/*! + Returns the video codec of a media resource. + + This may be null if the media resource does not contain a video stream, or the codec is + unknonwn. +*/ +QString QMediaResource::videoCodec() const +{ + return qvariant_cast(values.value(VideoCodec)); +} + +/*! + Sets the video \a codec of media resource. +*/ +void QMediaResource::setVideoCodec(const QString &codec) +{ + if (!codec.isNull()) + values.insert(VideoCodec, codec); + else + values.remove(VideoCodec); +} + +/*! + Returns the size in bytes of a media resource. + + This may be zero if the size is unknown. +*/ +qint64 QMediaResource::dataSize() const +{ + return qvariant_cast(values.value(DataSize)); +} + +/*! + Sets the \a size in bytes of a media resource. +*/ +void QMediaResource::setDataSize(const qint64 size) +{ + if (size != 0) + values.insert(DataSize, size); + else + values.remove(DataSize); +} + +/*! + Returns the bit rate in bits per second of a media resource's audio stream. + + This may be zero if the bit rate is unknown, or the resource contains no audio stream. +*/ +int QMediaResource::audioBitRate() const +{ + return values.value(AudioBitRate).toInt(); +} + +/*! + Sets the bit \a rate in bits per second of a media resource's video stream. +*/ +void QMediaResource::setAudioBitRate(int rate) +{ + if (rate != 0) + values.insert(AudioBitRate, rate); + else + values.remove(AudioBitRate); +} + +/*! + Returns the audio sample rate of a media resource. + + This may be zero if the sample size is unknown, or the resource contains no audio stream. +*/ +int QMediaResource::sampleRate() const +{ + return qvariant_cast(values.value(SampleRate)); +} + +/*! + Sets the audio \a sampleRate of a media resource. +*/ +void QMediaResource::setSampleRate(int sampleRate) +{ + if (sampleRate != 0) + values.insert(SampleRate, sampleRate); + else + values.remove(SampleRate); +} + +/*! + Returns the number of audio channels in a media resource. + + This may be zero if the sample size is unknown, or the resource contains no audio stream. +*/ +int QMediaResource::channelCount() const +{ + return qvariant_cast(values.value(ChannelCount)); +} + +/*! + Sets the number of audio \a channels in a media resource. +*/ +void QMediaResource::setChannelCount(int channels) +{ + if (channels != 0) + values.insert(ChannelCount, channels); + else + values.remove(ChannelCount); +} + +/*! + Returns the bit rate in bits per second of a media resource's video stream. + + This may be zero if the bit rate is unknown, or the resource contains no video stream. +*/ +int QMediaResource::videoBitRate() const +{ + return values.value(VideoBitRate).toInt(); +} + +/*! + Sets the bit \a rate in bits per second of a media resource's video stream. +*/ +void QMediaResource::setVideoBitRate(int rate) +{ + if (rate != 0) + values.insert(VideoBitRate, rate); + else + values.remove(VideoBitRate); +} + +/*! + Returns the resolution in pixels of a media resource. + + This may be null is the resolution is unknown, or the resource contains no pixel data (i.e. the + resource is an audio stream. +*/ +QSize QMediaResource::resolution() const +{ + return qvariant_cast(values.value(Resolution)); +} + +/*! + Sets the \a resolution in pixels of a media resource. +*/ +void QMediaResource::setResolution(const QSize &resolution) +{ + if (resolution.width() != -1 || resolution.height() != -1) + values.insert(Resolution, resolution); + else + values.remove(Resolution); +} + +/*! + Sets the \a width and \a height in pixels of a media resource. +*/ +void QMediaResource::setResolution(int width, int height) +{ + if (width != -1 || height != -1) + values.insert(Resolution, QSize(width, height)); + else + values.remove(Resolution); +} +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qmediaresource.h b/src/multimedia/mediaservices/base/qmediaresource.h new file mode 100644 index 0000000..69078cc --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaresource.h @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIARESOURCE_H +#define QMEDIARESOURCE_H + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class Q_MULTIMEDIA_EXPORT QMediaResource +{ +public: + QMediaResource(); + QMediaResource(const QUrl &url, const QString &mimeType = QString()); + QMediaResource(const QNetworkRequest &request, const QString &mimeType = QString()); + QMediaResource(const QMediaResource &other); + QMediaResource &operator =(const QMediaResource &other); + ~QMediaResource(); + + bool isNull() const; + + bool operator ==(const QMediaResource &other) const; + bool operator !=(const QMediaResource &other) const; + + QUrl url() const; + QNetworkRequest request() const; + QString mimeType() const; + + QString language() const; + void setLanguage(const QString &language); + + QString audioCodec() const; + void setAudioCodec(const QString &codec); + + QString videoCodec() const; + void setVideoCodec(const QString &codec); + + qint64 dataSize() const; + void setDataSize(const qint64 size); + + int audioBitRate() const; + void setAudioBitRate(int rate); + + int sampleRate() const; + void setSampleRate(int frequency); + + int channelCount() const; + void setChannelCount(int channels); + + int videoBitRate() const; + void setVideoBitRate(int rate); + + QSize resolution() const; + void setResolution(const QSize &resolution); + void setResolution(int width, int height); + + +private: + enum Property + { + Url, + Request, + MimeType, + Language, + AudioCodec, + VideoCodec, + DataSize, + AudioBitRate, + VideoBitRate, + SampleRate, + ChannelCount, + Resolution + }; + QMap values; +}; + +typedef QList QMediaResourceList; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QMediaResource) +Q_DECLARE_METATYPE(QMediaResourceList) + +QT_END_HEADER + + +#endif diff --git a/src/multimedia/mediaservices/base/qmediaservice.cpp b/src/multimedia/mediaservices/base/qmediaservice.cpp new file mode 100644 index 0000000..5d522dc --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaservice.cpp @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qmediaservice_p.h" + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +/*! + \class QMediaService + \brief The QMediaService class provides a common base class for media + service implementations. + \ingroup multimedia-serv + \preliminary + \since 4.7 + + Media services provide implementations of the functionality promised + by media objects, and allow multiple providers to implement a QMediaObject. + + To provide the functionality of a QMediaObject media services implement + QMediaControl interfaces. Services typically implement one core media + control which provides the core feature of a media object, and some + number of additional controls which provide either optional features of + the media object, or features of a secondary media object or peripheral + object. + + A pointer to media service's QMediaControl implementation can be + obtained by passing the control's interface name to the control() function. + + \code + QMediaPlayerControl *control = qobject_cast( + service->control("com.nokia.Qt.QMediaPlayerControl/1.0")); + \endcode + + Media objects can use services loaded dynamically from plug-ins or + implemented statically within an applications. Plug-in based services + should also implement the QMediaServiceProviderPlugin interface. Static + services should implement the QMediaServiceProvider interface. + + \sa QMediaObject, QMediaControl, QMediaServiceProvider, QMediaServiceProviderPlugin +*/ + +/*! + Construct a media service with the given \a parent. This class is meant as a + base class for Multimedia services so this constructor is protected. +*/ + +QMediaService::QMediaService(QObject *parent) + : QObject(parent) + , d_ptr(new QMediaServicePrivate) +{ + d_ptr->q_ptr = this; +} + +/*! + \internal +*/ +QMediaService::QMediaService(QMediaServicePrivate &dd, QObject *parent) + : QObject(parent) + , d_ptr(&dd) +{ + d_ptr->q_ptr = this; +} + +/*! + Destroys a media service. +*/ + +QMediaService::~QMediaService() +{ + delete d_ptr; +} + +/*! + \fn QMediaService::control(const char *interface) const + + Returns a pointer to the media control implementing \a interface. + + If the service does not implement the control a null pointer is returned instead. +*/ + +/*! + \fn QMediaService::control() const + + Returns a pointer to the media control of type T implemented by a media service. + + If the service does not implment the control a null pointer is returned instead. +*/ + +#include "moc_qmediaservice.cpp" + +QT_END_NAMESPACE + +QT_END_HEADER + diff --git a/src/multimedia/mediaservices/base/qmediaservice.h b/src/multimedia/mediaservices/base/qmediaservice.h new file mode 100644 index 0000000..060019b --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaservice.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QABSTRACTMEDIASERVICE_H +#define QABSTRACTMEDIASERVICE_H + +#include +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QMediaServicePrivate; +class Q_MULTIMEDIA_EXPORT QMediaService : public QObject +{ + Q_OBJECT + +public: + ~QMediaService(); + + virtual QMediaControl* control(const char *name) const = 0; + +#ifndef QT_NO_MEMBER_TEMPLATES + template inline T control() const { + if (QObject *object = control(qmediacontrol_iid())) { + return qobject_cast(object); + } + return 0; + } +#endif + +protected: + QMediaService(QObject* parent); + QMediaService(QMediaServicePrivate &dd, QObject *parent); + + QMediaServicePrivate *d_ptr; + +private: + Q_DECLARE_PRIVATE(QMediaService) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTMEDIASERVICE_H + diff --git a/src/multimedia/mediaservices/base/qmediaservice_p.h b/src/multimedia/mediaservices/base/qmediaservice_p.h new file mode 100644 index 0000000..e60e669 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaservice_p.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QABSTRACTMEDIASERVICE_P_H +#define QABSTRACTMEDIASERVICE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QAudioDeviceControl; + +class QMediaServicePrivate +{ +public: + QMediaServicePrivate(): q_ptr(0) {} + virtual ~QMediaServicePrivate() {} + + QMediaService *q_ptr; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qmediaserviceprovider.cpp b/src/multimedia/mediaservices/base/qmediaserviceprovider.cpp new file mode 100644 index 0000000..48d245d --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaserviceprovider.cpp @@ -0,0 +1,738 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 +#include +#include "qmediapluginloader_p.h" +#include + +QT_BEGIN_NAMESPACE + +class QMediaServiceProviderHintPrivate : public QSharedData +{ +public: + QMediaServiceProviderHintPrivate(QMediaServiceProviderHint::Type type) + :type(type), features(0) + { + } + + QMediaServiceProviderHintPrivate(const QMediaServiceProviderHintPrivate &other) + :QSharedData(other), + type(other.type), + device(other.device), + mimeType(other.mimeType), + codecs(other.codecs), + features(other.features) + { + } + + ~QMediaServiceProviderHintPrivate() + { + } + + QMediaServiceProviderHint::Type type; + QByteArray device; + QString mimeType; + QStringList codecs; + QMediaServiceProviderHint::Features features; +}; + +/*! + \class QMediaServiceProviderHint + \preliminary + \since 4.7 + \brief The QMediaServiceProviderHint class describes what is required of a QMediaService. + + \ingroup multimedia-serv + + The QMediaServiceProvider class uses hints to select an appropriate media service. +*/ + +/*! + \enum QMediaServiceProviderHint::Feature + + Enumerates features a media service may provide. + + \value LowLatencyPlayback + The service is expected to play simple audio formats, + but playback should start without significant delay. + Such playback service can be used for beeps, ringtones, etc. + + \value RecordingSupport + The service provides audio or video recording functions. + + \value StreamPlayback + The service is capable of playing QIODevice based streams. +*/ + +/*! + \enum QMediaServiceProviderHint::Type + + Enumerates the possible types of media service provider hint. + + \value Null En empty hint, use the default service. + \value ContentType Select media service most suitable for certain content type. + \value Device Select media service which supports certain device. + \value SupportedFeatures Select media service supporting the set of optional features. +*/ + + +/*! + Constructs an empty media service provider hint. +*/ +QMediaServiceProviderHint::QMediaServiceProviderHint() + :d(new QMediaServiceProviderHintPrivate(Null)) +{ +} + +/*! + Constructs a ContentType media service provider hint. + + This type of hint describes a service that is able to play content of a specific MIME \a type + encoded with one or more of the listed \a codecs. +*/ +QMediaServiceProviderHint::QMediaServiceProviderHint(const QString &type, const QStringList& codecs) + :d(new QMediaServiceProviderHintPrivate(ContentType)) +{ + d->mimeType = type; + d->codecs = codecs; +} + +/*! + Constructs a Device media service provider hint. + + This type of hint describes a media service that utilizes a specific \a device. +*/ +QMediaServiceProviderHint::QMediaServiceProviderHint(const QByteArray &device) + :d(new QMediaServiceProviderHintPrivate(Device)) +{ + d->device = device; +} + +/*! + Constructs a SupportedFeatures media service provider hint. + + This type of hint describes a service which supports a specific set of \a features. +*/ +QMediaServiceProviderHint::QMediaServiceProviderHint(QMediaServiceProviderHint::Features features) + :d(new QMediaServiceProviderHintPrivate(SupportedFeatures)) +{ + d->features = features; +} + +/*! + Constructs a copy of the media service provider hint \a other. +*/ +QMediaServiceProviderHint::QMediaServiceProviderHint(const QMediaServiceProviderHint &other) + :d(other.d) +{ +} + +/*! + Destroys a media service provider hint. +*/ +QMediaServiceProviderHint::~QMediaServiceProviderHint() +{ +} + +/*! + Assigns the value \a other to a media service provider hint. +*/ +QMediaServiceProviderHint& QMediaServiceProviderHint::operator=(const QMediaServiceProviderHint &other) +{ + d = other.d; + return *this; +} + +/*! + Identifies if \a other is of equal value to a media service provider hint. + + Returns true if the hints are equal, and false if they are not. +*/ +bool QMediaServiceProviderHint::operator == (const QMediaServiceProviderHint &other) const +{ + return (d == other.d) || + (d->type == other.d->type && + d->device == other.d->device && + d->mimeType == other.d->mimeType && + d->codecs == other.d->codecs && + d->features == other.d->features); +} + +/*! + Identifies if \a other is not of equal value to a media service provider hint. + + Returns true if the hints are not equal, and false if they are. +*/ +bool QMediaServiceProviderHint::operator != (const QMediaServiceProviderHint &other) const +{ + return !(*this == other); +} + +/*! + Returns true if a media service provider is null. +*/ +bool QMediaServiceProviderHint::isNull() const +{ + return d->type == Null; +} + +/*! + Returns the type of a media service provider hint. +*/ +QMediaServiceProviderHint::Type QMediaServiceProviderHint::type() const +{ + return d->type; +} + +/*! + Returns the mime type of the media a service is expected to be able play. +*/ +QString QMediaServiceProviderHint::mimeType() const +{ + return d->mimeType; +} + +/*! + Returns a list of codes a media service is expected to be able to decode. +*/ +QStringList QMediaServiceProviderHint::codecs() const +{ + return d->codecs; +} + +/*! + Returns the name of a device a media service is expected to utilize. +*/ +QByteArray QMediaServiceProviderHint::device() const +{ + return d->device; +} + +/*! + Returns a set of features a media service is expected to provide. +*/ +QMediaServiceProviderHint::Features QMediaServiceProviderHint::features() const +{ + return d->features; +} + + +Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, loader, + (QMediaServiceProviderFactoryInterface_iid, QLatin1String("/mediaservices"), Qt::CaseInsensitive)) + + +class QPluginServiceProvider : public QMediaServiceProvider +{ + QMap pluginMap; + +public: + QMediaService* requestService(const QByteArray &type, const QMediaServiceProviderHint &hint) + { + QString key(QString::fromLatin1(type.constData(),type.length())); + + QListplugins; + foreach (QObject *obj, loader()->instances(key)) { + QMediaServiceProviderPlugin *plugin = + qobject_cast(obj); + if (plugin) + plugins << plugin; + } + + if (!plugins.isEmpty()) { + QMediaServiceProviderPlugin *plugin = 0; + + switch (hint.type()) { + case QMediaServiceProviderHint::Null: + plugin = plugins[0]; + //special case for media player, if low latency was not asked, + //prefer services not offering it, since they are likely to support + //more formats + if (type == QByteArray(Q_MEDIASERVICE_MEDIAPLAYER)) { + foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { + QMediaServiceFeaturesInterface *iface = + qobject_cast(currentPlugin); + + if (!iface || !(iface->supportedFeatures(type) & + QMediaServiceProviderHint::LowLatencyPlayback)) { + plugin = currentPlugin; + break; + } + + } + } + break; + case QMediaServiceProviderHint::SupportedFeatures: + plugin = plugins[0]; + foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { + QMediaServiceFeaturesInterface *iface = + qobject_cast(currentPlugin); + + if (iface) { + if ((iface->supportedFeatures(type) & hint.features()) == hint.features()) { + plugin = currentPlugin; + break; + } + } + } + break; + case QMediaServiceProviderHint::Device: { + foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { + QMediaServiceSupportedDevicesInterface *iface = + qobject_cast(currentPlugin); + + if (!iface) { + // the plugin may support the device, + // but this choice still can be overridden + plugin = currentPlugin; + } else { + if (iface->devices(type).contains(hint.device())) { + plugin = currentPlugin; + break; + } + } + } + } + break; + case QMediaServiceProviderHint::ContentType: { + QtMediaservices::SupportEstimate estimate = QtMediaservices::NotSupported; + foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { + QtMediaservices::SupportEstimate currentEstimate = QtMediaservices::MaybeSupported; + QMediaServiceSupportedFormatsInterface *iface = + qobject_cast(currentPlugin); + + if (iface) + currentEstimate = iface->hasSupport(hint.mimeType(), hint.codecs()); + + if (currentEstimate > estimate) { + estimate = currentEstimate; + plugin = currentPlugin; + + if (currentEstimate == QtMediaservices::PreferredService) + break; + } + } + } + break; + } + + if (plugin != 0) { + QMediaService *service = plugin->create(key); + if (service != 0) + pluginMap.insert(service, plugin); + + return service; + } + } + + qWarning() << "defaultServiceProvider::requestService(): no service found for -" << key; + return 0; + } + + void releaseService(QMediaService *service) + { + if (service != 0) { + QMediaServiceProviderPlugin *plugin = pluginMap.take(service); + + if (plugin != 0) + plugin->release(service); + } + } + + QtMediaservices::SupportEstimate hasSupport(const QByteArray &serviceType, + const QString &mimeType, + const QStringList& codecs, + int flags) const + { + QList instances = loader()->instances( + QString::fromLatin1(serviceType.constData(),serviceType.length())); + + if (instances.isEmpty()) + return QtMediaservices::NotSupported; + + bool allServicesProvideInterface = true; + QtMediaservices::SupportEstimate supportEstimate = QtMediaservices::NotSupported; + + foreach(QObject *obj, instances) { + QMediaServiceSupportedFormatsInterface *iface = + qobject_cast(obj); + + + if (flags) { + QMediaServiceFeaturesInterface *iface = + qobject_cast(obj); + + if (iface) { + QMediaServiceProviderHint::Features features = iface->supportedFeatures(serviceType); + + //if low latency playback was asked, skip services known + //not to provide low latency playback + if ((flags & QMediaPlayer::LowLatency) && + !(features & QMediaServiceProviderHint::LowLatencyPlayback)) + continue; + + //the same for QIODevice based streams support + if ((flags & QMediaPlayer::StreamPlayback) && + !(features & QMediaServiceProviderHint::StreamPlayback)) + continue; + } + } + + if (iface) + supportEstimate = qMax(supportEstimate, iface->hasSupport(mimeType, codecs)); + else + allServicesProvideInterface = false; + } + + //don't return PreferredService + supportEstimate = qMin(supportEstimate, QtMediaservices::ProbablySupported); + + //Return NotSupported only if no services are available of serviceType + //or all the services returned NotSupported, otherwise return at least MaybeSupported + if (!allServicesProvideInterface) + supportEstimate = qMax(QtMediaservices::MaybeSupported, supportEstimate); + + return supportEstimate; + } + + QStringList supportedMimeTypes(const QByteArray &serviceType, int flags) const + { + QList instances = loader()->instances( + QString::fromLatin1(serviceType.constData(),serviceType.length())); + + QStringList supportedTypes; + + foreach(QObject *obj, instances) { + QMediaServiceSupportedFormatsInterface *iface = + qobject_cast(obj); + + + if (flags & QMediaPlayer::LowLatency) { + QMediaServiceFeaturesInterface *iface = + qobject_cast(obj); + + if (iface) { + QMediaServiceProviderHint::Features features = iface->supportedFeatures(serviceType); + + // If low latency playback was asked for, skip MIME types from services known + // not to provide low latency playback + if ((flags & QMediaPlayer::LowLatency) && + !(features & QMediaServiceProviderHint::LowLatencyPlayback)) + continue; + + //the same for QIODevice based streams support + if ((flags & QMediaPlayer::StreamPlayback) && + !(features & QMediaServiceProviderHint::StreamPlayback)) + continue; + } + } + + if (iface) { + supportedTypes << iface->supportedMimeTypes(); + } + } + + // Multiple services may support the same MIME type + supportedTypes.removeDuplicates(); + + return supportedTypes; + } + + QList devices(const QByteArray &serviceType) const + { + QList res; + + foreach(QObject *obj, loader()->instances( + QString::fromLatin1(serviceType.constData(),serviceType.length()))) { + QMediaServiceSupportedDevicesInterface *iface = + qobject_cast(obj); + + if (iface) { + res.append(iface->devices(serviceType)); + } + } + + return res; + } + + QString deviceDescription(const QByteArray &serviceType, const QByteArray &device) + { + foreach(QObject *obj, loader()->instances( + QString::fromLatin1(serviceType.constData(),serviceType.length()))) { + QMediaServiceSupportedDevicesInterface *iface = + qobject_cast(obj); + + if (iface) { + if (iface->devices(serviceType).contains(device)) + return iface->deviceDescription(serviceType, device); + } + } + + return QString(); + } +}; + +Q_GLOBAL_STATIC(QPluginServiceProvider, pluginProvider); + +/*! + \class QMediaServiceProvider + \preliminary + \since 4.7 + \brief The QMediaServiceProvider class provides an abstract allocator for media services. +*/ + +/*! + \fn QMediaServiceProvider::requestService(const QByteArray &type, const QMediaServiceProviderHint &hint) + + Requests an instance of a \a type service which best matches the given \a hint. + + Returns a pointer to the requested service, or a null pointer if there is no suitable service. + + The returned service must be released with releaseService when it is finished with. +*/ + +/*! + \fn QMediaServiceProvider::releaseService(QMediaService *service) + + Releases a media \a service requested with requestService(). +*/ + +/*! + \fn QtMediaservices::SupportEstimate QMediaServiceProvider::hasSupport(const QByteArray &serviceType, const QString &mimeType, const QStringList& codecs, int flags) const + + Returns how confident a media service provider is that is can provide a \a serviceType + service that is able to play media of a specific \a mimeType that is encoded using the listed + \a codecs while adhearing to constraints identified in \a flags. +*/ +QtMediaservices::SupportEstimate QMediaServiceProvider::hasSupport(const QByteArray &serviceType, + const QString &mimeType, + const QStringList& codecs, + int flags) const +{ + Q_UNUSED(serviceType); + Q_UNUSED(mimeType); + Q_UNUSED(codecs); + Q_UNUSED(flags); + + return QtMediaservices::MaybeSupported; +} + +/*! + \fn QStringList QMediaServiceProvider::supportedMimeTypes(const QByteArray &serviceType, int flags) const + + Returns a list of MIME types supported by the service provider for the specified \a serviceType. + + The resultant list is restricted to MIME types which can be supported given the constraints in \a flags. +*/ +QStringList QMediaServiceProvider::supportedMimeTypes(const QByteArray &serviceType, int flags) const +{ + Q_UNUSED(serviceType); + Q_UNUSED(flags); + + return QStringList(); +} + +/*! + Returns the list of devices related to \a service type. +*/ +QList QMediaServiceProvider::devices(const QByteArray &service) const +{ + Q_UNUSED(service); + return QList(); +} + +/*! + Returns the description of \a device related to \a serviceType, + suitable to be displayed to user. +*/ +QString QMediaServiceProvider::deviceDescription(const QByteArray &serviceType, const QByteArray &device) +{ + Q_UNUSED(serviceType); + Q_UNUSED(device); + return QString(); +} + + +#ifdef QT_BUILD_INTERNAL + +static QMediaServiceProvider *qt_defaultMediaServiceProvider = 0; + +/*! + Sets a media service \a provider as the default. + + \internal +*/ +void QMediaServiceProvider::setDefaultServiceProvider(QMediaServiceProvider *provider) +{ + qt_defaultMediaServiceProvider = provider; +} + +#endif + +/*! + Returns a default provider of media services. +*/ +QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider() +{ +#ifdef QT_BUILD_INTERNAL + return qt_defaultMediaServiceProvider != 0 + ? qt_defaultMediaServiceProvider + : static_cast(pluginProvider()); +#else + return pluginProvider(); +#endif +} + +/*! + \class QMediaServiceProviderPlugin + \preliminary + \since 4.7 + \brief The QMediaServiceProviderPlugin class interface provides an interface for QMediaService + plug-ins. + + A media service provider plug-in may implement one or more of + QMediaServiceSupportedFormatsInterface, QMediaServiceSupportedDevicesInterface, + and QMediaServiceFeaturesInterface to identify the features it supports. +*/ + +/*! + \fn QMediaServiceProviderPlugin::keys() const + + Returns a list of keys for media services a plug-in can create. +*/ + +/*! + \fn QMediaServiceProviderPlugin::create(const QString &key) + + Constructs a new instance of the QMediaService identified by \a key. + + The QMediaService returned must be destroyed with release(). +*/ + +/*! + \fn QMediaServiceProviderPlugin::release(QMediaService *service) + + Destroys a media \a service constructed with create(). +*/ + + +/*! + \class QMediaServiceSupportedFormatsInterface + \brief The QMediaServiceSupportedFormatsInterface class interface + identifies if a media service plug-in supports a media format. + \since 4.7 + + A QMediaServiceProviderPlugin may implement this interface. +*/ + +/*! + \fn QMediaServiceSupportedFormatsInterface::~QMediaServiceSupportedFormatsInterface() + + Destroys a media service supported formats interface. +*/ + +/*! + \fn QMediaServiceSupportedFormatsInterface::hasSupport(const QString &mimeType, const QStringList& codecs) const + + Returns the level of support a media service plug-in has for a \a mimeType and set of \a codecs. +*/ + +/*! + \fn QMediaServiceSupportedFormatsInterface::supportedMimeTypes() const + + Returns a list of MIME types supported by the media service plug-in. +*/ + +/*! + \class QMediaServiceSupportedDevicesInterface + \brief The QMediaServiceSupportedDevicesInterface class interface + identifies the devices supported by a media service plug-in. + \since 4.7 + + A QMediaServiceProviderPlugin may implement this interface. +*/ + +/*! + \fn QMediaServiceSupportedDevicesInterface::~QMediaServiceSupportedDevicesInterface() + + Destroys a media service supported devices interface. +*/ + +/*! + \fn QMediaServiceSupportedDevicesInterface::devices(const QByteArray &service) const + + Returns a list of devices supported by a plug-in \a service. +*/ + +/*! + \fn QMediaServiceSupportedDevicesInterface::deviceDescription(const QByteArray &service, const QByteArray &device) + + Returns a description of a \a device supported by a plug-in \a service. +*/ + +/*! + \class QMediaServiceFeaturesInterface + \brief The QMediaServiceFeaturesInterface class interface identifies + features supported by a media service plug-in. + \since 4.7 + + A QMediaServiceProviderPlugin may implement this interface. +*/ + +/*! + \fn QMediaServiceFeaturesInterface::~QMediaServiceFeaturesInterface() + + Destroys a media service features interface. +*/ +/*! + \fn QMediaServiceFeaturesInterface::supportedFeatures(const QByteArray &service) const + + Returns a set of features supported by a plug-in \a service. +*/ + +QT_END_NAMESPACE + +#include "moc_qmediaserviceprovider.cpp" +#include "moc_qmediaserviceproviderplugin.cpp" diff --git a/src/multimedia/mediaservices/base/qmediaserviceprovider.h b/src/multimedia/mediaservices/base/qmediaserviceprovider.h new file mode 100644 index 0000000..45021c7 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaserviceprovider.h @@ -0,0 +1,174 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIASERVICEPROVIDER_H +#define QMEDIASERVICEPROVIDER_H + +#include +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QMediaService; + +class QMediaServiceProviderHintPrivate; +class Q_MULTIMEDIA_EXPORT QMediaServiceProviderHint +{ +public: + enum Type { Null, ContentType, Device, SupportedFeatures }; + + enum Feature { + LowLatencyPlayback = 0x01, + RecordingSupport = 0x02, + StreamPlayback = 0x04 + }; + Q_DECLARE_FLAGS(Features, Feature) + + QMediaServiceProviderHint(); + QMediaServiceProviderHint(const QString &mimeType, const QStringList& codecs); + QMediaServiceProviderHint(const QByteArray &device); + QMediaServiceProviderHint(Features features); + QMediaServiceProviderHint(const QMediaServiceProviderHint &other); + ~QMediaServiceProviderHint(); + + QMediaServiceProviderHint& operator=(const QMediaServiceProviderHint &other); + + bool operator == (const QMediaServiceProviderHint &other) const; + bool operator != (const QMediaServiceProviderHint &other) const; + + bool isNull() const; + + Type type() const; + + QString mimeType() const; + QStringList codecs() const; + + QByteArray device() const; + + Features features() const; + + //to be extended, if necessary + +private: + QSharedDataPointer d; +}; + +class Q_MULTIMEDIA_EXPORT QMediaServiceProvider : public QObject +{ + Q_OBJECT + +public: + virtual QMediaService* requestService(const QByteArray &type, const QMediaServiceProviderHint &hint = QMediaServiceProviderHint()) = 0; + virtual void releaseService(QMediaService *service) = 0; + + virtual QtMediaservices::SupportEstimate hasSupport(const QByteArray &serviceType, + const QString &mimeType, + const QStringList& codecs, + int flags = 0) const; + virtual QStringList supportedMimeTypes(const QByteArray &serviceType, int flags = 0) const; + + virtual QList devices(const QByteArray &serviceType) const; + virtual QString deviceDescription(const QByteArray &serviceType, const QByteArray &device); + + static QMediaServiceProvider* defaultServiceProvider(); + +#ifdef QT_BUILD_INTERNAL + static void setDefaultServiceProvider(QMediaServiceProvider *provider); +#endif +}; + +/*! + Service with support for media playback + Required Controls: QMediaPlayerControl + Optional Controls: QMediaPlaylistControl, QAudioDeviceControl + Video Output Controls (used by QWideoWidget and QGraphicsVideoItem): + Required: QVideoOutputControl + Optional: QVideoWindowControl, QVideoRendererControl, QVideoWidgetControl +*/ +#define Q_MEDIASERVICE_MEDIAPLAYER "com.nokia.qt.mediaplayer" + +/*! + Service with support for recording from audio sources + Required Controls: QAudioDeviceControl + Recording Controls (QMediaRecorder): + Required: QMediaRecorderControl + Recommended: QAudioEncoderControl + Optional: QMediaContainerControl +*/ +#define Q_MEDIASERVICE_AUDIOSOURCE "com.nokia.qt.audiosource" + +/*! + Service with support for camera use. + Required Controls: QCameraControl + Optional Controls: QCameraExposureControl, QCameraFocusControl, QImageProcessingControl + Still Capture Controls: QImageCaptureControl + Recording Controls (QMediaRecorder): + Required: QMediaRecorderControl + Recommended: QAudioEncoderControl, QVideoEncoderControl, QMediaContainerControl + Viewfinder Video Output Controls (used by QWideoWidget and QGraphicsVideoItem): + Required: QVideoOutputControl + Optional: QVideoWindowControl, QVideoRendererControl, QVideoWidgetControl +*/ +#define Q_MEDIASERVICE_CAMERA "com.nokia.qt.camera" + +/*! + Service with support for radio tuning. + Required Controls: QRadioTunerControl + Recording Controls (Optional, used by QMediaRecorder): + Required: QMediaRecorderControl + Recommended: QAudioEncoderControl + Optional: QMediaContainerControl +*/ +#define Q_MEDIASERVICE_RADIO "com.nokia.qt.radio" + + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIASERVICEPROVIDER_H diff --git a/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h b/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h new file mode 100644 index 0000000..bc41845 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIASERVICEPROVIDERPLUGIN_H +#define QMEDIASERVICEPROVIDERPLUGIN_H + +#include +#include +#include + +#include + +#ifdef Q_MOC_RUN +# pragma Q_MOC_EXPAND_MACROS +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QMediaService; + + +struct Q_MULTIMEDIA_EXPORT QMediaServiceProviderFactoryInterface : public QFactoryInterface +{ + virtual QStringList keys() const = 0; + virtual QMediaService* create(QString const& key) = 0; + virtual void release(QMediaService *service) = 0; +}; + +#define QMediaServiceProviderFactoryInterface_iid \ + "com.nokia.Qt.QMediaServiceProviderFactoryInterface/1.0" +Q_DECLARE_INTERFACE(QMediaServiceProviderFactoryInterface, QMediaServiceProviderFactoryInterface_iid) + + +struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedFormatsInterface +{ + virtual ~QMediaServiceSupportedFormatsInterface() {} + virtual QtMediaservices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const = 0; + virtual QStringList supportedMimeTypes() const = 0; +}; + +#define QMediaServiceSupportedFormatsInterface_iid \ + "com.nokia.Qt.QMediaServiceSupportedFormatsInterface/1.0" +Q_DECLARE_INTERFACE(QMediaServiceSupportedFormatsInterface, QMediaServiceSupportedFormatsInterface_iid) + + +struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedDevicesInterface +{ + virtual ~QMediaServiceSupportedDevicesInterface() {} + virtual QList devices(const QByteArray &service) const = 0; + virtual QString deviceDescription(const QByteArray &service, const QByteArray &device) = 0; +}; + +#define QMediaServiceSupportedDevicesInterface_iid \ + "com.nokia.Qt.QMediaServiceSupportedDevicesInterface/1.0" +Q_DECLARE_INTERFACE(QMediaServiceSupportedDevicesInterface, QMediaServiceSupportedDevicesInterface_iid) + + +struct Q_MULTIMEDIA_EXPORT QMediaServiceFeaturesInterface +{ + virtual ~QMediaServiceFeaturesInterface() {} + virtual QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const = 0; +}; + +#define QMediaServiceFeaturesInterface_iid \ + "com.nokia.Qt.QMediaServiceFeaturesInterface/1.0" +Q_DECLARE_INTERFACE(QMediaServiceFeaturesInterface, QMediaServiceFeaturesInterface_iid) + +class Q_MULTIMEDIA_EXPORT QMediaServiceProviderPlugin : public QObject, public QMediaServiceProviderFactoryInterface +{ + Q_OBJECT + Q_INTERFACES(QMediaServiceProviderFactoryInterface:QFactoryInterface) + +public: + virtual QStringList keys() const = 0; + virtual QMediaService* create(const QString& key) = 0; + virtual void release(QMediaService *service) = 0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIASERVICEPROVIDERPLUGIN_H diff --git a/src/multimedia/mediaservices/base/qmediatimerange.cpp b/src/multimedia/mediaservices/base/qmediatimerange.cpp new file mode 100644 index 0000000..74f54dd --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediatimerange.cpp @@ -0,0 +1,708 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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 + + +QT_BEGIN_NAMESPACE + +/*! + \class QMediaTimeInterval + \brief The QMediaTimeInterval class represents a time interval with integer precision. + \ingroup multimedia + \since 4.7 + + An interval is specified by an inclusive start() and end() time. + These must be set in the constructor, as this is an immutable class. + The specific units of time represented by the class have not been defined - + it is suitable for any times which can be represented by a signed 64 bit integer. + + The isNormal() method determines if a time interval is normal + (a normal time interval has start() <= end()). An abnormal interval can be converted + in to a normal interval by calling the normalized() method. + + The contains() method determines if a specified time lies within + the time interval. + + The translated() method returns a time interval which has been translated + forwards or backwards through time by a specified offset. + + \sa QMediaTimeRange +*/ + +/*! + \fn QMediaTimeInterval::QMediaTimeInterval() + + Constructs an empty interval. +*/ +QMediaTimeInterval::QMediaTimeInterval() + : s(0) + , e(0) +{ + +} + +/*! + \fn QMediaTimeInterval::QMediaTimeInterval(qint64 start, qint64 end) + + Constructs an interval with the specified \a start and \a end times. +*/ +QMediaTimeInterval::QMediaTimeInterval(qint64 start, qint64 end) + : s(start) + , e(end) +{ + +} + +/*! + \fn QMediaTimeInterval::QMediaTimeInterval(const QMediaTimeInterval &other) + + Constructs an interval by taking a copy of \a other. +*/ +QMediaTimeInterval::QMediaTimeInterval(const QMediaTimeInterval &other) + : s(other.s) + , e(other.e) +{ + +} + +/*! + \fn QMediaTimeInterval::start() const + + Returns the start time of the interval. + + \sa end() +*/ +qint64 QMediaTimeInterval::start() const +{ + return s; +} + +/*! + \fn QMediaTimeInterval::end() const + + Returns the end time of the interval. + + \sa start() +*/ +qint64 QMediaTimeInterval::end() const +{ + return e; +} + +/*! + \fn QMediaTimeInterval::contains(qint64 time) const + + Returns true if the time interval contains the specified \a time. + That is, start() <= time <= end(). +*/ +bool QMediaTimeInterval::contains(qint64 time) const +{ + return isNormal() ? (s <= time && time <= e) + : (e <= time && time <= s); +} + +/*! + \fn QMediaTimeInterval::isNormal() const + + Returns true if this time interval is normal. + A normal time interval has start() <= end(). + + \sa normalized() +*/ +bool QMediaTimeInterval::isNormal() const +{ + return s <= e; +} + +/*! + \fn QMediaTimeInterval::normalized() const + + Returns a normalized version of this interval. + + If the start() time of the interval is greater than the end() time, + then the returned interval has the start and end times swapped. +*/ +QMediaTimeInterval QMediaTimeInterval::normalized() const +{ + if(s > e) + return QMediaTimeInterval(e, s); + + return *this; +} + +/*! + \fn QMediaTimeInterval::translated(qint64 offset) const + + Returns a copy of this time interval, translated by a value of \a offset. + An interval can be moved forward through time with a positive offset, or backward + through time with a negative offset. +*/ +QMediaTimeInterval QMediaTimeInterval::translated(qint64 offset) const +{ + return QMediaTimeInterval(s + offset, e + offset); +} + +/*! + \fn operator==(const QMediaTimeInterval &a, const QMediaTimeInterval &b) + \relates QMediaTimeRange + + Returns true if \a a is exactly equal to \a b. +*/ +bool operator==(const QMediaTimeInterval &a, const QMediaTimeInterval &b) +{ + return a.start() == b.start() && a.end() == b.end(); +} + +/*! + \fn operator!=(const QMediaTimeInterval &a, const QMediaTimeInterval &b) + \relates QMediaTimeRange + + Returns true if \a a is not exactly equal to \a b. +*/ +bool operator!=(const QMediaTimeInterval &a, const QMediaTimeInterval &b) +{ + return a.start() != b.start() || a.end() != b.end(); +} + +class QMediaTimeRangePrivate : public QSharedData +{ +public: + + QMediaTimeRangePrivate(); + QMediaTimeRangePrivate(const QMediaTimeRangePrivate &other); + QMediaTimeRangePrivate(const QMediaTimeInterval &interval); + + QList intervals; + + void addInterval(const QMediaTimeInterval &interval); + void removeInterval(const QMediaTimeInterval &interval); +}; + +QMediaTimeRangePrivate::QMediaTimeRangePrivate() + : QSharedData() +{ + +} + +QMediaTimeRangePrivate::QMediaTimeRangePrivate(const QMediaTimeRangePrivate &other) + : QSharedData() + , intervals(other.intervals) +{ + +} + +QMediaTimeRangePrivate::QMediaTimeRangePrivate(const QMediaTimeInterval &interval) + : QSharedData() +{ + if(interval.isNormal()) + intervals << interval; +} + +void QMediaTimeRangePrivate::addInterval(const QMediaTimeInterval &interval) +{ + // Handle normalized intervals only + if(!interval.isNormal()) + return; + + // Find a place to insert the interval + int i; + for (i = 0; i < intervals.count(); i++) { + // Insert before this element + if(interval.s < intervals[i].s) { + intervals.insert(i, interval); + break; + } + } + + // Interval needs to be added to the end of the list + if (i == intervals.count()) + intervals.append(interval); + + // Do we need to correct the element before us? + if(i > 0 && intervals[i - 1].e >= interval.s - 1) + i--; + + // Merge trailing ranges + while (i < intervals.count() - 1 + && intervals[i].e >= intervals[i + 1].s - 1) { + intervals[i].e = qMax(intervals[i].e, intervals[i + 1].e); + intervals.removeAt(i + 1); + } +} + +void QMediaTimeRangePrivate::removeInterval(const QMediaTimeInterval &interval) +{ + // Handle normalized intervals only + if(!interval.isNormal()) + return; + + for (int i = 0; i < intervals.count(); i++) { + QMediaTimeInterval r = intervals[i]; + + if (r.e < interval.s) { + // Before the removal interval + continue; + } else if (interval.e < r.s) { + // After the removal interval - stop here + break; + } else if (r.s < interval.s && interval.e < r.e) { + // Split case - a single range has a chunk removed + intervals[i].e = interval.s -1; + addInterval(QMediaTimeInterval(interval.e + 1, r.e)); + break; + } else if (r.s < interval.s) { + // Trimming Tail Case + intervals[i].e = interval.s - 1; + } else if (interval.e < r.e) { + // Trimming Head Case - we can stop after this + intervals[i].s = interval.e + 1; + break; + } else { + // Complete coverage case + intervals.removeAt(i); + --i; + } + } +} + +/*! + \class QMediaTimeRange + \brief The QMediaTimeRange class represents a set of zero or more disjoint + time intervals. + \ingroup multimedia + \since 4.7 + + \reentrant + + The earliestTime(), latestTime(), intervals() and isEmpty() + methods are used to get information about the current time range. + + The addInterval(), removeInterval() and clear() methods are used to modify + the current time range. + + When adding or removing intervals from the time range, existing intervals + within the range may be expanded, trimmed, deleted, merged or split to ensure + that all intervals within the time range remain distinct and disjoint. As a + consequence, all intervals added or removed from a time range must be + \l{QMediaTimeInterval::isNormal()}{normal}. + + \sa QMediaTimeInterval +*/ + +/*! + \fn QMediaTimeRange::QMediaTimeRange() + + Constructs an empty time range. +*/ +QMediaTimeRange::QMediaTimeRange() + : d(new QMediaTimeRangePrivate) +{ + +} + +/*! + \fn QMediaTimeRange::QMediaTimeRange(qint64 start, qint64 end) + + Constructs a time range that contains an initial interval from + \a start to \a end inclusive. + + If the interval is not \l{QMediaTimeInterval::isNormal()}{normal}, + the resulting time range will be empty. + + \sa addInterval() +*/ +QMediaTimeRange::QMediaTimeRange(qint64 start, qint64 end) + : d(new QMediaTimeRangePrivate(QMediaTimeInterval(start, end))) +{ + +} + +/*! + \fn QMediaTimeRange::QMediaTimeRange(const QMediaTimeInterval &interval) + + Constructs a time range that contains an intitial interval, \a interval. + + If \a interval is not \l{QMediaTimeInterval::isNormal()}{normal}, + the resulting time range will be empty. + + \sa addInterval() +*/ +QMediaTimeRange::QMediaTimeRange(const QMediaTimeInterval &interval) + : d(new QMediaTimeRangePrivate(interval)) +{ + +} + +/*! + \fn QMediaTimeRange::QMediaTimeRange(const QMediaTimeRange &range) + + Constructs a time range by copying another time \a range. +*/ +QMediaTimeRange::QMediaTimeRange(const QMediaTimeRange &range) + : d(range.d) +{ + +} + +/*! + \fn QMediaTimeRange::~QMediaTimeRange() + + Destructor. +*/ +QMediaTimeRange::~QMediaTimeRange() +{ + +} + +/*! + \fn QMediaTimeRange::operator=(const QMediaTimeRange &other) + + Takes a copy of the \a other time range and returns itself. +*/ +QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeRange &other) +{ + d = other.d; + return *this; +} + +/*! + \fn QMediaTimeRange::operator=(const QMediaTimeInterval &interval) + + Sets the time range to a single continuous interval, \a interval. +*/ +QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeInterval &interval) +{ + d = new QMediaTimeRangePrivate(interval); + return *this; +} + +/*! + \fn QMediaTimeRange::earliestTime() const + + Returns the earliest time within the time range. + + For empty time ranges, this value is equal to zero. + + \sa latestTime() +*/ +qint64 QMediaTimeRange::earliestTime() const +{ + if (!d->intervals.isEmpty()) + return d->intervals[0].s; + + return 0; +} + +/*! + \fn QMediaTimeRange::latestTime() const + + Returns the latest time within the time range. + + For empty time ranges, this value is equal to zero. + + \sa earliestTime() +*/ +qint64 QMediaTimeRange::latestTime() const +{ + if (!d->intervals.isEmpty()) + return d->intervals[d->intervals.count() - 1].e; + + return 0; +} + +/*! + \fn QMediaTimeRange::addInterval(qint64 start, qint64 end) + \overload + + Adds the interval specified by \a start and \a end + to the time range. + + \sa addInterval() +*/ +void QMediaTimeRange::addInterval(qint64 start, qint64 end) +{ + d->addInterval(QMediaTimeInterval(start, end)); +} + +/*! + \fn QMediaTimeRange::addInterval(const QMediaTimeInterval &interval) + + Adds the specified \a interval to the time range. + + Adding intervals which are not \l{QMediaTimeInterval::isNormal()}{normal} + is invalid, and will be ignored. + + If the specified interval is adjacent to, or overlaps existing + intervals within the time range, these intervals will be merged. + + This operation takes \l{linear time} + + \sa removeInterval() +*/ +void QMediaTimeRange::addInterval(const QMediaTimeInterval &interval) +{ + d->addInterval(interval); +} + +/*! + \fn QMediaTimeRange::addTimeRange(const QMediaTimeRange &range) + + Adds each of the intervals in \a range to this time range. + + Equivalent to calling addInterval() for each interval in \a range. +*/ +void QMediaTimeRange::addTimeRange(const QMediaTimeRange &range) +{ + foreach(const QMediaTimeInterval &i, range.intervals()) { + d->addInterval(i); + } +} + +/*! + \fn QMediaTimeRange::removeInterval(qint64 start, qint64 end) + \overload + + Removes the interval specified by \a start and \a end + from the time range. + + \sa removeInterval() +*/ +void QMediaTimeRange::removeInterval(qint64 start, qint64 end) +{ + d->removeInterval(QMediaTimeInterval(start, end)); +} + +/*! + \fn QMediaTimeRange::removeInterval(const QMediaTimeInterval &interval) + + Removes the specified \a interval from the time range. + + Removing intervals which are not \l{QMediaTimeInterval::isNormal()}{normal} + is invalid, and will be ignored. + + Intervals within the time range will be trimmed, split or deleted + such that no intervals within the time range include any part of the + target interval. + + This operation takes \l{linear time} + + \sa addInterval() +*/ +void QMediaTimeRange::removeInterval(const QMediaTimeInterval &interval) +{ + d->removeInterval(interval); +} + +/*! + \fn QMediaTimeRange::removeTimeRange(const QMediaTimeRange &range) + + Removes each of the intervals in \a range from this time range. + + Equivalent to calling removeInterval() for each interval in \a range. +*/ +void QMediaTimeRange::removeTimeRange(const QMediaTimeRange &range) +{ + foreach(const QMediaTimeInterval &i, range.intervals()) { + d->removeInterval(i); + } +} + +/*! + \fn QMediaTimeRange::operator+=(const QMediaTimeRange &other) + + Adds each interval in \a other to the time range and returns the result. +*/ +QMediaTimeRange& QMediaTimeRange::operator+=(const QMediaTimeRange &other) +{ + addTimeRange(other); + return *this; +} + +/*! + \fn QMediaTimeRange::operator+=(const QMediaTimeInterval &interval) + + Adds the specified \a interval to the time range and returns the result. +*/ +QMediaTimeRange& QMediaTimeRange::operator+=(const QMediaTimeInterval &interval) +{ + addInterval(interval); + return *this; +} + +/*! + \fn QMediaTimeRange::operator-=(const QMediaTimeRange &other) + + Removes each interval in \a other from the time range and returns the result. +*/ +QMediaTimeRange& QMediaTimeRange::operator-=(const QMediaTimeRange &other) +{ + removeTimeRange(other); + return *this; +} + +/*! + \fn QMediaTimeRange::operator-=(const QMediaTimeInterval &interval) + + Removes the specified \a interval from the time range and returns the result. +*/ +QMediaTimeRange& QMediaTimeRange::operator-=(const QMediaTimeInterval &interval) +{ + removeInterval(interval); + return *this; +} + +/*! + \fn QMediaTimeRange::clear() + + Removes all intervals from the time range. + + \sa removeInterval() +*/ +void QMediaTimeRange::clear() +{ + d->intervals.clear(); +} + +/*! + \fn QMediaTimeRange::intervals() const + + Returns the list of intervals covered by this time range. +*/ +QList QMediaTimeRange::intervals() const +{ + return d->intervals; +} + +/*! + \fn QMediaTimeRange::isEmpty() const + + Returns true if there are no intervals within the time range. + + \sa intervals() +*/ +bool QMediaTimeRange::isEmpty() const +{ + return d->intervals.isEmpty(); +} + +/*! + \fn QMediaTimeRange::isContinuous() const + + Returns true if the time range consists of a continuous interval. + That is, there is one or fewer disjoint intervals within the time range. +*/ +bool QMediaTimeRange::isContinuous() const +{ + return (d->intervals.count() <= 1); +} + +/*! + \fn QMediaTimeRange::contains(qint64 time) const + + Returns true if the specified \a time lies within the time range. +*/ +bool QMediaTimeRange::contains(qint64 time) const +{ + for (int i = 0; i < d->intervals.count(); i++) { + if (d->intervals[i].contains(time)) + return true; + + if (time < d->intervals[i].s) + break; + } + + return false; +} + +/*! + \fn operator==(const QMediaTimeRange &a, const QMediaTimeRange &b) + \relates QMediaTimeRange + + Returns true if all intervals in \a a are present in \a b. +*/ +bool operator==(const QMediaTimeRange &a, const QMediaTimeRange &b) +{ + if (a.intervals().count() != b.intervals().count()) + return false; + + for (int i = 0; i < a.intervals().count(); i++) + { + if(a.intervals()[i] != b.intervals()[i]) + return false; + } + + return true; +} + +/*! + \fn operator!=(const QMediaTimeRange &a, const QMediaTimeRange &b) + \relates QMediaTimeRange + + Returns true if one or more intervals in \a a are not present in \a b. +*/ +bool operator!=(const QMediaTimeRange &a, const QMediaTimeRange &b) +{ + return !(a == b); +} + +/*! + \fn operator+(const QMediaTimeRange &r1, const QMediaTimeRange &r2) + + Returns a time range containing the union between \a r1 and \a r2. + */ +QMediaTimeRange operator+(const QMediaTimeRange &r1, const QMediaTimeRange &r2) +{ + return (QMediaTimeRange(r1) += r2); +} + +/*! + \fn operator-(const QMediaTimeRange &r1, const QMediaTimeRange &r2) + + Returns a time range containing \a r2 subtracted from \a r1. + */ +QMediaTimeRange operator-(const QMediaTimeRange &r1, const QMediaTimeRange &r2) +{ + return (QMediaTimeRange(r1) -= r2); +} + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qmediatimerange.h b/src/multimedia/mediaservices/base/qmediatimerange.h new file mode 100644 index 0000000..94beaad --- /dev/null +++ b/src/multimedia/mediaservices/base/qmediatimerange.h @@ -0,0 +1,135 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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 QMEDIATIMERANGE_H +#define QMEDIATIMERANGE_H + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QMediaTimeRangePrivate; + +class Q_MULTIMEDIA_EXPORT QMediaTimeInterval +{ +public: + QMediaTimeInterval(); + QMediaTimeInterval(qint64 start, qint64 end); + QMediaTimeInterval(const QMediaTimeInterval&); + + qint64 start() const; + qint64 end() const; + + bool contains(qint64 time) const; + + bool isNormal() const; + QMediaTimeInterval normalized() const; + QMediaTimeInterval translated(qint64 offset) const; + +private: + friend class QMediaTimeRangePrivate; + friend class QMediaTimeRange; + + qint64 s; + qint64 e; +}; + +Q_MULTIMEDIA_EXPORT bool operator==(const QMediaTimeInterval&, const QMediaTimeInterval&); +Q_MULTIMEDIA_EXPORT bool operator!=(const QMediaTimeInterval&, const QMediaTimeInterval&); + +class Q_MULTIMEDIA_EXPORT QMediaTimeRange +{ +public: + + QMediaTimeRange(); + QMediaTimeRange(qint64 start, qint64 end); + QMediaTimeRange(const QMediaTimeInterval&); + QMediaTimeRange(const QMediaTimeRange &range); + ~QMediaTimeRange(); + + QMediaTimeRange &operator=(const QMediaTimeRange&); + QMediaTimeRange &operator=(const QMediaTimeInterval&); + + qint64 earliestTime() const; + qint64 latestTime() const; + + QList intervals() const; + bool isEmpty() const; + bool isContinuous() const; + + bool contains(qint64 time) const; + + void addInterval(qint64 start, qint64 end); + void addInterval(const QMediaTimeInterval &interval); + void addTimeRange(const QMediaTimeRange&); + + void removeInterval(qint64 start, qint64 end); + void removeInterval(const QMediaTimeInterval &interval); + void removeTimeRange(const QMediaTimeRange&); + + QMediaTimeRange& operator+=(const QMediaTimeRange&); + QMediaTimeRange& operator+=(const QMediaTimeInterval&); + QMediaTimeRange& operator-=(const QMediaTimeRange&); + QMediaTimeRange& operator-=(const QMediaTimeInterval&); + + void clear(); + +private: + QSharedDataPointer d; +}; + +Q_MULTIMEDIA_EXPORT bool operator==(const QMediaTimeRange&, const QMediaTimeRange&); +Q_MULTIMEDIA_EXPORT bool operator!=(const QMediaTimeRange&, const QMediaTimeRange&); +Q_MULTIMEDIA_EXPORT QMediaTimeRange operator+(const QMediaTimeRange&, const QMediaTimeRange&); +Q_MULTIMEDIA_EXPORT QMediaTimeRange operator-(const QMediaTimeRange&, const QMediaTimeRange&); + + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIATIMERANGE_H diff --git a/src/multimedia/mediaservices/base/qmetadatacontrol.cpp b/src/multimedia/mediaservices/base/qmetadatacontrol.cpp new file mode 100644 index 0000000..32be987 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmetadatacontrol.cpp @@ -0,0 +1,185 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qmediacontrol_p.h" + + +QT_BEGIN_NAMESPACE + + +/*! + \class QMetaDataControl + \ingroup multimedia-serv + \since 4.7 + \preliminary + \brief The QMetaDataControl class provides access to the meta-data of a + QMediaService's media. + + If a QMediaService can provide read or write access to the meta-data of + its current media it will implement QMetaDataControl. This control + provides functions for both retrieving and setting meta-data values. + Meta-data may be addressed by the well defined keys in the + QtMediaservices::MetaData enumeration using the metaData() functions, or by + string keys using the extendedMetaData() functions. + + The functionality provided by this control is exposed to application + code by the meta-data members of QMediaObject, and so meta-data access + is potentially available in any of the media object classes. Any media + service may implement QMetaDataControl. + + The interface name of QMetaDataControl is \c com.nokia.Qt.QMetaDataControl/1.0 as + defined in QMetaDataControl_iid. + + \sa QMediaService::control(), QMediaObject +*/ + +/*! + \macro QMetaDataControl_iid + + \c com.nokia.Qt.QMetaDataControl/1.0 + + Defines the interface name of the QMetaDataControl class. + + \relates QMetaDataControl +*/ + +/*! + Construct a QMetaDataControl with \a parent. This class is meant as a base class + for service specific meta data providers so this constructor is protected. +*/ + +QMetaDataControl::QMetaDataControl(QObject *parent): + QMediaControl(*new QMediaControlPrivate, parent) +{ +} + +/*! + Destroy the meta-data object. +*/ + +QMetaDataControl::~QMetaDataControl() +{ +} + +/*! + \fn bool QMetaDataControl::isMetaDataAvailable() const + + Identifies if meta-data is available from a media service. + + Returns true if the meta-data is available and false otherwise. +*/ + +/*! + \fn bool QMetaDataControl::isWritable() const + + Identifies if a media service's meta-data can be edited. + + Returns true if the meta-data is writable and false otherwise. +*/ + +/*! + \fn QVariant QMetaDataControl::metaData(QtMediaservices::MetaData key) const + + Returns the meta-data for the given \a key. +*/ + +/*! + \fn void QMetaDataControl::setMetaData(QtMediaservices::MetaData key, const QVariant &value) + + Sets the \a value of the meta-data element with the given \a key. +*/ + +/*! + \fn QMetaDataControl::availableMetaData() const + + Returns a list of keys there is meta-data available for. +*/ + +/*! + \fn QMetaDataControl::extendedMetaData(const QString &key) const + + Returns the metaData for an abitrary string \a key. + + The valid selection of keys for extended meta-data is determined by the provider and the meaning + and type may differ between providers. +*/ + +/*! + \fn QMetaDataControl::setExtendedMetaData(const QString &key, const QVariant &value) + + Change the value of the meta-data element with an abitrary string \a key to \a value. + + The valid selection of keys for extended meta-data is determined by the provider and the meaning + and type may differ between providers. +*/ + +/*! + \fn QMetaDataControl::availableExtendedMetaData() const + + Returns a list of keys there is extended meta-data available for. +*/ + + +/*! + \fn void QMetaDataControl::metaDataChanged() + + Signal the changes of meta-data. +*/ + +/*! + \fn void QMetaDataControl::metaDataAvailableChanged(bool available) + + Signal the availability of meta-data has changed, \a available will + be true if the multimedia object has meta-data. +*/ + +/*! + \fn void QMetaDataControl::writableChanged(bool writable) + + Signal a change in the writable status of meta-data, \a writable will be + true if meta-data elements can be added or adjusted. +*/ + +#include "moc_qmetadatacontrol.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qmetadatacontrol.h b/src/multimedia/mediaservices/base/qmetadatacontrol.h new file mode 100644 index 0000000..cf4a0d3 --- /dev/null +++ b/src/multimedia/mediaservices/base/qmetadatacontrol.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMETADATACONTROL_H +#define QMETADATACONTROL_H + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class Q_MULTIMEDIA_EXPORT QMetaDataControl : public QMediaControl +{ + Q_OBJECT + +public: + ~QMetaDataControl(); + + virtual bool isWritable() const = 0; + virtual bool isMetaDataAvailable() const = 0; + + virtual QVariant metaData(QtMediaservices::MetaData key) const = 0; + virtual void setMetaData(QtMediaservices::MetaData key, const QVariant &value) = 0; + virtual QList availableMetaData() const = 0; + + virtual QVariant extendedMetaData(const QString &key) const = 0; + virtual void setExtendedMetaData(const QString &key, const QVariant &value) = 0; + virtual QStringList availableExtendedMetaData() const = 0; + +Q_SIGNALS: + void metaDataChanged(); + + void writableChanged(bool writable); + void metaDataAvailableChanged(bool available); + +protected: + QMetaDataControl(QObject *parent = 0); +}; + +#define QMetaDataControl_iid "com.nokia.Qt.QMetaDataControl/1.0" +Q_MEDIA_DECLARE_CONTROL(QMetaDataControl, QMetaDataControl_iid) + +QT_END_NAMESPACE + +QT_END_HEADER + + +#endif // QMETADATAPROVIDER_H diff --git a/src/multimedia/mediaservices/base/qpaintervideosurface.cpp b/src/multimedia/mediaservices/base/qpaintervideosurface.cpp new file mode 100644 index 0000000..b3e0dd5 --- /dev/null +++ b/src/multimedia/mediaservices/base/qpaintervideosurface.cpp @@ -0,0 +1,1565 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qpaintervideosurface_p.h" +#include "qpaintervideosurface_mac_p.h" + +#include + +#include +#include +#include + +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#include +#endif + +#include + + +QT_BEGIN_NAMESPACE + +QVideoSurfacePainter::~QVideoSurfacePainter() +{ +} + +class QVideoSurfaceRasterPainter : public QVideoSurfacePainter +{ +public: + QVideoSurfaceRasterPainter(); + + QList supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const; + + bool isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const; + + QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format); + void stop(); + + QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame); + + QAbstractVideoSurface::Error paint( + const QRectF &target, QPainter *painter, const QRectF &source); + + void updateColors(int brightness, int contrast, int hue, int saturation); + +private: + QList m_imagePixelFormats; + QVideoFrame m_frame; + QSize m_imageSize; + QImage::Format m_imageFormat; + QVideoSurfaceFormat::Direction m_scanLineDirection; +}; + +QVideoSurfaceRasterPainter::QVideoSurfaceRasterPainter() + : m_imageFormat(QImage::Format_Invalid) + , m_scanLineDirection(QVideoSurfaceFormat::TopToBottom) +{ + m_imagePixelFormats + << QVideoFrame::Format_RGB32 +#ifndef QT_OPENGL_ES // The raster formats should be a subset of the GL formats. + << QVideoFrame::Format_RGB24 +#endif + << QVideoFrame::Format_ARGB32 + << QVideoFrame::Format_RGB565; +} + +QList QVideoSurfaceRasterPainter::supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const +{ + return handleType == QAbstractVideoBuffer::NoHandle + ? m_imagePixelFormats + : QList(); +} + +bool QVideoSurfaceRasterPainter::isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const +{ + return format.handleType() == QAbstractVideoBuffer::NoHandle + && m_imagePixelFormats.contains(format.pixelFormat()) + && !format.frameSize().isEmpty(); +} + +QAbstractVideoSurface::Error QVideoSurfaceRasterPainter::start(const QVideoSurfaceFormat &format) +{ + m_frame = QVideoFrame(); + m_imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()); + m_imageSize = format.frameSize(); + m_scanLineDirection = format.scanLineDirection(); + + return format.handleType() == QAbstractVideoBuffer::NoHandle + && m_imageFormat != QImage::Format_Invalid + && !m_imageSize.isEmpty() + ? QAbstractVideoSurface::NoError + : QAbstractVideoSurface::UnsupportedFormatError; +} + +void QVideoSurfaceRasterPainter::stop() +{ + m_frame = QVideoFrame(); +} + +QAbstractVideoSurface::Error QVideoSurfaceRasterPainter::setCurrentFrame(const QVideoFrame &frame) +{ + m_frame = frame; + + return QAbstractVideoSurface::NoError; +} + +QAbstractVideoSurface::Error QVideoSurfaceRasterPainter::paint( + const QRectF &target, QPainter *painter, const QRectF &source) +{ + if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) { + QImage image( + m_frame.bits(), + m_imageSize.width(), + m_imageSize.height(), + m_frame.bytesPerLine(), + m_imageFormat); + + if (m_scanLineDirection == QVideoSurfaceFormat::BottomToTop) { + const QTransform oldTransform = painter->transform(); + + painter->scale(1, -1); + painter->translate(0, -target.bottom()); + painter->drawImage( + QRectF(target.x(), 0, target.width(), target.height()), image, source); + painter->setTransform(oldTransform); + } else { + painter->drawImage(target, image, source); + } + + m_frame.unmap(); + } else if (m_frame.isValid()) { + return QAbstractVideoSurface::IncorrectFormatError; + } else { + painter->fillRect(target, Qt::black); + } + return QAbstractVideoSurface::NoError; +} + +void QVideoSurfaceRasterPainter::updateColors(int, int, int, int) +{ +} + +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) + +#ifndef Q_WS_MAC +# ifndef APIENTRYP +# ifdef APIENTRY +# define APIENTRYP APIENTRY * +# else +# define APIENTRY +# define APIENTRYP * +# endif +# endif +#else +# define APIENTRY +# define APIENTRYP * +#endif + +#ifndef GL_TEXTURE0 +# define GL_TEXTURE0 0x84C0 +# define GL_TEXTURE1 0x84C1 +# define GL_TEXTURE2 0x84C2 +#endif +#ifndef GL_PROGRAM_ERROR_STRING_ARB +# define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#endif + +#ifndef GL_UNSIGNED_SHORT_5_6_5 +# define GL_UNSIGNED_SHORT_5_6_5 33635 +#endif + +class QVideoSurfaceGLPainter : public QVideoSurfacePainter +{ +public: + QVideoSurfaceGLPainter(QGLContext *context); + ~QVideoSurfaceGLPainter(); + QList supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const; + + bool isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const; + + QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame); + + void updateColors(int brightness, int contrast, int hue, int saturation); + +protected: + void initRgbTextureInfo(GLenum internalFormat, GLuint format, GLenum type, const QSize &size); + void initYuv420PTextureInfo(const QSize &size); + void initYv12TextureInfo(const QSize &size); + +#ifndef QT_OPENGL_ES + typedef void (APIENTRY *_glActiveTexture) (GLenum); + _glActiveTexture glActiveTexture; +#endif + + QList m_imagePixelFormats; + QList m_glPixelFormats; + QMatrix4x4 m_colorMatrix; + QVideoFrame m_frame; + + QGLContext *m_context; + QAbstractVideoBuffer::HandleType m_handleType; + QVideoSurfaceFormat::Direction m_scanLineDirection; + GLenum m_textureFormat; + GLuint m_textureInternalFormat; + GLenum m_textureType; + int m_textureCount; + GLuint m_textureIds[3]; + int m_textureWidths[3]; + int m_textureHeights[3]; + int m_textureOffsets[3]; + bool m_yuv; +}; + +QVideoSurfaceGLPainter::QVideoSurfaceGLPainter(QGLContext *context) + : m_context(context) + , m_handleType(QAbstractVideoBuffer::NoHandle) + , m_scanLineDirection(QVideoSurfaceFormat::TopToBottom) + , m_textureFormat(0) + , m_textureInternalFormat(0) + , m_textureType(0) + , m_textureCount(0) + , m_yuv(false) +{ +#ifndef QT_OPENGL_ES + glActiveTexture = (_glActiveTexture)m_context->getProcAddress(QLatin1String("glActiveTexture")); +#endif +} + +QVideoSurfaceGLPainter::~QVideoSurfaceGLPainter() +{ +} + +QList QVideoSurfaceGLPainter::supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const +{ + switch (handleType) { + case QAbstractVideoBuffer::NoHandle: + return m_imagePixelFormats; + case QAbstractVideoBuffer::GLTextureHandle: + return m_glPixelFormats; + default: + return QList(); + } +} + +bool QVideoSurfaceGLPainter::isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const +{ + if (format.frameSize().isEmpty()) { + return false; + } else { + switch (format.handleType()) { + case QAbstractVideoBuffer::NoHandle: + return m_imagePixelFormats.contains(format.pixelFormat()); + case QAbstractVideoBuffer::GLTextureHandle: + return m_glPixelFormats.contains(format.pixelFormat()); + default: + return false; + } + } +} + +QAbstractVideoSurface::Error QVideoSurfaceGLPainter::setCurrentFrame(const QVideoFrame &frame) +{ + m_frame = frame; + + if (m_handleType == QAbstractVideoBuffer::GLTextureHandle) { + m_textureIds[0] = frame.handle().toInt(); + } else if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) { + m_context->makeCurrent(); + + for (int i = 0; i < m_textureCount; ++i) { + glBindTexture(GL_TEXTURE_2D, m_textureIds[i]); + glTexImage2D( + GL_TEXTURE_2D, + 0, + m_textureInternalFormat, + m_textureWidths[i], + m_textureHeights[i], + 0, + m_textureFormat, + m_textureType, + m_frame.bits() + m_textureOffsets[i]); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + } + m_frame.unmap(); + } else if (m_frame.isValid()) { + return QAbstractVideoSurface::IncorrectFormatError; + } + + return QAbstractVideoSurface::NoError; +} + +void QVideoSurfaceGLPainter::updateColors(int brightness, int contrast, int hue, int saturation) +{ + const qreal b = brightness / 200.0; + const qreal c = contrast / 100.0 + 1.0; + const qreal h = hue / 100.0; + const qreal s = saturation / 100.0 + 1.0; + + const qreal cosH = qCos(M_PI * h); + const qreal sinH = qSin(M_PI * h); + + const qreal h11 = 0.787 * cosH - 0.213 * sinH + 0.213; + const qreal h21 = -0.213 * cosH + 0.143 * sinH + 0.213; + const qreal h31 = -0.213 * cosH - 0.787 * sinH + 0.213; + + const qreal h12 = -0.715 * cosH - 0.715 * sinH + 0.715; + const qreal h22 = 0.285 * cosH + 0.140 * sinH + 0.715; + const qreal h32 = -0.715 * cosH + 0.715 * sinH + 0.715; + + const qreal h13 = -0.072 * cosH + 0.928 * sinH + 0.072; + const qreal h23 = -0.072 * cosH - 0.283 * sinH + 0.072; + const qreal h33 = 0.928 * cosH + 0.072 * sinH + 0.072; + + const qreal sr = (1.0 - s) * 0.3086; + const qreal sg = (1.0 - s) * 0.6094; + const qreal sb = (1.0 - s) * 0.0820; + + const qreal sr_s = sr + s; + const qreal sg_s = sg + s; + const qreal sb_s = sr + s; + + const float m4 = (s + sr + sg + sb) * (0.5 - 0.5 * c + b); + + m_colorMatrix(0, 0) = c * (sr_s * h11 + sg * h21 + sb * h31); + m_colorMatrix(0, 1) = c * (sr_s * h12 + sg * h22 + sb * h32); + m_colorMatrix(0, 2) = c * (sr_s * h13 + sg * h23 + sb * h33); + m_colorMatrix(0, 3) = m4; + + m_colorMatrix(1, 0) = c * (sr * h11 + sg_s * h21 + sb * h31); + m_colorMatrix(1, 1) = c * (sr * h12 + sg_s * h22 + sb * h32); + m_colorMatrix(1, 2) = c * (sr * h13 + sg_s * h23 + sb * h33); + m_colorMatrix(1, 3) = m4; + + m_colorMatrix(2, 0) = c * (sr * h11 + sg * h21 + sb_s * h31); + m_colorMatrix(2, 1) = c * (sr * h12 + sg * h22 + sb_s * h32); + m_colorMatrix(2, 2) = c * (sr * h13 + sg * h23 + sb_s * h33); + m_colorMatrix(2, 3) = m4; + + m_colorMatrix(3, 0) = 0.0; + m_colorMatrix(3, 1) = 0.0; + m_colorMatrix(3, 2) = 0.0; + m_colorMatrix(3, 3) = 1.0; + + if (m_yuv) { + m_colorMatrix = m_colorMatrix * QMatrix4x4( + 1.0, 0.000, 1.140, -0.5700, + 1.0, -0.394, -0.581, 0.4875, + 1.0, 2.028, 0.000, -1.0140, + 0.0, 0.000, 0.000, 1.0000); + } +} + +void QVideoSurfaceGLPainter::initRgbTextureInfo( + GLenum internalFormat, GLuint format, GLenum type, const QSize &size) +{ + m_yuv = false; + m_textureInternalFormat = internalFormat; + m_textureFormat = format; + m_textureType = type; + m_textureCount = 1; + m_textureWidths[0] = size.width(); + m_textureHeights[0] = size.height(); + m_textureOffsets[0] = 0; +} + +void QVideoSurfaceGLPainter::initYuv420PTextureInfo(const QSize &size) +{ + int w = (size.width() + 3) & ~3; + int w2 = (size.width()/2 + 3) & ~3; + + m_yuv = true; + m_textureInternalFormat = GL_LUMINANCE; + m_textureFormat = GL_LUMINANCE; + m_textureType = GL_UNSIGNED_BYTE; + m_textureCount = 3; + m_textureWidths[0] = size.width(); + m_textureHeights[0] = size.height(); + m_textureOffsets[0] = 0; + m_textureWidths[1] = size.width() / 2; + m_textureHeights[1] = size.height() / 2; + m_textureOffsets[1] = w * size.height(); + m_textureWidths[2] = size.width() / 2; + m_textureHeights[2] = size.height() / 2; + m_textureOffsets[2] = w * size.height() + w2 * (size.height() / 2); +} + +void QVideoSurfaceGLPainter::initYv12TextureInfo(const QSize &size) +{ + int w = (size.width() + 3) & ~3; + int w2 = (size.width()/2 + 3) & ~3; + + m_yuv = true; + m_textureInternalFormat = GL_LUMINANCE; + m_textureFormat = GL_LUMINANCE; + m_textureType = GL_UNSIGNED_BYTE; + m_textureCount = 3; + m_textureWidths[0] = size.width(); + m_textureHeights[0] = size.height(); + m_textureOffsets[0] = 0; + m_textureWidths[1] = size.width() / 2; + m_textureHeights[1] = size.height() / 2; + m_textureOffsets[1] = w * size.height() + w2 * (size.height() / 2); + m_textureWidths[2] = size.width() / 2; + m_textureHeights[2] = size.height() / 2; + m_textureOffsets[2] = w * size.height(); +} + +#ifndef QT_OPENGL_ES + +# ifndef GL_FRAGMENT_PROGRAM_ARB +# define GL_FRAGMENT_PROGRAM_ARB 0x8804 +# define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +# endif + +// Paints an RGB32 frame +static const char *qt_arbfp_xrgbShaderProgram = + "!!ARBfp1.0\n" + "PARAM matrix[4] = { program.local[0..2]," + "{ 0.0, 0.0, 0.0, 1.0 } };\n" + "TEMP xrgb;\n" + "TEX xrgb.xyz, fragment.texcoord[0], texture[0], 2D;\n" + "MOV xrgb.w, matrix[3].w;\n" + "DP4 result.color.x, xrgb.zyxw, matrix[0];\n" + "DP4 result.color.y, xrgb.zyxw, matrix[1];\n" + "DP4 result.color.z, xrgb.zyxw, matrix[2];\n" + "END"; + +// Paints an ARGB frame. +static const char *qt_arbfp_argbShaderProgram = + "!!ARBfp1.0\n" + "PARAM matrix[4] = { program.local[0..2]," + "{ 0.0, 0.0, 0.0, 1.0 } };\n" + "TEMP argb;\n" + "TEX argb, fragment.texcoord[0], texture[0], 2D;\n" + "MOV argb.w, matrix[3].w;\n" + "DP4 result.color.x, argb.zyxw, matrix[0];\n" + "DP4 result.color.y, argb.zyxw, matrix[1];\n" + "DP4 result.color.z, argb.zyxw, matrix[2];\n" + "TEX result.color.w, fragment.texcoord[0], texture, 2D;\n" + "END"; + +// Paints an RGB(A) frame. +static const char *qt_arbfp_rgbShaderProgram = + "!!ARBfp1.0\n" + "PARAM matrix[4] = { program.local[0..2]," + "{ 0.0, 0.0, 0.0, 1.0 } };\n" + "TEMP rgb;\n" + "TEX rgb, fragment.texcoord[0], texture[0], 2D;\n" + "MOV rgb.w, matrix[3].w;\n" + "DP4 result.color.x, rgb, matrix[0];\n" + "DP4 result.color.y, rgb, matrix[1];\n" + "DP4 result.color.z, rgb, matrix[2];\n" + "TEX result.color.w, fragment.texcoord[0], texture, 2D;\n" + "END"; + +// Paints a YUV420P or YV12 frame. +static const char *qt_arbfp_yuvPlanarShaderProgram = + "!!ARBfp1.0\n" + "PARAM matrix[4] = { program.local[0..2]," + "{ 0.0, 0.0, 0.0, 1.0 } };\n" + "TEMP yuv;\n" + "TEX yuv.x, fragment.texcoord[0], texture[0], 2D;\n" + "TEX yuv.y, fragment.texcoord[0], texture[1], 2D;\n" + "TEX yuv.z, fragment.texcoord[0], texture[2], 2D;\n" + "MOV yuv.w, matrix[3].w;\n" + "DP4 result.color.x, yuv, matrix[0];\n" + "DP4 result.color.y, yuv, matrix[1];\n" + "DP4 result.color.z, yuv, matrix[2];\n" + "END"; + +// Paints a YUV444 frame. +static const char *qt_arbfp_xyuvShaderProgram = + "!!ARBfp1.0\n" + "PARAM matrix[4] = { program.local[0..2]," + "{ 0.0, 0.0, 0.0, 1.0 } };\n" + "TEMP ayuv;\n" + "TEX ayuv, fragment.texcoord[0], texture[0], 2D;\n" + "MOV ayuv.x, matrix[3].w;\n" + "DP4 result.color.x, ayuv.yzwx, matrix[0];\n" + "DP4 result.color.y, ayuv.yzwx, matrix[1];\n" + "DP4 result.color.z, ayuv.yzwx, matrix[2];\n" + "END"; + +// Paints a AYUV444 frame. +static const char *qt_arbfp_ayuvShaderProgram = + "!!ARBfp1.0\n" + "PARAM matrix[4] = { program.local[0..2]," + "{ 0.0, 0.0, 0.0, 1.0 } };\n" + "TEMP ayuv;\n" + "TEX ayuv, fragment.texcoord[0], texture[0], 2D;\n" + "MOV ayuv.x, matrix[3].w;\n" + "DP4 result.color.x, ayuv.yzwx, matrix[0];\n" + "DP4 result.color.y, ayuv.yzwx, matrix[1];\n" + "DP4 result.color.z, ayuv.yzwx, matrix[2];\n" + "TEX result.color.w, fragment.texcoord[0], texture, 2D;\n" + "END"; + +class QVideoSurfaceArbFpPainter : public QVideoSurfaceGLPainter +{ +public: + QVideoSurfaceArbFpPainter(QGLContext *context); + + QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format); + void stop(); + + QAbstractVideoSurface::Error paint( + const QRectF &target, QPainter *painter, const QRectF &source); + +private: + typedef void (APIENTRY *_glProgramStringARB) (GLenum, GLenum, GLsizei, const GLvoid *); + typedef void (APIENTRY *_glBindProgramARB) (GLenum, GLuint); + typedef void (APIENTRY *_glDeleteProgramsARB) (GLsizei, const GLuint *); + typedef void (APIENTRY *_glGenProgramsARB) (GLsizei, GLuint *); + typedef void (APIENTRY *_glProgramLocalParameter4fARB) ( + GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); + typedef void (APIENTRY *_glActiveTexture) (GLenum); + + _glProgramStringARB glProgramStringARB; + _glBindProgramARB glBindProgramARB; + _glDeleteProgramsARB glDeleteProgramsARB; + _glGenProgramsARB glGenProgramsARB; + _glProgramLocalParameter4fARB glProgramLocalParameter4fARB; + + GLuint m_programId; + QSize m_frameSize; +}; + +QVideoSurfaceArbFpPainter::QVideoSurfaceArbFpPainter(QGLContext *context) + : QVideoSurfaceGLPainter(context) + , m_programId(0) +{ + glProgramStringARB = (_glProgramStringARB) m_context->getProcAddress( + QLatin1String("glProgramStringARB")); + glBindProgramARB = (_glBindProgramARB) m_context->getProcAddress( + QLatin1String("glBindProgramARB")); + glDeleteProgramsARB = (_glDeleteProgramsARB) m_context->getProcAddress( + QLatin1String("glDeleteProgramsARB")); + glGenProgramsARB = (_glGenProgramsARB) m_context->getProcAddress( + QLatin1String("glGenProgramsARB")); + glProgramLocalParameter4fARB = (_glProgramLocalParameter4fARB) m_context->getProcAddress( + QLatin1String("glProgramLocalParameter4fARB")); + + m_imagePixelFormats + << QVideoFrame::Format_RGB32 + << QVideoFrame::Format_BGR32 + << QVideoFrame::Format_ARGB32 + << QVideoFrame::Format_RGB24 + << QVideoFrame::Format_BGR24 + << QVideoFrame::Format_RGB565 + << QVideoFrame::Format_AYUV444 + << QVideoFrame::Format_YUV444 + << QVideoFrame::Format_YV12 + << QVideoFrame::Format_YUV420P; + m_glPixelFormats + << QVideoFrame::Format_RGB32 + << QVideoFrame::Format_ARGB32; +} + +QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::start(const QVideoSurfaceFormat &format) +{ + Q_ASSERT(m_textureCount == 0); + + QAbstractVideoSurface::Error error = QAbstractVideoSurface::NoError; + + m_context->makeCurrent(); + + const char *program = 0; + + if (format.handleType() == QAbstractVideoBuffer::NoHandle) { + switch (format.pixelFormat()) { + case QVideoFrame::Format_RGB32: + initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + program = qt_arbfp_xrgbShaderProgram; + break; + case QVideoFrame::Format_BGR32: + initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + program = qt_arbfp_rgbShaderProgram; + break; + case QVideoFrame::Format_ARGB32: + initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + program = qt_arbfp_argbShaderProgram; + break; + case QVideoFrame::Format_RGB24: + initRgbTextureInfo(GL_RGB8, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + program = qt_arbfp_rgbShaderProgram; + break; + case QVideoFrame::Format_BGR24: + initRgbTextureInfo(GL_RGB8, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + program = qt_arbfp_xrgbShaderProgram; + break; + case QVideoFrame::Format_RGB565: + initRgbTextureInfo(GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, format.frameSize()); + program = qt_arbfp_rgbShaderProgram; + break; + case QVideoFrame::Format_YUV444: + initRgbTextureInfo(GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, format.frameSize()); + program = qt_arbfp_xyuvShaderProgram; + m_yuv = true; + break; + case QVideoFrame::Format_AYUV444: + initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + program = qt_arbfp_ayuvShaderProgram; + m_yuv = true; + break; + case QVideoFrame::Format_YV12: + initYv12TextureInfo(format.frameSize()); + program = qt_arbfp_yuvPlanarShaderProgram; + break; + case QVideoFrame::Format_YUV420P: + initYuv420PTextureInfo(format.frameSize()); + program = qt_arbfp_yuvPlanarShaderProgram; + break; + default: + break; + } + } else if (format.handleType() == QAbstractVideoBuffer::GLTextureHandle) { + switch (format.pixelFormat()) { + case QVideoFrame::Format_RGB32: + case QVideoFrame::Format_ARGB32: + m_yuv = false; + m_textureCount = 1; + program = qt_arbfp_rgbShaderProgram; + break; + default: + break; + } + } + + if (!program) { + error = QAbstractVideoSurface::UnsupportedFormatError; + } else { + glGenProgramsARB(1, &m_programId); + + GLenum glError = glGetError(); + if (glError != GL_NO_ERROR) { + qWarning("QPainterVideoSurface: ARBfb Shader allocation error %x", int(glError)); + m_textureCount = 0; + m_programId = 0; + + error = QAbstractVideoSurface::ResourceError; + } else { + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_programId); + glProgramStringARB( + GL_FRAGMENT_PROGRAM_ARB, + GL_PROGRAM_FORMAT_ASCII_ARB, + qstrlen(program), + reinterpret_cast(program)); + + if ((glError = glGetError()) != GL_NO_ERROR) { + const GLubyte* errorString = glGetString(GL_PROGRAM_ERROR_STRING_ARB); + + qWarning("QPainterVideoSurface: ARBfp Shader compile error %x, %s", + int(glError), + reinterpret_cast(errorString)); + glDeleteProgramsARB(1, &m_programId); + + m_textureCount = 0; + m_programId = 0; + + error = QAbstractVideoSurface::ResourceError; + } else { + m_handleType = format.handleType(); + m_scanLineDirection = format.scanLineDirection(); + m_frameSize = format.frameSize(); + + if (m_handleType == QAbstractVideoBuffer::NoHandle) + glGenTextures(m_textureCount, m_textureIds); + } + } + } + + return error; +} + +void QVideoSurfaceArbFpPainter::stop() +{ + m_context->makeCurrent(); + + if (m_handleType != QAbstractVideoBuffer::GLTextureHandle) + glDeleteTextures(m_textureCount, m_textureIds); + glDeleteProgramsARB(1, &m_programId); + + m_textureCount = 0; + m_programId = 0; + m_handleType = QAbstractVideoBuffer::NoHandle; +} + +QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::paint( + const QRectF &target, QPainter *painter, const QRectF &source) +{ + if (m_frame.isValid()) { + bool stencilTestEnabled = glIsEnabled(GL_STENCIL_TEST); + bool scissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST); + + painter->beginNativePainting(); + + if (stencilTestEnabled) + glEnable(GL_STENCIL_TEST); + if (scissorTestEnabled) + glEnable(GL_SCISSOR_TEST); + + const float txLeft = source.left() / m_frameSize.width(); + const float txRight = source.right() / m_frameSize.width(); + const float txTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom + ? source.top() / m_frameSize.height() + : source.bottom() / m_frameSize.height(); + const float txBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom + ? source.bottom() / m_frameSize.height() + : source.top() / m_frameSize.height(); + + + const float tx_array[] = + { + txLeft , txBottom, + txRight, txBottom, + txLeft , txTop, + txRight, txTop + }; + const float v_array[] = + { + float(target.left()) , float(target.bottom() + 1), + float(target.right() + 1), float(target.bottom() + 1), + float(target.left()) , float(target.top()), + float(target.right() + 1), float(target.top()) + }; + + glEnable(GL_FRAGMENT_PROGRAM_ARB); + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_programId); + + glProgramLocalParameter4fARB( + GL_FRAGMENT_PROGRAM_ARB, + 0, + m_colorMatrix(0, 0), + m_colorMatrix(0, 1), + m_colorMatrix(0, 2), + m_colorMatrix(0, 3)); + glProgramLocalParameter4fARB( + GL_FRAGMENT_PROGRAM_ARB, + 1, + m_colorMatrix(1, 0), + m_colorMatrix(1, 1), + m_colorMatrix(1, 2), + m_colorMatrix(1, 3)); + glProgramLocalParameter4fARB( + GL_FRAGMENT_PROGRAM_ARB, + 2, + m_colorMatrix(2, 0), + m_colorMatrix(2, 1), + m_colorMatrix(2, 2), + m_colorMatrix(2, 3)); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, m_textureIds[0]); + + if (m_textureCount == 3) { + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, m_textureIds[1]); + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, m_textureIds[2]); + glActiveTexture(GL_TEXTURE0); + } + + glVertexPointer(2, GL_FLOAT, 0, v_array); + glTexCoordPointer(2, GL_FLOAT, 0, tx_array); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); + glDisable(GL_FRAGMENT_PROGRAM_ARB); + + painter->endNativePainting(); + } + return QAbstractVideoSurface::NoError; +} + +#endif + +static const char *qt_glsl_vertexShaderProgram = + "attribute highp vec4 vertexCoordArray;\n" + "attribute highp vec2 textureCoordArray;\n" + "uniform highp mat4 positionMatrix;\n" + "varying highp vec2 textureCoord;\n" + "void main(void)\n" + "{\n" + " gl_Position = positionMatrix * vertexCoordArray;\n" + " textureCoord = textureCoordArray;\n" + "}\n"; + +// Paints an RGB32 frame +static const char *qt_glsl_xrgbShaderProgram = + "uniform sampler2D texRgb;\n" + "uniform mediump mat4 colorMatrix;\n" + "varying highp vec2 textureCoord;\n" + "void main(void)\n" + "{\n" + " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).bgr, 1.0);\n" + " gl_FragColor = colorMatrix * color;\n" + "}\n"; + +// Paints an ARGB frame. +static const char *qt_glsl_argbShaderProgram = + "uniform sampler2D texRgb;\n" + "uniform mediump mat4 colorMatrix;\n" + "varying highp vec2 textureCoord;\n" + "void main(void)\n" + "{\n" + " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).bgr, 1.0);\n" + " color = colorMatrix * color;\n" + " gl_FragColor = vec4(color.rgb, texture2D(texRgb, textureCoord.st).a);\n" + "}\n"; + +// Paints an RGB(A) frame. +static const char *qt_glsl_rgbShaderProgram = + "uniform sampler2D texRgb;\n" + "uniform mediump mat4 colorMatrix;\n" + "varying highp vec2 textureCoord;\n" + "void main(void)\n" + "{\n" + " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).rgb, 1.0);\n" + " color = colorMatrix * color;\n" + " gl_FragColor = vec4(color.rgb, texture2D(texRgb, textureCoord.st).a);\n" + "}\n"; + +// Paints a YUV420P or YV12 frame. +static const char *qt_glsl_yuvPlanarShaderProgram = + "uniform sampler2D texY;\n" + "uniform sampler2D texU;\n" + "uniform sampler2D texV;\n" + "uniform mediump mat4 colorMatrix;\n" + "varying highp vec2 textureCoord;\n" + "void main(void)\n" + "{\n" + " highp vec4 color = vec4(\n" + " texture2D(texY, textureCoord.st).r,\n" + " texture2D(texU, textureCoord.st).r,\n" + " texture2D(texV, textureCoord.st).r,\n" + " 1.0);\n" + " gl_FragColor = colorMatrix * color;\n" + "}\n"; + +// Paints a YUV444 frame. +static const char *qt_glsl_xyuvShaderProgram = + "uniform sampler2D texRgb;\n" + "uniform mediump mat4 colorMatrix;\n" + "varying highp vec2 textureCoord;\n" + "void main(void)\n" + "{\n" + " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).gba, 1.0);\n" + " gl_FragColor = colorMatrix * color;\n" + "}\n"; + +// Paints a AYUV444 frame. +static const char *qt_glsl_ayuvShaderProgram = + "uniform sampler2D texRgb;\n" + "uniform mediump mat4 colorMatrix;\n" + "varying highp vec2 textureCoord;\n" + "void main(void)\n" + "{\n" + " highp vec4 color = vec4(texture2D(texRgb, textureCoord.st).gba, 1.0);\n" + " color = colorMatrix * color;\n" + " gl_FragColor = vec4(color.rgb, texture2D(texRgb, textureCoord.st).r);\n" + "}\n"; + +class QVideoSurfaceGlslPainter : public QVideoSurfaceGLPainter +{ +public: + QVideoSurfaceGlslPainter(QGLContext *context); + + QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format); + void stop(); + + QAbstractVideoSurface::Error paint( + const QRectF &target, QPainter *painter, const QRectF &source); + +private: + QGLShaderProgram m_program; + QSize m_frameSize; +}; + +QVideoSurfaceGlslPainter::QVideoSurfaceGlslPainter(QGLContext *context) + : QVideoSurfaceGLPainter(context) + , m_program(context) +{ + m_imagePixelFormats + << QVideoFrame::Format_RGB32 + << QVideoFrame::Format_BGR32 + << QVideoFrame::Format_ARGB32 +#ifndef QT_OPENGL_ES + << QVideoFrame::Format_RGB24 + << QVideoFrame::Format_BGR24 +#endif + << QVideoFrame::Format_RGB565 + << QVideoFrame::Format_YUV444 + << QVideoFrame::Format_AYUV444 + << QVideoFrame::Format_YV12 + << QVideoFrame::Format_YUV420P; + m_glPixelFormats + << QVideoFrame::Format_RGB32 + << QVideoFrame::Format_ARGB32; +} + +QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::start(const QVideoSurfaceFormat &format) +{ + Q_ASSERT(m_textureCount == 0); + + QAbstractVideoSurface::Error error = QAbstractVideoSurface::NoError; + + m_context->makeCurrent(); + + const char *fragmentProgram = 0; + + if (format.handleType() == QAbstractVideoBuffer::NoHandle) { + switch (format.pixelFormat()) { + case QVideoFrame::Format_RGB32: + initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + fragmentProgram = qt_glsl_xrgbShaderProgram; + break; + case QVideoFrame::Format_BGR32: + initRgbTextureInfo(GL_RGB, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + fragmentProgram = qt_glsl_rgbShaderProgram; + break; + case QVideoFrame::Format_ARGB32: + initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + fragmentProgram = qt_glsl_argbShaderProgram; + break; +#ifndef QT_OPENGL_ES + case QVideoFrame::Format_RGB24: + initRgbTextureInfo(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, format.frameSize()); + fragmentProgram = qt_glsl_rgbShaderProgram; + break; + case QVideoFrame::Format_BGR24: + initRgbTextureInfo(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, format.frameSize()); + fragmentProgram = qt_glsl_argbShaderProgram; + break; +#endif + case QVideoFrame::Format_RGB565: + initRgbTextureInfo(GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, format.frameSize()); + fragmentProgram = qt_glsl_rgbShaderProgram; + break; + case QVideoFrame::Format_YUV444: + initRgbTextureInfo(GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, format.frameSize()); + fragmentProgram = qt_glsl_xyuvShaderProgram; + m_yuv = true; + break; + case QVideoFrame::Format_AYUV444: + initRgbTextureInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, format.frameSize()); + fragmentProgram = qt_glsl_ayuvShaderProgram; + m_yuv = true; + break; + case QVideoFrame::Format_YV12: + initYv12TextureInfo(format.frameSize()); + fragmentProgram = qt_glsl_yuvPlanarShaderProgram; + break; + case QVideoFrame::Format_YUV420P: + initYuv420PTextureInfo(format.frameSize()); + fragmentProgram = qt_glsl_yuvPlanarShaderProgram; + break; + default: + break; + } + } else if (format.handleType() == QAbstractVideoBuffer::GLTextureHandle) { + switch (format.pixelFormat()) { + case QVideoFrame::Format_RGB32: + case QVideoFrame::Format_ARGB32: + m_yuv = false; + m_textureCount = 1; + fragmentProgram = qt_glsl_rgbShaderProgram; + break; + default: + break; + } + } + + if (!fragmentProgram) { + error = QAbstractVideoSurface::UnsupportedFormatError; + } else if (!m_program.addShaderFromSourceCode(QGLShader::Vertex, qt_glsl_vertexShaderProgram)) { + qWarning("QPainterVideoSurface: Vertex shader compile error %s", + qPrintable(m_program.log())); + error = QAbstractVideoSurface::ResourceError; + } else if (!m_program.addShaderFromSourceCode(QGLShader::Fragment, fragmentProgram)) { + qWarning("QPainterVideoSurface: Shader compile error %s", qPrintable(m_program.log())); + error = QAbstractVideoSurface::ResourceError; + m_program.removeAllShaders(); + } else if(!m_program.link()) { + qWarning("QPainterVideoSurface: Shader link error %s", qPrintable(m_program.log())); + m_program.removeAllShaders(); + error = QAbstractVideoSurface::ResourceError; + } else { + m_handleType = format.handleType(); + m_scanLineDirection = format.scanLineDirection(); + m_frameSize = format.frameSize(); + + if (m_handleType == QAbstractVideoBuffer::NoHandle) + glGenTextures(m_textureCount, m_textureIds); + } + + return error; +} + +void QVideoSurfaceGlslPainter::stop() +{ + m_context->makeCurrent(); + + if (m_handleType != QAbstractVideoBuffer::GLTextureHandle) + glDeleteTextures(m_textureCount, m_textureIds); + m_program.removeAllShaders(); + + m_textureCount = 0; + m_handleType = QAbstractVideoBuffer::NoHandle; +} + +QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint( + const QRectF &target, QPainter *painter, const QRectF &source) +{ + if (m_frame.isValid()) { + bool stencilTestEnabled = glIsEnabled(GL_STENCIL_TEST); + bool scissorTestEnabled = glIsEnabled(GL_SCISSOR_TEST); + + painter->beginNativePainting(); + + if (stencilTestEnabled) + glEnable(GL_STENCIL_TEST); + if (scissorTestEnabled) + glEnable(GL_SCISSOR_TEST); + + const int width = QGLContext::currentContext()->device()->width(); + const int height = QGLContext::currentContext()->device()->height(); + + const QTransform transform = painter->deviceTransform(); + + const GLfloat wfactor = 2.0 / width; + const GLfloat hfactor = -2.0 / height; + + const GLfloat positionMatrix[4][4] = + { + { + /*(0,0)*/ GLfloat(wfactor * transform.m11() - transform.m13()), + /*(0,1)*/ GLfloat(hfactor * transform.m12() + transform.m13()), + /*(0,2)*/ 0.0, + /*(0,3)*/ GLfloat(transform.m13()) + }, { + /*(1,0)*/ GLfloat(wfactor * transform.m21() - transform.m23()), + /*(1,1)*/ GLfloat(hfactor * transform.m22() + transform.m23()), + /*(1,2)*/ 0.0, + /*(1,3)*/ GLfloat(transform.m23()) + }, { + /*(2,0)*/ 0.0, + /*(2,1)*/ 0.0, + /*(2,2)*/ -1.0, + /*(2,3)*/ 0.0 + }, { + /*(3,0)*/ GLfloat(wfactor * transform.dx() - transform.m33()), + /*(3,1)*/ GLfloat(hfactor * transform.dy() + transform.m33()), + /*(3,2)*/ 0.0, + /*(3,3)*/ GLfloat(transform.m33()) + } + }; + + const GLfloat vertexCoordArray[] = + { + GLfloat(target.left()) , GLfloat(target.bottom() + 1), + GLfloat(target.right() + 1), GLfloat(target.bottom() + 1), + GLfloat(target.left()) , GLfloat(target.top()), + GLfloat(target.right() + 1), GLfloat(target.top()) + }; + + const GLfloat txLeft = source.left() / m_frameSize.width(); + const GLfloat txRight = source.right() / m_frameSize.width(); + const GLfloat txTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom + ? source.top() / m_frameSize.height() + : source.bottom() / m_frameSize.height(); + const GLfloat txBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom + ? source.bottom() / m_frameSize.height() + : source.top() / m_frameSize.height(); + + const GLfloat textureCoordArray[] = + { + txLeft , txBottom, + txRight, txBottom, + txLeft , txTop, + txRight, txTop + }; + + m_program.bind(); + + m_program.enableAttributeArray("vertexCoordArray"); + m_program.enableAttributeArray("textureCoordArray"); + m_program.setAttributeArray("vertexCoordArray", vertexCoordArray, 2); + m_program.setAttributeArray("textureCoordArray", textureCoordArray, 2); + m_program.setUniformValue("positionMatrix", positionMatrix); + + if (m_textureCount == 3) { + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, m_textureIds[0]); + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, m_textureIds[1]); + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, m_textureIds[2]); + glActiveTexture(GL_TEXTURE0); + + m_program.setUniformValue("texY", GLint(0)); + m_program.setUniformValue("texU", GLint(1)); + m_program.setUniformValue("texV", GLint(2)); + } else { + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, m_textureIds[0]); + + m_program.setUniformValue("texRgb", GLint(0)); + } + m_program.setUniformValue("colorMatrix", m_colorMatrix); + + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + m_program.release(); + + painter->endNativePainting(); + } + return QAbstractVideoSurface::NoError; +} + +#endif + +/*! + \class QPainterVideoSurface + \internal +*/ + +/*! +*/ +QPainterVideoSurface::QPainterVideoSurface(QObject *parent) + : QAbstractVideoSurface(parent) + , m_painter(0) +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) + , m_glContext(0) + , m_shaderTypes(NoShaders) + , m_shaderType(NoShaders) +#endif + , m_brightness(0) + , m_contrast(0) + , m_hue(0) + , m_saturation(0) + , m_pixelFormat(QVideoFrame::Format_Invalid) + , m_colorsDirty(true) + , m_ready(false) +{ +} + +/*! +*/ +QPainterVideoSurface::~QPainterVideoSurface() +{ + if (isActive()) + m_painter->stop(); + + delete m_painter; +} + +/*! +*/ +QList QPainterVideoSurface::supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const +{ + if (!m_painter) + const_cast(this)->createPainter(); + + return m_painter->supportedPixelFormats(handleType); +} + +/*! +*/ +bool QPainterVideoSurface::isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const +{ + if (!m_painter) + const_cast(this)->createPainter(); + + return m_painter->isFormatSupported(format, similar); +} + +/*! +*/ +bool QPainterVideoSurface::start(const QVideoSurfaceFormat &format) +{ + if (isActive()) + m_painter->stop(); + + if (!m_painter) + createPainter(); + + if (format.frameSize().isEmpty()) { + setError(UnsupportedFormatError); + } else { + QAbstractVideoSurface::Error error = m_painter->start(format); + + if (error != QAbstractVideoSurface::NoError) { + setError(error); + } else { + m_pixelFormat = format.pixelFormat(); + m_frameSize = format.frameSize(); + m_sourceRect = format.viewport(); + m_colorsDirty = true; + m_ready = true; + + return QAbstractVideoSurface::start(format); + } + } + + QAbstractVideoSurface::stop(); + + return false; +} + +/*! +*/ +void QPainterVideoSurface::stop() +{ + if (isActive()) { + m_painter->stop(); + m_ready = false; + + QAbstractVideoSurface::stop(); + } +} + +/*! +*/ +bool QPainterVideoSurface::present(const QVideoFrame &frame) +{ + if (!m_ready) { + if (!isActive()) + setError(StoppedError); + } else if (frame.isValid() + && (frame.pixelFormat() != m_pixelFormat || frame.size() != m_frameSize)) { + setError(IncorrectFormatError); + + stop(); + } else { + QAbstractVideoSurface::Error error = m_painter->setCurrentFrame(frame); + + if (error != QAbstractVideoSurface::NoError) { + setError(error); + + stop(); + } else { + m_ready = false; + + emit frameChanged(); + + return true; + } + } + return false; +} + +/*! +*/ +int QPainterVideoSurface::brightness() const +{ + return m_brightness; +} + +/*! +*/ +void QPainterVideoSurface::setBrightness(int brightness) +{ + m_brightness = brightness; + + m_colorsDirty = true; +} + +/*! +*/ +int QPainterVideoSurface::contrast() const +{ + return m_contrast; +} + +/*! +*/ +void QPainterVideoSurface::setContrast(int contrast) +{ + m_contrast = contrast; + + m_colorsDirty = true; +} + +/*! +*/ +int QPainterVideoSurface::hue() const +{ + return m_hue; +} + +/*! +*/ +void QPainterVideoSurface::setHue(int hue) +{ + m_hue = hue; + + m_colorsDirty = true; +} + +/*! +*/ +int QPainterVideoSurface::saturation() const +{ + return m_saturation; +} + +/*! +*/ +void QPainterVideoSurface::setSaturation(int saturation) +{ + m_saturation = saturation; + + m_colorsDirty = true; +} + +/*! +*/ +bool QPainterVideoSurface::isReady() const +{ + return m_ready; +} + +/*! +*/ +void QPainterVideoSurface::setReady(bool ready) +{ + m_ready = ready; +} + +/*! +*/ +void QPainterVideoSurface::paint(QPainter *painter, const QRectF &target, const QRectF &source) +{ + if (!isActive()) { + painter->fillRect(target, QBrush(Qt::black)); + } else { + if (m_colorsDirty) { + m_painter->updateColors(m_brightness, m_contrast, m_hue, m_saturation); + m_colorsDirty = false; + } + + const QRectF sourceRect( + m_sourceRect.x() + m_sourceRect.width() * source.x(), + m_sourceRect.y() + m_sourceRect.height() * source.y(), + m_sourceRect.width() * source.width(), + m_sourceRect.height() * source.height()); + + QAbstractVideoSurface::Error error = m_painter->paint(target, painter, sourceRect); + + if (error != QAbstractVideoSurface::NoError) { + setError(error); + + stop(); + } + } +} + +/*! + \fn QPainterVideoSurface::frameChanged() +*/ + +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) + +/*! +*/ +const QGLContext *QPainterVideoSurface::glContext() const +{ + return m_glContext; +} + +/*! +*/ +void QPainterVideoSurface::setGLContext(QGLContext *context) +{ + if (m_glContext == context) + return; + + m_glContext = context; + + m_shaderTypes = NoShaders; + + if (m_glContext) { + m_glContext->makeCurrent(); + + const QByteArray extensions(reinterpret_cast(glGetString(GL_EXTENSIONS))); +#ifndef QT_OPENGL_ES + + if (extensions.contains("ARB_fragment_program")) + m_shaderTypes |= FragmentProgramShader; +#endif + + if (QGLShaderProgram::hasOpenGLShaderPrograms(m_glContext) + && extensions.contains("ARB_shader_objects")) + m_shaderTypes |= GlslShader; + } + + ShaderType type = (m_shaderType & m_shaderTypes) + ? m_shaderType + : NoShaders; + + if (type != m_shaderType || type != NoShaders) { + m_shaderType = type; + + if (isActive()) { + m_painter->stop(); + delete m_painter; + m_painter = 0; + m_ready = false; + + setError(ResourceError); + QAbstractVideoSurface::stop(); + } + emit supportedFormatsChanged(); + } +} + +/*! + \enum QPainterVideoSurface::ShaderType + + \value NoShaders + \value FragmentProgramShader + \value HlslShader +*/ + +/*! + \typedef QPainterVideoSurface::ShaderTypes +*/ + +/*! +*/ +QPainterVideoSurface::ShaderTypes QPainterVideoSurface::supportedShaderTypes() const +{ + return m_shaderTypes; +} + +/*! +*/ +QPainterVideoSurface::ShaderType QPainterVideoSurface::shaderType() const +{ + return m_shaderType; +} + +/*! +*/ +void QPainterVideoSurface::setShaderType(ShaderType type) +{ + if (!(type & m_shaderTypes)) + type = NoShaders; + + if (type != m_shaderType) { + m_shaderType = type; + + if (isActive()) { + m_painter->stop(); + delete m_painter; + m_painter = 0; + m_ready = false; + + setError(ResourceError); + QAbstractVideoSurface::stop(); + } else { + delete m_painter; + m_painter = 0; + } + emit supportedFormatsChanged(); + } +} + +#endif + +void QPainterVideoSurface::createPainter() +{ + Q_ASSERT(!m_painter); + +#ifdef Q_WS_MAC + if (m_glContext) + m_glContext->makeCurrent(); + + m_painter = new QVideoSurfaceCoreGraphicsPainter(m_glContext != 0); + return; +#endif + +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) + switch (m_shaderType) { +#ifndef QT_OPENGL_ES + case FragmentProgramShader: + Q_ASSERT(m_glContext); + m_glContext->makeCurrent(); + m_painter = new QVideoSurfaceArbFpPainter(m_glContext); + break; +#endif + case GlslShader: + Q_ASSERT(m_glContext); + m_glContext->makeCurrent(); + m_painter = new QVideoSurfaceGlslPainter(m_glContext); + break; + default: + m_painter = new QVideoSurfaceRasterPainter; + break; + } +#else + m_painter = new QVideoSurfaceRasterPainter; +#endif +} + +QT_END_NAMESPACE + +#include "moc_qpaintervideosurface_p.cpp" + + diff --git a/src/multimedia/mediaservices/base/qpaintervideosurface_mac.mm b/src/multimedia/mediaservices/base/qpaintervideosurface_mac.mm new file mode 100644 index 0000000..1154f86 --- /dev/null +++ b/src/multimedia/mediaservices/base/qpaintervideosurface_mac.mm @@ -0,0 +1,283 @@ +/**************************************************************************** +** +** Copyright (C) 2009 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 "qpaintervideosurface_mac_p.h" + +#include + +#include + +#include +#include +#include + +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +extern CGContextRef qt_mac_cg_context(const QPaintDevice *pdev); //qpaintdevice_mac.cpp + +QVideoSurfaceCoreGraphicsPainter::QVideoSurfaceCoreGraphicsPainter(bool glSupported) + : ciContext(0) + , m_imageFormat(QImage::Format_Invalid) + , m_scanLineDirection(QVideoSurfaceFormat::TopToBottom) +{ + //qDebug() << "QVideoSurfaceCoreGraphicsPainter, GL supported:" << glSupported; + ciContext = 0; + m_imagePixelFormats + << QVideoFrame::Format_RGB32; + + m_supportedHandles + << QAbstractVideoBuffer::NoHandle + << QAbstractVideoBuffer::CoreImageHandle; + + if (glSupported) + m_supportedHandles << QAbstractVideoBuffer::GLTextureHandle; +} + +QVideoSurfaceCoreGraphicsPainter::~QVideoSurfaceCoreGraphicsPainter() +{ + [(CIContext*)ciContext release]; +} + +QList QVideoSurfaceCoreGraphicsPainter::supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const +{ + return m_supportedHandles.contains(handleType) + ? m_imagePixelFormats + : QList(); +} + +bool QVideoSurfaceCoreGraphicsPainter::isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const +{ + return m_supportedHandles.contains(format.handleType()) + && m_imagePixelFormats.contains(format.pixelFormat()) + && !format.frameSize().isEmpty(); +} + +QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::start(const QVideoSurfaceFormat &format) +{ + m_frame = QVideoFrame(); + m_imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat()); + m_imageSize = format.frameSize(); + m_scanLineDirection = format.scanLineDirection(); + + return m_supportedHandles.contains(format.handleType()) + && m_imageFormat != QImage::Format_Invalid + && !m_imageSize.isEmpty() + ? QAbstractVideoSurface::NoError + : QAbstractVideoSurface::UnsupportedFormatError; +} + +void QVideoSurfaceCoreGraphicsPainter::stop() +{ + m_frame = QVideoFrame(); +} + +QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::setCurrentFrame(const QVideoFrame &frame) +{ + m_frame = frame; + + return QAbstractVideoSurface::NoError; +} + +QAbstractVideoSurface::Error QVideoSurfaceCoreGraphicsPainter::paint( + const QRectF &target, QPainter *painter, const QRectF &source) +{ + if (m_frame.handleType() == QAbstractVideoBuffer::CoreImageHandle) { + if (painter->paintEngine()->type() == QPaintEngine::CoreGraphics ) { + + CIImage *img = (CIImage*)(m_frame.handle().value()); + + if (img) { + CGContextRef cgContext = qt_mac_cg_context(painter->device()); + + if (cgContext) { + painter->beginNativePainting(); + + CGRect sRect = CGRectMake(source.x(), source.y(), source.width(), source.height()); + CGRect dRect = CGRectMake(target.x(), target.y(), target.width(), target.height()); + + NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithCIImage:img]; + + if (m_scanLineDirection == QVideoSurfaceFormat::TopToBottom) { + CGContextSaveGState( cgContext ); + CGContextTranslateCTM(cgContext, 0, dRect.origin.y + CGRectGetMaxY(dRect)); + CGContextScaleCTM(cgContext, 1, -1); + +#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4) + if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_4) { + CGContextDrawImage(cgContext, dRect, [bitmap CGImage]); + } +#endif + + CGContextRestoreGState(cgContext); + } else { +#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4) + if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_4) { + CGContextDrawImage(cgContext, dRect, [bitmap CGImage]); + } +#endif + } + + [bitmap release]; + + painter->endNativePainting(); + + return QAbstractVideoSurface::NoError; + } + } + } else if (painter->paintEngine()->type() == QPaintEngine::OpenGL2 || + painter->paintEngine()->type() == QPaintEngine::OpenGL) { + CIImage *img = (CIImage*)(m_frame.handle().value()); + + if (img) { + CGLContextObj cglContext = CGLGetCurrentContext(); + + if (cglContext) { + + if (!ciContext) { + CGLContextObj cglContext = CGLGetCurrentContext(); + NSOpenGLPixelFormat *nsglPixelFormat = [NSOpenGLView defaultPixelFormat]; + CGLPixelFormatObj cglPixelFormat = static_cast([nsglPixelFormat CGLPixelFormatObj]); + + ciContext = [CIContext contextWithCGLContext:cglContext + pixelFormat:cglPixelFormat + options:nil]; + + [(CIContext*)ciContext retain]; + } + + CGRect sRect = CGRectMake(source.x(), source.y(), source.width(), source.height()); + CGRect dRect = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom ? + CGRectMake(target.x(), target.y()+target.height(), target.width(), -target.height()) : + CGRectMake(target.x(), target.y(), target.width(), target.height()); + + + painter->beginNativePainting(); + + [(CIContext*)ciContext drawImage:img inRect:dRect fromRect:sRect]; + + painter->endNativePainting(); + + return QAbstractVideoSurface::NoError; + } + } + } + } + + if (m_frame.handleType() == QAbstractVideoBuffer::GLTextureHandle && + (painter->paintEngine()->type() == QPaintEngine::OpenGL2 || + painter->paintEngine()->type() == QPaintEngine::OpenGL)) { + + painter->beginNativePainting(); + GLuint texture = m_frame.handle().toUInt(); + + glDisable(GL_CULL_FACE); + glEnable(GL_TEXTURE_2D); + + glBindTexture(GL_TEXTURE_2D, texture); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + const float txLeft = source.left() / m_frame.width(); + const float txRight = source.right() / m_frame.width(); + const float txTop = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom + ? source.top() / m_frame.height() + : source.bottom() / m_frame.height(); + const float txBottom = m_scanLineDirection == QVideoSurfaceFormat::TopToBottom + ? source.bottom() / m_frame.height() + : source.top() / m_frame.height(); + + glBegin(GL_QUADS); + QRectF rect = target; + glTexCoord2f(txLeft, txBottom); + glVertex2f(rect.topLeft().x(), rect.topLeft().y()); + glTexCoord2f(txRight, txBottom); + glVertex2f(rect.topRight().x() + 1, rect.topRight().y()); + glTexCoord2f(txRight, txTop); + glVertex2f(rect.bottomRight().x() + 1, rect.bottomRight().y() + 1); + glTexCoord2f(txLeft, txTop); + glVertex2f(rect.bottomLeft().x(), rect.bottomLeft().y() + 1); + glEnd(); + painter->endNativePainting(); + + return QAbstractVideoSurface::NoError; + } + + //fallback case, software rendering + if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) { + QImage image( + m_frame.bits(), + m_imageSize.width(), + m_imageSize.height(), + m_frame.bytesPerLine(), + m_imageFormat); + + if (m_scanLineDirection == QVideoSurfaceFormat::BottomToTop) { + const QTransform oldTransform = painter->transform(); + + painter->scale(1, -1); + painter->translate(0, -target.bottom()); + painter->drawImage( + QRectF(target.x(), 0, target.width(), target.height()), image, source); + painter->setTransform(oldTransform); + } else { + painter->drawImage(target, image, source); + } + + m_frame.unmap(); + } else { + painter->fillRect(target, Qt::black); + } + return QAbstractVideoSurface::NoError; +} + +void QVideoSurfaceCoreGraphicsPainter::updateColors(int, int, int, int) +{ +} + +QT_END_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qpaintervideosurface_mac_p.h b/src/multimedia/mediaservices/base/qpaintervideosurface_mac_p.h new file mode 100644 index 0000000..13c22c2 --- /dev/null +++ b/src/multimedia/mediaservices/base/qpaintervideosurface_mac_p.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QPAINTERVIDEOSURFACE_MAC_P_H +#define QPAINTERVIDEOSURFACE_MAC_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qpaintervideosurface_p.h" +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QVideoSurfaceCoreGraphicsPainter : public QVideoSurfacePainter +{ +public: + QVideoSurfaceCoreGraphicsPainter(bool glSupported); + ~QVideoSurfaceCoreGraphicsPainter(); + + QList supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const; + + bool isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const; + + QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format); + void stop(); + + QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame); + + QAbstractVideoSurface::Error paint( + const QRectF &target, QPainter *painter, const QRectF &source); + + void updateColors(int brightness, int contrast, int hue, int saturation); + +private: + void* ciContext; + QList m_imagePixelFormats; + QVideoFrame m_frame; + QSize m_imageSize; + QImage::Format m_imageFormat; + QVector m_supportedHandles; + QVideoSurfaceFormat::Direction m_scanLineDirection; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qpaintervideosurface_p.h b/src/multimedia/mediaservices/base/qpaintervideosurface_p.h new file mode 100644 index 0000000..de9c24a --- /dev/null +++ b/src/multimedia/mediaservices/base/qpaintervideosurface_p.h @@ -0,0 +1,178 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QPAINTERVIDEOSURFACE_P_H +#define QPAINTERVIDEOSURFACE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QGLContext; + +class QVideoSurfacePainter +{ +public: + virtual ~QVideoSurfacePainter(); + + virtual QList supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const = 0; + + virtual bool isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const = 0; + + virtual QAbstractVideoSurface::Error start(const QVideoSurfaceFormat &format) = 0; + virtual void stop() = 0; + + virtual QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame) = 0; + + virtual QAbstractVideoSurface::Error paint( + const QRectF &target, QPainter *painter, const QRectF &source) = 0; + + virtual void updateColors(int brightness, int contrast, int hue, int saturation) = 0; +}; + +class Q_MULTIMEDIA_EXPORT QPainterVideoSurface : public QAbstractVideoSurface +{ + Q_OBJECT +public: + explicit QPainterVideoSurface(QObject *parent = 0); + ~QPainterVideoSurface(); + + QList supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const; + + bool isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar = 0) const; + + bool start(const QVideoSurfaceFormat &format); + void stop(); + + bool present(const QVideoFrame &frame); + + int brightness() const; + void setBrightness(int brightness); + + int contrast() const; + void setContrast(int contrast); + + int hue() const; + void setHue(int hue); + + int saturation() const; + void setSaturation(int saturation); + + bool isReady() const; + void setReady(bool ready); + + void paint(QPainter *painter, const QRectF &target, const QRectF &source = QRectF(0, 0, 1, 1)); + +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) + const QGLContext *glContext() const; + void setGLContext(QGLContext *context); + + enum ShaderType + { + NoShaders = 0x00, + FragmentProgramShader = 0x01, + GlslShader = 0x02 + }; + + Q_DECLARE_FLAGS(ShaderTypes, ShaderType) + + ShaderTypes supportedShaderTypes() const; + + ShaderType shaderType() const; + void setShaderType(ShaderType type); +#endif + +Q_SIGNALS: + void frameChanged(); + +private: + void createPainter(); + + QVideoSurfacePainter *m_painter; +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) + QGLContext *m_glContext; + ShaderTypes m_shaderTypes; + ShaderType m_shaderType; +#endif + int m_brightness; + int m_contrast; + int m_hue; + int m_saturation; + + QVideoFrame::PixelFormat m_pixelFormat; + QSize m_frameSize; + QRect m_sourceRect; + bool m_colorsDirty; + bool m_ready; +}; + +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +Q_DECLARE_OPERATORS_FOR_FLAGS(QPainterVideoSurface::ShaderTypes) +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qtmedianamespace.h b/src/multimedia/mediaservices/base/qtmedianamespace.h new file mode 100644 index 0000000..7db7aa8 --- /dev/null +++ b/src/multimedia/mediaservices/base/qtmedianamespace.h @@ -0,0 +1,194 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QTMEDIANAMESPACE_H +#define QTMEDIANAMESPACE_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +namespace QtMediaservices +{ + enum MetaData + { + // Common + Title, + SubTitle, + Author, + Comment, + Description, + Category, + Genre, + Year, + Date, + UserRating, + Keywords, + Language, + Publisher, + Copyright, + ParentalRating, + RatingOrganisation, + + // Media + Size, + MediaType, + Duration, + + // Audio + AudioBitRate, + AudioCodec, + AverageLevel, + ChannelCount, + PeakValue, + SampleRate, + + // Music + AlbumTitle, + AlbumArtist, + ContributingArtist, + Composer, + Conductor, + Lyrics, + Mood, + TrackNumber, + TrackCount, + + CoverArtUrlSmall, + CoverArtUrlLarge, + + // Image/Video + Resolution, + PixelAspectRatio, + + // Video + VideoFrameRate, + VideoBitRate, + VideoCodec, + + PosterUrl, + + // Movie + ChapterNumber, + Director, + LeadPerformer, + Writer, + + // Photos + CameraManufacturer, + CameraModel, + Event, + Subject, + Orientation, + ExposureTime, + FNumber, + ExposureProgram, + ISOSpeedRatings, + ExposureBiasValue, + DateTimeOriginal, + DateTimeDigitized, + SubjectDistance, + MeteringMode, + LightSource, + Flash, + FocalLength, + ExposureMode, + WhiteBalance, + DigitalZoomRatio, + FocalLengthIn35mmFilm, + SceneCaptureType, + GainControl, + Contrast, + Saturation, + Sharpness, + DeviceSettingDescription, + + PosterImage, + CoverArtImage, + ThumbnailImage + + }; + + enum SupportEstimate + { + NotSupported, + MaybeSupported, + ProbablySupported, + PreferredService + }; + + enum EncodingQuality + { + VeryLowQuality, + LowQuality, + NormalQuality, + HighQuality, + VeryHighQuality + }; + + enum EncodingMode + { + ConstantQualityEncoding, + ConstantBitRateEncoding, + AverageBitRateEncoding, + TwoPassEncoding + }; + + enum AvailabilityError + { + NoError, + ServiceMissingError, + BusyError, + ResourceError + }; + +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qtmedianamespace.qdoc b/src/multimedia/mediaservices/base/qtmedianamespace.qdoc new file mode 100644 index 0000000..277b1a5 --- /dev/null +++ b/src/multimedia/mediaservices/base/qtmedianamespace.qdoc @@ -0,0 +1,214 @@ +/**************************************************************************** +** +** Copyright (C) 2009 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$ +** +****************************************************************************/ + +/*! + \namespace QtMultimedia + \ingroup multimedia + + \brief The QtMultimedia namespace contains miscellaneous identifiers used + throughout the Qt Multimedia library. +*/ + +/*! + \enum QtMultimedia::MetaData + + This enum provides identifiers for meta-data attributes. + + Common attributes + \value Title The title of the media. QString. + \value SubTitle The sub-title of the media. QString. + \value Author The authors of the media. QStringList. + \value Comment A user comment about the media. QString. + \value Description A description of the media. QString + \value Category The category of the media. QStringList. + \value Genre The genre of the media. QStringList. + \value Year The year of release of the media. int. + \value Date The date of the media. QDate. + \value UserRating A user rating of the media. int [0..100]. + \value Keywords A list of keywords describing the media. QStringList. + \value Language The language of media, as an ISO 639-2 code. + + \value Publisher The publisher of the media. QString. + \value Copyright The media's copyright notice. QString. + \value ParentalRating The parental rating of the media. QString. + \value RatingOrganisation The organisation responsible for the parental rating of the media. + QString. + + Media attributes + \value Size The size in bytes of the media. qint64 + \value MediaType The type of the media (audio, video, etc). QString. + \value Duration The duration in millseconds of the media. qint64. + + Audio attributes + \value AudioBitRate The bit rate of the media's audio stream in bits per second. int. + \value AudioCodec The codec of the media's audio stream. QString. + \value AverageLevel The average volume level of the media. int. + \value ChannelCount The number of channels in the media's audio stream. int. + \value PeakValue The peak volume of the media's audio stream. int + \value SampleRate The sample rate of the media's audio stream in hertz. int + + Music attributes + \value AlbumTitle The title of the album the media belongs to. QString. + \value AlbumArtist The principal artist of the album the media belongs to. QString. + \value ContributingArtist The artists contributing to the media. QStringList. + \value Composer The composer of the media. QStringList. + \value Conductor The conductor of the media. QString. + \value Lyrics The lyrics to the media. QString. + \value Mood The mood of the media. QString. + \value TrackNumber The track number of the media. int. + \value TrackCount The number of tracks on the album containing the media. int. + + \value CoverArtUrlSmall The URL of a small cover art image. QUrl. + \value CoverArtUrlLarge The URL of a large cover art image. QUrl. + \value CoverArtImage An embedded cover art image. QImage. + + Image and video attributes + \value Resolution The dimensions of an image or video. QSize. + \value PixelAspectRatio The pixel aspect ratio of an image or video. QSize. + + Video attributes + \value VideoFrameRate The frame rate of the media's video stream. qreal. + \value VideoBitRate The bit rate of the media's video stream in bits per second. int. + \value VideoCodec The codec of the media's video stream. QString. + + \value PosterUrl The URL of a poster image. QUrl. + \value PosterImage An embedded poster image. QImage. + + Movie attributes + \value ChapterNumber The chapter number of the media. int. + \value Director The director of the media. QString. + \value LeadPerformer The lead performer in the media. QStringList. + \value Writer The writer of the media. QStringList. + + Photo attributes. + \value CameraManufacturer The manufacturer of the camera used to capture the media. QString. + \value CameraModel The model of the camera used to capture the media. QString. + \value Event The event during which the media was captured. QString. + \value Subject The subject of the media. QString. + \value Orientation Orientation of image. + \value ExposureTime Exposure time, given in seconds. + \value FNumber The F Number. + \value ExposureProgram + The class of the program used by the camera to set exposure when the picture is taken. + \value ISOSpeedRatings + Indicates the ISO Speed and ISO Latitude of the camera or input device as specified in ISO 12232. + \value ExposureBiasValue + The exposure bias. + The unit is the APEX (Additive System of Photographic Exposure) setting. + \value DateTimeOriginal The date and time when the original image data was generated. + \value DateTimeDigitized The date and time when the image was stored as digital data. + \value SubjectDistance The distance to the subject, given in meters. + \value MeteringMode The metering mode. + \value LightSource + The kind of light source. + \value Flash + Status of flash when the image was shot. + \value FocalLength + The actual focal length of the lens, in mm. + \value ExposureMode + Indicates the exposure mode set when the image was shot. + \value WhiteBalance + Indicates the white balance mode set when the image was shot. + \value DigitalZoomRatio + Indicates the digital zoom ratio when the image was shot. + \value FocalLengthIn35mmFilm + Indicates the equivalent focal length assuming a 35mm film camera, in mm. + \value SceneCaptureType + Indicates the type of scene that was shot. + It can also be used to record the mode in which the image was shot. + \value GainControl + Indicates the degree of overall image gain adjustment. + \value Contrast + Indicates the direction of contrast processing applied by the camera when the image was shot. + \value Saturation + Indicates the direction of saturation processing applied by the camera when the image was shot. + \value Sharpness + Indicates the direction of sharpness processing applied by the camera when the image was shot. + \value DeviceSettingDescription + Exif tag, indicates information on the picture-taking conditions of a particular camera model. QString + + \value ThumbnailImage An embedded thumbnail image. QImage. +*/ + +/*! + \enum QtMultimedia::SupportEstimate + + Enumerates the levels of support a media service provider may have for a feature. + + \value NotSupported The feature is not supported. + \value MaybeSupported The feature may be supported. + \value ProbablySupported The feature is probably supported. + \value PreferredService The service is the preferred provider of a service. +*/ + +/*! + \enum QtMultimedia::EncodingQuality + + Enumerates quality encoding levels. + + \value VeryLowQuality + \value LowQuality + \value NormalQuality + \value HighQuality + \value VeryHighQuality +*/ + +/*! + \enum QtMultimedia::EncodingMode + + Enumerates encoding modes. + + \value ConstantQualityEncoding + \value ConstantBitRateEncoding + \value AverageBitRateEncoding + \value TwoPassEncoding +*/ + +/*! + \enum QtMultimedia::AvailabilityError + + Enumerates Service status errors. + + \value NoError + \value ServiceMissingError + \value ResourceError + \value BusyError +*/ diff --git a/src/multimedia/mediaservices/base/qvideodevicecontrol.cpp b/src/multimedia/mediaservices/base/qvideodevicecontrol.cpp new file mode 100644 index 0000000..128cee9 --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideodevicecontrol.cpp @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +/*! + \class QVideoDeviceControl + \preliminary + \since 4.7 + \brief The QVideoDeviceControl class provides an video device selector media control. + \ingroup multimedia-serv + + The QVideoDeviceControl class provides descriptions of the video devices + available on a system and allows one to be selected as the endpoint of + a media service. + + The interface name of QVideoDeviceControl is \c com.nokia.Qt.VideoDeviceControl as + defined in QVideoDeviceControl_iid. +*/ + +/*! + \macro QVideoDeviceControl_iid + + \c com.nokia.Qt.VideoDeviceControl + + Defines the interface name of the QVideoDeviceControl class. + + \relates QVideoDeviceControl +*/ + +/*! + Constructs a video device control with the given \a parent. +*/ +QVideoDeviceControl::QVideoDeviceControl(QObject *parent) + :QMediaControl(parent) +{ +} + +/*! + Destroys a video device control. +*/ +QVideoDeviceControl::~QVideoDeviceControl() +{ +} + +/*! + \fn QVideoDeviceControl::deviceCount() const + + Returns the number of available video devices; +*/ + +/*! + \fn QVideoDeviceControl::deviceName(int index) const + + Returns the name of the video device at \a index. +*/ + +/*! + \fn QVideoDeviceControl::deviceDescription(int index) const + + Returns a description of the video device at \a index. +*/ + +/*! + \fn QVideoDeviceControl::deviceIcon(int index) const + + Returns an icon for the video device at \a index. +*/ + +/*! + \fn QVideoDeviceControl::defaultDevice() const + + Returns the index of the default video device. +*/ + +/*! + \fn QVideoDeviceControl::selectedDevice() const + + Returns the index of the selected video device. +*/ + +/*! + \fn QVideoDeviceControl::setSelectedDevice(int index) + + Sets the selected video device \a index. +*/ + +/*! + \fn QVideoDeviceControl::devicesChanged() + + Signals that the list of available video devices has changed. +*/ + +/*! + \fn QVideoDeviceControl::selectedDeviceChanged(int index) + + Signals that the selected video device \a index has changed. +*/ + +/*! + \fn QVideoDeviceControl::selectedDeviceChanged(const QString &name) + + Signals that the selected video device \a name has changed. +*/ + +QT_END_NAMESPACE + +QT_END_HEADER + +#include "moc_qvideodevicecontrol.cpp" + + diff --git a/src/multimedia/mediaservices/base/qvideodevicecontrol.h b/src/multimedia/mediaservices/base/qvideodevicecontrol.h new file mode 100644 index 0000000..df1d4fa --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideodevicecontrol.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QVIDEODEVICECONTROL_H +#define QVIDEODEVICECONTROL_H + +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class Q_MULTIMEDIA_EXPORT QVideoDeviceControl : public QMediaControl +{ + Q_OBJECT + +public: + virtual ~QVideoDeviceControl(); + + virtual int deviceCount() const = 0; + + virtual QString deviceName(int index) const = 0; + virtual QString deviceDescription(int index) const = 0; + virtual QIcon deviceIcon(int index) const = 0; + + virtual int defaultDevice() const = 0; + virtual int selectedDevice() const = 0; + +public Q_SLOTS: + virtual void setSelectedDevice(int index) = 0; + +Q_SIGNALS: + void selectedDeviceChanged(int index); + void selectedDeviceChanged(const QString &deviceName); + void devicesChanged(); + +protected: + QVideoDeviceControl(QObject *parent = 0); +}; + +#define QVideoDeviceControl_iid "com.nokia.Qt.QVideoDeviceControl/1.0" +Q_MEDIA_DECLARE_CONTROL(QVideoDeviceControl, QVideoDeviceControl_iid) + + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QVIDEODEVICECONTROL_H diff --git a/src/multimedia/mediaservices/base/qvideooutputcontrol.cpp b/src/multimedia/mediaservices/base/qvideooutputcontrol.cpp new file mode 100644 index 0000000..7d7ed4b --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideooutputcontrol.cpp @@ -0,0 +1,135 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 + + +QT_BEGIN_NAMESPACE + +/*! + \class QVideoOutputControl + \preliminary + \since 4.7 + \brief The QVideoOutputControl class provides a means of selecting the + active video output control. + + \ingroup multimedia-serv + + There are multiple controls which a QMediaService may use to output + video ony one of which may be active at one time, QVideoOutputControl + is the means by which this active control is selected. + + The possible output controls are QVideoRendererControl, + QVideoWindowControl, and QVideoWidgetControl. + + The interface name of QVideoOutputControl is \c com.nokia.Qt.QVideoOutputControl/1.0 as + defined in QVideoOutputControl_iid. + + \sa QMediaService::control(), QVideoWidget, QVideoRendererControl, + QVideoWindowControl, QVideoWidgetControl +*/ + +/*! + \macro QVideoOutputControl_iid + + \c com.nokia.Qt.QVideoOutputControl/1.0 + + Defines the interface name of the QVideoOutputControl class. + + \relates QVideoOutputControl +*/ + +/*! + \enum QVideoOutputControl::Output + + Identifies the possible render targets of a video output. + + \value NoOutput Video is not rendered. + \value WindowOutput Video is rendered to the target of a QVideoWindowControl. + \value RendererOutput Video is rendered to the target of a QVideoRendererControl. + \value WidgetOutput Video is rendered to a QWidget provided by QVideoWidgetControl. + \value UserOutput Start value for user defined video targets. + \value MaxUserOutput End value for user defined video targets. +*/ + +/*! + Constructs a new video output control with the given \a parent. +*/ +QVideoOutputControl::QVideoOutputControl(QObject *parent) + : QMediaControl(parent) +{ +} + +/*! + Destroys a video output control. +*/ +QVideoOutputControl::~QVideoOutputControl() +{ +} + +/*! + \fn QList QVideoOutputControl::availableOutputs() const + + Returns a list of available video output targets. +*/ + +/*! + \fn QVideoOutputControl::output() const + + Returns the current video output target. +*/ + +/*! + \fn QVideoOutputControl::setOutput(Output output) + + Sets the current video \a output target. +*/ + +/*! + \fn QVideoOutputControl::availableOutputsChanged(const QList &outputs) + + Signals that available set of video \a outputs has changed. +*/ + +#include "moc_qvideooutputcontrol.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qvideooutputcontrol.h b/src/multimedia/mediaservices/base/qvideooutputcontrol.h new file mode 100644 index 0000000..05bc164 --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideooutputcontrol.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QVIDEOOUTPUTCONTROL_H +#define QVIDEOOUTPUTCONTROL_H + +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class Q_MULTIMEDIA_EXPORT QVideoOutputControl : public QMediaControl +{ + Q_OBJECT + +public: + enum Output + { + NoOutput, + WindowOutput, + RendererOutput, + WidgetOutput, + UserOutput = 100, + MaxUserOutput = 1000 + }; + + ~QVideoOutputControl(); + + virtual QList availableOutputs() const = 0; + + virtual Output output() const = 0; + virtual void setOutput(Output output) = 0; + +Q_SIGNALS: + void availableOutputsChanged(const QList &outputs); + +protected: + QVideoOutputControl(QObject *parent = 0); +}; + +#define QVideoOutputControl_iid "com.nokia.Qt.QVideoOutputControl/1.0" +Q_MEDIA_DECLARE_CONTROL(QVideoOutputControl, QVideoOutputControl_iid) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qvideorenderercontrol.cpp b/src/multimedia/mediaservices/base/qvideorenderercontrol.cpp new file mode 100644 index 0000000..bd7c78d --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideorenderercontrol.cpp @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qmediacontrol_p.h" + + +QT_BEGIN_NAMESPACE + +/*! + \class QVideoRendererControl + \preliminary + \since 4.7 + \brief The QVideoRendererControl class provides a control for rendering + to a video surface. + + \ingroup multimedia-serv + + Using the surface() property of QVideoRendererControl a QAbstractVideoSurface + may be set as the video render target of a QMediaService. + + \code + QVideoRendererControl *rendererControl = mediaService->control(); + rendererControl->setSurface(myVideoSurface); + \endcode + + QVideoRendererControl is one of number of possible video output controls, + in order to receive video it must be made the active video output + control by setting the output property of QVideoOutputControl to + \l {QVideoOutputControl::RendererOutput}{RendererOutput}. Consequently any + QMediaService that implements QVideoRendererControl must also implement + QVideoOutputControl. + + \code + QVideoOutputControl *outputControl = mediaService->control(); + outputControl->setOutput(QVideoOutputControl::RendererOutput); + \endcode + + The interface name of QVideoRendererControl is \c com.nokia.Qt.QVideoRendererControl/1.0 as + defined in QVideoRendererControl_iid. + + \sa QMediaService::control(), QVideoOutputControl, QVideoWidget +*/ + +/*! + \macro QVideoRendererControl_iid + + \c com.nokia.Qt.QVideoRendererControl/1.0 + + Defines the interface name of the QVideoRendererControl class. + + \relates QVideoRendererControl +*/ + +/*! + Constructs a new video renderer media end point with the given \a parent. +*/ +QVideoRendererControl::QVideoRendererControl(QObject *parent) + : QMediaControl(parent) +{ +} + +/*! + Destroys a video renderer media end point. +*/ +QVideoRendererControl::~QVideoRendererControl() +{ +} + +/*! + \fn QVideoRendererControl::surface() const + + Returns the surface a video producer renders to. +*/ + +/*! + \fn QVideoRendererControl::setSurface(QAbstractVideoSurface *surface) + + Sets the \a surface a video producer renders to. +*/ + +#include "moc_qvideorenderercontrol.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qvideorenderercontrol.h b/src/multimedia/mediaservices/base/qvideorenderercontrol.h new file mode 100644 index 0000000..fd130ac --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideorenderercontrol.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QVIDEORENDERERCONTROL_H +#define QVIDEORENDERERCONTROL_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QAbstractVideoSurface; + +class Q_MULTIMEDIA_EXPORT QVideoRendererControl : public QMediaControl +{ + Q_OBJECT + +public: + ~QVideoRendererControl(); + + virtual QAbstractVideoSurface *surface() const = 0; + virtual void setSurface(QAbstractVideoSurface *surface) = 0; + +protected: + QVideoRendererControl(QObject *parent = 0); +}; + +#define QVideoRendererControl_iid "com.nokia.Qt.QVideoRendererControl/1.0" +Q_MEDIA_DECLARE_CONTROL(QVideoRendererControl, QVideoRendererControl_iid) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QVIDEORENDERERCONTROL_H diff --git a/src/multimedia/mediaservices/base/qvideowidget.cpp b/src/multimedia/mediaservices/base/qvideowidget.cpp new file mode 100644 index 0000000..52291b0 --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideowidget.cpp @@ -0,0 +1,944 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qvideowidget_p.h" + +#include +#include +#include +#include +#include + +#include "qpaintervideosurface_p.h" +#include +#include +#include + +#include +#include +#include +#include +#include + + +QT_BEGIN_NAMESPACE + +QVideoWidgetControlBackend::QVideoWidgetControlBackend( + QVideoWidgetControl *control, QWidget *widget) + : m_widgetControl(control) +{ + connect(control, SIGNAL(brightnessChanged(int)), widget, SLOT(_q_brightnessChanged(int))); + connect(control, SIGNAL(contrastChanged(int)), widget, SLOT(_q_contrastChanged(int))); + connect(control, SIGNAL(hueChanged(int)), widget, SLOT(_q_hueChanged(int))); + connect(control, SIGNAL(saturationChanged(int)), widget, SLOT(_q_saturationChanged(int))); + connect(control, SIGNAL(fullScreenChanged(bool)), widget, SLOT(_q_fullScreenChanged(bool))); + + QBoxLayout *layout = new QVBoxLayout; + layout->setMargin(0); + layout->setSpacing(0); + layout->addWidget(control->videoWidget()); + + widget->setLayout(layout); +} + +void QVideoWidgetControlBackend::setBrightness(int brightness) +{ + m_widgetControl->setBrightness(brightness); +} + +void QVideoWidgetControlBackend::setContrast(int contrast) +{ + m_widgetControl->setContrast(contrast); +} + +void QVideoWidgetControlBackend::setHue(int hue) +{ + m_widgetControl->setHue(hue); +} + +void QVideoWidgetControlBackend::setSaturation(int saturation) +{ + m_widgetControl->setSaturation(saturation); +} + +void QVideoWidgetControlBackend::setFullScreen(bool fullScreen) +{ + m_widgetControl->setFullScreen(fullScreen); +} + + +Qt::AspectRatioMode QVideoWidgetControlBackend::aspectRatioMode() const +{ + return m_widgetControl->aspectRatioMode(); +} + +void QVideoWidgetControlBackend::setAspectRatioMode(Qt::AspectRatioMode mode) +{ + m_widgetControl->setAspectRatioMode(mode); +} + +QRendererVideoWidgetBackend::QRendererVideoWidgetBackend( + QVideoRendererControl *control, QWidget *widget) + : m_rendererControl(control) + , m_widget(widget) + , m_surface(new QPainterVideoSurface) + , m_aspectRatioMode(Qt::KeepAspectRatio) + , m_updatePaintDevice(true) +{ + connect(this, SIGNAL(brightnessChanged(int)), m_widget, SLOT(_q_brightnessChanged(int))); + connect(this, SIGNAL(contrastChanged(int)), m_widget, SLOT(_q_contrastChanged(int))); + connect(this, SIGNAL(hueChanged(int)), m_widget, SLOT(_q_hueChanged(int))); + connect(this, SIGNAL(saturationChanged(int)), m_widget, SLOT(_q_saturationChanged(int))); + connect(m_surface, SIGNAL(frameChanged()), this, SLOT(frameChanged())); + connect(m_surface, SIGNAL(surfaceFormatChanged(QVideoSurfaceFormat)), + this, SLOT(formatChanged(QVideoSurfaceFormat))); + + m_rendererControl->setSurface(m_surface); +} + +QRendererVideoWidgetBackend::~QRendererVideoWidgetBackend() +{ + delete m_surface; +} + +void QRendererVideoWidgetBackend::clearSurface() +{ + m_rendererControl->setSurface(0); +} + +void QRendererVideoWidgetBackend::setBrightness(int brightness) +{ + m_surface->setBrightness(brightness); + + emit brightnessChanged(brightness); +} + +void QRendererVideoWidgetBackend::setContrast(int contrast) +{ + m_surface->setContrast(contrast); + + emit contrastChanged(contrast); +} + +void QRendererVideoWidgetBackend::setHue(int hue) +{ + m_surface->setHue(hue); + + emit hueChanged(hue); +} + +void QRendererVideoWidgetBackend::setSaturation(int saturation) +{ + m_surface->setSaturation(saturation); + + emit saturationChanged(saturation); +} + +Qt::AspectRatioMode QRendererVideoWidgetBackend::aspectRatioMode() const +{ + return m_aspectRatioMode; +} + +void QRendererVideoWidgetBackend::setAspectRatioMode(Qt::AspectRatioMode mode) +{ + m_aspectRatioMode = mode; + + m_widget->updateGeometry(); +} + +void QRendererVideoWidgetBackend::setFullScreen(bool) +{ +} + +QSize QRendererVideoWidgetBackend::sizeHint() const +{ + return m_surface->surfaceFormat().sizeHint(); +} + +void QRendererVideoWidgetBackend::showEvent() +{ +} + +void QRendererVideoWidgetBackend::hideEvent(QHideEvent *) +{ +#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) + m_updatePaintDevice = true; + m_surface->setGLContext(0); +#endif +} + +void QRendererVideoWidgetBackend::resizeEvent(QResizeEvent *) +{ + updateRects(); +} + +void QRendererVideoWidgetBackend::moveEvent(QMoveEvent *) +{ +} + +void QRendererVideoWidgetBackend::paintEvent(QPaintEvent *event) +{ + QPainter painter(m_widget); + + if (m_widget->testAttribute(Qt::WA_OpaquePaintEvent)) { + QRegion borderRegion = event->region(); + borderRegion = borderRegion.subtracted(m_boundingRect); + + QBrush brush = m_widget->palette().window(); + + QVector rects = borderRegion.rects(); + for (QVector::iterator it = rects.begin(), end = rects.end(); it != end; ++it) { + painter.fillRect(*it, brush); + } + } + + if (m_surface->isActive() && m_boundingRect.intersects(event->rect())) { + m_surface->paint(&painter, m_boundingRect, m_sourceRect); + + m_surface->setReady(true); + } else { + #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) + if (m_updatePaintDevice && (painter.paintEngine()->type() == QPaintEngine::OpenGL + || painter.paintEngine()->type() == QPaintEngine::OpenGL2)) { + m_updatePaintDevice = false; + + m_surface->setGLContext(const_cast(QGLContext::currentContext())); + if (m_surface->supportedShaderTypes() & QPainterVideoSurface::GlslShader) { + m_surface->setShaderType(QPainterVideoSurface::GlslShader); + } else { + m_surface->setShaderType(QPainterVideoSurface::FragmentProgramShader); + } + } +#endif + } + +} + +void QRendererVideoWidgetBackend::formatChanged(const QVideoSurfaceFormat &format) +{ + m_nativeSize = format.sizeHint(); + + updateRects(); + + m_widget->updateGeometry(); + m_widget->update(); +} + +void QRendererVideoWidgetBackend::frameChanged() +{ + m_widget->update(m_boundingRect); +} + +void QRendererVideoWidgetBackend::updateRects() +{ + QRect rect = m_widget->rect(); + + if (m_nativeSize.isEmpty()) { + m_boundingRect = QRect(); + } else if (m_aspectRatioMode == Qt::IgnoreAspectRatio) { + m_boundingRect = rect; + m_sourceRect = QRectF(0, 0, 1, 1); + } else if (m_aspectRatioMode == Qt::KeepAspectRatio) { + QSize size = m_nativeSize; + size.scale(rect.size(), Qt::KeepAspectRatio); + + m_boundingRect = QRect(0, 0, size.width(), size.height()); + m_boundingRect.moveCenter(rect.center()); + + m_sourceRect = QRectF(0, 0, 1, 1); + } else if (m_aspectRatioMode == Qt::KeepAspectRatioByExpanding) { + m_boundingRect = rect; + + QSizeF size = rect.size(); + size.scale(m_nativeSize, Qt::KeepAspectRatio); + + m_sourceRect = QRectF( + 0, 0, size.width() / m_nativeSize.width(), size.height() / m_nativeSize.height()); + m_sourceRect.moveCenter(QPointF(0.5, 0.5)); + } +} + +QWindowVideoWidgetBackend::QWindowVideoWidgetBackend(QVideoWindowControl *control, QWidget *widget) + : m_windowControl(control) + , m_widget(widget) + , m_aspectRatioMode(Qt::KeepAspectRatio) +{ + connect(control, SIGNAL(brightnessChanged(int)), m_widget, SLOT(_q_brightnessChanged(int))); + connect(control, SIGNAL(contrastChanged(int)), m_widget, SLOT(_q_contrastChanged(int))); + connect(control, SIGNAL(hueChanged(int)), m_widget, SLOT(_q_hueChanged(int))); + connect(control, SIGNAL(saturationChanged(int)), m_widget, SLOT(_q_saturationChanged(int))); + connect(control, SIGNAL(fullScreenChanged(bool)), m_widget, SLOT(_q_fullScreenChanged(bool))); + connect(control, SIGNAL(nativeSizeChanged()), m_widget, SLOT(_q_dimensionsChanged())); +} + +QWindowVideoWidgetBackend::~QWindowVideoWidgetBackend() +{ +} + +void QWindowVideoWidgetBackend::setBrightness(int brightness) +{ + m_windowControl->setBrightness(brightness); +} + +void QWindowVideoWidgetBackend::setContrast(int contrast) +{ + m_windowControl->setContrast(contrast); +} + +void QWindowVideoWidgetBackend::setHue(int hue) +{ + m_windowControl->setHue(hue); +} + +void QWindowVideoWidgetBackend::setSaturation(int saturation) +{ + m_windowControl->setSaturation(saturation); +} + +void QWindowVideoWidgetBackend::setFullScreen(bool fullScreen) +{ + m_windowControl->setFullScreen(fullScreen); +} + +Qt::AspectRatioMode QWindowVideoWidgetBackend::aspectRatioMode() const +{ + return m_windowControl->aspectRatioMode(); +} + +void QWindowVideoWidgetBackend::setAspectRatioMode(Qt::AspectRatioMode mode) +{ + m_windowControl->setAspectRatioMode(mode); +} + +QSize QWindowVideoWidgetBackend::sizeHint() const +{ + return m_windowControl->nativeSize(); +} + +void QWindowVideoWidgetBackend::showEvent() +{ + m_windowControl->setWinId(m_widget->winId()); + + m_windowControl->setDisplayRect(m_widget->rect()); +} + +void QWindowVideoWidgetBackend::hideEvent(QHideEvent *) +{ +} + +void QWindowVideoWidgetBackend::moveEvent(QMoveEvent *) +{ + m_windowControl->setDisplayRect(m_widget->rect()); +} + +void QWindowVideoWidgetBackend::resizeEvent(QResizeEvent *) +{ + m_windowControl->setDisplayRect(m_widget->rect()); +} + +void QWindowVideoWidgetBackend::paintEvent(QPaintEvent *event) +{ + if (m_widget->testAttribute(Qt::WA_OpaquePaintEvent)) { + QPainter painter(m_widget); + + painter.fillRect(event->rect(), m_widget->palette().window()); + } + + m_windowControl->repaint(); + + event->accept(); +} + +void QVideoWidgetPrivate::setCurrentControl(QVideoWidgetControlInterface *control) +{ + if (currentControl != control) { + currentControl = control; + + currentControl->setBrightness(brightness); + currentControl->setContrast(contrast); + currentControl->setHue(hue); + currentControl->setSaturation(saturation); + currentControl->setAspectRatioMode(aspectRatioMode); + } +} + +void QVideoWidgetPrivate::show() +{ + if (outputControl) { + if (widgetBackend != 0) { + setCurrentControl(widgetBackend); + outputControl->setOutput(QVideoOutputControl::WidgetOutput); + } else if (windowBackend != 0 && (q_func()->window() == 0 + || !q_func()->window()->testAttribute(Qt::WA_DontShowOnScreen))) { + windowBackend->showEvent(); + currentBackend = windowBackend; + setCurrentControl(windowBackend); + outputControl->setOutput(QVideoOutputControl::WindowOutput); + } else if (rendererBackend != 0) { + rendererBackend->showEvent(); + currentBackend = rendererBackend; + setCurrentControl(rendererBackend); + outputControl->setOutput(QVideoOutputControl::RendererOutput); + } else { + outputControl->setOutput(QVideoOutputControl::NoOutput); + } + } +} + +void QVideoWidgetPrivate::clearService() +{ + if (service) { + QObject::disconnect(service, SIGNAL(destroyed()), q_func(), SLOT(_q_serviceDestroyed())); + + if (outputControl) + outputControl->setOutput(QVideoOutputControl::NoOutput); + + if (widgetBackend) { + QLayout *layout = q_func()->layout(); + + for (QLayoutItem *item = layout->takeAt(0); item; item = layout->takeAt(0)) { + item->widget()->setParent(0); + delete item; + } + delete layout; + + delete widgetBackend; + widgetBackend = 0; + } + + delete windowBackend; + windowBackend = 0; + + if (rendererBackend) { + rendererBackend->clearSurface(); + + delete rendererBackend; + rendererBackend = 0; + } + + currentBackend = 0; + currentControl = 0; + outputControl = 0; + service = 0; + } +} + +void QVideoWidgetPrivate::_q_serviceDestroyed() +{ + if (widgetBackend) { + delete q_func()->layout(); + + delete widgetBackend; + widgetBackend = 0; + } + + delete windowBackend; + windowBackend = 0; + + delete rendererBackend; + rendererBackend = 0; + + currentControl = 0; + currentBackend = 0; + outputControl = 0; + service = 0; +} + +void QVideoWidgetPrivate::_q_mediaObjectDestroyed() +{ + mediaObject = 0; + clearService(); +} + +void QVideoWidgetPrivate::_q_brightnessChanged(int b) +{ + if (b != brightness) + emit q_func()->brightnessChanged(brightness = b); +} + +void QVideoWidgetPrivate::_q_contrastChanged(int c) +{ + if (c != contrast) + emit q_func()->contrastChanged(contrast = c); +} + +void QVideoWidgetPrivate::_q_hueChanged(int h) +{ + if (h != hue) + emit q_func()->hueChanged(hue = h); +} + +void QVideoWidgetPrivate::_q_saturationChanged(int s) +{ + if (s != saturation) + emit q_func()->saturationChanged(saturation = s); +} + + +void QVideoWidgetPrivate::_q_fullScreenChanged(bool fullScreen) +{ + if (!fullScreen && q_func()->isFullScreen()) + q_func()->showNormal(); +} + +void QVideoWidgetPrivate::_q_dimensionsChanged() +{ + q_func()->updateGeometry(); + q_func()->update(); +} + +/*! + \class QVideoWidget + \preliminary + \since 4.7 + \brief The QVideoWidget class provides a widget which presents video + produced by a media object. + \ingroup multimedia + + Attaching a QVideoWidget to a QMediaObject allows it to display the + video or image output of that media object. A QVideoWidget is attached + to media object by passing a pointer to the QMediaObject in its + constructor, and detached by destroying the QVideoWidget. + + \code + player = new QMediaPlayer; + + widget = new QVideoWidget(player); + widget->show(); + + player->setMedia(QUrl("http://example.com/movie.mp4")); + player->play(); + \endcode + + \bold {Note}: Only a single display output can be attached to a media + object at one time. + + \sa QMediaObject, QMediaPlayer, QGraphicsVideoItem +*/ + +/*! + Constructs a new video widget. + + The \a parent is passed to QWidget. +*/ +QVideoWidget::QVideoWidget(QWidget *parent) + : QWidget(parent, 0) + , d_ptr(new QVideoWidgetPrivate) +{ + d_ptr->q_ptr = this; +} + +/*! + Destroys a video widget. +*/ +QVideoWidget::~QVideoWidget() +{ + setMediaObject(0); + delete d_ptr; +} + +/*! + \property QVideoWidget::mediaObject + \brief the media object which provides the video displayed by a widget. +*/ + +QMediaObject *QVideoWidget::mediaObject() const +{ + return d_func()->mediaObject; +} + +void QVideoWidget::setMediaObject(QMediaObject *object) +{ + Q_D(QVideoWidget); + + if (object == d->mediaObject) + return; + + if (d->mediaObject) { + disconnect(d->mediaObject, SIGNAL(destroyed()), this, SLOT(_q_mediaObjectDestroyed())); + d->mediaObject->unbind(this); + } + + d->clearService(); + + d->mediaObject = object; + + if (d->mediaObject) { + d->service = d->mediaObject->service(); + + connect(d->mediaObject, SIGNAL(destroyed()), this, SLOT(_q_mediaObjectDestroyed())); + d->mediaObject->bind(this); + } + + if (d->service) { + connect(d->service, SIGNAL(destroyed()), SLOT(_q_serviceDestroyed())); + + d->outputControl = qobject_cast( + d->service->control(QVideoOutputControl_iid)); + + QVideoWidgetControl *widgetControl = qobject_cast( + d->service->control(QVideoWidgetControl_iid)); + + if (widgetControl != 0) { + d->widgetBackend = new QVideoWidgetControlBackend(widgetControl, this); + } else { + QVideoWindowControl *windowControl = qobject_cast( + d->service->control(QVideoWindowControl_iid)); + + if (windowControl != 0) + d->windowBackend = new QWindowVideoWidgetBackend(windowControl, this); + + QVideoRendererControl *rendererControl = qobject_cast( + d->service->control(QVideoRendererControl_iid)); + + if (rendererControl != 0) + d->rendererBackend = new QRendererVideoWidgetBackend(rendererControl, this); + } + + if (isVisible()) + d->show(); + } +} + +/*! + \property QVideoWidget::aspectRatioMode + \brief how video is scaled with respect to its aspect ratio. +*/ + +Qt::AspectRatioMode QVideoWidget::aspectRatioMode() const +{ + return d_func()->aspectRatioMode; +} + +void QVideoWidget::setAspectRatioMode(Qt::AspectRatioMode mode) +{ + Q_D(QVideoWidget); + + if (d->currentControl) { + d->currentControl->setAspectRatioMode(mode); + d->aspectRatioMode = d->currentControl->aspectRatioMode(); + } else { + d->aspectRatioMode = mode; + } +} + +/*! + \property QVideoWidget::fullScreen + \brief whether video display is confined to a window or is fullScreen. +*/ + +void QVideoWidget::setFullScreen(bool fullScreen) +{ + Q_D(QVideoWidget); + + if (fullScreen) { + Qt::WindowFlags flags = windowFlags(); + + d->nonFullScreenFlags = flags & (Qt::Window | Qt::SubWindow); + flags |= Qt::Window; + flags &= ~Qt::SubWindow; + setWindowFlags(flags); + + showFullScreen(); + } else { + showNormal(); + } +} + +/*! + \fn QVideoWidget::fullScreenChanged(bool fullScreen) + + Signals that the \a fullScreen mode of a video widget has changed. + + \sa fullScreen +*/ + +/*! + \property QVideoWidget::brightness + \brief an adjustment to the brightness of displayed video. + + Valid brightness values range between -100 and 100, the default is 0. +*/ + +int QVideoWidget::brightness() const +{ + return d_func()->brightness; +} + +void QVideoWidget::setBrightness(int brightness) +{ + Q_D(QVideoWidget); + + int boundedBrightness = qBound(-100, brightness, 100); + + if (d->currentControl) + d->currentControl->setBrightness(boundedBrightness); + else if (d->brightness != boundedBrightness) + emit brightnessChanged(d->brightness = boundedBrightness); +} + +/*! + \fn QVideoWidget::brightnessChanged(int brightness) + + Signals that a video widgets's \a brightness adjustment has changed. + + \sa brightness +*/ + +/*! + \property QVideoWidget::contrast + \brief an adjustment to the contrast of displayed video. + + Valid contrast values range between -100 and 100, the default is 0. + +*/ + +int QVideoWidget::contrast() const +{ + return d_func()->contrast; +} + +void QVideoWidget::setContrast(int contrast) +{ + Q_D(QVideoWidget); + + int boundedContrast = qBound(-100, contrast, 100); + + if (d->currentControl) + d->currentControl->setContrast(boundedContrast); + else if (d->contrast != boundedContrast) + emit contrastChanged(d->contrast = boundedContrast); +} + +/*! + \fn QVideoWidget::contrastChanged(int contrast) + + Signals that a video widgets's \a contrast adjustment has changed. + + \sa contrast +*/ + +/*! + \property QVideoWidget::hue + \brief an adjustment to the hue of displayed video. + + Valid hue values range between -100 and 100, the default is 0. +*/ + +int QVideoWidget::hue() const +{ + return d_func()->hue; +} + +void QVideoWidget::setHue(int hue) +{ + Q_D(QVideoWidget); + + int boundedHue = qBound(-100, hue, 100); + + if (d->currentControl) + d->currentControl->setHue(boundedHue); + else if (d->hue != boundedHue) + emit hueChanged(d->hue = boundedHue); +} + +/*! + \fn QVideoWidget::hueChanged(int hue) + + Signals that a video widgets's \a hue has changed. + + \sa hue +*/ + +/*! + \property QVideoWidget::saturation + \brief an adjustment to the saturation of displayed video. + + Valid saturation values range between -100 and 100, the default is 0. +*/ + +int QVideoWidget::saturation() const +{ + return d_func()->saturation; +} + +void QVideoWidget::setSaturation(int saturation) +{ + Q_D(QVideoWidget); + + int boundedSaturation = qBound(-100, saturation, 100); + + if (d->currentControl) + d->currentControl->setSaturation(boundedSaturation); + else if (d->saturation != boundedSaturation) + emit saturationChanged(d->saturation = boundedSaturation); + +} + +/*! + \fn QVideoWidget::saturationChanged(int saturation) + + Signals that a video widgets's \a saturation has changed. + + \sa saturation +*/ + +/*! + Returns the size hint for the current back end, + if there is one, or else the size hint from QWidget. + */ +QSize QVideoWidget::sizeHint() const +{ + Q_D(const QVideoWidget); + + if (d->currentBackend) + return d->currentBackend->sizeHint(); + else + return QWidget::sizeHint(); + + +} + +/*! + \reimp + \internal + */ +bool QVideoWidget::event(QEvent *event) +{ + Q_D(QVideoWidget); + + if (event->type() == QEvent::WindowStateChange) { + Qt::WindowFlags flags = windowFlags(); + + if (windowState() & Qt::WindowFullScreen) { + if (d->currentControl) + d->currentControl->setFullScreen(true); + + if (!d->wasFullScreen) + emit fullScreenChanged(d->wasFullScreen = true); + } else { + if (d->currentControl) + d->currentControl->setFullScreen(false); + + if (d->wasFullScreen) { + flags &= ~(Qt::Window | Qt::SubWindow); //clear the flags... + flags |= d->nonFullScreenFlags; //then we reset the flags (window and subwindow) + setWindowFlags(flags); + + emit fullScreenChanged(d->wasFullScreen = false); + } + } + } + return QWidget::event(event); +} + +/*! + Handles the show \a event. + */ +void QVideoWidget::showEvent(QShowEvent *event) +{ + Q_D(QVideoWidget); + + QWidget::showEvent(event); + + d->show(); + +} + +/*! + + Handles the hide \a event. +*/ +void QVideoWidget::hideEvent(QHideEvent *event) +{ + Q_D(QVideoWidget); + + if (d->currentBackend) + d->currentBackend->hideEvent(event); + + QWidget::hideEvent(event); +} + +/*! + Handles the resize \a event. + */ +void QVideoWidget::resizeEvent(QResizeEvent *event) +{ + Q_D(QVideoWidget); + + QWidget::resizeEvent(event); + + if (d->currentBackend) + d->currentBackend->resizeEvent(event); +} + +/*! + Handles the move \a event. + */ +void QVideoWidget::moveEvent(QMoveEvent *event) +{ + Q_D(QVideoWidget); + + if (d->currentBackend) + d->currentBackend->moveEvent(event); +} + +/*! + Handles the paint \a event. + */ +void QVideoWidget::paintEvent(QPaintEvent *event) +{ + Q_D(QVideoWidget); + + if (d->currentBackend) { + d->currentBackend->paintEvent(event); + } else if (testAttribute(Qt::WA_OpaquePaintEvent)) { + QPainter painter(this); + + painter.fillRect(event->rect(), palette().window()); + } +} + +#include "moc_qvideowidget.cpp" +#include "moc_qvideowidget_p.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qvideowidget.h b/src/multimedia/mediaservices/base/qvideowidget.h new file mode 100644 index 0000000..080e19c --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideowidget.h @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QVIDEOWIDGET_H +#define QVIDEOWIDGET_H + +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QMediaObject; + +class QVideoWidgetPrivate; +class Q_MULTIMEDIA_EXPORT QVideoWidget : public QWidget +{ + Q_OBJECT + Q_PROPERTY(QMediaObject* mediaObject READ mediaObject WRITE setMediaObject) + Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged) + Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode NOTIFY aspectRatioModeChanged) + Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) + Q_PROPERTY(int contrast READ contrast WRITE setContrast NOTIFY contrastChanged) + Q_PROPERTY(int hue READ hue WRITE setHue NOTIFY hueChanged) + Q_PROPERTY(int saturation READ saturation WRITE setSaturation NOTIFY saturationChanged) + +public: + QVideoWidget(QWidget *parent = 0); + ~QVideoWidget(); + + QMediaObject *mediaObject() const; + void setMediaObject(QMediaObject *object); + +#ifdef Q_QDOC + bool isFullScreen() const; +#endif + + Qt::AspectRatioMode aspectRatioMode() const; + + int brightness() const; + int contrast() const; + int hue() const; + int saturation() const; + + QSize sizeHint() const; + +public Q_SLOTS: + void setFullScreen(bool fullScreen); + void setAspectRatioMode(Qt::AspectRatioMode mode); + void setBrightness(int brightness); + void setContrast(int contrast); + void setHue(int hue); + void setSaturation(int saturation); + +Q_SIGNALS: + void fullScreenChanged(bool fullScreen); + void brightnessChanged(int brightness); + void contrastChanged(int contrast); + void hueChanged(int hue); + void saturationChanged(int saturation); + +protected: + bool event(QEvent *event); + void showEvent(QShowEvent *event); + void hideEvent(QHideEvent *event); + void resizeEvent(QResizeEvent *event); + void moveEvent(QMoveEvent *event); + void paintEvent(QPaintEvent *event); + +protected: + QVideoWidgetPrivate *d_ptr; + +private: + Q_DECLARE_PRIVATE(QVideoWidget) + Q_PRIVATE_SLOT(d_func(), void _q_serviceDestroyed()) + Q_PRIVATE_SLOT(d_func(), void _q_mediaObjectDestroyed()) + Q_PRIVATE_SLOT(d_func(), void _q_brightnessChanged(int)) + Q_PRIVATE_SLOT(d_func(), void _q_contrastChanged(int)) + Q_PRIVATE_SLOT(d_func(), void _q_hueChanged(int)) + Q_PRIVATE_SLOT(d_func(), void _q_saturationChanged(int)) + Q_PRIVATE_SLOT(d_func(), void _q_fullScreenChanged(bool)) + Q_PRIVATE_SLOT(d_func(), void _q_dimensionsChanged()); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qvideowidget_p.h b/src/multimedia/mediaservices/base/qvideowidget_p.h new file mode 100644 index 0000000..4f67117 --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideowidget_p.h @@ -0,0 +1,271 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QVIDEOWIDGET_P_H +#define QVIDEOWIDGET_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +#ifndef QT_NO_OPENGL +#include +#endif + +#include "qpaintervideosurface_p.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QVideoWidgetControlInterface +{ +public: + virtual ~QVideoWidgetControlInterface() {} + + virtual void setBrightness(int brightness) = 0; + virtual void setContrast(int contrast) = 0; + virtual void setHue(int hue) = 0; + virtual void setSaturation(int saturation) = 0; + + virtual void setFullScreen(bool fullScreen) = 0; + + virtual Qt::AspectRatioMode aspectRatioMode() const = 0; + virtual void setAspectRatioMode(Qt::AspectRatioMode mode) = 0; +}; + +class QVideoWidgetBackend : public QObject, public QVideoWidgetControlInterface +{ + Q_OBJECT + +public: + virtual QSize sizeHint() const = 0; + + virtual void showEvent() = 0; + virtual void hideEvent(QHideEvent *event) = 0; + virtual void resizeEvent(QResizeEvent *event) = 0; + virtual void moveEvent(QMoveEvent *event) = 0; + virtual void paintEvent(QPaintEvent *event) = 0; +}; + +class QVideoWidgetControl; + +class QVideoWidgetControlBackend : public QObject, public QVideoWidgetControlInterface +{ + Q_OBJECT +public: + QVideoWidgetControlBackend(QVideoWidgetControl *control, QWidget *widget); + + void setBrightness(int brightness); + void setContrast(int contrast); + void setHue(int hue); + void setSaturation(int saturation); + + void setFullScreen(bool fullScreen); + + Qt::AspectRatioMode aspectRatioMode() const; + void setAspectRatioMode(Qt::AspectRatioMode mode); + +private: + QVideoWidgetControl *m_widgetControl; +}; + + +class QVideoRendererControl; + +class QRendererVideoWidgetBackend : public QVideoWidgetBackend +{ + Q_OBJECT +public: + QRendererVideoWidgetBackend(QVideoRendererControl *control, QWidget *widget); + ~QRendererVideoWidgetBackend(); + + void clearSurface(); + + void setBrightness(int brightness); + void setContrast(int contrast); + void setHue(int hue); + void setSaturation(int saturation); + + void setFullScreen(bool fullScreen); + + Qt::AspectRatioMode aspectRatioMode() const; + void setAspectRatioMode(Qt::AspectRatioMode mode); + + QSize sizeHint() const; + + void showEvent(); + void hideEvent(QHideEvent *event); + void resizeEvent(QResizeEvent *event); + void moveEvent(QMoveEvent *event); + void paintEvent(QPaintEvent *event); + +Q_SIGNALS: + void fullScreenChanged(bool fullScreen); + void brightnessChanged(int brightness); + void contrastChanged(int contrast); + void hueChanged(int hue); + void saturationChanged(int saturation); + +private Q_SLOTS: + void formatChanged(const QVideoSurfaceFormat &format); + void frameChanged(); + +private: + void updateRects(); + + QVideoRendererControl *m_rendererControl; + QWidget *m_widget; + QPainterVideoSurface *m_surface; + Qt::AspectRatioMode m_aspectRatioMode; + QRect m_boundingRect; + QRectF m_sourceRect; + QSize m_nativeSize; + bool m_updatePaintDevice; +}; + +class QVideoWindowControl; + +class QWindowVideoWidgetBackend : public QVideoWidgetBackend +{ + Q_OBJECT +public: + QWindowVideoWidgetBackend(QVideoWindowControl *control, QWidget *widget); + ~QWindowVideoWidgetBackend(); + + void setBrightness(int brightness); + void setContrast(int contrast); + void setHue(int hue); + void setSaturation(int saturation); + + void setFullScreen(bool fullScreen); + + Qt::AspectRatioMode aspectRatioMode() const; + void setAspectRatioMode(Qt::AspectRatioMode mode); + + QSize sizeHint() const; + + void showEvent(); + void hideEvent(QHideEvent *event); + void resizeEvent(QResizeEvent *event); + void moveEvent(QMoveEvent *event); + void paintEvent(QPaintEvent *event); + +private: + QVideoWindowControl *m_windowControl; + QWidget *m_widget; + Qt::AspectRatioMode m_aspectRatioMode; + QSize m_pixelAspectRatio; +}; + +class QMediaService; +class QVideoOutputControl; + +class QVideoWidgetPrivate +{ + Q_DECLARE_PUBLIC(QVideoWidget) +public: + QVideoWidgetPrivate() + : q_ptr(0) + , mediaObject(0) + , service(0) + , outputControl(0) + , widgetBackend(0) + , windowBackend(0) + , rendererBackend(0) + , currentControl(0) + , currentBackend(0) + , brightness(0) + , contrast(0) + , hue(0) + , saturation(0) + , aspectRatioMode(Qt::KeepAspectRatio) + , nonFullScreenFlags(0) + , wasFullScreen(false) + { + } + + QVideoWidget *q_ptr; + QMediaObject *mediaObject; + QMediaService *service; + QVideoOutputControl *outputControl; + QVideoWidgetControlBackend *widgetBackend; + QWindowVideoWidgetBackend *windowBackend; + QRendererVideoWidgetBackend *rendererBackend; + QVideoWidgetControlInterface *currentControl; + QVideoWidgetBackend *currentBackend; + int brightness; + int contrast; + int hue; + int saturation; + Qt::AspectRatioMode aspectRatioMode; + Qt::WindowFlags nonFullScreenFlags; + bool wasFullScreen; + + void setCurrentControl(QVideoWidgetControlInterface *control); + void show(); + void clearService(); + + void _q_serviceDestroyed(); + void _q_mediaObjectDestroyed(); + void _q_brightnessChanged(int brightness); + void _q_contrastChanged(int contrast); + void _q_hueChanged(int hue); + void _q_saturationChanged(int saturation); + void _q_fullScreenChanged(bool fullScreen); + void _q_dimensionsChanged(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qvideowidgetcontrol.cpp b/src/multimedia/mediaservices/base/qvideowidgetcontrol.cpp new file mode 100644 index 0000000..1cc7eaf --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideowidgetcontrol.cpp @@ -0,0 +1,235 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 "qmediacontrol_p.h" + + +QT_BEGIN_NAMESPACE + +/*! + \class QVideoWidgetControl + \preliminary + \since 4.7 + \brief The QVideoWidgetControl class provides a media control which + implements a video widget. + + \ingroup multimedia-serv + + The videoWidget() property of QVideoWidgetControl provides a pointer to + a video widget implemented by the control's media service. This widget + is owned by the media service and so care should be taken not to delete it. + + \code + QVideoWidgetControl *widgetControl = mediaService->control(); + + layout->addWidget(widgetControl->widget()); + \endcode + + QVideoWidgetControl is one of number of possible video output controls, + in order to receive video it must be made the active video output + control by setting the output property of QVideoOutputControl to \l {QVideoOutputControl::WidgetOutput}{WidgetOutput}. Consequently any + QMediaService that implements QVideoWidgetControl must also implement + QVideoOutputControl. + + The interface name of QVideoWidgetControl is \c com.nokia.Qt.QVideoWidgetControl/1.0 as + defined in QVideoWidgetControl_iid. + + \sa QMediaService::control(), QVideoOutputControl, QVideoWidget +*/ + +/*! + \macro QVideoWidgetControl_iid + + \c com.nokia.Qt.QVideoWidgetControl/1.0 + + Defines the interface name of the QVideoWidgetControl class. + + \relates QVideoWidgetControl +*/ + +/*! + Constructs a new video widget control with the given \a parent. +*/ +QVideoWidgetControl::QVideoWidgetControl(QObject *parent) + :QMediaControl(parent) +{ +} + +/*! + Destroys a video widget control. +*/ +QVideoWidgetControl::~QVideoWidgetControl() +{ +} + +/*! + \fn QVideoWidgetControl::isFullScreen() const + + Returns true if the video is shown using the complete screen. +*/ + +/*! + \fn QVideoWidgetControl::setFullScreen(bool fullScreen) + + Sets whether a video widget is in \a fullScreen mode. +*/ + +/*! + \fn QVideoWidgetControl::fullScreenChanged(bool fullScreen) + + Signals that the \a fullScreen state of a video widget has changed. +*/ + +/*! + \fn QVideoWidgetControl::aspectRatioMode() const + + Returns how video is scaled to fit the widget with respect to its aspect ratio. +*/ + +/*! + \fn QVideoWidgetControl::setAspectRatioMode(Qt::AspectRatioMode mode) + + Sets the aspect ratio \a mode which determines how video is scaled to the fit the widget with + respect to its aspect ratio. +*/ + +/*! + \fn QVideoWidgetControl::brightness() const + + Returns the brightness adjustment applied to a video. + + Valid brightness values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWidgetControl::setBrightness(int brightness) + + Sets a \a brightness adjustment for a video. + + Valid brightness values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWidgetControl::brightnessChanged(int brightness) + + Signals that a video widget's \a brightness adjustment has changed. +*/ + +/*! + \fn QVideoWidgetControl::contrast() const + + Returns the contrast adjustment applied to a video. + + Valid contrast values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWidgetControl::setContrast(int contrast) + + Sets the contrast adjustment for a video widget to \a contrast. + + Valid contrast values range between -100 and 100, the default is 0. +*/ + + +/*! + \fn QVideoWidgetControl::contrastChanged(int contrast) + + Signals that a video widget's \a contrast adjustment has changed. +*/ + +/*! + \fn QVideoWidgetControl::hue() const + + Returns the hue adjustment applied to a video widget. + + Value hue values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWidgetControl::setHue(int hue) + + Sets a \a hue adjustment for a video widget. + + Valid hue values range between -100 and 100, the default is 0. +*/ + + +/*! + \fn QVideoWidgetControl::hueChanged(int hue) + + Signals that a video widget's \a hue adjustment has changed. +*/ + +/*! + \fn QVideoWidgetControl::saturation() const + + Returns the saturation adjustment applied to a video widget. + + Value saturation values range between -100 and 100, the default is 0. +*/ + + +/*! + \fn QVideoWidgetControl::setSaturation(int saturation) + + Sets a \a saturation adjustment for a video widget. + + Valid saturation values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWidgetControl::saturationChanged(int saturation) + + Signals that a video widget's \a saturation adjustment has changed. +*/ + +/*! + \fn QVideoWidgetControl::videoWidget() + + Returns the QWidget. +*/ + +#include "moc_qvideowidgetcontrol.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qvideowidgetcontrol.h b/src/multimedia/mediaservices/base/qvideowidgetcontrol.h new file mode 100644 index 0000000..a8105ac --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideowidgetcontrol.h @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QVIDEOWIDGETCONTROL_H +#define QVIDEOWIDGETCONTROL_H + +#include + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QVideoWidgetControlPrivate; + +class Q_MULTIMEDIA_EXPORT QVideoWidgetControl : public QMediaControl +{ + Q_OBJECT + +public: + virtual ~QVideoWidgetControl(); + + virtual QWidget *videoWidget() = 0; + + virtual Qt::AspectRatioMode aspectRatioMode() const = 0; + virtual void setAspectRatioMode(Qt::AspectRatioMode mode) = 0; + + virtual bool isFullScreen() const = 0; + virtual void setFullScreen(bool fullScreen) = 0; + + virtual int brightness() const = 0; + virtual void setBrightness(int brightness) = 0; + + virtual int contrast() const = 0; + virtual void setContrast(int contrast) = 0; + + virtual int hue() const = 0; + virtual void setHue(int hue) = 0; + + virtual int saturation() const = 0; + virtual void setSaturation(int saturation) = 0; + +Q_SIGNALS: + void fullScreenChanged(bool fullScreen); + void brightnessChanged(int brightness); + void contrastChanged(int contrast); + void hueChanged(int hue); + void saturationChanged(int saturation); + +protected: + QVideoWidgetControl(QObject *parent = 0); +}; + +#define QVideoWidgetControl_iid "com.nokia.Qt.QVideoWidgetControl/1.0" +Q_MEDIA_DECLARE_CONTROL(QVideoWidgetControl, QVideoWidgetControl_iid) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/base/qvideowindowcontrol.cpp b/src/multimedia/mediaservices/base/qvideowindowcontrol.cpp new file mode 100644 index 0000000..f73b187 --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideowindowcontrol.cpp @@ -0,0 +1,275 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 + + +QT_BEGIN_NAMESPACE + +/*! + \class QVideoWindowControl + \preliminary + \since 4.7 + \ingroup multimedia-serv + \brief The QVideoWindowControl class provides a media control for rendering video to a window. + + + The winId() property QVideoWindowControl allows a platform specific + window ID to be set as the video render target of a QMediaService. The + displayRect() property is used to set the region of the window the + video should be rendered to, and the aspectRatioMode() property + indicates how the video should be scaled to fit the displayRect(). + + \code + QVideoWindowControl *windowControl = mediaService->control(); + windowControl->setWinId(widget->winId()); + windowControl->setDisplayRect(widget->rect()); + windowControl->setAspectRatioMode(Qt::KeepAspectRatio); + \endcode + + QVideoWindowControl is one of number of possible video output controls, + in order to receive video it must be made the active video output + control by setting the output property of QVideoOutputControl to \l {QVideoOutputControl::WindowOutput}{WindowOutput}. + Consequently any QMediaService that implements QVideoWindowControl must + also implement QVideoOutputControl. + + \code + QVideoOutputControl *outputControl = mediaService->control(); + outputControl->setOutput(QVideoOutputControl::WindowOutput); + \endcode + + The interface name of QVideoWindowControl is \c com.nokia.Qt.QVideoWindowControl/1.0 as + defined in QVideoWindowControl_iid. + + \sa QMediaService::control(), QVideoOutputControl, QVideoWidget +*/ + +/*! + \macro QVideoWindowControl_iid + + \c com.nokia.Qt.QVideoWindowControl/1.0 + + Defines the interface name of the QVideoWindowControl class. + + \relates QVideoWindowControl +*/ + +/*! + Constructs a new video window control with the given \a parent. +*/ +QVideoWindowControl::QVideoWindowControl(QObject *parent) + : QMediaControl(parent) +{ +} + +/*! + Destroys a video window control. +*/ +QVideoWindowControl::~QVideoWindowControl() +{ +} + +/*! + \fn QVideoWindowControl::winId() const + + Returns the ID of the window a video overlay end point renders to. +*/ + +/*! + \fn QVideoWindowControl::setWinId(WId id) + + Sets the \a id of the window a video overlay end point renders to. +*/ + +/*! + \fn QVideoWindowControl::displayRect() const + Returns the sub-rect of a window where video is displayed. +*/ + +/*! + \fn QVideoWindowControl::setDisplayRect(const QRect &rect) + Sets the sub-\a rect of a window where video is displayed. +*/ + +/*! + \fn QVideoWindowControl::isFullScreen() const + + Identifies if a video overlay is a fullScreen overlay. + + Returns true if the video overlay is fullScreen, and false otherwise. +*/ + +/*! + \fn QVideoWindowControl::setFullScreen(bool fullScreen) + + Sets whether a video overlay is a \a fullScreen overlay. +*/ + +/*! + \fn QVideoWindowControl::fullScreenChanged(bool fullScreen) + + Signals that the \a fullScreen state of a video overlay has changed. +*/ + +/*! + \fn QVideoWindowControl::repaint() + + Repaints the last frame. +*/ + +/*! + \fn QVideoWindowControl::nativeSize() const + + Returns a suggested size for the video display based on the resolution and aspect ratio of the + video. +*/ + +/*! + \fn QVideoWindowControl::nativeSizeChanged() + + Signals that the native dimensions of the video have changed. +*/ + + +/*! + \fn QVideoWindowControl::aspectRatioMode() const + + Returns how video is scaled to fit the display region with respect to its aspect ratio. +*/ + +/*! + \fn QVideoWindowControl::setAspectRatioMode(Qt::AspectRatioMode mode) + + Sets the aspect ratio \a mode which determines how video is scaled to the fit the display region + with respect to its aspect ratio. +*/ + +/*! + \fn QVideoWindowControl::brightness() const + + Returns the brightness adjustment applied to a video overlay. + + Valid brightness values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWindowControl::setBrightness(int brightness) + + Sets a \a brightness adjustment for a video overlay. + + Valid brightness values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWindowControl::brightnessChanged(int brightness) + + Signals that a video overlay's \a brightness adjustment has changed. +*/ + +/*! + \fn QVideoWindowControl::contrast() const + + Returns the contrast adjustment applied to a video overlay. + + Valid contrast values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWindowControl::setContrast(int contrast) + + Sets the \a contrast adjustment for a video overlay. + + Valid contrast values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWindowControl::contrastChanged(int contrast) + + Signals that a video overlay's \a contrast adjustment has changed. +*/ + +/*! + \fn QVideoWindowControl::hue() const + + Returns the hue adjustment applied to a video overlay. + + Value hue values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWindowControl::setHue(int hue) + + Sets a \a hue adjustment for a video overlay. + + Valid hue values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWindowControl::hueChanged(int hue) + + Signals that a video overlay's \a hue adjustment has changed. +*/ + +/*! + \fn QVideoWindowControl::saturation() const + + Returns the saturation adjustment applied to a video overlay. + + Value saturation values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWindowControl::setSaturation(int saturation) + Sets a \a saturation adjustment for a video overlay. + + Valid saturation values range between -100 and 100, the default is 0. +*/ + +/*! + \fn QVideoWindowControl::saturationChanged(int saturation) + + Signals that a video overlay's \a saturation adjustment has changed. +*/ + +#include "moc_qvideowindowcontrol.cpp" + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/base/qvideowindowcontrol.h b/src/multimedia/mediaservices/base/qvideowindowcontrol.h new file mode 100644 index 0000000..0fabce9 --- /dev/null +++ b/src/multimedia/mediaservices/base/qvideowindowcontrol.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QVIDEOWINDOWCONTROL_H +#define QVIDEOWINDOWCONTROL_H + +#include + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class Q_MULTIMEDIA_EXPORT QVideoWindowControl : public QMediaControl +{ + Q_OBJECT + +public: + ~QVideoWindowControl(); + + virtual WId winId() const = 0; + virtual void setWinId(WId id) = 0; + + virtual QRect displayRect() const = 0; + virtual void setDisplayRect(const QRect &rect) = 0; + + virtual bool isFullScreen() const = 0; + virtual void setFullScreen(bool fullScreen) = 0; + + virtual void repaint() = 0; + + virtual QSize nativeSize() const = 0; + + virtual Qt::AspectRatioMode aspectRatioMode() const = 0; + virtual void setAspectRatioMode(Qt::AspectRatioMode mode) = 0; + + virtual int brightness() const = 0; + virtual void setBrightness(int brightness) = 0; + + virtual int contrast() const = 0; + virtual void setContrast(int contrast) = 0; + + virtual int hue() const = 0; + virtual void setHue(int hue) = 0; + + virtual int saturation() const = 0; + virtual void setSaturation(int saturation) = 0; + +Q_SIGNALS: + void fullScreenChanged(bool fullScreen); + void brightnessChanged(int brightness); + void contrastChanged(int contrast); + void hueChanged(int hue); + void saturationChanged(int saturation); + void nativeSizeChanged(); + +protected: + QVideoWindowControl(QObject *parent = 0); +}; + +#define QVideoWindowControl_iid "com.nokia.Qt.QVideoWindowControl/1.0" +Q_MEDIA_DECLARE_CONTROL(QVideoWindowControl, QVideoWindowControl_iid) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/mediaservices/effects/effects.pri b/src/multimedia/mediaservices/effects/effects.pri new file mode 100644 index 0000000..6307255 --- /dev/null +++ b/src/multimedia/mediaservices/effects/effects.pri @@ -0,0 +1,26 @@ + + +unix:!mac { + contains(QT_CONFIG, pulseaudio) { + DEFINES += QT_MULTIMEDIA_PULSEAUDIO + HEADERS += $$PWD/qsoundeffect_pulse_p.h + SOURCES += $$PWD/qsoundeffect_pulse_p.cpp + QMAKE_CXXFLAGS += $$QT_CFLAGS_PULSEAUDIO + LIBS += $$QT_LIBS_PULSEAUDIO + } else { + DEFINES += QT_MULTIMEDIA_QMEDIAPLAYER + HEADERS += $$PWD/qsoundeffect_qmedia_p.h + SOURCES += $$PWD/qsoundeffect_qmedia_p.cpp + } +} else { + HEADERS += $$PWD/qsoundeffect_qsound_p.h + SOURCES += $$PWD/qsoundeffect_qsound_p.cpp +} + +HEADERS += \ + $$PWD/qsoundeffect_p.h \ + $$PWD/wavedecoder_p.h + +SOURCES += \ + $$PWD/qsoundeffect.cpp \ + $$PWD/wavedecoder_p.cpp diff --git a/src/multimedia/mediaservices/effects/qsoundeffect.cpp b/src/multimedia/mediaservices/effects/qsoundeffect.cpp new file mode 100644 index 0000000..8a38103 --- /dev/null +++ b/src/multimedia/mediaservices/effects/qsoundeffect.cpp @@ -0,0 +1,207 @@ +/**************************************************************************** +** +** 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 "qsoundeffect_p.h" + +#if defined(QT_MULTIMEDIA_PULSEAUDIO) +#include "qsoundeffect_pulse_p.h" +#elif(QT_MULTIMEDIA_QMEDIAPLAYER) +#include "qsoundeffect_qmedia_p.h" +#else +#include "qsoundeffect_qsound_p.h" +#endif + +QT_BEGIN_NAMESPACE + +/*! + \qmlclass SoundEffect QSoundEffect + \since 4.7 + \brief The SoundEffect element provides a way to play sound effects in qml. + + This element is part of the \bold{Qt.multimedia 4.7} module. + + The following example plays a wav file on mouse click. + + \qml + import Qt 4.6 + import Qt.multimedia 4.7 + + Item { + SoundEffect { + id: playSound + source: "test.wav" + } + MouseArea { + id: playArea + anchors.fill: parent + onPressed: { + playSound.play() + } + } + } + \endqml +*/ + +/*! + \qmlproperty QUrl SoundEffect::source + + This property provides a way to control the sound to play. +*/ + +/*! + \qmlproperty int SoundEffect::loops + + This property provides a way to control the number of times to repeat the sound on each play(). +*/ + +/*! + \qmlproperty int SoundEffect::volume + + This property provides a way to control the volume for playback. +*/ + +/*! + \qmlproperty bool SoundEffect::muted + + This property provides a way to control muting. +*/ + +/*! + \qmlsignal SoundEffect::sourceChanged() + + This handler is called when the source has changed. +*/ + +/*! + \qmlsignal SoundEffect::loopsChanged() + + This handler is called when the number of loops has changes. +*/ + +/*! + \qmlsignal SoundEffect::volumeChanged() + + This handler is called when the volume has changed. +*/ + +/*! + \qmlsignal SoundEffect::mutedChanged() + + This handler is called when the mute state has changed. +*/ + + +QSoundEffect::QSoundEffect(QObject *parent) : + QObject(parent) +{ + d = new QSoundEffectPrivate(this); + connect(d, SIGNAL(volumeChanged()), SIGNAL(volumeChanged())); + connect(d, SIGNAL(mutedChanged()), SIGNAL(mutedChanged())); +} + +QSoundEffect::~QSoundEffect() +{ + d->deleteLater(); +} + +QUrl QSoundEffect::source() const +{ + return d->source(); +} + +void QSoundEffect::setSource(const QUrl &url) +{ + if (d->source() == url) + return; + + d->setSource(url); + + emit sourceChanged(); +} + +int QSoundEffect::loops() const +{ + return d->loopCount(); +} + +void QSoundEffect::setLoops(int loopCount) +{ + if (d->loopCount() == loopCount) + return; + + d->setLoopCount(loopCount); + emit loopsChanged(); +} + +int QSoundEffect::volume() const +{ + return d->volume(); +} + +void QSoundEffect::setVolume(int volume) +{ + if (d->volume() == volume) + return; + + d->setVolume(volume); + emit volumeChanged(); +} + +bool QSoundEffect::isMuted() const +{ + return d->isMuted(); +} + +void QSoundEffect::setMuted(bool muted) +{ + if (d->isMuted() == muted) + return; + + d->setMuted(muted); + emit mutedChanged(); +} + +void QSoundEffect::play() +{ + d->play(); +} + +QT_END_NAMESPACE diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_p.h b/src/multimedia/mediaservices/effects/qsoundeffect_p.h new file mode 100644 index 0000000..8c8985a --- /dev/null +++ b/src/multimedia/mediaservices/effects/qsoundeffect_p.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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 QSOUNDEFFECT_H +#define QSOUNDEFFECT_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QSoundEffectPrivate; +class Q_MULTIMEDIA_EXPORT QSoundEffect : public QObject +{ + Q_OBJECT + Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) + Q_PROPERTY(int loops READ loops WRITE setLoops NOTIFY loopsChanged) + Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) + Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) + +public: + explicit QSoundEffect(QObject *parent = 0); + ~QSoundEffect(); + + QUrl source() const; + void setSource(const QUrl &url); + + int loops() const; + void setLoops(int loopCount); + + int volume() const; + void setVolume(int volume); + + bool isMuted() const; + void setMuted(bool muted); + +Q_SIGNALS: + void sourceChanged(); + void loopsChanged(); + void volumeChanged(); + void mutedChanged(); + +public Q_SLOTS: + void play(); + +private: + Q_DISABLE_COPY(QSoundEffect) + QSoundEffectPrivate* d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + + +#endif // QSOUNDEFFECT_H diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp new file mode 100644 index 0000000..e834280 --- /dev/null +++ b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp @@ -0,0 +1,499 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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$ +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include + +#include "wavedecoder_p.h" + +#include "qsoundeffect_pulse_p.h" + +#if defined(Q_WS_MAEMO_5) +#include +#endif + +#include + +// Less than ideal +#define PA_SCACHE_ENTRY_SIZE_MAX (1024*1024*16) + +QT_BEGIN_NAMESPACE + +namespace +{ +inline pa_sample_spec audioFormatToSampleSpec(const QAudioFormat &format) +{ + pa_sample_spec spec; + + spec.rate = format.frequency(); + spec.channels = format.channels(); + + if (format.sampleSize() == 8) + spec.format = PA_SAMPLE_U8; + else if (format.sampleSize() == 16) { + switch (format.byteOrder()) { + case QAudioFormat::BigEndian: spec.format = PA_SAMPLE_S16BE; break; + case QAudioFormat::LittleEndian: spec.format = PA_SAMPLE_S16LE; break; + } + } + else if (format.sampleSize() == 32) { + switch (format.byteOrder()) { + case QAudioFormat::BigEndian: spec.format = PA_SAMPLE_S32BE; break; + case QAudioFormat::LittleEndian: spec.format = PA_SAMPLE_S32LE; break; + } + } + + return spec; +} + +class PulseDaemon +{ +public: + PulseDaemon():m_prepared(false) + { + prepare(); + } + + ~PulseDaemon() + { + if (m_prepared) + release(); + } + + inline void lock() + { + pa_threaded_mainloop_lock(m_mainLoop); + } + + inline void unlock() + { + pa_threaded_mainloop_unlock(m_mainLoop); + } + + inline pa_context *context() const + { + return m_context; + } + + int volume() + { + return m_vol; + } + +private: + void prepare() + { + m_vol = 100; + + m_mainLoop = pa_threaded_mainloop_new(); + if (m_mainLoop == 0) { + qWarning("PulseAudioService: unable to create pulseaudio mainloop"); + return; + } + + if (pa_threaded_mainloop_start(m_mainLoop) != 0) { + qWarning("PulseAudioService: unable to start pulseaudio mainloop"); + pa_threaded_mainloop_free(m_mainLoop); + return; + } + + m_mainLoopApi = pa_threaded_mainloop_get_api(m_mainLoop); + + lock(); + m_context = pa_context_new(m_mainLoopApi, QString(QLatin1String("QtPulseAudio:%1")).arg(::getpid()).toAscii().constData()); + +#if defined(Q_WS_MAEMO_5) + pa_context_set_state_callback(m_context, context_state_callback, this); +#endif + if (m_context == 0) { + qWarning("PulseAudioService: Unable to create new pulseaudio context"); + pa_threaded_mainloop_free(m_mainLoop); + return; + } + + if (pa_context_connect(m_context, NULL, (pa_context_flags_t)0, NULL) < 0) { + qWarning("PulseAudioService: pa_context_connect() failed"); + pa_context_unref(m_context); + pa_threaded_mainloop_free(m_mainLoop); + return; + } + unlock(); + + m_prepared = true; + } + + void release() + { + if (!m_prepared) return; + pa_threaded_mainloop_stop(m_mainLoop); + pa_threaded_mainloop_free(m_mainLoop); + m_prepared = false; + } + +#if defined(Q_WS_MAEMO_5) + static void context_state_callback(pa_context *c, void *userdata) + { + PulseDaemon *self = reinterpret_cast(userdata); + switch (pa_context_get_state(c)) { + case PA_CONTEXT_CONNECTING: + case PA_CONTEXT_AUTHORIZING: + case PA_CONTEXT_SETTING_NAME: + break; + case PA_CONTEXT_READY: + pa_ext_stream_restore_set_subscribe_cb(c, &stream_restore_monitor_callback, self); + pa_ext_stream_restore_subscribe(c, 1, NULL, self); + break; + default: + break; + } + } + static void stream_restore_monitor_callback(pa_context *c, void *userdata) + { + PulseDaemon *self = reinterpret_cast(userdata); + pa_ext_stream_restore2_read(c, &stream_restore_info_callback, self); + } + static void stream_restore_info_callback(pa_context *c, const pa_ext_stream_restore2_info *info, + int eol, void *userdata) + { + Q_UNUSED(c) + + PulseDaemon *self = reinterpret_cast(userdata); + + if (!eol) { + if (QString(info->name).startsWith(QLatin1String("sink-input-by-media-role:x-maemo"))) { + const unsigned str_length = 256; + char str[str_length]; + pa_cvolume_snprint(str, str_length, &info->volume); + self->m_vol = QString(str).replace(" ","").replace("%","").mid(2).toInt(); + } + } + } +#endif + + int m_vol; + bool m_prepared; + pa_context *m_context; + pa_threaded_mainloop *m_mainLoop; + pa_mainloop_api *m_mainLoopApi; +}; +} + +Q_GLOBAL_STATIC(PulseDaemon, daemon) + + +QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent): + QObject(parent), + m_retry(false), + m_muted(false), + m_playQueued(false), + m_sampleLoaded(false), + m_volume(100), + m_duration(0), + m_dataUploaded(0), + m_loopCount(1), + m_runningCount(0), + m_reply(0), + m_stream(0), + m_networkAccessManager(0) +{ +} + +QSoundEffectPrivate::~QSoundEffectPrivate() +{ + m_reply->deleteLater(); + unloadSample(); +} + +QUrl QSoundEffectPrivate::source() const +{ + return m_source; +} + +void QSoundEffectPrivate::setSource(const QUrl &url) +{ + if (url.isEmpty()) { + m_source = QUrl(); + unloadSample(); + return; + } + + m_source = url; + + if (m_networkAccessManager == 0) + m_networkAccessManager = new QNetworkAccessManager(this); + + m_stream = m_networkAccessManager->get(QNetworkRequest(m_source)); + + unloadSample(); + loadSample(); +} + +int QSoundEffectPrivate::loopCount() const +{ + return m_loopCount; +} + +void QSoundEffectPrivate::setLoopCount(int loopCount) +{ + m_loopCount = loopCount; +} + +int QSoundEffectPrivate::volume() const +{ + return m_volume; +} + +void QSoundEffectPrivate::setVolume(int volume) +{ + m_volume = volume; +} + +bool QSoundEffectPrivate::isMuted() const +{ + return m_muted; +} + +void QSoundEffectPrivate::setMuted(bool muted) +{ + m_muted = muted; +} + +void QSoundEffectPrivate::play() +{ + if (m_retry) { + m_retry = false; + setSource(m_source); + return; + } + + if (!m_sampleLoaded) { + m_playQueued = true; + return; + } + + m_runningCount += m_loopCount; + + playSample(); +} + +void QSoundEffectPrivate::decoderReady() +{ + if (m_waveDecoder->size() >= PA_SCACHE_ENTRY_SIZE_MAX) { + m_waveDecoder->deleteLater(); + qWarning("QSoundEffect(pulseaudio): Attempting to load to large a sample"); + return; + } + + if (m_name.isNull()) + m_name = QString(QLatin1String("QtPulseSample-%1-%2")).arg(::getpid()).arg(quintptr(this)).toUtf8(); + + pa_sample_spec spec = audioFormatToSampleSpec(m_waveDecoder->audioFormat()); + + daemon()->lock(); + pa_stream *stream = pa_stream_new(daemon()->context(), m_name.constData(), &spec, 0); + pa_stream_set_state_callback(stream, stream_state_callback, this); + pa_stream_set_write_callback(stream, stream_write_callback, this); + pa_stream_connect_upload(stream, (size_t)m_waveDecoder->size()); + m_pulseStream = stream; + daemon()->unlock(); +} + +void QSoundEffectPrivate::decoderError() +{ + qWarning("QSoundEffect(pulseaudio): Error decoding source"); +} + +void QSoundEffectPrivate::checkPlayTime() +{ + int elapsed = m_playbackTime.elapsed(); + + if (elapsed < m_duration) + startTimer(m_duration - elapsed); +} + +void QSoundEffectPrivate::loadSample() +{ + m_sampleLoaded = false; + m_dataUploaded = 0; + m_waveDecoder = new WaveDecoder(m_stream); + connect(m_waveDecoder, SIGNAL(formatKnown()), SLOT(decoderReady())); + connect(m_waveDecoder, SIGNAL(invalidFormat()), SLOT(decoderError())); +} + +void QSoundEffectPrivate::unloadSample() +{ + if (!m_sampleLoaded) + return; + + daemon()->lock(); + pa_context_remove_sample(daemon()->context(), m_name.constData(), NULL, NULL); + daemon()->unlock(); + + m_duration = 0; + m_dataUploaded = 0; + m_sampleLoaded = false; +} + +void QSoundEffectPrivate::uploadSample() +{ + daemon()->lock(); + + size_t bufferSize = qMin(pa_stream_writable_size(m_pulseStream), + size_t(m_waveDecoder->bytesAvailable())); + char buffer[bufferSize]; + + size_t len = 0; + while (len < (m_waveDecoder->size())) { + qint64 read = m_waveDecoder->read(buffer, qMin((int)bufferSize, + (int)(m_waveDecoder->size()-len))); + if (read > 0) { + if (pa_stream_write(m_pulseStream, buffer, size_t(read), 0, 0, PA_SEEK_RELATIVE) == 0) + len += size_t(read); + else + break; + } + } + + m_dataUploaded += len; + pa_stream_set_write_callback(m_pulseStream, NULL, NULL); + + if (m_waveDecoder->size() == m_dataUploaded) { + int err = pa_stream_finish_upload(m_pulseStream); + if(err != 0) { + qWarning("pa_stream_finish_upload() err=%d",err); + pa_stream_disconnect(m_pulseStream); + m_retry = true; + m_playQueued = false; + QMetaObject::invokeMethod(this, "play"); + daemon()->unlock(); + return; + } + m_duration = m_waveDecoder->duration(); + m_waveDecoder->deleteLater(); + m_stream->deleteLater(); + m_sampleLoaded = true; + if (m_playQueued) { + m_playQueued = false; + QMetaObject::invokeMethod(this, "play"); + } + } + daemon()->unlock(); +} + +void QSoundEffectPrivate::playSample() +{ + pa_volume_t volume = PA_VOLUME_NORM; + + daemon()->lock(); +#ifdef Q_WS_MAEMO_5 + volume = PA_VOLUME_NORM / 100 * ((daemon()->volume() + m_volume) / 2); +#endif + pa_operation_unref( + pa_context_play_sample(daemon()->context(), + m_name.constData(), + 0, + volume, + play_callback, + this) + ); + daemon()->unlock(); + + m_playbackTime.start(); +} + +void QSoundEffectPrivate::timerEvent(QTimerEvent *event) +{ + if (m_runningCount > 0) + playSample(); + + killTimer(event->timerId()); +} + +void QSoundEffectPrivate::stream_write_callback(pa_stream *s, size_t length, void *userdata) +{ + Q_UNUSED(length); + + QSoundEffectPrivate *self = reinterpret_cast(userdata); + + QMetaObject::invokeMethod(self, "uploadSample", Qt::QueuedConnection); +} + +void QSoundEffectPrivate::stream_state_callback(pa_stream *s, void *userdata) +{ + switch (pa_stream_get_state(s)) { + case PA_STREAM_CREATING: + case PA_STREAM_READY: + case PA_STREAM_TERMINATED: + break; + + case PA_STREAM_FAILED: + default: + qWarning("QSoundEffect(pulseaudio): Error in pulse audio stream"); + break; + } +} + +void QSoundEffectPrivate::play_callback(pa_context *c, int success, void *userdata) +{ + Q_UNUSED(c); + + QSoundEffectPrivate *self = reinterpret_cast(userdata); + + if (success == 1) { + self->m_runningCount--; + QMetaObject::invokeMethod(self, "checkPlayTime", Qt::QueuedConnection); + } +} + +QT_END_NAMESPACE diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.h b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.h new file mode 100644 index 0000000..ef6bff1 --- /dev/null +++ b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.h @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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 QSOUNDEFFECT_PULSE_H +#define QSOUNDEFFECT_PULSE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + + +#include "qsoundeffect_p.h" + +#include +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QNetworkReply; +class QNetworkAccessManager; +class WaveDecoder; + +class QSoundEffectPrivate : public QObject +{ + Q_OBJECT +public: + explicit QSoundEffectPrivate(QObject* parent); + ~QSoundEffectPrivate(); + + QUrl source() const; + void setSource(const QUrl &url); + int loopCount() const; + void setLoopCount(int loopCount); + int volume() const; + void setVolume(int volume); + bool isMuted() const; + void setMuted(bool muted); + +public Q_SLOTS: + void play(); + +Q_SIGNALS: + void volumeChanged(); + void mutedChanged(); + +private Q_SLOTS: + void decoderReady(); + void decoderError(); + void checkPlayTime(); + void uploadSample(); + +private: + void loadSample(); + void unloadSample(); + void playSample(); + + void timerEvent(QTimerEvent *event); + + static void stream_write_callback(pa_stream *s, size_t length, void *userdata); + static void stream_state_callback(pa_stream *s, void *userdata); + static void play_callback(pa_context *c, int success, void *userdata); + + pa_stream *m_pulseStream; + + bool m_retry; + bool m_muted; + bool m_playQueued; + bool m_sampleLoaded; + int m_volume; + int m_duration; + int m_dataUploaded; + int m_loopCount; + int m_runningCount; + QUrl m_source; + QTime m_playbackTime; + QByteArray m_name; + QNetworkReply *m_reply; + WaveDecoder *m_waveDecoder; + QIODevice *m_stream; + QNetworkAccessManager *m_networkAccessManager; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QSOUNDEFFECT_PULSE_H diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.cpp b/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.cpp new file mode 100644 index 0000000..8cc2675 --- /dev/null +++ b/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.cpp @@ -0,0 +1,132 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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$ +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qsoundeffect_qmedia_p.h" + +#include + +#include +#include + + +QT_BEGIN_NAMESPACE + +QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent): + QObject(parent), + m_loopCount(1), + m_runningCount(0), + m_player(0) +{ + m_player = new QMediaPlayer(this, QMediaPlayer::LowLatency); + connect(m_player, SIGNAL(stateChanged(QMediaPlayer::State)), SLOT(stateChanged(QMediaPlayer::State))); +} + +QSoundEffectPrivate::~QSoundEffectPrivate() +{ +} + +QUrl QSoundEffectPrivate::source() const +{ + return m_player->media().canonicalUrl(); +} + +void QSoundEffectPrivate::setSource(const QUrl &url) +{ + m_player->setMedia(url); +} + +int QSoundEffectPrivate::loopCount() const +{ + return m_loopCount; +} + +void QSoundEffectPrivate::setLoopCount(int loopCount) +{ + m_loopCount = loopCount; +} + +int QSoundEffectPrivate::volume() const +{ + return m_player->volume(); +} + +void QSoundEffectPrivate::setVolume(int volume) +{ + m_player->setVolume(volume); +} + +bool QSoundEffectPrivate::isMuted() const +{ + return m_player->isMuted(); +} + +void QSoundEffectPrivate::setMuted(bool muted) +{ + m_player->setMuted(muted); +} + +void QSoundEffectPrivate::play() +{ + m_runningCount += m_loopCount; + m_player->play(); +} + +void QSoundEffectPrivate::stateChanged(QMediaPlayer::State state) +{ + if (state == QMediaPlayer::StoppedState) { + if (--m_runningCount > 0) + m_player->play(); + } +} + +QT_END_NAMESPACE + diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.h b/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.h new file mode 100644 index 0000000..5abdcad --- /dev/null +++ b/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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 QSOUNDEFFECT_QMEDIA_H +#define QSOUNDEFFECT_QMEDIA_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class QSoundEffectPrivate : public QObject +{ + Q_OBJECT +public: + explicit QSoundEffectPrivate(QObject* parent); + ~QSoundEffectPrivate(); + + QUrl source() const; + void setSource(const QUrl &url); + int loopCount() const; + void setLoopCount(int loopCount); + int volume() const; + void setVolume(int volume); + bool isMuted() const; + void setMuted(bool muted); + +public Q_SLOTS: + void play(); + +Q_SIGNALS: + void volumeChanged(); + void mutedChanged(); + +private Q_SLOTS: + void stateChanged(QMediaPlayer::State); + +private: + int m_loopCount; + int m_runningCount; + QMediaPlayer *m_player; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QSOUNDEFFECT_QMEDIA_H diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.cpp b/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.cpp new file mode 100644 index 0000000..7746f0c --- /dev/null +++ b/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.cpp @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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$ +** +****************************************************************************/ + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qsoundeffect_qsound_p.h" + +#include +#include + + +QT_BEGIN_NAMESPACE + +QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent): + QObject(parent), + m_muted(false), + m_loopCount(1), + m_volume(100), + m_sound(0) +{ +} + +QSoundEffectPrivate::~QSoundEffectPrivate() +{ +} + +QUrl QSoundEffectPrivate::source() const +{ + return m_source; +} + +void QSoundEffectPrivate::setSource(const QUrl &url) +{ + if (url.isEmpty() || url.scheme() != QLatin1String("file")) { + m_source = QUrl(); + return; + } + + if (m_sound != 0) + delete m_sound; + + m_source = url; + m_sound = new QSound(m_source.toLocalFile(), this); + m_sound->setLoops(m_loopCount); +} + +int QSoundEffectPrivate::loopCount() const +{ + return m_loopCount; +} + +void QSoundEffectPrivate::setLoopCount(int lc) +{ + m_loopCount = lc; + if (m_sound) + m_sound->setLoops(lc); +} + +int QSoundEffectPrivate::volume() const +{ + return m_volume; +} + +void QSoundEffectPrivate::setVolume(int v) +{ + m_volume = v; +} + +bool QSoundEffectPrivate::isMuted() const +{ + return m_muted; +} + +void QSoundEffectPrivate::setMuted(bool muted) +{ + m_muted = muted; +} + +void QSoundEffectPrivate::play() +{ + m_sound->play(); +} + +QT_END_NAMESPACE diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.h b/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.h new file mode 100644 index 0000000..133e6ec --- /dev/null +++ b/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.h @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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 QSOUNDEFFECT_QSOUND_H +#define QSOUNDEFFECT_QSOUND_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QSound; + +class QSoundEffectPrivate : public QObject +{ + Q_OBJECT +public: + explicit QSoundEffectPrivate(QObject* parent); + ~QSoundEffectPrivate(); + + QUrl source() const; + void setSource(const QUrl &url); + int loopCount() const; + void setLoopCount(int loopCount); + int volume() const; + void setVolume(int volume); + bool isMuted() const; + void setMuted(bool muted); + +public Q_SLOTS: + void play(); + +Q_SIGNALS: + void volumeChanged(); + void mutedChanged(); + +private: + bool m_muted; + int m_loopCount; + int m_volume; + QSound *m_sound; + QUrl m_source; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QSOUNDEFFECT_QSOUND_H diff --git a/src/multimedia/mediaservices/effects/wavedecoder_p.cpp b/src/multimedia/mediaservices/effects/wavedecoder_p.cpp new file mode 100644 index 0000000..2208461 --- /dev/null +++ b/src/multimedia/mediaservices/effects/wavedecoder_p.cpp @@ -0,0 +1,151 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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 "wavedecoder_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +WaveDecoder::WaveDecoder(QIODevice *s, QObject *parent): + QIODevice(parent), + haveFormat(false), + dataSize(0), + remaining(0), + source(s) +{ + open(QIODevice::ReadOnly | QIODevice::Unbuffered); + + if (source->bytesAvailable() >= qint64(sizeof(CombinedHeader) + sizeof(DATAHeader) + sizeof(quint16))) + QTimer::singleShot(0, this, SLOT(handleData())); + else + connect(source, SIGNAL(readyRead()), SLOT(handleData())); +} + +WaveDecoder::~WaveDecoder() +{ +} + +QAudioFormat WaveDecoder::audioFormat() const +{ + return format; +} + +int WaveDecoder::duration() const +{ + return size() * 1000 / (format.sampleSize() / 8) / format.channels() / format.frequency(); +} + +qint64 WaveDecoder::size() const +{ + return haveFormat ? dataSize : 0; +} + +bool WaveDecoder::isSequential() const +{ + return source->isSequential(); +} + +qint64 WaveDecoder::bytesAvailable() const +{ + return haveFormat ? source->bytesAvailable() : 0; +} + +qint64 WaveDecoder::readData(char *data, qint64 maxlen) +{ + return haveFormat ? source->read(data, maxlen) : 0; +} + +qint64 WaveDecoder::writeData(const char *data, qint64 len) +{ + Q_UNUSED(data); + Q_UNUSED(len); + + return -1; +} + +void WaveDecoder::handleData() +{ + if (source->bytesAvailable() < qint64(sizeof(CombinedHeader) + sizeof(DATAHeader) + sizeof(quint16))) + return; + + source->disconnect(SIGNAL(readyRead()), this, SLOT(handleData())); + source->read((char*)&header, sizeof(CombinedHeader)); + + if (qstrncmp(header.riff.descriptor.id, "RIFF", 4) != 0 || + qstrncmp(header.riff.type, "WAVE", 4) != 0 || + qstrncmp(header.wave.descriptor.id, "fmt ", 4) != 0 || + (header.wave.audioFormat != 0 && header.wave.audioFormat != 1)) { + + emit invalidFormat(); + } + else { + DATAHeader dataHeader; + + if (qFromLittleEndian(header.wave.descriptor.size) > sizeof(WAVEHeader)) { + // Extended data available + quint16 extraFormatBytes; + source->peek((char*)&extraFormatBytes, sizeof(quint16)); + extraFormatBytes = qFromLittleEndian(extraFormatBytes); + source->read(sizeof(quint16) + extraFormatBytes); // dump it all + } + + source->read((char*)&dataHeader, sizeof(DATAHeader)); + + int bps = qFromLittleEndian(header.wave.bitsPerSample); + + format.setCodec(QLatin1String("audio/pcm")); + format.setSampleType(bps == 8 ? QAudioFormat::UnSignedInt : QAudioFormat::SignedInt); + format.setByteOrder(QAudioFormat::LittleEndian); + format.setFrequency(qFromLittleEndian(header.wave.sampleRate)); + format.setSampleSize(bps); + format.setChannels(qFromLittleEndian(header.wave.numChannels)); + + dataSize = qFromLittleEndian(dataHeader.descriptor.size); + + haveFormat = true; + connect(source, SIGNAL(readyRead()), SIGNAL(readyRead())); + emit formatKnown(); + } +} + +QT_END_NAMESPACE diff --git a/src/multimedia/mediaservices/effects/wavedecoder_p.h b/src/multimedia/mediaservices/effects/wavedecoder_p.h new file mode 100644 index 0000000..bb22907 --- /dev/null +++ b/src/multimedia/mediaservices/effects/wavedecoder_p.h @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** 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 QtMediaservices 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 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 + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +class WaveDecoder : public QIODevice +{ + Q_OBJECT + +public: + explicit WaveDecoder(QIODevice *source, QObject *parent = 0); + ~WaveDecoder(); + + QAudioFormat audioFormat() const; + int duration() const; + + qint64 size() const; + bool isSequential() const; + qint64 bytesAvailable() const; + +Q_SIGNALS: + void formatKnown(); + void invalidFormat(); + +private Q_SLOTS: + void handleData(); + +private: + qint64 readData(char *data, qint64 maxlen); + qint64 writeData(const char *data, qint64 len); + + struct chunk + { + char id[4]; + quint32 size; + }; + struct RIFFHeader + { + chunk descriptor; + char type[4]; + }; + struct WAVEHeader + { + chunk descriptor; + quint16 audioFormat; + quint16 numChannels; + quint32 sampleRate; + quint32 byteRate; + quint16 blockAlign; + quint16 bitsPerSample; + }; + struct DATAHeader + { + chunk descriptor; + }; + struct CombinedHeader + { + RIFFHeader riff; + WAVEHeader wave; + }; + + bool haveFormat; + qint64 dataSize; + qint64 remaining; + QAudioFormat format; + QIODevice *source; + CombinedHeader header; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // WAVEDECODER_H diff --git a/src/multimedia/mediaservices/mediaservices.pro b/src/multimedia/mediaservices/mediaservices.pro new file mode 100644 index 0000000..908f60a --- /dev/null +++ b/src/multimedia/mediaservices/mediaservices.pro @@ -0,0 +1,16 @@ +TARGET = QtMediaservices +QPRO_PWD = $$PWD +QT = core gui multimedia + +DEFINES += QT_BUILD_MEDIASERVICES_LIB QT_NO_USING_NAMESPACE + +unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtMultimedia + +include(../../qbase.pri) + +include(base/base.pri) +include(playback/playback.pri) +include(effects/effects.pri) + +symbian: TARGET.UID3 = 0x2001E631 + diff --git a/src/multimedia/mediaservices/playback/playback.pri b/src/multimedia/mediaservices/playback/playback.pri new file mode 100644 index 0000000..09a81c9 --- /dev/null +++ b/src/multimedia/mediaservices/playback/playback.pri @@ -0,0 +1,11 @@ + +HEADERS += \ + $$PWD/qmediaplayer.h \ + $$PWD/qmediaplayercontrol.h + +SOURCES += \ + $$PWD/qmediaplayer.cpp \ + $$PWD/qmediaplayercontrol.cpp + + + diff --git a/src/multimedia/mediaservices/playback/qmediaplayer.cpp b/src/multimedia/mediaservices/playback/qmediaplayer.cpp new file mode 100644 index 0000000..676a6eb --- /dev/null +++ b/src/multimedia/mediaservices/playback/qmediaplayer.cpp @@ -0,0 +1,982 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +//#define DEBUG_PLAYER_STATE + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +/*! + \class QMediaPlayer + \brief The QMediaPlayer class allows the playing of a media source. + \ingroup multimedia + \since 4.7 + \preliminary + + The QMediaPlayer class is a high level media playback class. It can be used + to playback such content as songs, movies and internet radio. The content + to playback is specified as a QMediaContent, which can be thought of as a + main or canonical URL with addition information attached. When provided + with a QMediaContent playback may be able to commence. + + \code + player = new QMediaPlayer; + connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64))); + player->setMedia(QUrl::fromLocalFile("/Users/me/Music/coolsong.mp3")); + player->setVolume(50); + player->play(); + \endcode + + QVideoWidget can be used with QMediaPlayer for video rendering and QMediaPlaylist + for accessing playlist functionality. + + \code + player = new QMediaPlayer; + + playlist = new QMediaPlaylist; + playlist->setMediaObject(player); + playlist->append(QUrl("http://example.com/movie1.mp4")); + playlist->append(QUrl("http://example.com/movie2.mp4")); + + widget = new QVideoWidget; + widget->setMediaObject(player); + widget->show(); + + player->play(); + \endcode + + \sa QMediaObject, QMediaService, QVideoWidget, QMediaPlaylist +*/ + +namespace +{ +class MediaPlayerRegisterMetaTypes +{ +public: + MediaPlayerRegisterMetaTypes() + { + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + } +} _registerPlayerMetaTypes; +} + +class QMediaPlayerPrivate : public QMediaObjectPrivate +{ + Q_DECLARE_NON_CONST_PUBLIC(QMediaPlayer) + +public: + QMediaPlayerPrivate() + : provider(0) + , control(0) + , playlistControl(0) + , state(QMediaPlayer::StoppedState) + , error(QMediaPlayer::NoError) + , filterStates(false) + , playlist(0) + {} + + QMediaServiceProvider *provider; + QMediaPlayerControl* control; + QMediaPlaylistControl* playlistControl; + QMediaPlayer::State state; + QMediaPlayer::Error error; + QString errorString; + bool filterStates; + + QMediaPlaylist *playlist; + QPointer videoWidget; + QPointer videoItem; + + void _q_stateChanged(QMediaPlayer::State state); + void _q_mediaStatusChanged(QMediaPlayer::MediaStatus status); + void _q_error(int error, const QString &errorString); + void _q_updateMedia(const QMediaContent&); + void _q_playlistDestroyed(); +}; + +#define ENUM_NAME(c,e,v) (c::staticMetaObject.enumerator(c::staticMetaObject.indexOfEnumerator(e)).valueToKey((v))) + +void QMediaPlayerPrivate::_q_stateChanged(QMediaPlayer::State ps) +{ + Q_Q(QMediaPlayer); + +#ifdef DEBUG_PLAYER_STATE + qDebug() << "State changed:" << ENUM_NAME(QMediaPlayer, "State", ps) << (filterStates ? "(filtered)" : ""); +#endif + + if (filterStates) + return; + + if (playlist + && !playlistControl //service should do this itself + && ps != state && ps == QMediaPlayer::StoppedState + && control->mediaStatus() == QMediaPlayer::EndOfMedia) { + playlist->next(); + ps = control->state(); + } + + if (ps != state) { + state = ps; + + if (ps == QMediaPlayer::PlayingState) + q->addPropertyWatch("position"); + else + q->removePropertyWatch("position"); + + emit q->stateChanged(ps); + } +} + +void QMediaPlayerPrivate::_q_mediaStatusChanged(QMediaPlayer::MediaStatus status) +{ + Q_Q(QMediaPlayer); + +#ifdef DEBUG_PLAYER_STATE + qDebug() << "MediaStatus changed:" << ENUM_NAME(QMediaPlayer, "MediaStatus", status); +#endif + + switch (status) { + case QMediaPlayer::StalledMedia: + case QMediaPlayer::BufferingMedia: + q->addPropertyWatch("bufferStatus"); + emit q->mediaStatusChanged(status); + break; + default: + q->removePropertyWatch("bufferStatus"); + emit q->mediaStatusChanged(status); + break; + } + +} + +void QMediaPlayerPrivate::_q_error(int error, const QString &errorString) +{ + Q_Q(QMediaPlayer); + + this->error = QMediaPlayer::Error(error); + this->errorString = errorString; + + emit q->error(this->error); +} + +void QMediaPlayerPrivate::_q_updateMedia(const QMediaContent &media) +{ + const QMediaPlayer::State currentState = state; + + filterStates = true; + control->setMedia(media, 0); + + if (!media.isNull()) { + switch (currentState) { + case QMediaPlayer::PlayingState: + control->play(); + break; + case QMediaPlayer::PausedState: + control->pause(); + break; + default: + break; + } + } + filterStates = false; + + state = control->state(); + + if (state != currentState) { +#ifdef DEBUG_PLAYER_STATE + qDebug() << "State changed:" << ENUM_NAME(QMediaPlayer, "State", state); +#endif + emit q_func()->stateChanged(state); + } +} + +void QMediaPlayerPrivate::_q_playlistDestroyed() +{ + playlist = 0; + + control->setMedia(QMediaContent(), 0); +} + +static QMediaService *playerService(QMediaPlayer::Flags flags, QMediaServiceProvider *provider) +{ + if (flags) { + QMediaServiceProviderHint::Features features = 0; + if (flags & QMediaPlayer::LowLatency) + features |= QMediaServiceProviderHint::LowLatencyPlayback; + + if (flags & QMediaPlayer::StreamPlayback) + features |= QMediaServiceProviderHint::StreamPlayback; + + return provider->requestService(Q_MEDIASERVICE_MEDIAPLAYER, + QMediaServiceProviderHint(features)); + } else + return provider->requestService(Q_MEDIASERVICE_MEDIAPLAYER); +} + + +/*! + Construct a QMediaPlayer that uses the playback service from \a provider, + parented to \a parent and with \a flags. + + If a playback service is not specified the system default will be used. +*/ + +QMediaPlayer::QMediaPlayer(QObject *parent, QMediaPlayer::Flags flags, QMediaServiceProvider *provider): + QMediaObject(*new QMediaPlayerPrivate, + parent, + playerService(flags,provider)) +{ + Q_D(QMediaPlayer); + + d->provider = provider; + + if (d->service == 0) { + d->error = ServiceMissingError; + } else { + d->control = qobject_cast(d->service->control(QMediaPlayerControl_iid)); + d->playlistControl = qobject_cast(d->service->control(QMediaPlaylistControl_iid)); + if (d->control != 0) { + connect(d->control, SIGNAL(mediaChanged(QMediaContent)), SIGNAL(mediaChanged(QMediaContent))); + connect(d->control, SIGNAL(stateChanged(QMediaPlayer::State)), SLOT(_q_stateChanged(QMediaPlayer::State))); + connect(d->control, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), + SLOT(_q_mediaStatusChanged(QMediaPlayer::MediaStatus))); + connect(d->control, SIGNAL(error(int,QString)), SLOT(_q_error(int,QString))); + + connect(d->control, SIGNAL(durationChanged(qint64)), SIGNAL(durationChanged(qint64))); + connect(d->control, SIGNAL(positionChanged(qint64)), SIGNAL(positionChanged(qint64))); + connect(d->control, SIGNAL(audioAvailableChanged(bool)), SIGNAL(audioAvailableChanged(bool))); + connect(d->control, SIGNAL(videoAvailableChanged(bool)), SIGNAL(videoAvailableChanged(bool))); + connect(d->control, SIGNAL(volumeChanged(int)), SIGNAL(volumeChanged(int))); + connect(d->control, SIGNAL(mutedChanged(bool)), SIGNAL(mutedChanged(bool))); + connect(d->control, SIGNAL(seekableChanged(bool)), SIGNAL(seekableChanged(bool))); + connect(d->control, SIGNAL(playbackRateChanged(qreal)), SIGNAL(playbackRateChanged(qreal))); + + if (d->control->state() == PlayingState) + addPropertyWatch("position"); + + if (d->control->mediaStatus() == StalledMedia || d->control->mediaStatus() == BufferingMedia) + addPropertyWatch("bufferStatus"); + } + } +} + + +/*! + Destroys the player object. +*/ + +QMediaPlayer::~QMediaPlayer() +{ + Q_D(QMediaPlayer); + + d->provider->releaseService(d->service); +} + +QMediaContent QMediaPlayer::media() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->media(); + + return QMediaContent(); +} + +/*! + Returns the stream source of media data. + + This is only valid if a stream was passed to setMedia(). + + \sa setMedia() +*/ + +const QIODevice *QMediaPlayer::mediaStream() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->mediaStream(); + + return 0; +} + +QMediaPlayer::State QMediaPlayer::state() const +{ + return d_func()->state; +} + +QMediaPlayer::MediaStatus QMediaPlayer::mediaStatus() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->mediaStatus(); + + return QMediaPlayer::UnknownMediaStatus; +} + +qint64 QMediaPlayer::duration() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->duration(); + + return -1; +} + +qint64 QMediaPlayer::position() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->position(); + + return 0; +} + +int QMediaPlayer::volume() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->volume(); + + return 0; +} + +bool QMediaPlayer::isMuted() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->isMuted(); + + return false; +} + +int QMediaPlayer::bufferStatus() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->bufferStatus(); + + return 0; +} + +bool QMediaPlayer::isAudioAvailable() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->isAudioAvailable(); + + return false; +} + +bool QMediaPlayer::isVideoAvailable() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->isVideoAvailable(); + + return false; +} + +bool QMediaPlayer::isSeekable() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->isSeekable(); + + return false; +} + +qreal QMediaPlayer::playbackRate() const +{ + Q_D(const QMediaPlayer); + + if (d->control != 0) + return d->control->playbackRate(); + + return 0.0; +} + +/*! + Returns the current error state. +*/ + +QMediaPlayer::Error QMediaPlayer::error() const +{ + return d_func()->error; +} + +QString QMediaPlayer::errorString() const +{ + return d_func()->errorString; +} + +//public Q_SLOTS: +/*! + Start or resume playing the current source. +*/ + +void QMediaPlayer::play() +{ + Q_D(QMediaPlayer); + + if (d->control == 0) { + QMetaObject::invokeMethod(this, "_q_error", Qt::QueuedConnection); + Q_ARG(int, QMediaPlayer::ServiceMissingError), + Q_ARG(QString, tr("The QMediaPlayer object does not have a valid service")); + return; + } + + //if playlist control is available, the service should advance itself + if (d->playlist && !d->playlistControl && d->playlist->currentIndex() == -1 && !d->playlist->isEmpty()) + d->playlist->setCurrentIndex(0); + + // Reset error conditions + d->error = NoError; + d->errorString = QString(); + + d->control->play(); +} + +/*! + Pause playing the current source. +*/ + +void QMediaPlayer::pause() +{ + Q_D(QMediaPlayer); + + if (d->control != 0) + d->control->pause(); +} + +/*! + Stop playing, and reset the play position to the beginning. +*/ + +void QMediaPlayer::stop() +{ + Q_D(QMediaPlayer); + + if (d->control != 0) + d->control->stop(); +} + +void QMediaPlayer::setPosition(qint64 position) +{ + Q_D(QMediaPlayer); + + if (d->control == 0 || !isSeekable()) + return; + + d->control->setPosition(qBound(qint64(0), duration(), position)); +} + +void QMediaPlayer::setVolume(int v) +{ + Q_D(QMediaPlayer); + + if (d->control == 0) + return; + + int clamped = qBound(0, v, 100); + if (clamped == volume()) + return; + + d->control->setVolume(clamped); +} + +void QMediaPlayer::setMuted(bool muted) +{ + Q_D(QMediaPlayer); + + if (d->control == 0 || muted == isMuted()) + return; + + d->control->setMuted(muted); +} + +void QMediaPlayer::setPlaybackRate(qreal rate) +{ + Q_D(QMediaPlayer); + + if (d->control != 0) + d->control->setPlaybackRate(rate); +} + +/*! + Sets the current \a media source. + + If a \a stream is supplied; media data will be read from it instead of resolving the media + source. In this case the media source may still be used to resolve additional information + about the media such as mime type. + + Setting the media to a null QMediaContent will cause the player to discard all + information relating to the current media source and to cease all I/O operations related + to that media. +*/ + +void QMediaPlayer::setMedia(const QMediaContent &media, QIODevice *stream) +{ + Q_D(QMediaPlayer); + + if (d->control != 0) + d_func()->control->setMedia(media, stream); +} + +/*! + \internal +*/ + +void QMediaPlayer::bind(QObject *obj) +{ + Q_D(QMediaPlayer); + + if (d->control != 0) { + QMediaPlaylist *playlist = qobject_cast(obj); + + if (playlist) { + if (d->playlist) + d->playlist->setMediaObject(0); + + d->playlist = playlist; + connect(d->playlist, SIGNAL(currentMediaChanged(QMediaContent)), + this, SLOT(_q_updateMedia(QMediaContent))); + connect(d->playlist, SIGNAL(destroyed()), this, SLOT(_q_playlistDestroyed())); + + setMedia(playlist->currentMedia()); + + return; + } + + QVideoWidget *videoWidget = qobject_cast(obj); + QGraphicsVideoItem *videoItem = qobject_cast(obj); + + if (videoWidget || videoItem) { + //detach the current video output + if (d->videoWidget) { + d->videoWidget->setMediaObject(0); + d->videoWidget = 0; + } + + if (d->videoItem) { + d->videoItem->setMediaObject(0); + d->videoItem = 0; + } + } + + if (videoWidget) + d->videoWidget = videoWidget; + + if (videoItem) + d->videoItem = videoItem; + } +} + +/*! + \internal +*/ + +void QMediaPlayer::unbind(QObject *obj) +{ + Q_D(QMediaPlayer); + + if (obj == d->videoWidget) { + d->videoWidget = 0; + } else if (obj == d->videoItem) { + d->videoItem = 0; + } else if (obj == d->playlist) { + disconnect(d->playlist, SIGNAL(currentMediaChanged(QMediaContent)), + this, SLOT(_q_updateMedia(QMediaContent))); + disconnect(d->playlist, SIGNAL(destroyed()), this, SLOT(_q_playlistDestroyed())); + d->playlist = 0; + setMedia(QMediaContent()); + } +} + +/*! + Returns the level of support a media player has for a \a mimeType and a set of \a codecs. + + The \a flags argument allows additional requirements such as performance indicators to be + specified. +*/ +QtMediaservices::SupportEstimate QMediaPlayer::hasSupport(const QString &mimeType, + const QStringList& codecs, + Flags flags) +{ + return QMediaServiceProvider::defaultServiceProvider()->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), + mimeType, + codecs, + flags); +} + +/*! + Returns a list of MIME types supported by the media player. + + The \a flags argument causes the resultant list to be restricted to MIME types which can be supported + given additional requirements, such as performance indicators. +*/ +QStringList QMediaPlayer::supportedMimeTypes(Flags flags) +{ + return QMediaServiceProvider::defaultServiceProvider()->supportedMimeTypes(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), + flags); +} + + +// Enums +/*! + \enum QMediaPlayer::State + + Defines the current state of a media player. + + \value PlayingState The media player is currently playing content. + \value PausedState The media player has paused playback, playback of the current track will + resume from the position the player was paused at. + \value StoppedState The media player is not playing content, playback will begin from the start + of the current track. +*/ + +/*! + \enum QMediaPlayer::MediaStatus + + Defines the status of a media player's current media. + + \value UnknownMediaStatus The status of the media cannot be determined. + \value NoMedia The is no current media. The player is in the StoppedState. + \value LoadingMedia The current media is being loaded. The player may be in any state. + \value LoadedMedia The current media has been loaded. The player is in the StoppedState. + \value StalledMedia Playback of the current media has stalled due to insufficient buffering or + some other temporary interruption. The player is in the PlayingState or PausedState. + \value BufferingMedia The player is buffering data but has enough data buffered for playback to + continue for the immediate future. The player is in the PlayingState or PausedState. + \value BufferedMedia The player has fully buffered the current media. The player is in the + PlayingState or PausedState. + \value EndOfMedia Playback has reached the end of the current media. The player is in the + StoppedState. + \value InvalidMedia The current media cannot be played. The player is in the StoppedState. +*/ + +/*! + \enum QMediaPlayer::Error + + Defines a media player error condition. + + \value NoError No error has occurred. + \value ResourceError A media resource couldn't be resolved. + \value FormatError The format of a media resource isn't (fully) supported. Playback may still + be possible, but without an audio or video component. + \value NetworkError A network error occurred. + \value AccessDeniedError There are not the appropriate permissions to play a media resource. + \value ServiceMissingError A valid playback service was not found, playback cannot proceed. +*/ + +// Signals +/*! + \fn QMediaPlayer::error(QMediaPlayer::Error error) + + Signals that an \a error condition has occurred. + + \sa errorString() +*/ + +/*! + \fn void QMediaPlayer::stateChanged(State state) + + Signal the \a state of the Player object has changed. +*/ + +/*! + \fn QMediaPlayer::mediaStatusChanged(QMediaPlayer::MediaStatus status) + + Signals that the \a status of the current media has changed. + + \sa mediaStatus() +*/ + +/*! + \fn void QMediaPlayer::mediaChanged(const QMediaContent &media); + + Signals that the current playing content will be obtained from \a media. + + \sa media() +*/ + +/*! + \fn void QMediaPlayer::playbackRateChanged(qreal rate); + + Signals the playbackRate has changed to \a rate. +*/ + +/*! + \fn void QMediaPlayer::seekableChanged(bool seekable); + + Signals the \a seekable status of the player object has changed. +*/ + +// Properties +/*! + \property QMediaPlayer::state + \brief the media player's playback state. + + By default this property is QMediaPlayer::Stopped + + \sa mediaStatus(), play(), pause(), stop() +*/ + +/*! + \property QMediaPlayer::error + \brief a string describing the last error condition. + + \sa error() +*/ + +/*! + \property QMediaPlayer::media + \brief the active media source being used by the player object. + + The player object will use the QMediaContent for selection of the content to + be played. + + By default this property has a null QMediaContent. + + Setting this property to a null QMediaContent will cause the player to discard all + information relating to the current media source and to cease all I/O operations related + to that media. + + \sa QMediaContent +*/ + +/*! + \property QMediaPlayer::mediaStatus + \brief the status of the current media stream. + + The stream status describes how the playback of the current stream is + progressing. + + By default this property is QMediaPlayer::NoMedia + + \sa state +*/ + +/*! + \property QMediaPlayer::duration + \brief the duration of the current media. + + The value is the total playback time in milliseconds of the current media. + The value may change across the life time of the QMediaPlayer object and + may not be available when initial playback begins, connect to the + durationChanged() signal to receive status notifications. +*/ + +/*! + \property QMediaPlayer::position + \brief the playback position of the current media. + + The value is the current playback position, expressed in milliseconds since + the beginning of the media. Periodically changes in the position will be + indicated with the signal positionChanged(), the interval between updates + can be set with QMediaObject's method setNotifyInterval(). +*/ + +/*! + \property QMediaPlayer::volume + \brief the current playback volume. + + The playback volume is a linear in effect and the value can range from 0 - + 100, values outside this range will be clamped. +*/ + +/*! + \property QMediaPlayer::muted + \brief the muted state of the current media. + + The value will be true if the playback volume is muted; otherwise false. +*/ + +/*! + \property QMediaPlayer::bufferStatus + \brief the percentage of the temporary buffer filled before playback begins. + + When the player object is buffering; this property holds the percentage of + the temporary buffer that is filled. The buffer will need to reach 100% + filled before playback can resume, at which time the MediaStatus will be + BufferedMedia. + + \sa mediaStatus() +*/ + +/*! + \property QMediaPlayer::audioAvailable + \brief the audio availabilty status for the current media. + + As the life time of QMediaPlayer can be longer than the playback of one + QMediaContent, this property may change over time, the + audioAvailableChanged signal can be used to monitor it's status. +*/ + +/*! + \property QMediaPlayer::videoAvailable + \brief the video availability status for the current media. + + If available, the QVideoWidget class can be used to view the video. As the + life time of QMediaPlayer can be longer than the playback of one + QMediaContent, this property may change over time, the + videoAvailableChanged signal can be used to monitor it's status. + + \sa QVideoWidget, QMediaContent +*/ + +/*! + \property QMediaPlayer::seekable + \brief the seek-able status of the current media + + If seeking is supported this property will be true; false otherwise. The + status of this property may change across the life time of the QMediaPlayer + object, use the seekableChanged signal to monitor changes. +*/ + +/*! + \property QMediaPlayer::playbackRate + \brief the playback rate of the current media. + + This value is a multiplier applied to the media's standard play rate. By + default this value is 1.0, indicating that the media is playing at the + standard pace. Values higher than 1.0 will increase the rate of play. + Values less than zero can be set and indicate the media will rewind at the + multiplier of the standard pace. + + Not all playback services support change of the playback rate. It is + framework defined as to the status and quality of audio and video + while fast forwarding or rewinding. +*/ + +/*! + \fn void QMediaPlayer::durationChanged(qint64 duration) + + Signal the duration of the content has changed to \a duration, expressed in milliseconds. +*/ + +/*! + \fn void QMediaPlayer::positionChanged(qint64 position) + + Signal the position of the content has changed to \a position, expressed in + milliseconds. +*/ + +/*! + \fn void QMediaPlayer::volumeChanged(int volume) + + Signal the playback volume has changed to \a volume. +*/ + +/*! + \fn void QMediaPlayer::mutedChanged(bool muted) + + Signal the mute state has changed to \a muted. +*/ + +/*! + \fn void QMediaPlayer::audioAvailableChanged(bool available) + + Signals the availability of audio content has changed to \a available. +*/ + +/*! + \fn void QMediaPlayer::videoAvailableChanged(bool videoAvailable) + + Signal the availability of visual content has changed to \a videoAvailable. +*/ + +/*! + \fn void QMediaPlayer::bufferStatusChanged(int percentFilled) + + Signal the amount of the local buffer filled as a percentage by \a percentFilled. +*/ + +/*! + \enum QMediaPlayer::Flag + + \value LowLatency + The player is expected to be used with simple audio formats, + but playback should start without significant delay. + Such playback service can be used for beeps, ringtones, etc. + + \value StreamPlayback + The player is expected to play QIODevice based streams. + If passed to QMediaPlayer constructor, the service supporting + streams playback will be choosen. +*/ + +QT_END_NAMESPACE + +QT_END_HEADER + +#include "moc_qmediaplayer.cpp" diff --git a/src/multimedia/mediaservices/playback/qmediaplayer.h b/src/multimedia/mediaservices/playback/qmediaplayer.h new file mode 100644 index 0000000..2b4c443 --- /dev/null +++ b/src/multimedia/mediaservices/playback/qmediaplayer.h @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIAPLAYER_H +#define QMEDIAPLAYER_H + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QMediaPlaylist; + +class QMediaPlayerPrivate; +class Q_MULTIMEDIA_EXPORT QMediaPlayer : public QMediaObject +{ + Q_OBJECT + Q_PROPERTY(QMediaContent media READ media WRITE setMedia NOTIFY mediaChanged) + Q_PROPERTY(qint64 duration READ duration NOTIFY durationChanged) + Q_PROPERTY(qint64 position READ position WRITE setPosition NOTIFY positionChanged) + Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) + Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) + Q_PROPERTY(int bufferStatus READ bufferStatus NOTIFY bufferStatusChanged) + Q_PROPERTY(bool audioAvailable READ isAudioAvailable NOTIFY audioAvailableChanged) + Q_PROPERTY(bool videoAvailable READ isVideoAvailable NOTIFY videoAvailableChanged) + Q_PROPERTY(bool seekable READ isSeekable NOTIFY seekableChanged) + Q_PROPERTY(qreal playbackRate READ playbackRate WRITE setPlaybackRate NOTIFY playbackRateChanged) + Q_PROPERTY(State state READ state NOTIFY stateChanged) + Q_PROPERTY(MediaStatus mediaStatus READ mediaStatus NOTIFY mediaStatusChanged) + Q_PROPERTY(QString error READ errorString) + Q_ENUMS(State) + Q_ENUMS(MediaStatus) + +public: + enum State + { + StoppedState, + PlayingState, + PausedState + }; + + enum MediaStatus + { + UnknownMediaStatus, + NoMedia, + LoadingMedia, + LoadedMedia, + StalledMedia, + BufferingMedia, + BufferedMedia, + EndOfMedia, + InvalidMedia + }; + + enum Flag + { + LowLatency = 0x01, + StreamPlayback = 0x02 + }; + Q_DECLARE_FLAGS(Flags, Flag) + + enum Error + { + NoError, + ResourceError, + FormatError, + NetworkError, + AccessDeniedError, + ServiceMissingError + }; + + QMediaPlayer(QObject *parent = 0, Flags flags = 0, QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider()); + ~QMediaPlayer(); + + static QtMediaservices::SupportEstimate hasSupport(const QString &mimeType, + const QStringList& codecs = QStringList(), + Flags flags = 0); + static QStringList supportedMimeTypes(Flags flags = 0); + + QMediaContent media() const; + const QIODevice *mediaStream() const; + + State state() const; + MediaStatus mediaStatus() const; + + qint64 duration() const; + qint64 position() const; + + int volume() const; + bool isMuted() const; + bool isAudioAvailable() const; + bool isVideoAvailable() const; + + int bufferStatus() const; + + bool isSeekable() const; + qreal playbackRate() const; + + Error error() const; + QString errorString() const; + +public Q_SLOTS: + void play(); + void pause(); + void stop(); + + void setPosition(qint64 position); + void setVolume(int volume); + void setMuted(bool muted); + + void setPlaybackRate(qreal rate); + + void setMedia(const QMediaContent &media, QIODevice *stream = 0); + +Q_SIGNALS: + void mediaChanged(const QMediaContent &media); + + void stateChanged(QMediaPlayer::State newState); + void mediaStatusChanged(QMediaPlayer::MediaStatus status); + + void durationChanged(qint64 duration); + void positionChanged(qint64 position); + + void volumeChanged(int volume); + void mutedChanged(bool muted); + void audioAvailableChanged(bool audioAvailable); + void videoAvailableChanged(bool videoAvailable); + + void bufferStatusChanged(int percentFilled); + + void seekableChanged(bool seekable); + void playbackRateChanged(qreal rate); + + void error(QMediaPlayer::Error error); + +public: + virtual void bind(QObject*); + virtual void unbind(QObject*); + +private: + Q_DISABLE_COPY(QMediaPlayer) + Q_DECLARE_PRIVATE(QMediaPlayer) + Q_PRIVATE_SLOT(d_func(), void _q_stateChanged(QMediaPlayer::State)) + Q_PRIVATE_SLOT(d_func(), void _q_mediaStatusChanged(QMediaPlayer::MediaStatus)) + Q_PRIVATE_SLOT(d_func(), void _q_error(int, const QString &)) + Q_PRIVATE_SLOT(d_func(), void _q_updateMedia(const QMediaContent&)) + Q_PRIVATE_SLOT(d_func(), void _q_playlistDestroyed()) +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QMediaPlayer::State) +Q_DECLARE_METATYPE(QMediaPlayer::MediaStatus) +Q_DECLARE_METATYPE(QMediaPlayer::Error) + +QT_END_HEADER + +#endif // QMEDIAPLAYER_H diff --git a/src/multimedia/mediaservices/playback/qmediaplayercontrol.cpp b/src/multimedia/mediaservices/playback/qmediaplayercontrol.cpp new file mode 100644 index 0000000..3b63d93 --- /dev/null +++ b/src/multimedia/mediaservices/playback/qmediaplayercontrol.cpp @@ -0,0 +1,378 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 + + +QT_BEGIN_NAMESPACE + + +/*! + \class QMediaPlayerControl + \ingroup multimedia-serv + \since 4.7 + \preliminary + \brief The QMediaPlayerControl class provides access to the media playing + functionality of a QMediaService. + + If a QMediaService can play media is will implement QMediaPlayerControl. + This control provides a means to set the \l {setMedia()}{media} to play, + \l {play()}{start}, \l {pause()} {pause} and \l {stop()}{stop} playback, + \l {setPosition()}{seek}, and control the \l {setVolume()}{volume}. + It also provides feedback on the \l {duration()}{duration} of the media, + the current \l {position()}{position}, and \l {bufferStatus()}{buffering} + progress. + + The functionality provided by this control is exposed to application + code through the QMediaPlayer class. + + The interface name of QMediaPlayerControl is \c com.nokia.Qt.QMediaPlayerControl/1.0 as + defined in QMediaPlayerControl_iid. + + \sa QMediaService::control(), QMediaPlayer +*/ + +/*! + \macro QMediaPlayerControl_iid + + \c com.nokia.Qt.QMediaPlayerControl/1.0 + + Defines the interface name of the QMediaPlayerControl class. + + \relates QMediaPlayerControl +*/ + +/*! + Destroys a media player control. +*/ +QMediaPlayerControl::~QMediaPlayerControl() +{ +} + +/*! + Constructs a new media player control with the given \a parent. +*/ +QMediaPlayerControl::QMediaPlayerControl(QObject *parent): + QMediaControl(*new QMediaControlPrivate, parent) +{ +} + +/*! + \fn QMediaPlayerControl::state() const + + Returns the state of a player control. +*/ + +/*! + \fn QMediaPlayerControl::stateChanged(QMediaPlayer::State state) + + Signals that the \a state of a player control has changed. + + \sa state() +*/ + +/*! + \fn QMediaPlayerControl::mediaStatus() const + + Returns the status of the current media. +*/ + +/*! + \fn QMediaPlayerControl::mediaStatusChanged(QMediaPlayer::MediaStatus status) + + Signals that the \a status of the current media has changed. + + \sa mediaStatus() +*/ + + +/*! + \fn QMediaPlayerControl::duration() const + + Returns the duration of the current media in milliseconds. +*/ + +/*! + \fn QMediaPlayerControl::durationChanged(qint64 duration) + + Signals that the \a duration of the current media has changed. + + \sa duration() +*/ + +/*! + \fn QMediaPlayerControl::position() const + + Returns the current playback position in milliseconds. +*/ + +/*! + \fn QMediaPlayerControl::setPosition(qint64 position) + + Sets the playback \a position of the current media. This will initiate a seek and it may take + some time for playback to reach the position set. +*/ + +/*! + \fn QMediaPlayerControl::positionChanged(qint64 position) + + Signals the playback \a position has changed. + + This is only emitted in when there has been a discontinous change in the playback postion, such + as a seek or the position being reset. + + \sa position() +*/ + +/*! + \fn QMediaPlayerControl::volume() const + + Returns the audio volume of a player control. +*/ + +/*! + \fn QMediaPlayerControl::setVolume(int volume) + + Sets the audio \a volume of a player control. +*/ + +/*! + \fn QMediaPlayerControl::volumeChanged(int volume) + + Signals the audio \a volume of a player control has changed. + + \sa volume() +*/ + +/*! + \fn QMediaPlayerControl::isMuted() const + + Returns the mute state of a player control. +*/ + +/*! + \fn QMediaPlayerControl::setMuted(bool mute) + + Sets the \a mute state of a player control. +*/ + +/*! + \fn QMediaPlayerControl::mutedChanged(bool mute) + + Signals a change in the \a mute status of a player control. + + \sa isMuted() +*/ + +/*! + \fn QMediaPlayerControl::bufferStatus() const + + Returns the buffering progress of the current media. Progress is measured in the percentage + of the buffer filled. +*/ + +/*! + \fn QMediaPlayerControl::bufferStatusChanged(int progress) + + Signals that buffering \a progress has changed. + + \sa bufferStatus() +*/ + +/*! + \fn QMediaPlayerControl::isAudioAvailable() const + + Identifies if there is audio output available for the current media. + + Returns true if audio output is available and false otherwise. +*/ + +/*! + \fn QMediaPlayerControl::audioAvailableChanged(bool audio) + + Signals that there has been a change in the availability of \a audio output. + + \sa isAudioAvailable() +*/ + +/*! + \fn QMediaPlayerControl::isVideoAvailable() const + + Identifies if there is video output available for the current media. + + Returns true if video output is available and false otherwise. +*/ + +/*! + \fn QMediaPlayerControl::videoAvailableChanged(bool video) + + Signals that there has been a change in the availability of \a video output. + + \sa isVideoAvailable() +*/ + +/*! + \fn QMediaPlayerControl::isSeekable() const + + Identifies if the current media is seekable. + + Returns true if it possible to seek within the current media, and false otherwise. +*/ + +/*! + \fn QMediaPlayerControl::seekableChanged(bool seekable) + + Signals that the \a seekable state of a player control has changed. + + \sa isSeekable() +*/ + +/*! + \fn QMediaPlayerControl::availablePlaybackRanges() const + + Returns a range of times in milliseconds that can be played back. + + Usually for local files this is a continuous interval equal to [0..duration()] + or an empty time range if seeking is not supported, but for network sources + it refers to the buffered parts of the media. +*/ + +/*! + \fn QMediaPlayerControl::availablePlaybackRangesChanged(const QMediaTimeRange &ranges) + + Signals that the available media playback \a ranges have changed. + + \sa QMediaPlayerControl::availablePlaybackRanges() +*/ + +/*! + \fn qreal QMediaPlayerControl::playbackRate() const + + Returns the rate of playback. +*/ + +/*! + \fn QMediaPlayerControl::setPlaybackRate(qreal rate) + + Sets the \a rate of playback. +*/ + +/*! + \fn QMediaPlayerControl::media() const + + Returns the current media source. +*/ + +/*! + \fn QMediaPlayerControl::mediaStream() const + + Returns the current media stream. This is only a valid if a stream was passed to setMedia(). + + \sa setMedia() +*/ + +/*! + \fn QMediaPlayerControl::setMedia(const QMediaContent &media, QIODevice *stream) + + Sets the current \a media source. If a \a stream is supplied; data will be read from that + instead of attempting to resolve the media source. The media source may still be used to + supply media information such as mime type. + + Setting the media to a null QMediaContent will cause the control to discard all + information relating to the current media source and to cease all I/O operations related + to that media. +*/ + +/*! + \fn QMediaPlayerControl::mediaChanged(const QMediaContent& content) + + Signals that the current media \a content has changed. +*/ + +/*! + \fn QMediaPlayerControl::play() + + Starts playback of the current media. + + If successful the player control will immediately enter the \l {QMediaPlayer::PlayingState} + {playing} state. + + \sa state() +*/ + +/*! + \fn QMediaPlayerControl::pause() + + Pauses playback of the current media. + + If sucessful the player control will immediately enter the \l {QMediaPlayer::PausedState} + {paused} state. + + \sa state(), play(), stop() +*/ + +/*! + \fn QMediaPlayerControl::stop() + + Stops playback of the current media. + + If succesful the player control will immediately enter the \l {QMediaPlayer::StoppedState} + {stopped} state. +*/ + +/*! + \fn QMediaPlayerControl::error(int error, const QString &errorString) + + Signals that an \a error has occurred. The \a errorString provides a more detailed explanation. +*/ + +/*! + \fn QMediaPlayerControl::playbackRateChanged(qreal rate) + + Signal emitted when playback rate changes to \a rate. +*/ + +QT_END_NAMESPACE + +#include "moc_qmediaplayercontrol.cpp" + diff --git a/src/multimedia/mediaservices/playback/qmediaplayercontrol.h b/src/multimedia/mediaservices/playback/qmediaplayercontrol.h new file mode 100644 index 0000000..be10713 --- /dev/null +++ b/src/multimedia/mediaservices/playback/qmediaplayercontrol.h @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMediaservices 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 QMEDIAPLAYERCONTROL_H +#define QMEDIAPLAYERCONTROL_H + +#include + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QMediaPlaylist; + +class Q_MULTIMEDIA_EXPORT QMediaPlayerControl : public QMediaControl +{ + Q_OBJECT + +public: + ~QMediaPlayerControl(); + + virtual QMediaPlayer::State state() const = 0; + + virtual QMediaPlayer::MediaStatus mediaStatus() const = 0; + + virtual qint64 duration() const = 0; + + virtual qint64 position() const = 0; + virtual void setPosition(qint64 position) = 0; + + virtual int volume() const = 0; + virtual void setVolume(int volume) = 0; + + virtual bool isMuted() const = 0; + virtual void setMuted(bool muted) = 0; + + virtual int bufferStatus() const = 0; + + virtual bool isAudioAvailable() const = 0; + virtual bool isVideoAvailable() const = 0; + + virtual bool isSeekable() const = 0; + + virtual QMediaTimeRange availablePlaybackRanges() const = 0; + + virtual qreal playbackRate() const = 0; + virtual void setPlaybackRate(qreal rate) = 0; + + virtual QMediaContent media() const = 0; + virtual const QIODevice *mediaStream() const = 0; + virtual void setMedia(const QMediaContent &media, QIODevice *stream) = 0; + + virtual void play() = 0; + virtual void pause() = 0; + virtual void stop() = 0; + +Q_SIGNALS: + void mediaChanged(const QMediaContent& content); + void durationChanged(qint64 duration); + void positionChanged(qint64 position); + void stateChanged(QMediaPlayer::State newState); + void mediaStatusChanged(QMediaPlayer::MediaStatus status); + void volumeChanged(int volume); + void mutedChanged(bool muted); + void audioAvailableChanged(bool audioAvailable); + void videoAvailableChanged(bool videoAvailable); + void bufferStatusChanged(int percentFilled); + void seekableChanged(bool); + void availablePlaybackRangesChanged(const QMediaTimeRange&); + void playbackRateChanged(qreal rate); + void error(int error, const QString &errorString); + +protected: + QMediaPlayerControl(QObject* parent = 0); +}; + +#define QMediaPlayerControl_iid "com.nokia.Qt.QMediaPlayerControl/1.0" +Q_MEDIA_DECLARE_CONTROL(QMediaPlayerControl, QMediaPlayerControl_iid) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMEDIAPLAYERCONTROL_H + diff --git a/src/multimedia/multimedia.pro b/src/multimedia/multimedia.pro index 500aff7..8cdcb38 100644 --- a/src/multimedia/multimedia.pro +++ b/src/multimedia/multimedia.pro @@ -1,17 +1,8 @@ -TARGET = QtMultimedia -QPRO_PWD = $$PWD -QT = core gui +TEMPLATE = subdirs -DEFINES += QT_BUILD_MULTIMEDIA_LIB QT_NO_USING_NAMESPACE +contains(QT_CONFIG, multimedia) { + SUBDIRS += multimedia -unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui + contains(QT_CONFIG, mediaservices):SUBDIRS += mediaservices +} -include(../qbase.pri) - -include(audio/audio.pri) -include(video/video.pri) -include(base/base.pri) -include(playback/playback.pri) -include(effects/effects.pri) - -symbian: TARGET.UID3 = 0x2001E627 diff --git a/src/multimedia/multimedia/audio/audio.pri b/src/multimedia/multimedia/audio/audio.pri new file mode 100644 index 0000000..ae28a26 --- /dev/null +++ b/src/multimedia/multimedia/audio/audio.pri @@ -0,0 +1,73 @@ +HEADERS += $$PWD/qaudio.h \ + $$PWD/qaudioformat.h \ + $$PWD/qaudioinput.h \ + $$PWD/qaudiooutput.h \ + $$PWD/qaudiodeviceinfo.h \ + $$PWD/qaudioengineplugin.h \ + $$PWD/qaudioengine.h \ + $$PWD/qaudiodevicefactory_p.h + + +SOURCES += $$PWD/qaudio.cpp \ + $$PWD/qaudioformat.cpp \ + $$PWD/qaudiodeviceinfo.cpp \ + $$PWD/qaudiooutput.cpp \ + $$PWD/qaudioinput.cpp \ + $$PWD/qaudioengineplugin.cpp \ + $$PWD/qaudioengine.cpp \ + $$PWD/qaudiodevicefactory.cpp + +contains(QT_CONFIG, audio-backend) { + +mac { + HEADERS += $$PWD/qaudioinput_mac_p.h \ + $$PWD/qaudiooutput_mac_p.h \ + $$PWD/qaudiodeviceinfo_mac_p.h \ + $$PWD/qaudio_mac_p.h + + SOURCES += $$PWD/qaudiodeviceinfo_mac_p.cpp \ + $$PWD/qaudiooutput_mac_p.cpp \ + $$PWD/qaudioinput_mac_p.cpp \ + $$PWD/qaudio_mac.cpp + + LIBS += -framework ApplicationServices -framework CoreAudio -framework AudioUnit -framework AudioToolbox + +} else:win32 { + + HEADERS += $$PWD/qaudioinput_win32_p.h $$PWD/qaudiooutput_win32_p.h $$PWD/qaudiodeviceinfo_win32_p.h + SOURCES += $$PWD/qaudiodeviceinfo_win32_p.cpp \ + $$PWD/qaudiooutput_win32_p.cpp \ + $$PWD/qaudioinput_win32_p.cpp + !wince*:LIBS += -lwinmm + wince*:LIBS += -lcoredll + +} else:symbian { + INCLUDEPATH += /epoc32/include/mmf/common + INCLUDEPATH += /epoc32/include/mmf/server + + HEADERS += $$PWD/qaudio_symbian_p.h \ + $$PWD/qaudiodeviceinfo_symbian_p.h \ + $$PWD/qaudioinput_symbian_p.h \ + $$PWD/qaudiooutput_symbian_p.h + + SOURCES += $$PWD/qaudio_symbian_p.cpp \ + $$PWD/qaudiodeviceinfo_symbian_p.cpp \ + $$PWD/qaudioinput_symbian_p.cpp \ + $$PWD/qaudiooutput_symbian_p.cpp + + LIBS += -lmmfdevsound +} else:unix { + unix:contains(QT_CONFIG, alsa) { + linux-*|freebsd-*|openbsd-*:{ + DEFINES += HAS_ALSA + HEADERS += $$PWD/qaudiooutput_alsa_p.h $$PWD/qaudioinput_alsa_p.h $$PWD/qaudiodeviceinfo_alsa_p.h + SOURCES += $$PWD/qaudiodeviceinfo_alsa_p.cpp \ + $$PWD/qaudiooutput_alsa_p.cpp \ + $$PWD/qaudioinput_alsa_p.cpp + LIBS_PRIVATE += -lasound + } + } +} +} else { + DEFINES += QT_NO_AUDIO_BACKEND +} diff --git a/src/multimedia/multimedia/audio/qaudio.cpp b/src/multimedia/multimedia/audio/qaudio.cpp new file mode 100644 index 0000000..e0f24ce --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudio.cpp @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** 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 + + +QT_BEGIN_NAMESPACE + +namespace QAudio +{ + +class RegisterMetaTypes +{ +public: + RegisterMetaTypes() + { + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + } + +} _register; + +} + +/*! + \namespace QAudio + \brief The QAudio namespace contains enums used by the audio classes. + \inmodule QtMultimedia + \ingroup multimedia + \since 4.6 +*/ + +/*! + \enum QAudio::Error + + \value NoError No errors have occurred + \value OpenError An error opening the audio device + \value IOError An error occurred during read/write of audio device + \value UnderrunError Audio data is not being fed to the audio device at a fast enough rate + \value FatalError A non-recoverable error has occurred, the audio device is not usable at this time. +*/ + +/*! + \enum QAudio::State + + \value ActiveState Audio data is being processed, this state is set after start() is called + and while audio data is available to be processed. + \value SuspendedState The audio device is in a suspended state, this state will only be entered + after suspend() is called. + \value StoppedState The audio device is closed, not processing any audio data + \value IdleState The QIODevice passed in has no data and audio system's buffer is empty, this state + is set after start() is called and while no audio data is available to be processed. +*/ + +/*! + \enum QAudio::Mode + + \value AudioOutput audio output device + \value AudioInput audio input device +*/ + + +QT_END_NAMESPACE + diff --git a/src/multimedia/multimedia/audio/qaudio.h b/src/multimedia/multimedia/audio/qaudio.h new file mode 100644 index 0000000..9ca1dff --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudio.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** 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 QAUDIO_H +#define QAUDIO_H + + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +namespace QAudio +{ + enum Error { NoError, OpenError, IOError, UnderrunError, FatalError }; + enum State { ActiveState, SuspendedState, StoppedState, IdleState }; + enum Mode { AudioInput, AudioOutput }; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +Q_DECLARE_METATYPE(QAudio::Error) +Q_DECLARE_METATYPE(QAudio::State) +Q_DECLARE_METATYPE(QAudio::Mode) + +#endif // QAUDIO_H diff --git a/src/multimedia/multimedia/audio/qaudio_mac.cpp b/src/multimedia/multimedia/audio/qaudio_mac.cpp new file mode 100644 index 0000000..14fee8b --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudio_mac.cpp @@ -0,0 +1,142 @@ +/**************************************************************************** +** +** 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 "qaudio_mac_p.h" + +QT_BEGIN_NAMESPACE + +// Debugging +QDebug operator<<(QDebug dbg, const QAudioFormat& audioFormat) +{ + dbg.nospace() << "QAudioFormat(" << + audioFormat.frequency() << "," << + audioFormat.channels() << "," << + audioFormat.sampleSize()<< "," << + audioFormat.codec() << "," << + audioFormat.byteOrder() << "," << + audioFormat.sampleType() << ")"; + + return dbg.space(); +} + + +// Conversion +QAudioFormat toQAudioFormat(AudioStreamBasicDescription const& sf) +{ + QAudioFormat audioFormat; + + audioFormat.setFrequency(sf.mSampleRate); + audioFormat.setChannels(sf.mChannelsPerFrame); + audioFormat.setSampleSize(sf.mBitsPerChannel); + audioFormat.setCodec(QString::fromLatin1("audio/pcm")); + audioFormat.setByteOrder(sf.mFormatFlags & kLinearPCMFormatFlagIsBigEndian != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian); + QAudioFormat::SampleType type = QAudioFormat::UnSignedInt; + if ((sf.mFormatFlags & kLinearPCMFormatFlagIsSignedInteger) != 0) + type = QAudioFormat::SignedInt; + else if ((sf.mFormatFlags & kLinearPCMFormatFlagIsFloat) != 0) + type = QAudioFormat::Float; + audioFormat.setSampleType(type); + + return audioFormat; +} + +AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& audioFormat) +{ + AudioStreamBasicDescription sf; + + sf.mFormatFlags = kAudioFormatFlagIsPacked; + sf.mSampleRate = audioFormat.frequency(); + sf.mFramesPerPacket = 1; + sf.mChannelsPerFrame = audioFormat.channels(); + sf.mBitsPerChannel = audioFormat.sampleSize(); + sf.mBytesPerFrame = sf.mChannelsPerFrame * (sf.mBitsPerChannel / 8); + sf.mBytesPerPacket = sf.mFramesPerPacket * sf.mBytesPerFrame; + sf.mFormatID = kAudioFormatLinearPCM; + + switch (audioFormat.sampleType()) { + case QAudioFormat::SignedInt: sf.mFormatFlags |= kAudioFormatFlagIsSignedInteger; break; + case QAudioFormat::UnSignedInt: /* default */ break; + case QAudioFormat::Float: sf.mFormatFlags |= kAudioFormatFlagIsFloat; break; + case QAudioFormat::Unknown: default: break; + } + + return sf; +} + +// QAudioRingBuffer +QAudioRingBuffer::QAudioRingBuffer(int bufferSize): + m_bufferSize(bufferSize) +{ + m_buffer = new char[m_bufferSize]; + reset(); +} + +QAudioRingBuffer::~QAudioRingBuffer() +{ + delete m_buffer; +} + +int QAudioRingBuffer::used() const +{ + return m_bufferUsed; +} + +int QAudioRingBuffer::free() const +{ + return m_bufferSize - m_bufferUsed; +} + +int QAudioRingBuffer::size() const +{ + return m_bufferSize; +} + +void QAudioRingBuffer::reset() +{ + m_readPos = 0; + m_writePos = 0; + m_bufferUsed = 0; +} + +QT_END_NAMESPACE + + diff --git a/src/multimedia/multimedia/audio/qaudio_mac_p.h b/src/multimedia/multimedia/audio/qaudio_mac_p.h new file mode 100644 index 0000000..4e7d688 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudio_mac_p.h @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + + +#ifndef QAUDIO_MAC_P_H +#define QAUDIO_MAC_P_H + +#include + +#include +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +extern QDebug operator<<(QDebug dbg, const QAudioFormat& audioFormat); + +extern QAudioFormat toQAudioFormat(const AudioStreamBasicDescription& streamFormat); +extern AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& audioFormat); + +class QAudioRingBuffer +{ +public: + typedef QPair Region; + + QAudioRingBuffer(int bufferSize); + ~QAudioRingBuffer(); + + Region acquireReadRegion(int size) + { + const int used = m_bufferUsed.fetchAndAddAcquire(0); + + if (used > 0) { + const int readSize = qMin(size, qMin(m_bufferSize - m_readPos, used)); + + return readSize > 0 ? Region(m_buffer + m_readPos, readSize) : Region(0, 0); + } + + return Region(0, 0); + } + + void releaseReadRegion(Region const& region) + { + m_readPos = (m_readPos + region.second) % m_bufferSize; + + m_bufferUsed.fetchAndAddRelease(-region.second); + } + + Region acquireWriteRegion(int size) + { + const int free = m_bufferSize - m_bufferUsed.fetchAndAddAcquire(0); + + if (free > 0) { + const int writeSize = qMin(size, qMin(m_bufferSize - m_writePos, free)); + + return writeSize > 0 ? Region(m_buffer + m_writePos, writeSize) : Region(0, 0); + } + + return Region(0, 0); + } + + void releaseWriteRegion(Region const& region) + { + m_writePos = (m_writePos + region.second) % m_bufferSize; + + m_bufferUsed.fetchAndAddRelease(region.second); + } + + int used() const; + int free() const; + int size() const; + + void reset(); + +private: + int m_bufferSize; + int m_readPos; + int m_writePos; + char* m_buffer; + QAtomicInt m_bufferUsed; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIO_MAC_P_H + + diff --git a/src/multimedia/multimedia/audio/qaudio_symbian_p.cpp b/src/multimedia/multimedia/audio/qaudio_symbian_p.cpp new file mode 100644 index 0000000..58e3745 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudio_symbian_p.cpp @@ -0,0 +1,395 @@ +/**************************************************************************** +** +** 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 "qaudio_symbian_p.h" +#include + +QT_BEGIN_NAMESPACE + +namespace SymbianAudio { + +DevSoundCapabilities::DevSoundCapabilities(CMMFDevSound &devsound, + QAudio::Mode mode) +{ + QT_TRAP_THROWING(constructL(devsound, mode)); +} + +DevSoundCapabilities::~DevSoundCapabilities() +{ + m_fourCC.Close(); +} + +void DevSoundCapabilities::constructL(CMMFDevSound &devsound, + QAudio::Mode mode) +{ + m_caps = devsound.Capabilities(); + + TMMFPrioritySettings settings; + + switch (mode) { + case QAudio::AudioOutput: + settings.iState = EMMFStatePlaying; + devsound.GetSupportedInputDataTypesL(m_fourCC, settings); + break; + + case QAudio::AudioInput: + settings.iState = EMMFStateRecording; + devsound.GetSupportedInputDataTypesL(m_fourCC, settings); + break; + + default: + Q_ASSERT_X(false, Q_FUNC_INFO, "Invalid mode"); + } +} + +namespace Utils { + +//----------------------------------------------------------------------------- +// Static data +//----------------------------------------------------------------------------- + +// Sample rate / frequency + +typedef TMMFSampleRate SampleRateNative; +typedef int SampleRateQt; + +const int SampleRateCount = 12; + +const SampleRateNative SampleRateListNative[SampleRateCount] = { + EMMFSampleRate8000Hz + , EMMFSampleRate11025Hz + , EMMFSampleRate12000Hz + , EMMFSampleRate16000Hz + , EMMFSampleRate22050Hz + , EMMFSampleRate24000Hz + , EMMFSampleRate32000Hz + , EMMFSampleRate44100Hz + , EMMFSampleRate48000Hz + , EMMFSampleRate64000Hz + , EMMFSampleRate88200Hz + , EMMFSampleRate96000Hz +}; + +const SampleRateQt SampleRateListQt[SampleRateCount] = { + 8000 + , 11025 + , 12000 + , 16000 + , 22050 + , 24000 + , 32000 + , 44100 + , 48000 + , 64000 + , 88200 + , 96000 +}; + +// Channels + +typedef TMMFMonoStereo ChannelsNative; +typedef int ChannelsQt; + +const int ChannelsCount = 2; + +const ChannelsNative ChannelsListNative[ChannelsCount] = { + EMMFMono + , EMMFStereo +}; + +const ChannelsQt ChannelsListQt[ChannelsCount] = { + 1 + , 2 +}; + +// Encoding + +const int EncodingCount = 6; + +const TUint32 EncodingFourCC[EncodingCount] = { + KMMFFourCCCodePCM8 // 0 + , KMMFFourCCCodePCMU8 // 1 + , KMMFFourCCCodePCM16 // 2 + , KMMFFourCCCodePCMU16 // 3 + , KMMFFourCCCodePCM16B // 4 + , KMMFFourCCCodePCMU16B // 5 +}; + +// The characterised DevSound API specification states that the iEncoding +// field in TMMFCapabilities is ignored, and that the FourCC should be used +// to specify the PCM encoding. +// See "SGL.GT0287.102 Multimedia DevSound Baseline Compatibility.doc" in the +// mm_info/mm_docs repository. +const TMMFSoundEncoding EncodingNative[EncodingCount] = { + EMMFSoundEncoding16BitPCM // 0 + , EMMFSoundEncoding16BitPCM // 1 + , EMMFSoundEncoding16BitPCM // 2 + , EMMFSoundEncoding16BitPCM // 3 + , EMMFSoundEncoding16BitPCM // 4 + , EMMFSoundEncoding16BitPCM // 5 +}; + + +const int EncodingSampleSize[EncodingCount] = { + 8 // 0 + , 8 // 1 + , 16 // 2 + , 16 // 3 + , 16 // 4 + , 16 // 5 +}; + +const QAudioFormat::Endian EncodingByteOrder[EncodingCount] = { + QAudioFormat::LittleEndian // 0 + , QAudioFormat::LittleEndian // 1 + , QAudioFormat::LittleEndian // 2 + , QAudioFormat::LittleEndian // 3 + , QAudioFormat::BigEndian // 4 + , QAudioFormat::BigEndian // 5 +}; + +const QAudioFormat::SampleType EncodingSampleType[EncodingCount] = { + QAudioFormat::SignedInt // 0 + , QAudioFormat::UnSignedInt // 1 + , QAudioFormat::SignedInt // 2 + , QAudioFormat::UnSignedInt // 3 + , QAudioFormat::SignedInt // 4 + , QAudioFormat::UnSignedInt // 5 +}; + + +//----------------------------------------------------------------------------- +// Private functions +//----------------------------------------------------------------------------- + +// Helper functions for implementing parameter conversions + +template +bool findValue(const Input *inputArray, int length, Input input, int &index) { + bool result = false; + for (int i=0; !result && i +bool convertValue(const Input *inputArray, const Output *outputArray, + int length, Input input, Output &output) { + int index; + const bool result = findValue(inputArray, length, input, index); + if (result) + output = outputArray[index]; + return result; +} + +/** + * Macro which is used to generate the implementation of the conversion + * functions. The implementation is just a wrapper around the templated + * convertValue function, e.g. + * + * CONVERSION_FUNCTION_IMPL(SampleRate, Qt, Native) + * + * expands to + * + * bool SampleRateQtToNative(int input, TMMFSampleRate &output) { + * return convertValue + * (SampleRateListQt, SampleRateListNative, SampleRateCount, + * input, output); + * } + */ +#define CONVERSION_FUNCTION_IMPL(FieldLc, Field, Input, Output) \ +bool FieldLc##Input##To##Output(Field##Input input, Field##Output &output) { \ + return convertValue(Field##List##Input, \ + Field##List##Output, Field##Count, input, output); \ +} + +//----------------------------------------------------------------------------- +// Local helper functions +//----------------------------------------------------------------------------- + +CONVERSION_FUNCTION_IMPL(sampleRate, SampleRate, Qt, Native) +CONVERSION_FUNCTION_IMPL(sampleRate, SampleRate, Native, Qt) +CONVERSION_FUNCTION_IMPL(channels, Channels, Qt, Native) +CONVERSION_FUNCTION_IMPL(channels, Channels, Native, Qt) + +bool sampleInfoQtToNative(int inputSampleSize, + QAudioFormat::Endian inputByteOrder, + QAudioFormat::SampleType inputSampleType, + TUint32 &outputFourCC, + TMMFSoundEncoding &outputEncoding) { + + bool found = false; + + for (int i=0; i &frequencies, + QList &channels, + QList &sampleSizes, + QList &byteOrders, + QList &sampleTypes) { + + frequencies.clear(); + sampleSizes.clear(); + byteOrders.clear(); + sampleTypes.clear(); + channels.clear(); + + for (int i=0; i +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace SymbianAudio { + +/** + * Default values used by audio input and output classes, when underlying + * DevSound instance has not yet been created. + */ + +const int DefaultBufferSize = 4096; // bytes +const int DefaultNotifyInterval = 1000; // ms + +/** + * Enumeration used to track state of internal DevSound instances. + * Values are translated to the corresponding QAudio::State values by + * SymbianAudio::Utils::stateNativeToQt. + */ +enum State { + ClosedState + , InitializingState + , ActiveState + , IdleState + , SuspendedState +}; + +/* + * Helper class for querying DevSound codec / format support + */ +class DevSoundCapabilities { +public: + DevSoundCapabilities(CMMFDevSound &devsound, QAudio::Mode mode); + ~DevSoundCapabilities(); + + const RArray& fourCC() const { return m_fourCC; } + const TMMFCapabilities& caps() const { return m_caps; } + +private: + void constructL(CMMFDevSound &devsound, QAudio::Mode mode); + +private: + RArray m_fourCC; + TMMFCapabilities m_caps; +}; + +namespace Utils { + +/** + * Convert native audio capabilities to QAudio lists. + */ +void capabilitiesNativeToQt(const DevSoundCapabilities &caps, + QList &frequencies, + QList &channels, + QList &sampleSizes, + QList &byteOrders, + QList &sampleTypes); + +/** + * Check whether format is supported. + */ +bool isFormatSupported(const QAudioFormat &format, + const DevSoundCapabilities &caps); + +/** + * Convert QAudioFormat to native format types. + * + * Note that, despite the name, DevSound uses TMMFCapabilities to specify + * single formats as well as capabilities. + * + * Note that this function does not modify outputFormat.iBufferSize. + */ +bool formatQtToNative(const QAudioFormat &inputFormat, + TUint32 &outputFourCC, + TMMFCapabilities &outputFormat); + +/** + * Convert internal states to QAudio states. + */ +QAudio::State stateNativeToQt(State nativeState, + QAudio::State initializingState); + +/** + * Convert data length to number of samples. + */ +qint64 bytesToSamples(const QAudioFormat &format, qint64 length); + +/** + * Convert number of samples to data length. + */ +qint64 samplesToBytes(const QAudioFormat &format, qint64 samples); + +} // namespace Utils +} // namespace SymbianAudio + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp new file mode 100644 index 0000000..4f45110 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp @@ -0,0 +1,257 @@ +/**************************************************************************** +** +** 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 +#include "qaudiodevicefactory_p.h" + +#ifndef QT_NO_AUDIO_BACKEND +#if defined(Q_OS_WIN) +#include "qaudiodeviceinfo_win32_p.h" +#include "qaudiooutput_win32_p.h" +#include "qaudioinput_win32_p.h" +#elif defined(Q_OS_MAC) +#include "qaudiodeviceinfo_mac_p.h" +#include "qaudiooutput_mac_p.h" +#include "qaudioinput_mac_p.h" +#elif defined(HAS_ALSA) +#include "qaudiodeviceinfo_alsa_p.h" +#include "qaudiooutput_alsa_p.h" +#include "qaudioinput_alsa_p.h" +#elif defined(Q_OS_SYMBIAN) +#include "qaudiodeviceinfo_symbian_p.h" +#include "qaudiooutput_symbian_p.h" +#include "qaudioinput_symbian_p.h" +#endif +#endif + +QT_BEGIN_NAMESPACE + +Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, + (QAudioEngineFactoryInterface_iid, QLatin1String("/audio"), Qt::CaseInsensitive)) + + +class QNullDeviceInfo : public QAbstractAudioDeviceInfo +{ +public: + QAudioFormat preferredFormat() const { qWarning()<<"using null deviceinfo, none available"; return QAudioFormat(); } + bool isFormatSupported(const QAudioFormat& ) const { return false; } + QAudioFormat nearestFormat(const QAudioFormat& ) const { return QAudioFormat(); } + QString deviceName() const { return QString(); } + QStringList codecList() { return QStringList(); } + QList frequencyList() { return QList(); } + QList channelsList() { return QList(); } + QList sampleSizeList() { return QList(); } + QList byteOrderList() { return QList(); } + QList sampleTypeList() { return QList(); } +}; + +class QNullInputDevice : public QAbstractAudioInput +{ +public: + QIODevice* start(QIODevice* ) { qWarning()<<"using null input device, none available"; return 0; } + void stop() {} + void reset() {} + void suspend() {} + void resume() {} + int bytesReady() const { return 0; } + int periodSize() const { return 0; } + void setBufferSize(int ) {} + int bufferSize() const { return 0; } + void setNotifyInterval(int ) {} + int notifyInterval() const { return 0; } + qint64 processedUSecs() const { return 0; } + qint64 elapsedUSecs() const { return 0; } + QAudio::Error error() const { return QAudio::OpenError; } + QAudio::State state() const { return QAudio::StoppedState; } + QAudioFormat format() const { return QAudioFormat(); } +}; + +class QNullOutputDevice : public QAbstractAudioOutput +{ +public: + QIODevice* start(QIODevice* ) { qWarning()<<"using null output device, none available"; return 0; } + void stop() {} + void reset() {} + void suspend() {} + void resume() {} + int bytesFree() const { return 0; } + int periodSize() const { return 0; } + void setBufferSize(int ) {} + int bufferSize() const { return 0; } + void setNotifyInterval(int ) {} + int notifyInterval() const { return 0; } + qint64 processedUSecs() const { return 0; } + qint64 elapsedUSecs() const { return 0; } + QAudio::Error error() const { return QAudio::OpenError; } + QAudio::State state() const { return QAudio::StoppedState; } + QAudioFormat format() const { return QAudioFormat(); } +}; + +QList QAudioDeviceFactory::availableDevices(QAudio::Mode mode) +{ + QList devices; +#ifndef QT_NO_AUDIO_BACKEND +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) + foreach (const QByteArray &handle, QAudioDeviceInfoInternal::availableDevices(mode)) + devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode); +#endif +#endif + QFactoryLoader* l = loader(); + + foreach (QString const& key, l->keys()) { + QAudioEngineFactoryInterface* plugin = qobject_cast(l->instance(key)); + if (plugin) { + foreach (QByteArray const& handle, plugin->availableDevices(mode)) + devices << QAudioDeviceInfo(key, handle, mode); + } + + delete plugin; + } + + return devices; +} + +QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice() +{ + QAudioEngineFactoryInterface* plugin = qobject_cast(loader()->instance(QLatin1String("default"))); + + if (plugin) { + QList list = plugin->availableDevices(QAudio::AudioInput); + if (list.size() > 0) + return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput); + } +#ifndef QT_NO_AUDIO_BACKEND +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) + return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput); +#endif +#endif + return QAudioDeviceInfo(); +} + +QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice() +{ + QAudioEngineFactoryInterface* plugin = qobject_cast(loader()->instance(QLatin1String("default"))); + + if (plugin) { + QList list = plugin->availableDevices(QAudio::AudioOutput); + if (list.size() > 0) + return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput); + } +#ifndef QT_NO_AUDIO_BACKEND +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) + return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput); +#endif +#endif + return QAudioDeviceInfo(); +} + +QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode) +{ + QAbstractAudioDeviceInfo *rc = 0; + +#ifndef QT_NO_AUDIO_BACKEND +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) + if (realm == QLatin1String("builtin")) + return new QAudioDeviceInfoInternal(handle, mode); +#endif +#endif + QAudioEngineFactoryInterface* plugin = + qobject_cast(loader()->instance(realm)); + + if (plugin) + rc = plugin->createDeviceInfo(handle, mode); + + return rc == 0 ? new QNullDeviceInfo() : rc; +} + +QAbstractAudioInput* QAudioDeviceFactory::createDefaultInputDevice(QAudioFormat const &format) +{ + return createInputDevice(defaultInputDevice(), format); +} + +QAbstractAudioOutput* QAudioDeviceFactory::createDefaultOutputDevice(QAudioFormat const &format) +{ + return createOutputDevice(defaultOutputDevice(), format); +} + +QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format) +{ + if (deviceInfo.isNull()) + return new QNullInputDevice(); +#ifndef QT_NO_AUDIO_BACKEND +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) + if (deviceInfo.realm() == QLatin1String("builtin")) + return new QAudioInputPrivate(deviceInfo.handle(), format); +#endif +#endif + QAudioEngineFactoryInterface* plugin = + qobject_cast(loader()->instance(deviceInfo.realm())); + + if (plugin) + return plugin->createInput(deviceInfo.handle(), format); + + return new QNullInputDevice(); +} + +QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format) +{ + if (deviceInfo.isNull()) + return new QNullOutputDevice(); +#ifndef QT_NO_AUDIO_BACKEND +#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) + if (deviceInfo.realm() == QLatin1String("builtin")) + return new QAudioOutputPrivate(deviceInfo.handle(), format); +#endif +#endif + QAudioEngineFactoryInterface* plugin = + qobject_cast(loader()->instance(deviceInfo.realm())); + + if (plugin) + return plugin->createOutput(deviceInfo.handle(), format); + + return new QNullOutputDevice(); +} + +QT_END_NAMESPACE + diff --git a/src/multimedia/multimedia/audio/qaudiodevicefactory_p.h b/src/multimedia/multimedia/audio/qaudiodevicefactory_p.h new file mode 100644 index 0000000..8ee8b05 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodevicefactory_p.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + +#ifndef QAUDIODEVICEFACTORY_P_H +#define QAUDIODEVICEFACTORY_P_H + +#include +#include +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QAbstractAudioInput; +class QAbstractAudioOutput; +class QAbstractAudioDeviceInfo; + +class QAudioDeviceFactory +{ +public: + static QList availableDevices(QAudio::Mode mode); + + static QAudioDeviceInfo defaultInputDevice(); + static QAudioDeviceInfo defaultOutputDevice(); + + static QAbstractAudioDeviceInfo* audioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode); + + static QAbstractAudioInput* createDefaultInputDevice(QAudioFormat const &format); + static QAbstractAudioOutput* createDefaultOutputDevice(QAudioFormat const &format); + + static QAbstractAudioInput* createInputDevice(QAudioDeviceInfo const &device, QAudioFormat const &format); + static QAbstractAudioOutput* createOutputDevice(QAudioDeviceInfo const &device, QAudioFormat const &format); + + static QAbstractAudioInput* createNullInput(); + static QAbstractAudioOutput* createNullOutput(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIODEVICEFACTORY_P_H + diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/multimedia/audio/qaudiodeviceinfo.cpp new file mode 100644 index 0000000..ff04b4e --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo.cpp @@ -0,0 +1,400 @@ +/**************************************************************************** +** +** 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 "qaudiodevicefactory_p.h" +#include +#include + + +QT_BEGIN_NAMESPACE + +class QAudioDeviceInfoPrivate : public QSharedData +{ +public: + QAudioDeviceInfoPrivate():info(0) {} + QAudioDeviceInfoPrivate(const QString &r, const QByteArray &h, QAudio::Mode m): + realm(r), handle(h), mode(m) + { + info = QAudioDeviceFactory::audioDeviceInfo(realm, handle, mode); + } + + QAudioDeviceInfoPrivate(const QAudioDeviceInfoPrivate &other): + QSharedData(other), + realm(other.realm), handle(other.handle), mode(other.mode) + { + info = QAudioDeviceFactory::audioDeviceInfo(realm, handle, mode); + } + + QAudioDeviceInfoPrivate& operator=(const QAudioDeviceInfoPrivate &other) + { + delete info; + + realm = other.realm; + handle = other.handle; + mode = other.mode; + info = QAudioDeviceFactory::audioDeviceInfo(realm, handle, mode); + return *this; + } + + ~QAudioDeviceInfoPrivate() + { + delete info; + } + + QString realm; + QByteArray handle; + QAudio::Mode mode; + QAbstractAudioDeviceInfo* info; +}; + + +/*! + \class QAudioDeviceInfo + \brief The QAudioDeviceInfo class provides an interface to query audio devices and their functionality. + \inmodule QtMultimedia + \ingroup multimedia + + \since 4.6 + + QAudioDeviceInfo lets you query for audio devices--such as sound + cards and USB headsets--that are currently available on the system. + The audio devices available are dependent on the platform or audio plugins installed. + + You can also query each device for the formats it supports. A + format in this context is a set consisting of a specific byte + order, channel, codec, frequency, sample rate, and sample type. A + format is represented by the QAudioFormat class. + + The values supported by the the device for each of these + parameters can be fetched with + supportedByteOrders(), supportedChannelCounts(), supportedCodecs(), + supportedSampleRates(), supportedSampleSizes(), and + supportedSampleTypes(). The combinations supported are dependent on the platform, + audio plugins installed and the audio device capabilities. If you need a specific format, you can check if + the device supports it with isFormatSupported(), or fetch a + supported format that is as close as possible to the format with + nearestFormat(). For instance: + + \snippet doc/src/snippets/audio/main.cpp 1 + \dots 8 + \snippet doc/src/snippets/audio/main.cpp 2 + + A QAudioDeviceInfo is used by Qt to construct + classes that communicate with the device--such as + QAudioInput, and QAudioOutput. The static + functions defaultInputDevice(), defaultOutputDevice(), and + availableDevices() let you get a list of all available + devices. Devices are fetch according to the value of mode + this is specified by the QAudio::Mode enum. + The QAudioDeviceInfo returned are only valid for the QAudio::Mode. + + For instance: + + \code + foreach(const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) + qDebug() << "Device name: " << deviceInfo.deviceName(); + \endcode + + In this code sample, we loop through all devices that are able to output + sound, i.e., play an audio stream in a supported format. For each device we + find, we simply print the deviceName(). + + \sa QAudioOutput, QAudioInput +*/ + +/*! + Constructs an empty QAudioDeviceInfo object. +*/ + +QAudioDeviceInfo::QAudioDeviceInfo(): + d(new QAudioDeviceInfoPrivate) +{ +} + +/*! + Constructs a copy of \a other. +*/ + +QAudioDeviceInfo::QAudioDeviceInfo(const QAudioDeviceInfo& other): + d(other.d) +{ +} + +/*! + Destroy this audio device info. +*/ + +QAudioDeviceInfo::~QAudioDeviceInfo() +{ +} + +/*! + Sets the QAudioDeviceInfo object to be equal to \a other. +*/ + +QAudioDeviceInfo& QAudioDeviceInfo::operator=(const QAudioDeviceInfo &other) +{ + d = other.d; + return *this; +} + +/*! + Returns whether this QAudioDeviceInfo object holds a device definition. +*/ + +bool QAudioDeviceInfo::isNull() const +{ + return d->info == 0; +} + +/*! + Returns human readable name of audio device. + + Device names vary depending on platform/audio plugin being used. + + They are a unique string identifiers for the audio device. + + eg. default, Intel, U0x46d0x9a4 +*/ + +QString QAudioDeviceInfo::deviceName() const +{ + return isNull() ? QString() : d->info->deviceName(); +} + +/*! + Returns true if \a settings are supported by the audio device of this QAudioDeviceInfo. +*/ + +bool QAudioDeviceInfo::isFormatSupported(const QAudioFormat &settings) const +{ + return isNull() ? false : d->info->isFormatSupported(settings); +} + +/*! + Returns QAudioFormat of default settings. + + These settings are provided by the platform/audio plugin being used. + + They also are dependent on the QAudio::Mode being used. + + A typical audio system would provide something like: + \list + \o Input settings: 8000Hz mono 8 bit. + \o Output settings: 44100Hz stereo 16 bit little endian. + \endlist +*/ + +QAudioFormat QAudioDeviceInfo::preferredFormat() const +{ + return isNull() ? QAudioFormat() : d->info->preferredFormat(); +} + +/*! + Returns closest QAudioFormat to \a settings that system audio supports. + + These settings are provided by the platform/audio plugin being used. + + They also are dependent on the QAudio::Mode being used. +*/ + +QAudioFormat QAudioDeviceInfo::nearestFormat(const QAudioFormat &settings) const +{ + return isNull() ? QAudioFormat() : d->info->nearestFormat(settings); +} + +/*! + Returns a list of supported codecs. + + All platform and plugin implementations should provide support for: + + "audio/pcm" - Linear PCM + + For writing plugins to support additional codecs refer to: + + http://www.iana.org/assignments/media-types/audio/ +*/ + +QStringList QAudioDeviceInfo::supportedCodecs() const +{ + return isNull() ? QStringList() : d->info->codecList(); +} + +/*! + Returns a list of supported sample rates. + + \since 4.7 +*/ + +QList QAudioDeviceInfo::supportedSampleRates() const +{ + return supportedFrequencies(); +} + +/*! + \obsolete + + Use supportedSampleRates() instead. +*/ + +QList QAudioDeviceInfo::supportedFrequencies() const +{ + return isNull() ? QList() : d->info->frequencyList(); +} + +/*! + Returns a list of supported channel counts. + + \since 4.7 +*/ + +QList QAudioDeviceInfo::supportedChannelCounts() const +{ + return supportedChannels(); +} + +/*! + \obsolete + + Use supportedChannelCount() instead. +*/ + +QList QAudioDeviceInfo::supportedChannels() const +{ + return isNull() ? QList() : d->info->channelsList(); +} + +/*! + Returns a list of supported sample sizes. +*/ + +QList QAudioDeviceInfo::supportedSampleSizes() const +{ + return isNull() ? QList() : d->info->sampleSizeList(); +} + +/*! + Returns a list of supported byte orders. +*/ + +QList QAudioDeviceInfo::supportedByteOrders() const +{ + return isNull() ? QList() : d->info->byteOrderList(); +} + +/*! + Returns a list of supported sample types. +*/ + +QList QAudioDeviceInfo::supportedSampleTypes() const +{ + return isNull() ? QList() : d->info->sampleTypeList(); +} + +/*! + Returns the name of the default input audio device. + All platform and audio plugin implementations provide a default audio device to use. +*/ + +QAudioDeviceInfo QAudioDeviceInfo::defaultInputDevice() +{ + return QAudioDeviceFactory::defaultInputDevice(); +} + +/*! + Returns the name of the default output audio device. + All platform and audio plugin implementations provide a default audio device to use. +*/ + +QAudioDeviceInfo QAudioDeviceInfo::defaultOutputDevice() +{ + return QAudioDeviceFactory::defaultOutputDevice(); +} + +/*! + Returns a list of audio devices that support \a mode. +*/ + +QList QAudioDeviceInfo::availableDevices(QAudio::Mode mode) +{ + return QAudioDeviceFactory::availableDevices(mode); +} + + +/*! + \internal +*/ + +QAudioDeviceInfo::QAudioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode): + d(new QAudioDeviceInfoPrivate(realm, handle, mode)) +{ +} + +/*! + \internal +*/ + +QString QAudioDeviceInfo::realm() const +{ + return d->realm; +} + +/*! + \internal +*/ + +QByteArray QAudioDeviceInfo::handle() const +{ + return d->handle; +} + + +/*! + \internal +*/ + +QAudio::Mode QAudioDeviceInfo::mode() const +{ + return d->mode; +} + +QT_END_NAMESPACE + diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo.h b/src/multimedia/multimedia/audio/qaudiodeviceinfo.h new file mode 100644 index 0000000..1cc0731 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo.h @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** 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 QAUDIODEVICEINFO_H +#define QAUDIODEVICEINFO_H + +#include +#include +#include +#include +#include +#include + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QAudioDeviceFactory; + +class QAudioDeviceInfoPrivate; +class Q_MULTIMEDIA_EXPORT QAudioDeviceInfo +{ + friend class QAudioDeviceFactory; + +public: + QAudioDeviceInfo(); + QAudioDeviceInfo(const QAudioDeviceInfo& other); + ~QAudioDeviceInfo(); + + QAudioDeviceInfo& operator=(const QAudioDeviceInfo& other); + + bool isNull() const; + + QString deviceName() const; + + bool isFormatSupported(const QAudioFormat &format) const; + QAudioFormat preferredFormat() const; + QAudioFormat nearestFormat(const QAudioFormat &format) const; + + QStringList supportedCodecs() const; + QList supportedFrequencies() const; + QList supportedSampleRates() const; + QList supportedChannels() const; + QList supportedChannelCounts() const; + QList supportedSampleSizes() const; + QList supportedByteOrders() const; + QList supportedSampleTypes() const; + + static QAudioDeviceInfo defaultInputDevice(); + static QAudioDeviceInfo defaultOutputDevice(); + + static QList availableDevices(QAudio::Mode mode); + +private: + QAudioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode); + QString realm() const; + QByteArray handle() const; + QAudio::Mode mode() const; + + QSharedDataPointer d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +Q_DECLARE_METATYPE(QAudioDeviceInfo) + +#endif // QAUDIODEVICEINFO_H diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp new file mode 100644 index 0000000..36270a7 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp @@ -0,0 +1,486 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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 "qaudiodeviceinfo_alsa_p.h" + +#include + +QT_BEGIN_NAMESPACE + +QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray dev, QAudio::Mode mode) +{ + handle = 0; + + device = QLatin1String(dev); + this->mode = mode; +} + +QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal() +{ + close(); +} + +bool QAudioDeviceInfoInternal::isFormatSupported(const QAudioFormat& format) const +{ + return testSettings(format); +} + +QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const +{ + QAudioFormat nearest; + if(mode == QAudio::AudioOutput) { + nearest.setFrequency(44100); + nearest.setChannels(2); + nearest.setByteOrder(QAudioFormat::LittleEndian); + nearest.setSampleType(QAudioFormat::SignedInt); + nearest.setSampleSize(16); + nearest.setCodec(QLatin1String("audio/pcm")); + } else { + nearest.setFrequency(8000); + nearest.setChannels(1); + nearest.setSampleType(QAudioFormat::UnSignedInt); + nearest.setSampleSize(8); + nearest.setCodec(QLatin1String("audio/pcm")); + if(!testSettings(nearest)) { + nearest.setChannels(2); + nearest.setSampleSize(16); + nearest.setSampleType(QAudioFormat::SignedInt); + } + } + return nearest; +} + +QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat& format) const +{ + if(testSettings(format)) + return format; + else + return preferredFormat(); +} + +QString QAudioDeviceInfoInternal::deviceName() const +{ + return device; +} + +QStringList QAudioDeviceInfoInternal::codecList() +{ + updateLists(); + return codecz; +} + +QList QAudioDeviceInfoInternal::frequencyList() +{ + updateLists(); + return freqz; +} + +QList QAudioDeviceInfoInternal::channelsList() +{ + updateLists(); + return channelz; +} + +QList QAudioDeviceInfoInternal::sampleSizeList() +{ + updateLists(); + return sizez; +} + +QList QAudioDeviceInfoInternal::byteOrderList() +{ + updateLists(); + return byteOrderz; +} + +QList QAudioDeviceInfoInternal::sampleTypeList() +{ + updateLists(); + return typez; +} + +bool QAudioDeviceInfoInternal::open() +{ + int err = 0; + QString dev = device; + QList devices = availableDevices(mode); + + if(dev.compare(QLatin1String("default")) == 0) { +#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) + dev = QLatin1String(devices.first().constData()); +#else + dev = QLatin1String("hw:0,0"); +#endif + } else { +#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) + dev = device; +#else + int idx = 0; + char *name; + + QString shortName = device.mid(device.indexOf(QLatin1String("="),0)+1); + + while(snd_card_get_name(idx,&name) == 0) { + if(dev.contains(QLatin1String(name))) + break; + idx++; + } + dev = QString(QLatin1String("hw:%1,0")).arg(idx); +#endif + } + if(mode == QAudio::AudioOutput) { + err=snd_pcm_open( &handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_PLAYBACK,0); + } else { + err=snd_pcm_open( &handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_CAPTURE,0); + } + if(err < 0) { + handle = 0; + return false; + } + return true; +} + +void QAudioDeviceInfoInternal::close() +{ + if(handle) + snd_pcm_close(handle); + handle = 0; +} + +bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const +{ + // Set nearest to closest settings that do work. + // See if what is in settings will work (return value). + int err = 0; + snd_pcm_t* handle; + snd_pcm_hw_params_t *params; + QString dev = device; + + QList devices = QAudioDeviceInfoInternal::availableDevices(QAudio::AudioOutput); + + if(dev.compare(QLatin1String("default")) == 0) { +#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) + dev = QLatin1String(devices.first().constData()); +#else + dev = QLatin1String("hw:0,0"); +#endif + } else { +#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) + dev = device; +#else + int idx = 0; + char *name; + + QString shortName = device.mid(device.indexOf(QLatin1String("="),0)+1); + + while(snd_card_get_name(idx,&name) == 0) { + if(shortName.compare(QLatin1String(name)) == 0) + break; + idx++; + } + dev = QString(QLatin1String("hw:%1,0")).arg(idx); +#endif + } + if(mode == QAudio::AudioOutput) { + err=snd_pcm_open( &handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_PLAYBACK,0); + } else { + err=snd_pcm_open( &handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_CAPTURE,0); + } + if(err < 0) { + handle = 0; + return false; + } + + bool testChannel = false; + bool testCodec = false; + bool testFreq = false; + bool testType = false; + bool testSize = false; + + int dir = 0; + + snd_pcm_nonblock( handle, 0 ); + snd_pcm_hw_params_alloca( ¶ms ); + snd_pcm_hw_params_any( handle, params ); + + // set the values! + snd_pcm_hw_params_set_channels(handle,params,format.channels()); + snd_pcm_hw_params_set_rate(handle,params,format.frequency(),dir); + switch(format.sampleSize()) { + case 8: + if(format.sampleType() == QAudioFormat::SignedInt) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S8); + else if(format.sampleType() == QAudioFormat::UnSignedInt) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U8); + break; + case 16: + if(format.sampleType() == QAudioFormat::SignedInt) { + if(format.byteOrder() == QAudioFormat::LittleEndian) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_LE); + else if(format.byteOrder() == QAudioFormat::BigEndian) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_BE); + } else if(format.sampleType() == QAudioFormat::UnSignedInt) { + if(format.byteOrder() == QAudioFormat::LittleEndian) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_LE); + else if(format.byteOrder() == QAudioFormat::BigEndian) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_BE); + } + break; + case 32: + if(format.sampleType() == QAudioFormat::SignedInt) { + if(format.byteOrder() == QAudioFormat::LittleEndian) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_LE); + else if(format.byteOrder() == QAudioFormat::BigEndian) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_BE); + } else if(format.sampleType() == QAudioFormat::UnSignedInt) { + if(format.byteOrder() == QAudioFormat::LittleEndian) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_LE); + else if(format.byteOrder() == QAudioFormat::BigEndian) + snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_BE); + } + } + + // For now, just accept only audio/pcm codec + if(!format.codec().startsWith(QLatin1String("audio/pcm"))) { + err=-1; + } else + testCodec = true; + + if(err>=0 && format.channels() != -1) { + err = snd_pcm_hw_params_test_channels(handle,params,format.channels()); + if(err>=0) + err = snd_pcm_hw_params_set_channels(handle,params,format.channels()); + if(err>=0) + testChannel = true; + } + + if(err>=0 && format.frequency() != -1) { + err = snd_pcm_hw_params_test_rate(handle,params,format.frequency(),0); + if(err>=0) + err = snd_pcm_hw_params_set_rate(handle,params,format.frequency(),dir); + if(err>=0) + testFreq = true; + } + + if((err>=0 && format.sampleSize() != -1) && + (format.sampleType() != QAudioFormat::Unknown)) { + switch(format.sampleSize()) { + case 8: + if(format.sampleType() == QAudioFormat::SignedInt) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S8); + else if(format.sampleType() == QAudioFormat::UnSignedInt) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U8); + break; + case 16: + if(format.sampleType() == QAudioFormat::SignedInt) { + if(format.byteOrder() == QAudioFormat::LittleEndian) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_LE); + else if(format.byteOrder() == QAudioFormat::BigEndian) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_BE); + } else if(format.sampleType() == QAudioFormat::UnSignedInt) { + if(format.byteOrder() == QAudioFormat::LittleEndian) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_LE); + else if(format.byteOrder() == QAudioFormat::BigEndian) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_BE); + } + break; + case 32: + if(format.sampleType() == QAudioFormat::SignedInt) { + if(format.byteOrder() == QAudioFormat::LittleEndian) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_LE); + else if(format.byteOrder() == QAudioFormat::BigEndian) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_BE); + } else if(format.sampleType() == QAudioFormat::UnSignedInt) { + if(format.byteOrder() == QAudioFormat::LittleEndian) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_LE); + else if(format.byteOrder() == QAudioFormat::BigEndian) + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_BE); + } + } + if(err>=0) { + testSize = true; + testType = true; + } + } + if(err>=0) + err = snd_pcm_hw_params(handle, params); + + if(err == 0) { + // settings work + // close() + if(handle) + snd_pcm_close(handle); + return true; + } + if(handle) + snd_pcm_close(handle); + + return false; +} + +void QAudioDeviceInfoInternal::updateLists() +{ + // redo all lists based on current settings + freqz.clear(); + channelz.clear(); + sizez.clear(); + byteOrderz.clear(); + typez.clear(); + codecz.clear(); + + if(!handle) + open(); + + if(!handle) + return; + + for(int i=0; i<(int)MAX_SAMPLE_RATES; i++) { + //if(snd_pcm_hw_params_test_rate(handle, params, SAMPLE_RATES[i], dir) == 0) + freqz.append(SAMPLE_RATES[i]); + } + channelz.append(1); + channelz.append(2); + sizez.append(8); + sizez.append(16); + sizez.append(32); + byteOrderz.append(QAudioFormat::LittleEndian); + byteOrderz.append(QAudioFormat::BigEndian); + typez.append(QAudioFormat::SignedInt); + typez.append(QAudioFormat::UnSignedInt); + typez.append(QAudioFormat::Float); + codecz.append(QLatin1String("audio/pcm")); + close(); +} + +QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) +{ + QList allDevices; + QList devices; + QByteArray filter; + +#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) + // Create a list of all current audio devices that support mode + void **hints, **n; + char *name, *descr, *io; + + if(snd_device_name_hint(-1, "pcm", &hints) < 0) { + qWarning() << "no alsa devices available"; + return devices; + } + n = hints; + + if(mode == QAudio::AudioInput) { + filter = "Input"; + } else { + filter = "Output"; + } + + while (*n != NULL) { + name = snd_device_name_get_hint(*n, "NAME"); + descr = snd_device_name_get_hint(*n, "DESC"); + io = snd_device_name_get_hint(*n, "IOID"); + if((name != NULL) && (descr != NULL) && ((io == NULL) || (io == filter))) { + QString deviceName = QLatin1String(name); + QString deviceDescription = QLatin1String(descr); + allDevices.append(deviceName.toLocal8Bit().constData()); + if(deviceDescription.contains(QLatin1String("Default Audio Device"))) + devices.append(deviceName.toLocal8Bit().constData()); + } + if(name != NULL) + free(name); + if(descr != NULL) + free(descr); + if(io != NULL) + free(io); + ++n; + } + snd_device_name_free_hint(hints); + + if(devices.size() > 0) { + devices.append("default"); + } +#else + int idx = 0; + char* name; + + while(snd_card_get_name(idx,&name) == 0) { + devices.append(name); + idx++; + } + if (idx > 0) + devices.append("default"); +#endif + if (devices.size() == 0 && allDevices.size() > 0) + return allDevices; + + return devices; +} + +QByteArray QAudioDeviceInfoInternal::defaultInputDevice() +{ + QList devices = availableDevices(QAudio::AudioInput); + if(devices.size() == 0) + return QByteArray(); + + return devices.first(); +} + +QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() +{ + QList devices = availableDevices(QAudio::AudioOutput); + if(devices.size() == 0) + return QByteArray(); + + return devices.first(); +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo_alsa_p.h b/src/multimedia/multimedia/audio/qaudiodeviceinfo_alsa_p.h new file mode 100644 index 0000000..6f9a459 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo_alsa_p.h @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + + +#ifndef QAUDIODEVICEINFOALSA_H +#define QAUDIODEVICEINFOALSA_H + +#include + +#include +#include +#include +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +const unsigned int MAX_SAMPLE_RATES = 5; +const unsigned int SAMPLE_RATES[] = + { 8000, 11025, 22050, 44100, 48000 }; + +class QAudioDeviceInfoInternal : public QAbstractAudioDeviceInfo +{ + Q_OBJECT +public: + QAudioDeviceInfoInternal(QByteArray dev,QAudio::Mode mode); + ~QAudioDeviceInfoInternal(); + + bool testSettings(const QAudioFormat& format) const; + void updateLists(); + QAudioFormat preferredFormat() const; + bool isFormatSupported(const QAudioFormat& format) const; + QAudioFormat nearestFormat(const QAudioFormat& format) const; + QString deviceName() const; + QStringList codecList(); + QList frequencyList(); + QList channelsList(); + QList sampleSizeList(); + QList byteOrderList(); + QList sampleTypeList(); + static QByteArray defaultInputDevice(); + static QByteArray defaultOutputDevice(); + static QList availableDevices(QAudio::Mode); + +private: + bool open(); + void close(); + + QString device; + QAudio::Mode mode; + QAudioFormat nearest; + QList freqz; + QList channelz; + QList sizez; + QList byteOrderz; + QStringList codecz; + QList typez; + snd_pcm_t* handle; + snd_pcm_hw_params_t *params; +}; + +QT_END_NAMESPACE + +#endif + diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo_mac_p.cpp b/src/multimedia/multimedia/audio/qaudiodeviceinfo_mac_p.cpp new file mode 100644 index 0000000..ecd03e5 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo_mac_p.cpp @@ -0,0 +1,357 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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 +#include +#include +#include +#include + +#include +#include "qaudio_mac_p.h" +#include "qaudiodeviceinfo_mac_p.h" + + + +QT_BEGIN_NAMESPACE + + +QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray const& handle, QAudio::Mode) +{ + QDataStream ds(handle); + quint32 did, tm; + + ds >> did >> tm >> name; + deviceId = AudioDeviceID(did); + mode = QAudio::Mode(tm); +} + +bool QAudioDeviceInfoInternal::isFormatSupported(const QAudioFormat& format) const +{ + return format.codec() == QString::fromLatin1("audio/pcm"); +} + +QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const +{ + QAudioFormat rc; + + UInt32 propSize = 0; + + if (AudioDeviceGetPropertyInfo(deviceId, + 0, + mode == QAudio::AudioInput, + kAudioDevicePropertyStreams, + &propSize, + 0) == noErr) { + + const int sc = propSize / sizeof(AudioStreamID); + + if (sc > 0) { + AudioStreamID* streams = new AudioStreamID[sc]; + + if (AudioDeviceGetProperty(deviceId, + 0, + mode == QAudio::AudioInput, + kAudioDevicePropertyStreams, + &propSize, + streams) == noErr) { + + for (int i = 0; i < sc; ++i) { + if (AudioStreamGetPropertyInfo(streams[i], + 0, + kAudioStreamPropertyPhysicalFormat, + &propSize, + 0) == noErr) { + + AudioStreamBasicDescription sf; + + if (AudioStreamGetProperty(streams[i], + 0, + kAudioStreamPropertyPhysicalFormat, + &propSize, + &sf) == noErr) { + rc = toQAudioFormat(sf); + break; + } + } + } + } + + delete streams; + } + } + + return rc; +} + +QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat& format) const +{ + QAudioFormat rc(format); + QAudioFormat target = preferredFormat(); + + if (!format.codec().isEmpty() && format.codec() != QString::fromLatin1("audio/pcm")) + return QAudioFormat(); + + rc.setCodec(QString::fromLatin1("audio/pcm")); + + if (rc.frequency() != target.frequency()) + rc.setFrequency(target.frequency()); + if (rc.channels() != target.channels()) + rc.setChannels(target.channels()); + if (rc.sampleSize() != target.sampleSize()) + rc.setSampleSize(target.sampleSize()); + if (rc.byteOrder() != target.byteOrder()) + rc.setByteOrder(target.byteOrder()); + if (rc.sampleType() != target.sampleType()) + rc.setSampleType(target.sampleType()); + + return rc; +} + +QString QAudioDeviceInfoInternal::deviceName() const +{ + return name; +} + +QStringList QAudioDeviceInfoInternal::codecList() +{ + return QStringList() << QString::fromLatin1("audio/pcm"); +} + +QList QAudioDeviceInfoInternal::frequencyList() +{ + QSet rc; + + // Add some common frequencies + rc << 8000 << 11025 << 22050 << 44100; + + // + UInt32 propSize = 0; + + if (AudioDeviceGetPropertyInfo(deviceId, + 0, + mode == QAudio::AudioInput, + kAudioDevicePropertyAvailableNominalSampleRates, + &propSize, + 0) == noErr) { + + const int pc = propSize / sizeof(AudioValueRange); + + if (pc > 0) { + AudioValueRange* vr = new AudioValueRange[pc]; + + if (AudioDeviceGetProperty(deviceId, + 0, + mode == QAudio::AudioInput, + kAudioDevicePropertyAvailableNominalSampleRates, + &propSize, + vr) == noErr) { + + for (int i = 0; i < pc; ++i) + rc << vr[i].mMaximum; + } + + delete vr; + } + } + + return rc.toList(); +} + +QList QAudioDeviceInfoInternal::channelsList() +{ + QList rc; + + // Can mix down to 1 channel + rc << 1; + + UInt32 propSize = 0; + int channels = 0; + + if (AudioDeviceGetPropertyInfo(deviceId, + 0, + mode == QAudio::AudioInput, + kAudioDevicePropertyStreamConfiguration, + &propSize, + 0) == noErr) { + + AudioBufferList* audioBufferList = static_cast(qMalloc(propSize)); + + if (audioBufferList != 0) { + if (AudioDeviceGetProperty(deviceId, + 0, + mode == QAudio::AudioInput, + kAudioDevicePropertyStreamConfiguration, + &propSize, + audioBufferList) == noErr) { + + for (int i = 0; i < int(audioBufferList->mNumberBuffers); ++i) { + channels += audioBufferList->mBuffers[i].mNumberChannels; + rc << channels; + } + } + + qFree(audioBufferList); + } + } + + return rc; +} + +QList QAudioDeviceInfoInternal::sampleSizeList() +{ + return QList() << 8 << 16 << 24 << 32 << 64; +} + +QList QAudioDeviceInfoInternal::byteOrderList() +{ + return QList() << QAudioFormat::LittleEndian << QAudioFormat::BigEndian; +} + +QList QAudioDeviceInfoInternal::sampleTypeList() +{ + return QList() << QAudioFormat::SignedInt << QAudioFormat::UnSignedInt << QAudioFormat::Float; +} + +static QByteArray get_device_info(AudioDeviceID audioDevice, QAudio::Mode mode) +{ + UInt32 size; + QByteArray device; + QDataStream ds(&device, QIODevice::WriteOnly); + AudioStreamBasicDescription sf; + CFStringRef name; + Boolean isInput = mode == QAudio::AudioInput; + + // Id + ds << quint32(audioDevice); + + // Mode + size = sizeof(AudioStreamBasicDescription); + if (AudioDeviceGetProperty(audioDevice, 0, isInput, kAudioDevicePropertyStreamFormat, + &size, &sf) != noErr) { + return QByteArray(); + } + ds << quint32(mode); + + // Name + size = sizeof(CFStringRef); + if (AudioDeviceGetProperty(audioDevice, 0, isInput, kAudioObjectPropertyName, + &size, &name) != noErr) { + qWarning() << "QAudioDeviceInfo: Unable to find device name"; + } + ds << QCFString::toQString(name); + + CFRelease(name); + + return device; +} + +QByteArray QAudioDeviceInfoInternal::defaultInputDevice() +{ + AudioDeviceID audioDevice; + UInt32 size = sizeof(audioDevice); + + if (AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, &size, + &audioDevice) != noErr) { + qWarning() << "QAudioDeviceInfo: Unable to find default input device"; + return QByteArray(); + } + + return get_device_info(audioDevice, QAudio::AudioInput); +} + +QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() +{ + AudioDeviceID audioDevice; + UInt32 size = sizeof(audioDevice); + + if (AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &size, + &audioDevice) != noErr) { + qWarning() << "QAudioDeviceInfo: Unable to find default output device"; + return QByteArray(); + } + + return get_device_info(audioDevice, QAudio::AudioOutput); +} + +QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) +{ + QList devices; + + UInt32 propSize = 0; + + if (AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &propSize, 0) == noErr) { + + const int dc = propSize / sizeof(AudioDeviceID); + + if (dc > 0) { + AudioDeviceID* audioDevices = new AudioDeviceID[dc]; + + if (AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &propSize, audioDevices) == noErr) { + for (int i = 0; i < dc; ++i) { + QByteArray info = get_device_info(audioDevices[i], mode); + if (!info.isNull()) + devices << info; + } + } + + delete audioDevices; + } + } + + return devices; +} + + +QT_END_NAMESPACE + diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo_mac_p.h b/src/multimedia/multimedia/audio/qaudiodeviceinfo_mac_p.h new file mode 100644 index 0000000..e234384 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo_mac_p.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + + +#ifndef QDEVICEINFO_MAC_P_H +#define QDEVICEINFO_MAC_P_H + +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QAudioDeviceInfoInternal : public QAbstractAudioDeviceInfo +{ +public: + AudioDeviceID deviceId; + QString name; + QAudio::Mode mode; + + QAudioDeviceInfoInternal(QByteArray const& handle, QAudio::Mode mode); + + bool isFormatSupported(const QAudioFormat& format) const; + QAudioFormat preferredFormat() const; + QAudioFormat nearestFormat(const QAudioFormat& format) const; + + QString deviceName() const; + + QStringList codecList(); + QList frequencyList(); + QList channelsList(); + QList sampleSizeList(); + QList byteOrderList(); + QList sampleTypeList(); + + static QByteArray defaultInputDevice(); + static QByteArray defaultOutputDevice(); + + static QList availableDevices(QAudio::Mode mode); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDEVICEINFO_MAC_P_H diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp b/src/multimedia/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp new file mode 100644 index 0000000..36284d3 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo_symbian_p.cpp @@ -0,0 +1,200 @@ +/**************************************************************************** +** +** 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 "qaudiodeviceinfo_symbian_p.h" +#include "qaudio_symbian_p.h" + +QT_BEGIN_NAMESPACE + +QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray device, + QAudio::Mode mode) + : m_deviceName(QLatin1String(device)) + , m_mode(mode) + , m_updated(false) +{ + QT_TRAP_THROWING(m_devsound.reset(CMMFDevSound::NewL())); +} + +QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal() +{ + +} + +QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const +{ + QAudioFormat format; + switch (m_mode) { + case QAudio::AudioOutput: + format.setFrequency(44100); + format.setChannels(2); + format.setSampleSize(16); + format.setByteOrder(QAudioFormat::LittleEndian); + format.setSampleType(QAudioFormat::SignedInt); + format.setCodec(QLatin1String("audio/pcm")); + break; + + case QAudio::AudioInput: + format.setFrequency(8000); + format.setChannels(1); + format.setSampleSize(16); + format.setByteOrder(QAudioFormat::LittleEndian); + format.setSampleType(QAudioFormat::SignedInt); + format.setCodec(QLatin1String("audio/pcm")); + break; + + default: + Q_ASSERT_X(false, Q_FUNC_INFO, "Invalid mode"); + } + + if (!isFormatSupported(format)) { + if (m_frequencies.size()) + format.setFrequency(m_frequencies[0]); + if (m_channels.size()) + format.setChannels(m_channels[0]); + if (m_sampleSizes.size()) + format.setSampleSize(m_sampleSizes[0]); + if (m_byteOrders.size()) + format.setByteOrder(m_byteOrders[0]); + if (m_sampleTypes.size()) + format.setSampleType(m_sampleTypes[0]); + } + + return format; +} + +bool QAudioDeviceInfoInternal::isFormatSupported( + const QAudioFormat &format) const +{ + getSupportedFormats(); + const bool supported = + m_codecs.contains(format.codec()) + && m_frequencies.contains(format.frequency()) + && m_channels.contains(format.channels()) + && m_sampleSizes.contains(format.sampleSize()) + && m_byteOrders.contains(format.byteOrder()) + && m_sampleTypes.contains(format.sampleType()); + + return supported; +} + +QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat &format) const +{ + if (isFormatSupported(format)) + return format; + else + return preferredFormat(); +} + +QString QAudioDeviceInfoInternal::deviceName() const +{ + return m_deviceName; +} + +QStringList QAudioDeviceInfoInternal::codecList() +{ + getSupportedFormats(); + return m_codecs; +} + +QList QAudioDeviceInfoInternal::frequencyList() +{ + getSupportedFormats(); + return m_frequencies; +} + +QList QAudioDeviceInfoInternal::channelsList() +{ + getSupportedFormats(); + return m_channels; +} + +QList QAudioDeviceInfoInternal::sampleSizeList() +{ + getSupportedFormats(); + return m_sampleSizes; +} + +QList QAudioDeviceInfoInternal::byteOrderList() +{ + getSupportedFormats(); + return m_byteOrders; +} + +QList QAudioDeviceInfoInternal::sampleTypeList() +{ + getSupportedFormats(); + return m_sampleTypes; +} + +QByteArray QAudioDeviceInfoInternal::defaultInputDevice() +{ + return QByteArray("default"); +} + +QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() +{ + return QByteArray("default"); +} + +QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode) +{ + QList result; + result += QByteArray("default"); + return result; +} + +void QAudioDeviceInfoInternal::getSupportedFormats() const +{ + if (!m_updated) { + QScopedPointer caps( + new SymbianAudio::DevSoundCapabilities(*m_devsound, m_mode)); + + SymbianAudio::Utils::capabilitiesNativeToQt(*caps, + m_frequencies, m_channels, m_sampleSizes, + m_byteOrders, m_sampleTypes); + + m_codecs.append(QLatin1String("audio/pcm")); + + m_updated = true; + } +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo_symbian_p.h b/src/multimedia/multimedia/audio/qaudiodeviceinfo_symbian_p.h new file mode 100644 index 0000000..89e539f --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo_symbian_p.h @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + +#ifndef QAUDIODEVICEINFO_SYMBIAN_P_H +#define QAUDIODEVICEINFO_SYMBIAN_P_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QAudioDeviceInfoInternal + : public QAbstractAudioDeviceInfo +{ + Q_OBJECT + +public: + QAudioDeviceInfoInternal(QByteArray device, QAudio::Mode mode); + ~QAudioDeviceInfoInternal(); + + // QAbstractAudioDeviceInfo + QAudioFormat preferredFormat() const; + bool isFormatSupported(const QAudioFormat &format) const; + QAudioFormat nearestFormat(const QAudioFormat &format) const; + QString deviceName() const; + QStringList codecList(); + QList frequencyList(); + QList channelsList(); + QList sampleSizeList(); + QList byteOrderList(); + QList sampleTypeList(); + static QByteArray defaultInputDevice(); + static QByteArray defaultOutputDevice(); + static QList availableDevices(QAudio::Mode); + +private: + void getSupportedFormats() const; + +private: + QScopedPointer m_devsound; + + QString m_deviceName; + QAudio::Mode m_mode; + + // Mutable to allow lazy initialization when called from const-qualified + // public functions (isFormatSupported, nearestFormat) + mutable bool m_updated; + mutable QStringList m_codecs; + mutable QList m_frequencies; + mutable QList m_channels; + mutable QList m_sampleSizes; + mutable QList m_byteOrders; + mutable QList m_sampleTypes; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/multimedia/audio/qaudiodeviceinfo_win32_p.cpp new file mode 100644 index 0000000..aee0807 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo_win32_p.cpp @@ -0,0 +1,433 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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 +#include "qaudiodeviceinfo_win32_p.h" + +QT_BEGIN_NAMESPACE + +// For mingw toolchain mmsystem.h only defines half the defines, so add if needed. +#ifndef WAVE_FORMAT_44M08 +#define WAVE_FORMAT_44M08 0x00000100 +#define WAVE_FORMAT_44S08 0x00000200 +#define WAVE_FORMAT_44M16 0x00000400 +#define WAVE_FORMAT_44S16 0x00000800 +#define WAVE_FORMAT_48M08 0x00001000 +#define WAVE_FORMAT_48S08 0x00002000 +#define WAVE_FORMAT_48M16 0x00004000 +#define WAVE_FORMAT_48S16 0x00008000 +#define WAVE_FORMAT_96M08 0x00010000 +#define WAVE_FORMAT_96S08 0x00020000 +#define WAVE_FORMAT_96M16 0x00040000 +#define WAVE_FORMAT_96S16 0x00080000 +#endif + + +QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray dev, QAudio::Mode mode) +{ + device = QLatin1String(dev); + this->mode = mode; + + updateLists(); +} + +QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal() +{ + close(); +} + +bool QAudioDeviceInfoInternal::isFormatSupported(const QAudioFormat& format) const +{ + return testSettings(format); +} + +QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const +{ + QAudioFormat nearest; + if(mode == QAudio::AudioOutput) { + nearest.setFrequency(44100); + nearest.setChannelCount(2); + nearest.setByteOrder(QAudioFormat::LittleEndian); + nearest.setSampleType(QAudioFormat::SignedInt); + nearest.setSampleSize(16); + nearest.setCodec(QLatin1String("audio/pcm")); + } else { + nearest.setFrequency(11025); + nearest.setChannelCount(1); + nearest.setByteOrder(QAudioFormat::LittleEndian); + nearest.setSampleType(QAudioFormat::SignedInt); + nearest.setSampleSize(8); + nearest.setCodec(QLatin1String("audio/pcm")); + } + return nearest; +} + +QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat& format) const +{ + if(testSettings(format)) + return format; + else + return preferredFormat(); +} + +QString QAudioDeviceInfoInternal::deviceName() const +{ + return device; +} + +QStringList QAudioDeviceInfoInternal::codecList() +{ + updateLists(); + return codecz; +} + +QList QAudioDeviceInfoInternal::frequencyList() +{ + updateLists(); + return freqz; +} + +QList QAudioDeviceInfoInternal::channelsList() +{ + updateLists(); + return channelz; +} + +QList QAudioDeviceInfoInternal::sampleSizeList() +{ + updateLists(); + return sizez; +} + +QList QAudioDeviceInfoInternal::byteOrderList() +{ + updateLists(); + return byteOrderz; +} + +QList QAudioDeviceInfoInternal::sampleTypeList() +{ + updateLists(); + return typez; +} + + +bool QAudioDeviceInfoInternal::open() +{ + return true; +} + +void QAudioDeviceInfoInternal::close() +{ +} + +bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const +{ + // Set nearest to closest settings that do work. + // See if what is in settings will work (return value). + + bool failed = false; + bool match = false; + + // check codec + for( int i = 0; i < codecz.count(); i++) { + if (format.codec() == codecz.at(i)) + match = true; + } + if (!match) failed = true; + + // check channel + match = false; + if (!failed) { + for( int i = 0; i < channelz.count(); i++) { + if (format.channels() == channelz.at(i)) { + match = true; + break; + } + } + } + if (!match) failed = true; + + // check frequency + match = false; + if (!failed) { + for( int i = 0; i < freqz.count(); i++) { + if (format.frequency() == freqz.at(i)) { + match = true; + break; + } + } + } + + // check sample size + match = false; + if (!failed) { + for( int i = 0; i < sizez.count(); i++) { + if (format.sampleSize() == sizez.at(i)) { + match = true; + break; + } + } + } + + // check byte order + match = false; + if (!failed) { + for( int i = 0; i < byteOrderz.count(); i++) { + if (format.byteOrder() == byteOrderz.at(i)) { + match = true; + break; + } + } + } + + // check sample type + match = false; + if (!failed) { + for( int i = 0; i < typez.count(); i++) { + if (format.sampleType() == typez.at(i)) { + match = true; + break; + } + } + } + + if(!failed) { + // settings work + return true; + } + return false; +} + +void QAudioDeviceInfoInternal::updateLists() +{ + // redo all lists based on current settings + bool base = false; + bool match = false; + DWORD fmt = NULL; + QString tmp; + + if(device.compare(QLatin1String("default")) == 0) + base = true; + + if(mode == QAudio::AudioOutput) { + WAVEOUTCAPS woc; + unsigned long iNumDevs,i; + iNumDevs = waveOutGetNumDevs(); + for(i=0;i 0) + freqz.prepend(8000); +} + +QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) +{ + Q_UNUSED(mode) + + QList devices; + + if(mode == QAudio::AudioOutput) { + WAVEOUTCAPS woc; + unsigned long iNumDevs,i; + iNumDevs = waveOutGetNumDevs(); + for(i=0;i 0) + devices.append("default"); + + return devices; +} + +QByteArray QAudioDeviceInfoInternal::defaultOutputDevice() +{ + return QByteArray("default"); +} + +QByteArray QAudioDeviceInfoInternal::defaultInputDevice() +{ + return QByteArray("default"); +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudiodeviceinfo_win32_p.h b/src/multimedia/multimedia/audio/qaudiodeviceinfo_win32_p.h new file mode 100644 index 0000000..cb6dd91 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiodeviceinfo_win32_p.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + + +#ifndef QAUDIODEVICEINFOWIN_H +#define QAUDIODEVICEINFOWIN_H + +#include +#include +#include +#include + +#include +#include + + +QT_BEGIN_NAMESPACE + +const unsigned int MAX_SAMPLE_RATES = 5; +const unsigned int SAMPLE_RATES[] = { 8000, 11025, 22050, 44100, 48000 }; + +class QAudioDeviceInfoInternal : public QAbstractAudioDeviceInfo +{ + Q_OBJECT + +public: + QAudioDeviceInfoInternal(QByteArray dev,QAudio::Mode mode); + ~QAudioDeviceInfoInternal(); + + bool open(); + void close(); + + bool testSettings(const QAudioFormat& format) const; + void updateLists(); + QAudioFormat preferredFormat() const; + bool isFormatSupported(const QAudioFormat& format) const; + QAudioFormat nearestFormat(const QAudioFormat& format) const; + QString deviceName() const; + QStringList codecList(); + QList frequencyList(); + QList channelsList(); + QList sampleSizeList(); + QList byteOrderList(); + QList sampleTypeList(); + static QByteArray defaultInputDevice(); + static QByteArray defaultOutputDevice(); + static QList availableDevices(QAudio::Mode); + +private: + QAudio::Mode mode; + QString device; + QAudioFormat nearest; + QList freqz; + QList channelz; + QList sizez; + QList byteOrderz; + QStringList codecz; + QList typez; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/audio/qaudioengine.cpp b/src/multimedia/multimedia/audio/qaudioengine.cpp new file mode 100644 index 0000000..7f1f5d3 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioengine.cpp @@ -0,0 +1,343 @@ +/**************************************************************************** +** +** 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 + +QT_BEGIN_NAMESPACE + +/*! + \class QAbstractAudioDeviceInfo + \brief The QAbstractAudioDeviceInfo class provides access for QAudioDeviceInfo to access the audio + device provided by the plugin. + \internal + + \ingroup multimedia + + This class implements the audio functionality for + QAudioDeviceInfo, i.e., QAudioDeviceInfo keeps a + QAbstractAudioDeviceInfo and routes function calls to it. For a + description of the functionality that QAbstractAudioDeviceInfo + implements, you can read the class and functions documentation of + QAudioDeviceInfo. + + \sa QAudioDeviceInfo +*/ + +/*! + \fn virtual QAudioFormat QAbstractAudioDeviceInfo::preferredFormat() const + Returns the nearest settings. +*/ + +/*! + \fn virtual bool QAbstractAudioDeviceInfo::isFormatSupported(const QAudioFormat& format) const + Returns true if \a format is available from audio device. +*/ + +/*! + \fn virtual QAudioFormat QAbstractAudioDeviceInfo::nearestFormat(const QAudioFormat& format) const + Returns the nearest settings \a format. +*/ + +/*! + \fn virtual QString QAbstractAudioDeviceInfo::deviceName() const + Returns the audio device name. +*/ + +/*! + \fn virtual QStringList QAbstractAudioDeviceInfo::codecList() + Returns the list of currently available codecs. +*/ + +/*! + \fn virtual QList QAbstractAudioDeviceInfo::frequencyList() + Returns the list of currently available frequencies. +*/ + +/*! + \fn virtual QList QAbstractAudioDeviceInfo::channelsList() + Returns the list of currently available channels. +*/ + +/*! + \fn virtual QList QAbstractAudioDeviceInfo::sampleSizeList() + Returns the list of currently available sample sizes. +*/ + +/*! + \fn virtual QList QAbstractAudioDeviceInfo::byteOrderList() + Returns the list of currently available byte orders. +*/ + +/*! + \fn virtual QList QAbstractAudioDeviceInfo::sampleTypeList() + Returns the list of currently available sample types. +*/ + +/*! + \class QAbstractAudioOutput + \brief The QAbstractAudioOutput class provides access for QAudioOutput to access the audio + device provided by the plugin. + \internal + + \ingroup multimedia + + QAbstractAudioOutput implements audio functionality for + QAudioOutput, i.e., QAudioOutput routes function calls to + QAbstractAudioOutput. For a description of the functionality that + is implemented, see the QAudioOutput class and function + descriptions. + + \sa QAudioOutput +*/ + +/*! + \fn virtual QIODevice* QAbstractAudioOutput::start(QIODevice* device) + Uses the \a device as the QIODevice to transfer data. If \a device is null then the class + creates an internal QIODevice. Returns a pointer to the QIODevice being used to handle + the data transfer. This QIODevice can be used to write() audio data directly. Passing a + QIODevice allows the data to be transfered without any extra code. +*/ + +/*! + \fn virtual void QAbstractAudioOutput::stop() + Stops the audio output. +*/ + +/*! + \fn virtual void QAbstractAudioOutput::reset() + Drops all audio data in the buffers, resets buffers to zero. +*/ + +/*! + \fn virtual void QAbstractAudioOutput::suspend() + Stops processing audio data, preserving buffered audio data. +*/ + +/*! + \fn virtual void QAbstractAudioOutput::resume() + Resumes processing audio data after a suspend() +*/ + +/*! + \fn virtual int QAbstractAudioOutput::bytesFree() const + Returns the free space available in bytes in the audio buffer. +*/ + +/*! + \fn virtual int QAbstractAudioOutput::periodSize() const + Returns the period size in bytes. +*/ + +/*! + \fn virtual void QAbstractAudioOutput::setBufferSize(int value) + Sets the audio buffer size to \a value in bytes. +*/ + +/*! + \fn virtual int QAbstractAudioOutput::bufferSize() const + Returns the audio buffer size in bytes. +*/ + +/*! + \fn virtual void QAbstractAudioOutput::setNotifyInterval(int ms) + Sets the interval for notify() signal to be emitted. This is based on the \a ms + of audio data processed not on actual real-time. The resolution of the timer + is platform specific. +*/ + +/*! + \fn virtual int QAbstractAudioOutput::notifyInterval() const + Returns the notify interval in milliseconds. +*/ + +/*! + \fn virtual qint64 QAbstractAudioOutput::processedUSecs() const + Returns the amount of audio data processed since start() was called in milliseconds. +*/ + +/*! + \fn virtual qint64 QAbstractAudioOutput::elapsedUSecs() const + Returns the milliseconds since start() was called, including time in Idle and suspend states. +*/ + +/*! + \fn virtual QAudio::Error QAbstractAudioOutput::error() const + Returns the error state. +*/ + +/*! + \fn virtual QAudio::State QAbstractAudioOutput::state() const + Returns the state of audio processing. +*/ + +/*! + \fn virtual QAudioFormat QAbstractAudioOutput::format() const + Returns the QAudioFormat being used. +*/ + +/*! + \fn QAbstractAudioOutput::stateChanged(QAudio::State state) + This signal is emitted when the device \a state has changed. +*/ + +/*! + \fn QAbstractAudioOutput::notify() + This signal is emitted when x ms of audio data has been processed + the interval set by setNotifyInterval(x). +*/ + + +/*! + \class QAbstractAudioInput + \brief The QAbstractAudioInput class provides access for QAudioInput to access the audio + device provided by the plugin. + \internal + + \ingroup multimedia + + QAudioDeviceInput keeps an instance of QAbstractAudioInput and + routes calls to functions of the same name to QAbstractAudioInput. + This means that it is QAbstractAudioInput that implements the + audio functionality. For a description of the functionality, see + the QAudioInput class description. + + \sa QAudioInput +*/ + +/*! + \fn virtual QIODevice* QAbstractAudioInput::start(QIODevice* device) + Uses the \a device as the QIODevice to transfer data. If \a device is null + then the class creates an internal QIODevice. Returns a pointer to the + QIODevice being used to handle the data transfer. This QIODevice can be used to + read() audio data directly. Passing a QIODevice allows the data to be transfered + without any extra code. +*/ + +/*! + \fn virtual void QAbstractAudioInput::stop() + Stops the audio input. +*/ + +/*! + \fn virtual void QAbstractAudioInput::reset() + Drops all audio data in the buffers, resets buffers to zero. +*/ + +/*! + \fn virtual void QAbstractAudioInput::suspend() + Stops processing audio data, preserving buffered audio data. +*/ + +/*! + \fn virtual void QAbstractAudioInput::resume() + Resumes processing audio data after a suspend(). +*/ + +/*! + \fn virtual int QAbstractAudioInput::bytesReady() const + Returns the amount of audio data available to read in bytes. +*/ + +/*! + \fn virtual int QAbstractAudioInput::periodSize() const + Returns the period size in bytes. +*/ + +/*! + \fn virtual void QAbstractAudioInput::setBufferSize(int value) + Sets the audio buffer size to \a value in milliseconds. +*/ + +/*! + \fn virtual int QAbstractAudioInput::bufferSize() const + Returns the audio buffer size in milliseconds. +*/ + +/*! + \fn virtual void QAbstractAudioInput::setNotifyInterval(int ms) + Sets the interval for notify() signal to be emitted. This is based + on the \a ms of audio data processed not on actual real-time. + The resolution of the timer is platform specific. +*/ + +/*! + \fn virtual int QAbstractAudioInput::notifyInterval() const + Returns the notify interval in milliseconds. +*/ + +/*! + \fn virtual qint64 QAbstractAudioInput::processedUSecs() const + Returns the amount of audio data processed since start() was called in milliseconds. +*/ + +/*! + \fn virtual qint64 QAbstractAudioInput::elapsedUSecs() const + Returns the milliseconds since start() was called, including time in Idle and suspend states. +*/ + +/*! + \fn virtual QAudio::Error QAbstractAudioInput::error() const + Returns the error state. +*/ + +/*! + \fn virtual QAudio::State QAbstractAudioInput::state() const + Returns the state of audio processing. +*/ + +/*! + \fn virtual QAudioFormat QAbstractAudioInput::format() const + Returns the QAudioFormat being used +*/ + +/*! + \fn QAbstractAudioInput::stateChanged(QAudio::State state) + This signal is emitted when the device \a state has changed. +*/ + +/*! + \fn QAbstractAudioInput::notify() + This signal is emitted when x ms of audio data has been processed + the interval set by setNotifyInterval(x). +*/ + + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudioengine.h b/src/multimedia/multimedia/audio/qaudioengine.h new file mode 100644 index 0000000..df9d09d --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioengine.h @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** 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 QAUDIOENGINE_H +#define QAUDIOENGINE_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class Q_MULTIMEDIA_EXPORT QAbstractAudioDeviceInfo : public QObject +{ + Q_OBJECT + +public: + virtual QAudioFormat preferredFormat() const = 0; + virtual bool isFormatSupported(const QAudioFormat &format) const = 0; + virtual QAudioFormat nearestFormat(const QAudioFormat &format) const = 0; + virtual QString deviceName() const = 0; + virtual QStringList codecList() = 0; + virtual QList frequencyList() = 0; + virtual QList channelsList() = 0; + virtual QList sampleSizeList() = 0; + virtual QList byteOrderList() = 0; + virtual QList sampleTypeList() = 0; +}; + +class Q_MULTIMEDIA_EXPORT QAbstractAudioOutput : public QObject +{ + Q_OBJECT + +public: + virtual QIODevice* start(QIODevice* device) = 0; + virtual void stop() = 0; + virtual void reset() = 0; + virtual void suspend() = 0; + virtual void resume() = 0; + virtual int bytesFree() const = 0; + virtual int periodSize() const = 0; + virtual void setBufferSize(int value) = 0; + virtual int bufferSize() const = 0; + virtual void setNotifyInterval(int milliSeconds) = 0; + virtual int notifyInterval() const = 0; + virtual qint64 processedUSecs() const = 0; + virtual qint64 elapsedUSecs() const = 0; + virtual QAudio::Error error() const = 0; + virtual QAudio::State state() const = 0; + virtual QAudioFormat format() const = 0; + +Q_SIGNALS: + void stateChanged(QAudio::State); + void notify(); +}; + +class Q_MULTIMEDIA_EXPORT QAbstractAudioInput : public QObject +{ + Q_OBJECT + +public: + virtual QIODevice* start(QIODevice* device) = 0; + virtual void stop() = 0; + virtual void reset() = 0; + virtual void suspend() = 0; + virtual void resume() = 0; + virtual int bytesReady() const = 0; + virtual int periodSize() const = 0; + virtual void setBufferSize(int value) = 0; + virtual int bufferSize() const = 0; + virtual void setNotifyInterval(int milliSeconds) = 0; + virtual int notifyInterval() const = 0; + virtual qint64 processedUSecs() const = 0; + virtual qint64 elapsedUSecs() const = 0; + virtual QAudio::Error error() const = 0; + virtual QAudio::State state() const = 0; + virtual QAudioFormat format() const = 0; + +Q_SIGNALS: + void stateChanged(QAudio::State); + void notify(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOENGINE_H diff --git a/src/multimedia/multimedia/audio/qaudioengineplugin.cpp b/src/multimedia/multimedia/audio/qaudioengineplugin.cpp new file mode 100644 index 0000000..82324b5 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioengineplugin.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** 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 + +QT_BEGIN_NAMESPACE + +QAudioEnginePlugin::QAudioEnginePlugin(QObject* parent) : + QObject(parent) +{} + +QAudioEnginePlugin::~QAudioEnginePlugin() +{} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudioengineplugin.h b/src/multimedia/multimedia/audio/qaudioengineplugin.h new file mode 100644 index 0000000..2322d2a --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioengineplugin.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** 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 QAUDIOENGINEPLUGIN_H +#define QAUDIOENGINEPLUGIN_H + +#include +#include +#include + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +struct Q_MULTIMEDIA_EXPORT QAudioEngineFactoryInterface : public QFactoryInterface +{ + virtual QList availableDevices(QAudio::Mode) const = 0; + virtual QAbstractAudioInput* createInput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; + virtual QAbstractAudioOutput* createOutput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; + virtual QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device, QAudio::Mode mode) = 0; +}; + +#define QAudioEngineFactoryInterface_iid \ + "com.nokia.qt.QAudioEngineFactoryInterface" +Q_DECLARE_INTERFACE(QAudioEngineFactoryInterface, QAudioEngineFactoryInterface_iid) + +class Q_MULTIMEDIA_EXPORT QAudioEnginePlugin : public QObject, public QAudioEngineFactoryInterface +{ + Q_OBJECT + Q_INTERFACES(QAudioEngineFactoryInterface:QFactoryInterface) + +public: + QAudioEnginePlugin(QObject *parent = 0); + ~QAudioEnginePlugin(); + + virtual QStringList keys() const = 0; + virtual QList availableDevices(QAudio::Mode) const = 0; + virtual QAbstractAudioInput* createInput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; + virtual QAbstractAudioOutput* createOutput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; + virtual QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device, QAudio::Mode mode) = 0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOENGINEPLUGIN_H diff --git a/src/multimedia/multimedia/audio/qaudioformat.cpp b/src/multimedia/multimedia/audio/qaudioformat.cpp new file mode 100644 index 0000000..86d72f6 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioformat.cpp @@ -0,0 +1,407 @@ +/**************************************************************************** +** +** 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 + + +QT_BEGIN_NAMESPACE + + +class QAudioFormatPrivate : public QSharedData +{ +public: + QAudioFormatPrivate() + { + frequency = -1; + channels = -1; + sampleSize = -1; + byteOrder = QAudioFormat::Endian(QSysInfo::ByteOrder); + sampleType = QAudioFormat::Unknown; + } + + QAudioFormatPrivate(const QAudioFormatPrivate &other): + QSharedData(other), + codec(other.codec), + byteOrder(other.byteOrder), + sampleType(other.sampleType), + frequency(other.frequency), + channels(other.channels), + sampleSize(other.sampleSize) + { + } + + QAudioFormatPrivate& operator=(const QAudioFormatPrivate &other) + { + codec = other.codec; + byteOrder = other.byteOrder; + sampleType = other.sampleType; + frequency = other.frequency; + channels = other.channels; + sampleSize = other.sampleSize; + + return *this; + } + + QString codec; + QAudioFormat::Endian byteOrder; + QAudioFormat::SampleType sampleType; + int frequency; + int channels; + int sampleSize; +}; + +/*! + \class QAudioFormat + \brief The QAudioFormat class stores audio parameter information. + + \inmodule QtMultimedia + \ingroup multimedia + \since 4.6 + + An audio format specifies how data in an audio stream is arranged, + i.e, how the stream is to be interpreted. The encoding itself is + specified by the codec() used for the stream. + + In addition to the encoding, QAudioFormat contains other + parameters that further specify how the audio data is arranged. + These are the frequency, the number of channels, the sample size, + the sample type, and the byte order. The following table describes + these in more detail. + + \table + \header + \o Parameter + \o Description + \row + \o Sample Rate + \o Samples per second of audio data in Hertz. + \row + \o Number of channels + \o The number of audio channels (typically one for mono + or two for stereo) + \row + \o Sample size + \o How much data is stored in each sample (typically 8 + or 16 bits) + \row + \o Sample type + \o Numerical representation of sample (typically signed integer, + unsigned integer or float) + \row + \o Byte order + \o Byte ordering of sample (typically little endian, big endian) + \endtable + + You can obtain audio formats compatible with the audio device used + through functions in QAudioDeviceInfo. This class also lets you + query available parameter values for a device, so that you can set + the parameters yourself. See the QAudioDeviceInfo class + description for details. You need to know the format of the audio + streams you wish to play. Qt does not set up formats for you. +*/ + +/*! + Construct a new audio format. + + Values are initialized as follows: + \list + \o sampleRate() = -1 + \o channelCount() = -1 + \o sampleSize() = -1 + \o byteOrder() = QAudioFormat::Endian(QSysInfo::ByteOrder) + \o sampleType() = QAudioFormat::Unknown + \c codec() = "" + \endlist +*/ + +QAudioFormat::QAudioFormat(): + d(new QAudioFormatPrivate) +{ +} + +/*! + Construct a new audio format using \a other. +*/ + +QAudioFormat::QAudioFormat(const QAudioFormat &other): + d(other.d) +{ +} + +/*! + Destroy this audio format. +*/ + +QAudioFormat::~QAudioFormat() +{ +} + +/*! + Assigns \a other to this QAudioFormat implementation. +*/ + +QAudioFormat& QAudioFormat::operator=(const QAudioFormat &other) +{ + d = other.d; + return *this; +} + +/*! + Returns true if this QAudioFormat is equal to the \a other + QAudioFormat; otherwise returns false. + + All elements of QAudioFormat are used for the comparison. +*/ + +bool QAudioFormat::operator==(const QAudioFormat &other) const +{ + return d->frequency == other.d->frequency && + d->channels == other.d->channels && + d->sampleSize == other.d->sampleSize && + d->byteOrder == other.d->byteOrder && + d->codec == other.d->codec && + d->sampleType == other.d->sampleType; +} + +/*! + Returns true if this QAudioFormat is not equal to the \a other + QAudioFormat; otherwise returns false. + + All elements of QAudioFormat are used for the comparison. +*/ + +bool QAudioFormat::operator!=(const QAudioFormat& other) const +{ + return !(*this == other); +} + +/*! + Returns true if all of the parameters are valid. +*/ + +bool QAudioFormat::isValid() const +{ + return d->frequency != -1 && d->channels != -1 && d->sampleSize != -1 && + d->sampleType != QAudioFormat::Unknown && !d->codec.isEmpty(); +} + +/*! + Sets the sample rate to \a samplerate Hertz. + + \since 4.7 +*/ + +void QAudioFormat::setSampleRate(int samplerate) +{ + d->frequency = samplerate; +} + +/*! + \obsolete + + Use setSampleRate() instead. +*/ + +void QAudioFormat::setFrequency(int frequency) +{ + d->frequency = frequency; +} + +/*! + Returns the current sample rate in Hertz. + + \since 4.7 +*/ + +int QAudioFormat::sampleRate() const +{ + return d->frequency; +} + +/*! + \obsolete + + Use sampleRate() instead. +*/ + +int QAudioFormat::frequency() const +{ + return d->frequency; +} + +/*! + Sets the channel count to \a channels. + + \since 4.7 +*/ + +void QAudioFormat::setChannelCount(int channels) +{ + d->channels = channels; +} + +/*! + \obsolete + + Use setChannelCount() instead. +*/ + +void QAudioFormat::setChannels(int channels) +{ + d->channels = channels; +} + +/*! + Returns the current channel count value. + + \since 4.7 +*/ + +int QAudioFormat::channelCount() const +{ + return d->channels; +} + +/*! + \obsolete + + Use channelCount() instead. +*/ + +int QAudioFormat::channels() const +{ + return d->channels; +} + +/*! + Sets the sample size to the \a sampleSize specified. +*/ + +void QAudioFormat::setSampleSize(int sampleSize) +{ + d->sampleSize = sampleSize; +} + +/*! + Returns the current sample size value. +*/ + +int QAudioFormat::sampleSize() const +{ + return d->sampleSize; +} + +/*! + Sets the codec to \a codec. + + \sa QAudioDeviceInfo::supportedCodecs() +*/ + +void QAudioFormat::setCodec(const QString &codec) +{ + d->codec = codec; +} + +/*! + Returns the current codec value. + + \sa QAudioDeviceInfo::supportedCodecs() +*/ + +QString QAudioFormat::codec() const +{ + return d->codec; +} + +/*! + Sets the byteOrder to \a byteOrder. +*/ + +void QAudioFormat::setByteOrder(QAudioFormat::Endian byteOrder) +{ + d->byteOrder = byteOrder; +} + +/*! + Returns the current byteOrder value. +*/ + +QAudioFormat::Endian QAudioFormat::byteOrder() const +{ + return d->byteOrder; +} + +/*! + Sets the sampleType to \a sampleType. +*/ + +void QAudioFormat::setSampleType(QAudioFormat::SampleType sampleType) +{ + d->sampleType = sampleType; +} + +/*! + Returns the current SampleType value. +*/ + +QAudioFormat::SampleType QAudioFormat::sampleType() const +{ + return d->sampleType; +} + +/*! + \enum QAudioFormat::SampleType + + \value Unknown Not Set + \value SignedInt samples are signed integers + \value UnSignedInt samples are unsigned intergers + \value Float samples are floats +*/ + +/*! + \enum QAudioFormat::Endian + + \value BigEndian samples are big endian byte order + \value LittleEndian samples are little endian byte order +*/ + +QT_END_NAMESPACE + diff --git a/src/multimedia/multimedia/audio/qaudioformat.h b/src/multimedia/multimedia/audio/qaudioformat.h new file mode 100644 index 0000000..6c835b7 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioformat.h @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** 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 QAUDIOFORMAT_H +#define QAUDIOFORMAT_H + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QAudioFormatPrivate; + +class Q_MULTIMEDIA_EXPORT QAudioFormat +{ +public: + enum SampleType { Unknown, SignedInt, UnSignedInt, Float }; + enum Endian { BigEndian = QSysInfo::BigEndian, LittleEndian = QSysInfo::LittleEndian }; + + QAudioFormat(); + QAudioFormat(const QAudioFormat &other); + ~QAudioFormat(); + + QAudioFormat& operator=(const QAudioFormat &other); + bool operator==(const QAudioFormat &other) const; + bool operator!=(const QAudioFormat &other) const; + + bool isValid() const; + + void setFrequency(int frequency); + int frequency() const; + void setSampleRate(int sampleRate); + int sampleRate() const; + + void setChannels(int channels); + int channels() const; + void setChannelCount(int channelCount); + int channelCount() const; + + void setSampleSize(int sampleSize); + int sampleSize() const; + + void setCodec(const QString &codec); + QString codec() const; + + void setByteOrder(QAudioFormat::Endian byteOrder); + QAudioFormat::Endian byteOrder() const; + + void setSampleType(QAudioFormat::SampleType sampleType); + QAudioFormat::SampleType sampleType() const; + +private: + QSharedDataPointer d; +}; + + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOFORMAT_H diff --git a/src/multimedia/multimedia/audio/qaudioinput.cpp b/src/multimedia/multimedia/audio/qaudioinput.cpp new file mode 100644 index 0000000..c99e870 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput.cpp @@ -0,0 +1,432 @@ +/**************************************************************************** +** +** 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 + +#include "qaudiodevicefactory_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \class QAudioInput + \brief The QAudioInput class provides an interface for receiving audio data from an audio input device. + + \inmodule QtMultimedia + \ingroup multimedia + \since 4.6 + + You can construct an audio input with the system's + \l{QAudioDeviceInfo::defaultInputDevice()}{default audio input + device}. It is also possible to create QAudioInput with a + specific QAudioDeviceInfo. When you create the audio input, you + should also send in the QAudioFormat to be used for the recording + (see the QAudioFormat class description for details). + + To record to a file: + + QAudioInput lets you record audio with an audio input device. The + default constructor of this class will use the systems default + audio device, but you can also specify a QAudioDeviceInfo for a + specific device. You also need to pass in the QAudioFormat in + which you wish to record. + + Starting up the QAudioInput is simply a matter of calling start() + with a QIODevice opened for writing. For instance, to record to a + file, you can: + + \code + QFile outputFile; // class member. + QAudioInput* audio; // class member. + \endcode + + \code + { + outputFile.setFileName("/tmp/test.raw"); + outputFile.open( QIODevice::WriteOnly | QIODevice::Truncate ); + + QAudioFormat format; + // set up the format you want, eg. + format.setFrequency(8000); + format.setChannels(1); + format.setSampleSize(8); + format.setCodec("audio/pcm"); + format.setByteOrder(QAudioFormat::LittleEndian); + format.setSampleType(QAudioFormat::UnSignedInt); + + QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice(); + if (!info.isFormatSupported(format)) { + qWarning()<<"default format not supported try to use nearest"; + format = info.nearestFormat(format); + } + + audio = new QAudioInput(format, this); + QTimer::singleShot(3000, this, SLOT(stopRecording())); + audio->start(&outputFile); + // Records audio for 3000ms + } + \endcode + + This will start recording if the format specified is supported by + the input device (you can check this with + QAudioDeviceInfo::isFormatSupported(). In case there are any + snags, use the error() function to check what went wrong. We stop + recording in the \c stopRecording() slot. + + \code + void stopRecording() + { + audio->stop(); + outputFile->close(); + delete audio; + } + \endcode + + At any point in time, QAudioInput will be in one of four states: + active, suspended, stopped, or idle. These states are specified by + the QAudio::State enum. You can request a state change directly through + suspend(), resume(), stop(), reset(), and start(). The current + state is reported by state(). QAudioOutput will also signal you + when the state changes (stateChanged()). + + QAudioInput provides several ways of measuring the time that has + passed since the start() of the recording. The \c processedUSecs() + function returns the length of the stream in microseconds written, + i.e., it leaves out the times the audio input was suspended or idle. + The elapsedUSecs() function returns the time elapsed since start() was called regardless of + which states the QAudioInput has been in. + + If an error should occur, you can fetch its reason with error(). + The possible error reasons are described by the QAudio::Error + enum. The QAudioInput will enter the \l{QAudio::}{StoppedState} when + an error is encountered. Connect to the stateChanged() signal to + handle the error: + + \snippet doc/src/snippets/audio/main.cpp 0 + + \sa QAudioOutput, QAudioDeviceInfo + + \section1 Symbian Platform Security Requirements + + On Symbian, processes which use this class must have the + \c UserEnvironment platform security capability. If the client + process lacks this capability, calls to either overload of start() + will fail. + This failure is indicated by the QAudioInput object setting + its error() value to \l{QAudio::OpenError} and then emitting a + \l{stateChanged()}{stateChanged}(\l{QAudio::StoppedState}) signal. + + Platform security capabilities are added via the + \l{qmake-variable-reference.html#target-capability}{TARGET.CAPABILITY} + qmake variable. +*/ + +/*! + Construct a new audio input and attach it to \a parent. + The default audio input device is used with the output + \a format parameters. +*/ + +QAudioInput::QAudioInput(const QAudioFormat &format, QObject *parent): + QObject(parent) +{ + d = QAudioDeviceFactory::createDefaultInputDevice(format); + connect(d, SIGNAL(notify()), SIGNAL(notify())); + connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); +} + +/*! + Construct a new audio input and attach it to \a parent. + The device referenced by \a audioDevice is used with the input + \a format parameters. +*/ + +QAudioInput::QAudioInput(const QAudioDeviceInfo &audioDevice, const QAudioFormat &format, QObject *parent): + QObject(parent) +{ + d = QAudioDeviceFactory::createInputDevice(audioDevice, format); + connect(d, SIGNAL(notify()), SIGNAL(notify())); + connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); +} + +/*! + Destroy this audio input. +*/ + +QAudioInput::~QAudioInput() +{ + delete d; +} + +/*! + Uses the \a device as the QIODevice to transfer data. + Passing a QIODevice allows the data to be transfered without any extra code. + All that is required is to open the QIODevice. + + If able to successfully get audio data from the systems audio device the + state() is set to either QAudio::ActiveState or QAudio::IdleState, + error() is set to QAudio::NoError and the stateChanged() signal is emitted. + + If a problem occurs during this process the error() is set to QAudio::OpenError, + state() is set to QAudio::StoppedState and stateChanged() signal is emitted. + + \sa {Symbian Platform Security Requirements} + + \sa QIODevice +*/ + +void QAudioInput::start(QIODevice* device) +{ + d->start(device); +} + +/*! + Returns a pointer to the QIODevice being used to handle the data + transfer. This QIODevice can be used to read() audio data + directly. + + If able to access the systems audio device the state() is set to + QAudio::IdleState, error() is set to QAudio::NoError + and the stateChanged() signal is emitted. + + If a problem occurs during this process the error() is set to QAudio::OpenError, + state() is set to QAudio::StoppedState and stateChanged() signal is emitted. + + \sa {Symbian Platform Security Requirements} + + \sa QIODevice +*/ + +QIODevice* QAudioInput::start() +{ + return d->start(0); +} + +/*! + Returns the QAudioFormat being used. +*/ + +QAudioFormat QAudioInput::format() const +{ + return d->format(); +} + +/*! + Stops the audio input, detaching from the system resource. + + Sets error() to QAudio::NoError, state() to QAudio::StoppedState and + emit stateChanged() signal. +*/ + +void QAudioInput::stop() +{ + d->stop(); +} + +/*! + Drops all audio data in the buffers, resets buffers to zero. +*/ + +void QAudioInput::reset() +{ + d->reset(); +} + +/*! + Stops processing audio data, preserving buffered audio data. + + Sets error() to QAudio::NoError, state() to QAudio::SuspendedState and + emit stateChanged() signal. +*/ + +void QAudioInput::suspend() +{ + d->suspend(); +} + +/*! + Resumes processing audio data after a suspend(). + + Sets error() to QAudio::NoError. + Sets state() to QAudio::ActiveState if you previously called start(QIODevice*). + Sets state() to QAudio::IdleState if you previously called start(). + emits stateChanged() signal. +*/ + +void QAudioInput::resume() +{ + d->resume(); +} + +/*! + Sets the audio buffer size to \a value milliseconds. + + Note: This function can be called anytime before start(), calls to this + are ignored after start(). It should not be assumed that the buffer size + set is the actual buffer size used, calling bufferSize() anytime after start() + will return the actual buffer size being used. + +*/ + +void QAudioInput::setBufferSize(int value) +{ + d->setBufferSize(value); +} + +/*! + Returns the audio buffer size in milliseconds. + + If called before start(), returns platform default value. + If called before start() but setBufferSize() was called prior, returns value set by setBufferSize(). + If called after start(), returns the actual buffer size being used. This may not be what was set previously + by setBufferSize(). + +*/ + +int QAudioInput::bufferSize() const +{ + return d->bufferSize(); +} + +/*! + Returns the amount of audio data available to read in bytes. + + NOTE: returned value is only valid while in QAudio::ActiveState or QAudio::IdleState + state, otherwise returns zero. +*/ + +int QAudioInput::bytesReady() const +{ + /* + -If not ActiveState|IdleState, return 0 + -return amount of audio data available to read + */ + return d->bytesReady(); +} + +/*! + Returns the period size in bytes. + + Note: This is the recommended read size in bytes. +*/ + +int QAudioInput::periodSize() const +{ + return d->periodSize(); +} + +/*! + Sets the interval for notify() signal to be emitted. + This is based on the \a ms of audio data processed + not on actual real-time. + The minimum resolution of the timer is platform specific and values + should be checked with notifyInterval() to confirm actual value + being used. +*/ + +void QAudioInput::setNotifyInterval(int ms) +{ + d->setNotifyInterval(ms); +} + +/*! + Returns the notify interval in milliseconds. +*/ + +int QAudioInput::notifyInterval() const +{ + return d->notifyInterval(); +} + +/*! + Returns the amount of audio data processed since start() + was called in microseconds. +*/ + +qint64 QAudioInput::processedUSecs() const +{ + return d->processedUSecs(); +} + +/*! + Returns the microseconds since start() was called, including time in Idle and + Suspend states. +*/ + +qint64 QAudioInput::elapsedUSecs() const +{ + return d->elapsedUSecs(); +} + +/*! + Returns the error state. +*/ + +QAudio::Error QAudioInput::error() const +{ + return d->error(); +} + +/*! + Returns the state of audio processing. +*/ + +QAudio::State QAudioInput::state() const +{ + return d->state(); +} + +/*! + \fn QAudioInput::stateChanged(QAudio::State state) + This signal is emitted when the device \a state has changed. +*/ + +/*! + \fn QAudioInput::notify() + This signal is emitted when x ms of audio data has been processed + the interval set by setNotifyInterval(x). +*/ + +QT_END_NAMESPACE + diff --git a/src/multimedia/multimedia/audio/qaudioinput.h b/src/multimedia/multimedia/audio/qaudioinput.h new file mode 100644 index 0000000..5be9b5a --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** 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 QAUDIOINPUT_H +#define QAUDIOINPUT_H + +#include +#include + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QAbstractAudioInput; + +class Q_MULTIMEDIA_EXPORT QAudioInput : public QObject +{ + Q_OBJECT + +public: + explicit QAudioInput(const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); + explicit QAudioInput(const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); + ~QAudioInput(); + + QAudioFormat format() const; + + void start(QIODevice *device); + QIODevice* start(); + + void stop(); + void reset(); + void suspend(); + void resume(); + + void setBufferSize(int bytes); + int bufferSize() const; + + int bytesReady() const; + int periodSize() const; + + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + + QAudio::Error error() const; + QAudio::State state() const; + +Q_SIGNALS: + void stateChanged(QAudio::State); + void notify(); + +private: + Q_DISABLE_COPY(QAudioInput) + + QAbstractAudioInput* d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOINPUT_H diff --git a/src/multimedia/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/multimedia/audio/qaudioinput_alsa_p.cpp new file mode 100644 index 0000000..6b15008 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput_alsa_p.cpp @@ -0,0 +1,706 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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 "qaudioinput_alsa_p.h" +#include "qaudiodeviceinfo_alsa_p.h" + +QT_BEGIN_NAMESPACE + +//#define DEBUG_AUDIO 1 + +static const int minimumIntervalTime = 50; + +QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): + settings(audioFormat) +{ + bytesAvailable = 0; + handle = 0; + ahandler = 0; + access = SND_PCM_ACCESS_RW_INTERLEAVED; + pcmformat = SND_PCM_FORMAT_S16; + buffer_size = 0; + period_size = 0; + buffer_time = 100000; + period_time = 20000; + totalTimeValue = 0; + intervalTime = 1000; + audioBuffer = 0; + errorState = QAudio::NoError; + deviceState = QAudio::StoppedState; + audioSource = 0; + pullMode = true; + resuming = false; + + m_device = device; + + timer = new QTimer(this); + connect(timer,SIGNAL(timeout()),SLOT(userFeed())); +} + +QAudioInputPrivate::~QAudioInputPrivate() +{ + close(); + disconnect(timer, SIGNAL(timeout())); + QCoreApplication::processEvents(); + delete timer; +} + +QAudio::Error QAudioInputPrivate::error() const +{ + return errorState; +} + +QAudio::State QAudioInputPrivate::state() const +{ + return deviceState; +} + + +QAudioFormat QAudioInputPrivate::format() const +{ + return settings; +} + +int QAudioInputPrivate::xrun_recovery(int err) +{ + int count = 0; + bool reset = false; + + if(err == -EPIPE) { + errorState = QAudio::UnderrunError; + err = snd_pcm_prepare(handle); + if(err < 0) + reset = true; + else { + bytesAvailable = bytesReady(); + if (bytesAvailable <= 0) + reset = true; + } + + } else if((err == -ESTRPIPE)||(err == -EIO)) { + errorState = QAudio::IOError; + while((err = snd_pcm_resume(handle)) == -EAGAIN){ + usleep(100); + count++; + if(count > 5) { + reset = true; + break; + } + } + if(err < 0) { + err = snd_pcm_prepare(handle); + if(err < 0) + reset = true; + } + } + if(reset) { + close(); + open(); + snd_pcm_prepare(handle); + return 0; + } + return err; +} + +int QAudioInputPrivate::setFormat() +{ + snd_pcm_format_t format = SND_PCM_FORMAT_S16; + + if(settings.sampleSize() == 8) { + format = SND_PCM_FORMAT_U8; + } else if(settings.sampleSize() == 16) { + if(settings.sampleType() == QAudioFormat::SignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + format = SND_PCM_FORMAT_S16_LE; + else + format = SND_PCM_FORMAT_S16_BE; + } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + format = SND_PCM_FORMAT_U16_LE; + else + format = SND_PCM_FORMAT_U16_BE; + } + } else if(settings.sampleSize() == 24) { + if(settings.sampleType() == QAudioFormat::SignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + format = SND_PCM_FORMAT_S24_LE; + else + format = SND_PCM_FORMAT_S24_BE; + } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + format = SND_PCM_FORMAT_U24_LE; + else + format = SND_PCM_FORMAT_U24_BE; + } + } else if(settings.sampleSize() == 32) { + if(settings.sampleType() == QAudioFormat::SignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + format = SND_PCM_FORMAT_S32_LE; + else + format = SND_PCM_FORMAT_S32_BE; + } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + format = SND_PCM_FORMAT_U32_LE; + else + format = SND_PCM_FORMAT_U32_BE; + } else if(settings.sampleType() == QAudioFormat::Float) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + format = SND_PCM_FORMAT_FLOAT_LE; + else + format = SND_PCM_FORMAT_FLOAT_BE; + } + } else if(settings.sampleSize() == 64) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + format = SND_PCM_FORMAT_FLOAT64_LE; + else + format = SND_PCM_FORMAT_FLOAT64_BE; + } + + return snd_pcm_hw_params_set_format( handle, hwparams, format); +} + +QIODevice* QAudioInputPrivate::start(QIODevice* device) +{ + if(deviceState != QAudio::StoppedState) + close(); + + if(!pullMode && audioSource) { + delete audioSource; + } + + if(device) { + //set to pull mode + pullMode = true; + audioSource = device; + deviceState = QAudio::ActiveState; + } else { + //set to push mode + pullMode = false; + deviceState = QAudio::IdleState; + audioSource = new InputPrivate(this); + audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered); + } + + if( !open() ) + return 0; + + emit stateChanged(deviceState); + + return audioSource; +} + +void QAudioInputPrivate::stop() +{ + if(deviceState == QAudio::StoppedState) + return; + + deviceState = QAudio::StoppedState; + + close(); + emit stateChanged(deviceState); +} + +bool QAudioInputPrivate::open() +{ +#ifdef DEBUG_AUDIO + QTime now(QTime::currentTime()); + qDebug()< devices = QAudioDeviceInfoInternal::availableDevices(QAudio::AudioInput); + if(dev.compare(QLatin1String("default")) == 0) { +#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) + dev = QLatin1String(devices.first()); +#else + dev = QLatin1String("hw:0,0"); +#endif + } else { +#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) + dev = QLatin1String(m_device); +#else + int idx = 0; + char *name; + + QString shortName = QLatin1String(m_device.mid(m_device.indexOf('=',0)+1).constData()); + + while(snd_card_get_name(idx,&name) == 0) { + if(qstrncmp(shortName.toLocal8Bit().constData(),name,shortName.length()) == 0) + break; + idx++; + } + dev = QString(QLatin1String("hw:%1,0")).arg(idx); +#endif + } + + // Step 1: try and open the device + while((count < 5) && (err < 0)) { + err=snd_pcm_open(&handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_CAPTURE,0); + if(err < 0) + count++; + } + if (( err < 0)||(handle == 0)) { + errorState = QAudio::OpenError; + deviceState = QAudio::StoppedState; + emit stateChanged(deviceState); + return false; + } + snd_pcm_nonblock( handle, 0 ); + + // Step 2: Set the desired HW parameters. + snd_pcm_hw_params_alloca( &hwparams ); + + bool fatal = false; + QString errMessage; + unsigned int chunks = 8; + + err = snd_pcm_hw_params_any( handle, hwparams ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_any: err = %1").arg(err); + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_rate_resample( handle, hwparams, 1 ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_rate_resample: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_access( handle, hwparams, access ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_access: err = %1").arg(err); + } + } + if ( !fatal ) { + err = setFormat(); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_format: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_channels( handle, hwparams, (unsigned int)settings.channels() ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_channels: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_rate_near( handle, hwparams, &freakuency, 0 ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_rate_near: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_buffer_time_near(handle, hwparams, &buffer_time, &dir); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_buffer_time_near: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_period_time_near(handle, hwparams, &period_time, &dir); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_period_time_near: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_periods_near(handle, hwparams, &chunks, &dir); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_periods_near: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params(handle, hwparams); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params: err = %1").arg(err); + } + } + if( err < 0) { + qWarning()<start(period_time*chunks/2000); + + errorState = QAudio::NoError; + + totalTimeValue = 0; + + return true; +} + +void QAudioInputPrivate::close() +{ + timer->stop(); + + if ( handle ) { + snd_pcm_drop( handle ); + snd_pcm_close( handle ); + handle = 0; + delete [] audioBuffer; + audioBuffer=0; + } +} + +int QAudioInputPrivate::bytesReady() const +{ + if(resuming) + return period_size; + + if(deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState) + return 0; + int frames = snd_pcm_avail_update(handle); + if (frames < 0) return frames; + if((int)frames > (int)buffer_frames) + frames = buffer_frames; + + return snd_pcm_frames_to_bytes(handle, frames); +} + +qint64 QAudioInputPrivate::read(char* data, qint64 len) +{ + Q_UNUSED(len) + + // Read in some audio data and write it to QIODevice, pull mode + if ( !handle ) + return 0; + + bytesAvailable = bytesReady(); + + if (bytesAvailable < 0) { + // bytesAvailable as negative is error code, try to recover from it. + xrun_recovery(bytesAvailable); + bytesAvailable = bytesReady(); + if (bytesAvailable < 0) { + // recovery failed must stop and set error. + close(); + errorState = QAudio::IOError; + deviceState = QAudio::StoppedState; + emit stateChanged(deviceState); + return 0; + } + } + + int count=0, err = 0; + while(count < 5) { + int chunks = bytesAvailable/period_size; + int frames = chunks*period_frames; + if(frames > (int)buffer_frames) + frames = buffer_frames; + int readFrames = snd_pcm_readi(handle, audioBuffer, frames); + if (readFrames >= 0) { + err = snd_pcm_frames_to_bytes(handle, readFrames); +#ifdef DEBUG_AUDIO + qDebug()< 0) { + // got some send it onward +#ifdef DEBUG_AUDIO + qDebug()<<"frames to write to QIODevice = "<< + snd_pcm_bytes_to_frames( handle, (int)err )<<" ("<write(audioBuffer,err); + if(l < 0) { + close(); + errorState = QAudio::IOError; + deviceState = QAudio::StoppedState; + emit stateChanged(deviceState); + } else if(l == 0) { + if (deviceState != QAudio::IdleState) { + errorState = QAudio::NoError; + deviceState = QAudio::IdleState; + emit stateChanged(deviceState); + } + } else { + totalTimeValue += err; + resuming = false; + if (deviceState != QAudio::ActiveState) { + errorState = QAudio::NoError; + deviceState = QAudio::ActiveState; + emit stateChanged(deviceState); + } + } + return l; + + } else { + memcpy(data,audioBuffer,err); + totalTimeValue += err; + resuming = false; + if (deviceState != QAudio::ActiveState) { + errorState = QAudio::NoError; + deviceState = QAudio::ActiveState; + emit stateChanged(deviceState); + } + return err; + } + } + return 0; +} + +void QAudioInputPrivate::resume() +{ + if(deviceState == QAudio::SuspendedState) { + int err = 0; + + if(handle) { + err = snd_pcm_prepare( handle ); + if(err < 0) + xrun_recovery(err); + + err = snd_pcm_start(handle); + if(err < 0) + xrun_recovery(err); + + bytesAvailable = buffer_size; + } + resuming = true; + deviceState = QAudio::ActiveState; + int chunks = buffer_size/period_size; + timer->start(period_time*chunks/2000); + emit stateChanged(deviceState); + } +} + +void QAudioInputPrivate::setBufferSize(int value) +{ + buffer_size = value; +} + +int QAudioInputPrivate::bufferSize() const +{ + return buffer_size; +} + +int QAudioInputPrivate::periodSize() const +{ + return period_size; +} + +void QAudioInputPrivate::setNotifyInterval(int ms) +{ + if(ms >= minimumIntervalTime) + intervalTime = ms; + else + intervalTime = minimumIntervalTime; +} + +int QAudioInputPrivate::notifyInterval() const +{ + return intervalTime; +} + +qint64 QAudioInputPrivate::processedUSecs() const +{ + qint64 result = qint64(1000000) * totalTimeValue / + (settings.channels()*(settings.sampleSize()/8)) / + settings.frequency(); + + return result; +} + +void QAudioInputPrivate::suspend() +{ + if(deviceState == QAudio::ActiveState||resuming) { + timer->stop(); + deviceState = QAudio::SuspendedState; + emit stateChanged(deviceState); + } +} + +void QAudioInputPrivate::userFeed() +{ + if(deviceState == QAudio::StoppedState || deviceState == QAudio::SuspendedState) + return; +#ifdef DEBUG_AUDIO + QTime now(QTime::currentTime()); + qDebug()<(audioSource); + a->trigger(); + } + bytesAvailable = bytesReady(); + + if(deviceState != QAudio::ActiveState) + return true; + + if((timeStamp.elapsed() + elapsedTimeOffset) > intervalTime) { + emit notify(); + elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime; + timeStamp.restart(); + } + return true; +} + +qint64 QAudioInputPrivate::elapsedUSecs() const +{ + if (deviceState == QAudio::StoppedState) + return 0; + + return clockStamp.elapsed()*1000; +} + +void QAudioInputPrivate::reset() +{ + if(handle) + snd_pcm_reset(handle); +} + +void QAudioInputPrivate::drain() +{ + if(handle) + snd_pcm_drain(handle); +} + +InputPrivate::InputPrivate(QAudioInputPrivate* audio) +{ + audioDevice = qobject_cast(audio); +} + +InputPrivate::~InputPrivate() +{ +} + +qint64 InputPrivate::readData( char* data, qint64 len) +{ + return audioDevice->read(data,len); +} + +qint64 InputPrivate::writeData(const char* data, qint64 len) +{ + Q_UNUSED(data) + Q_UNUSED(len) + return 0; +} + +void InputPrivate::trigger() +{ + emit readyRead(); +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudioinput_alsa_p.h b/src/multimedia/multimedia/audio/qaudioinput_alsa_p.h new file mode 100644 index 0000000..c907019 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput_alsa_p.h @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + + +#ifndef QAUDIOINPUTALSA_H +#define QAUDIOINPUTALSA_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class InputPrivate; + +class QAudioInputPrivate : public QAbstractAudioInput +{ + Q_OBJECT +public: + QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat); + ~QAudioInputPrivate(); + + qint64 read(char* data, qint64 len); + + QIODevice* start(QIODevice* device = 0); + void stop(); + void reset(); + void suspend(); + void resume(); + int bytesReady() const; + int periodSize() const; + void setBufferSize(int value); + int bufferSize() const; + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + QAudio::Error error() const; + QAudio::State state() const; + QAudioFormat format() const; + bool resuming; + snd_pcm_t* handle; + qint64 totalTimeValue; + QIODevice* audioSource; + QAudioFormat settings; + QAudio::Error errorState; + QAudio::State deviceState; + +private slots: + void userFeed(); + bool deviceReady(); + +private: + int xrun_recovery(int err); + int setFormat(); + bool open(); + void close(); + void drain(); + + QTimer* timer; + QElapsedTimer timeStamp; + QElapsedTimer clockStamp; + qint64 elapsedTimeOffset; + int intervalTime; + char* audioBuffer; + int bytesAvailable; + QByteArray m_device; + bool pullMode; + int buffer_size; + int period_size; + unsigned int buffer_time; + unsigned int period_time; + snd_pcm_uframes_t buffer_frames; + snd_pcm_uframes_t period_frames; + snd_async_handler_t* ahandler; + snd_pcm_access_t access; + snd_pcm_format_t pcmformat; + snd_timestamp_t* timestamp; + snd_pcm_hw_params_t *hwparams; +}; + +class InputPrivate : public QIODevice +{ + Q_OBJECT +public: + InputPrivate(QAudioInputPrivate* audio); + ~InputPrivate(); + + qint64 readData( char* data, qint64 len); + qint64 writeData(const char* data, qint64 len); + + void trigger(); +private: + QAudioInputPrivate *audioDevice; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/multimedia/audio/qaudioinput_mac_p.cpp new file mode 100644 index 0000000..cb65f6e --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput_mac_p.cpp @@ -0,0 +1,956 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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 +#include + +#include + +#include "qaudio_mac_p.h" +#include "qaudioinput_mac_p.h" +#include "qaudiodeviceinfo_mac_p.h" + +QT_BEGIN_NAMESPACE + + +namespace QtMultimediaInternal +{ + +static const int default_buffer_size = 4 * 1024; + +class QAudioBufferList +{ +public: + QAudioBufferList(AudioStreamBasicDescription const& streamFormat): + owner(false), + sf(streamFormat) + { + const bool isInterleaved = (sf.mFormatFlags & kAudioFormatFlagIsNonInterleaved) == 0; + const int numberOfBuffers = isInterleaved ? 1 : sf.mChannelsPerFrame; + + dataSize = 0; + + bfs = reinterpret_cast(qMalloc(sizeof(AudioBufferList) + + (sizeof(AudioBuffer) * numberOfBuffers))); + + bfs->mNumberBuffers = numberOfBuffers; + for (int i = 0; i < numberOfBuffers; ++i) { + bfs->mBuffers[i].mNumberChannels = isInterleaved ? numberOfBuffers : 1; + bfs->mBuffers[i].mDataByteSize = 0; + bfs->mBuffers[i].mData = 0; + } + } + + QAudioBufferList(AudioStreamBasicDescription const& streamFormat, char* buffer, int bufferSize): + owner(false), + sf(streamFormat), + bfs(0) + { + dataSize = bufferSize; + + bfs = reinterpret_cast(qMalloc(sizeof(AudioBufferList) + sizeof(AudioBuffer))); + + bfs->mNumberBuffers = 1; + bfs->mBuffers[0].mNumberChannels = 1; + bfs->mBuffers[0].mDataByteSize = dataSize; + bfs->mBuffers[0].mData = buffer; + } + + QAudioBufferList(AudioStreamBasicDescription const& streamFormat, int framesToBuffer): + owner(true), + sf(streamFormat), + bfs(0) + { + const bool isInterleaved = (sf.mFormatFlags & kAudioFormatFlagIsNonInterleaved) == 0; + const int numberOfBuffers = isInterleaved ? 1 : sf.mChannelsPerFrame; + + dataSize = framesToBuffer * sf.mBytesPerFrame; + + bfs = reinterpret_cast(qMalloc(sizeof(AudioBufferList) + + (sizeof(AudioBuffer) * numberOfBuffers))); + bfs->mNumberBuffers = numberOfBuffers; + for (int i = 0; i < numberOfBuffers; ++i) { + bfs->mBuffers[i].mNumberChannels = isInterleaved ? numberOfBuffers : 1; + bfs->mBuffers[i].mDataByteSize = dataSize; + bfs->mBuffers[i].mData = qMalloc(dataSize); + } + } + + ~QAudioBufferList() + { + if (owner) { + for (UInt32 i = 0; i < bfs->mNumberBuffers; ++i) + qFree(bfs->mBuffers[i].mData); + } + + qFree(bfs); + } + + AudioBufferList* audioBufferList() const + { + return bfs; + } + + char* data(int buffer = 0) const + { + return static_cast(bfs->mBuffers[buffer].mData); + } + + qint64 bufferSize(int buffer = 0) const + { + return bfs->mBuffers[buffer].mDataByteSize; + } + + int frameCount(int buffer = 0) const + { + return bfs->mBuffers[buffer].mDataByteSize / sf.mBytesPerFrame; + } + + int packetCount(int buffer = 0) const + { + return bfs->mBuffers[buffer].mDataByteSize / sf.mBytesPerPacket; + } + + int packetSize() const + { + return sf.mBytesPerPacket; + } + + void reset() + { + for (UInt32 i = 0; i < bfs->mNumberBuffers; ++i) { + bfs->mBuffers[i].mDataByteSize = dataSize; + bfs->mBuffers[i].mData = 0; + } + } + +private: + bool owner; + int dataSize; + AudioStreamBasicDescription sf; + AudioBufferList* bfs; +}; + +class QAudioPacketFeeder +{ +public: + QAudioPacketFeeder(QAudioBufferList* abl): + audioBufferList(abl) + { + totalPackets = audioBufferList->packetCount(); + position = 0; + } + + bool feed(AudioBufferList& dst, UInt32& packetCount) + { + if (position == totalPackets) { + dst.mBuffers[0].mDataByteSize = 0; + packetCount = 0; + return false; + } + + if (totalPackets - position < packetCount) + packetCount = totalPackets - position; + + dst.mBuffers[0].mDataByteSize = packetCount * audioBufferList->packetSize(); + dst.mBuffers[0].mData = audioBufferList->data() + (position * audioBufferList->packetSize()); + + position += packetCount; + + return true; + } + +private: + UInt32 totalPackets; + UInt32 position; + QAudioBufferList* audioBufferList; +}; + +class QAudioInputBuffer : public QObject +{ + Q_OBJECT + +public: + QAudioInputBuffer(int bufferSize, + int maxPeriodSize, + AudioStreamBasicDescription const& inputFormat, + AudioStreamBasicDescription const& outputFormat, + QObject* parent): + QObject(parent), + m_deviceError(false), + m_audioConverter(0), + m_inputFormat(inputFormat), + m_outputFormat(outputFormat) + { + m_maxPeriodSize = maxPeriodSize; + m_periodTime = m_maxPeriodSize / m_outputFormat.mBytesPerFrame * 1000 / m_outputFormat.mSampleRate; + m_buffer = new QAudioRingBuffer(bufferSize + (bufferSize % maxPeriodSize == 0 ? 0 : maxPeriodSize - (bufferSize % maxPeriodSize))); + m_inputBufferList = new QAudioBufferList(m_inputFormat); + + m_flushTimer = new QTimer(this); + connect(m_flushTimer, SIGNAL(timeout()), SLOT(flushBuffer())); + + if (toQAudioFormat(inputFormat) != toQAudioFormat(outputFormat)) { + if (AudioConverterNew(&m_inputFormat, &m_outputFormat, &m_audioConverter) != noErr) { + qWarning() << "QAudioInput: Unable to create an Audio Converter"; + m_audioConverter = 0; + } + } + } + + ~QAudioInputBuffer() + { + delete m_buffer; + } + + qint64 renderFromDevice(AudioUnit audioUnit, + AudioUnitRenderActionFlags* ioActionFlags, + const AudioTimeStamp* inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames) + { + const bool wasEmpty = m_buffer->used() == 0; + + OSStatus err; + qint64 framesRendered = 0; + + m_inputBufferList->reset(); + err = AudioUnitRender(audioUnit, + ioActionFlags, + inTimeStamp, + inBusNumber, + inNumberFrames, + m_inputBufferList->audioBufferList()); + + if (m_audioConverter != 0) { + QAudioPacketFeeder feeder(m_inputBufferList); + + bool wecan = true; + int copied = 0; + + const int available = m_buffer->free(); + + while (err == noErr && wecan) { + QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(available); + + if (region.second > 0) { + AudioBufferList output; + output.mNumberBuffers = 1; + output.mBuffers[0].mNumberChannels = 1; + output.mBuffers[0].mDataByteSize = region.second; + output.mBuffers[0].mData = region.first; + + UInt32 packetSize = region.second / m_outputFormat.mBytesPerPacket; + err = AudioConverterFillComplexBuffer(m_audioConverter, + converterCallback, + &feeder, + &packetSize, + &output, + 0); + + region.second = output.mBuffers[0].mDataByteSize; + copied += region.second; + + m_buffer->releaseWriteRegion(region); + } + else + wecan = false; + } + + framesRendered += copied / m_outputFormat.mBytesPerFrame; + } + else { + const int available = m_inputBufferList->bufferSize(); + bool wecan = true; + int copied = 0; + + while (wecan && copied < available) { + QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(available - copied); + + if (region.second > 0) { + memcpy(region.first, m_inputBufferList->data() + copied, region.second); + copied += region.second; + } + else + wecan = false; + + m_buffer->releaseWriteRegion(region); + } + + framesRendered = copied / m_outputFormat.mBytesPerFrame; + } + + if (wasEmpty && framesRendered > 0) + emit readyRead(); + + return framesRendered; + } + + qint64 readBytes(char* data, qint64 len) + { + bool wecan = true; + qint64 bytesCopied = 0; + + len -= len % m_maxPeriodSize; + while (wecan && bytesCopied < len) { + QAudioRingBuffer::Region region = m_buffer->acquireReadRegion(len - bytesCopied); + + if (region.second > 0) { + memcpy(data + bytesCopied, region.first, region.second); + bytesCopied += region.second; + } + else + wecan = false; + + m_buffer->releaseReadRegion(region); + } + + return bytesCopied; + } + + void setFlushDevice(QIODevice* device) + { + if (m_device != device) + m_device = device; + } + + void startFlushTimer() + { + if (m_device != 0) { + m_flushTimer->start((m_buffer->size() - (m_maxPeriodSize * 2)) / m_maxPeriodSize * m_periodTime); + } + } + + void stopFlushTimer() + { + m_flushTimer->stop(); + } + + void flush(bool all = false) + { + if (m_device == 0) + return; + + const int used = m_buffer->used(); + const int readSize = all ? used : used - (used % m_maxPeriodSize); + + if (readSize > 0) { + bool wecan = true; + int flushed = 0; + + while (!m_deviceError && wecan && flushed < readSize) { + QAudioRingBuffer::Region region = m_buffer->acquireReadRegion(readSize - flushed); + + if (region.second > 0) { + int bytesWritten = m_device->write(region.first, region.second); + if (bytesWritten < 0) { + stopFlushTimer(); + m_deviceError = true; + } + else { + region.second = bytesWritten; + flushed += bytesWritten; + wecan = bytesWritten != 0; + } + } + else + wecan = false; + + m_buffer->releaseReadRegion(region); + } + } + } + + void reset() + { + m_buffer->reset(); + m_deviceError = false; + } + + int available() const + { + return m_buffer->free(); + } + + int used() const + { + return m_buffer->used(); + } + +signals: + void readyRead(); + +private slots: + void flushBuffer() + { + flush(); + } + +private: + bool m_deviceError; + int m_maxPeriodSize; + int m_periodTime; + QIODevice* m_device; + QTimer* m_flushTimer; + QAudioRingBuffer* m_buffer; + QAudioBufferList* m_inputBufferList; + AudioConverterRef m_audioConverter; + AudioStreamBasicDescription m_inputFormat; + AudioStreamBasicDescription m_outputFormat; + + const static OSStatus as_empty = 'qtem'; + + // Converter callback + static OSStatus converterCallback(AudioConverterRef inAudioConverter, + UInt32* ioNumberDataPackets, + AudioBufferList* ioData, + AudioStreamPacketDescription** outDataPacketDescription, + void* inUserData) + { + Q_UNUSED(inAudioConverter); + Q_UNUSED(outDataPacketDescription); + + QAudioPacketFeeder* feeder = static_cast(inUserData); + + if (!feeder->feed(*ioData, *ioNumberDataPackets)) + return as_empty; + + return noErr; + } +}; + + +class MacInputDevice : public QIODevice +{ + Q_OBJECT + +public: + MacInputDevice(QAudioInputBuffer* audioBuffer, QObject* parent): + QIODevice(parent), + m_audioBuffer(audioBuffer) + { + open(QIODevice::ReadOnly | QIODevice::Unbuffered); + connect(m_audioBuffer, SIGNAL(readyRead()), SIGNAL(readyRead())); + } + + qint64 readData(char* data, qint64 len) + { + return m_audioBuffer->readBytes(data, len); + } + + qint64 writeData(const char* data, qint64 len) + { + Q_UNUSED(data); + Q_UNUSED(len); + + return 0; + } + + bool isSequential() const + { + return true; + } + +private: + QAudioInputBuffer* m_audioBuffer; +}; + +} + + +QAudioInputPrivate::QAudioInputPrivate(const QByteArray& device, QAudioFormat const& format): + audioFormat(format) +{ + QDataStream ds(device); + quint32 did, mode; + + ds >> did >> mode; + + if (QAudio::Mode(mode) == QAudio::AudioOutput) + errorCode = QAudio::OpenError; + else { + audioDeviceInfo = new QAudioDeviceInfoInternal(device, QAudio::AudioInput); + isOpen = false; + audioDeviceId = AudioDeviceID(did); + audioUnit = 0; + startTime = 0; + totalFrames = 0; + audioBuffer = 0; + internalBufferSize = QtMultimediaInternal::default_buffer_size; + clockFrequency = AudioGetHostClockFrequency() / 1000; + errorCode = QAudio::NoError; + stateCode = QAudio::StoppedState; + + intervalTimer = new QTimer(this); + intervalTimer->setInterval(1000); + connect(intervalTimer, SIGNAL(timeout()), SIGNAL(notify())); + } +} + +QAudioInputPrivate::~QAudioInputPrivate() +{ + close(); + delete audioDeviceInfo; +} + +bool QAudioInputPrivate::open() +{ + UInt32 size = 0; + + if (isOpen) + return true; + + ComponentDescription cd; + cd.componentType = kAudioUnitType_Output; + cd.componentSubType = kAudioUnitSubType_HALOutput; + cd.componentManufacturer = kAudioUnitManufacturer_Apple; + cd.componentFlags = 0; + cd.componentFlagsMask = 0; + + // Open + Component cp = FindNextComponent(NULL, &cd); + if (cp == 0) { + qWarning() << "QAudioInput: Failed to find HAL Output component"; + return false; + } + + if (OpenAComponent(cp, &audioUnit) != noErr) { + qWarning() << "QAudioInput: Unable to Open Output Component"; + return false; + } + + // Set mode + // switch to input mode + UInt32 enable = 1; + if (AudioUnitSetProperty(audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Input, + 1, + &enable, + sizeof(enable)) != noErr) { + qWarning() << "QAudioInput: Unable to switch to input mode (Enable Input)"; + return false; + } + + enable = 0; + if (AudioUnitSetProperty(audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Output, + 0, + &enable, + sizeof(enable)) != noErr) { + qWarning() << "QAudioInput: Unable to switch to input mode (Disable output)"; + return false; + } + + // register callback + AURenderCallbackStruct cb; + cb.inputProc = inputCallback; + cb.inputProcRefCon = this; + + if (AudioUnitSetProperty(audioUnit, + kAudioOutputUnitProperty_SetInputCallback, + kAudioUnitScope_Global, + 0, + &cb, + sizeof(cb)) != noErr) { + qWarning() << "QAudioInput: Failed to set AudioUnit callback"; + return false; + } + + // Set Audio Device + if (AudioUnitSetProperty(audioUnit, + kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, + 0, + &audioDeviceId, + sizeof(audioDeviceId)) != noErr) { + qWarning() << "QAudioInput: Unable to use configured device"; + return false; + } + + // Set format + // Wanted + streamFormat = toAudioStreamBasicDescription(audioFormat); + + // Required on unit + if (audioFormat == audioDeviceInfo->preferredFormat()) { + deviceFormat = streamFormat; + AudioUnitSetProperty(audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Output, + 1, + &deviceFormat, + sizeof(deviceFormat)); + } + else { + size = sizeof(deviceFormat); + if (AudioUnitGetProperty(audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, + 1, + &deviceFormat, + &size) != noErr) { + qWarning() << "QAudioInput: Unable to retrieve device format"; + return false; + } + + if (AudioUnitSetProperty(audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Output, + 1, + &deviceFormat, + sizeof(deviceFormat)) != noErr) { + qWarning() << "QAudioInput: Unable to set device format"; + return false; + } + } + + // Setup buffers + UInt32 numberOfFrames; + size = sizeof(UInt32); + if (AudioUnitGetProperty(audioUnit, + kAudioDevicePropertyBufferFrameSize, + kAudioUnitScope_Global, + 0, + &numberOfFrames, + &size) != noErr) { + qWarning() << "QAudioInput: Failed to get audio period size"; + return false; + } + + // Allocate buffer + periodSizeBytes = numberOfFrames * streamFormat.mBytesPerFrame; + + if (internalBufferSize < periodSizeBytes * 2) + internalBufferSize = periodSizeBytes * 2; + else + internalBufferSize -= internalBufferSize % streamFormat.mBytesPerFrame; + + audioBuffer = new QtMultimediaInternal::QAudioInputBuffer(internalBufferSize, + periodSizeBytes, + deviceFormat, + streamFormat, + this); + + audioIO = new QtMultimediaInternal::MacInputDevice(audioBuffer, this); + + // Init + if (AudioUnitInitialize(audioUnit) != noErr) { + qWarning() << "QAudioInput: Failed to initialize AudioUnit"; + return false; + } + + isOpen = true; + + return isOpen; +} + +void QAudioInputPrivate::close() +{ + if (audioUnit != 0) { + AudioOutputUnitStop(audioUnit); + AudioUnitUninitialize(audioUnit); + CloseComponent(audioUnit); + } + + delete audioBuffer; +} + +QAudioFormat QAudioInputPrivate::format() const +{ + return audioFormat; +} + +QIODevice* QAudioInputPrivate::start(QIODevice* device) +{ + QIODevice* op = device; + + if (!audioFormat.isValid() || !open()) { + stateCode = QAudio::StoppedState; + errorCode = QAudio::OpenError; + return audioIO; + } + + reset(); + audioBuffer->reset(); + audioBuffer->setFlushDevice(op); + + if (op == 0) + op = audioIO; + + // Start + startTime = AudioGetCurrentHostTime(); + totalFrames = 0; + + audioThreadStart(); + + stateCode = QAudio::ActiveState; + errorCode = QAudio::NoError; + emit stateChanged(stateCode); + + return op; +} + +void QAudioInputPrivate::stop() +{ + QMutexLocker lock(&mutex); + if (stateCode != QAudio::StoppedState) { + audioThreadStop(); + audioBuffer->flush(true); + + errorCode = QAudio::NoError; + stateCode = QAudio::StoppedState; + QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); + } +} + +void QAudioInputPrivate::reset() +{ + QMutexLocker lock(&mutex); + if (stateCode != QAudio::StoppedState) { + audioThreadStop(); + + errorCode = QAudio::NoError; + stateCode = QAudio::StoppedState; + QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); + } +} + +void QAudioInputPrivate::suspend() +{ + QMutexLocker lock(&mutex); + if (stateCode == QAudio::ActiveState || stateCode == QAudio::IdleState) { + audioThreadStop(); + + errorCode = QAudio::NoError; + stateCode = QAudio::SuspendedState; + QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); + } +} + +void QAudioInputPrivate::resume() +{ + QMutexLocker lock(&mutex); + if (stateCode == QAudio::SuspendedState) { + audioThreadStart(); + + errorCode = QAudio::NoError; + stateCode = QAudio::ActiveState; + QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); + } +} + +int QAudioInputPrivate::bytesReady() const +{ + return audioBuffer->used(); +} + +int QAudioInputPrivate::periodSize() const +{ + return periodSizeBytes; +} + +void QAudioInputPrivate::setBufferSize(int bs) +{ + internalBufferSize = bs; +} + +int QAudioInputPrivate::bufferSize() const +{ + return internalBufferSize; +} + +void QAudioInputPrivate::setNotifyInterval(int milliSeconds) +{ + if (intervalTimer->interval() == milliSeconds) + return; + + if (milliSeconds <= 0) + milliSeconds = 0; + + intervalTimer->setInterval(milliSeconds); +} + +int QAudioInputPrivate::notifyInterval() const +{ + return intervalTimer->interval(); +} + +qint64 QAudioInputPrivate::processedUSecs() const +{ + return totalFrames * 1000000 / audioFormat.frequency(); +} + +qint64 QAudioInputPrivate::elapsedUSecs() const +{ + if (stateCode == QAudio::StoppedState) + return 0; + + return (AudioGetCurrentHostTime() - startTime) / (clockFrequency / 1000); +} + +QAudio::Error QAudioInputPrivate::error() const +{ + return errorCode; +} + +QAudio::State QAudioInputPrivate::state() const +{ + return stateCode; +} + +void QAudioInputPrivate::audioThreadStop() +{ + stopTimers(); + if (audioThreadState.testAndSetAcquire(Running, Stopped)) + threadFinished.wait(&mutex); +} + +void QAudioInputPrivate::audioThreadStart() +{ + startTimers(); + audioThreadState = Running; + AudioOutputUnitStart(audioUnit); +} + +void QAudioInputPrivate::audioDeviceStop() +{ + AudioOutputUnitStop(audioUnit); + audioThreadState = Stopped; + threadFinished.wakeOne(); +} + +void QAudioInputPrivate::audioDeviceFull() +{ + QMutexLocker lock(&mutex); + if (stateCode == QAudio::ActiveState) { + audioDeviceStop(); + + errorCode = QAudio::UnderrunError; + stateCode = QAudio::IdleState; + QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection); + } +} + +void QAudioInputPrivate::audioDeviceError() +{ + QMutexLocker lock(&mutex); + if (stateCode == QAudio::ActiveState) { + audioDeviceStop(); + + errorCode = QAudio::IOError; + stateCode = QAudio::StoppedState; + QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection); + } +} + +void QAudioInputPrivate::startTimers() +{ + audioBuffer->startFlushTimer(); + if (intervalTimer->interval() > 0) + intervalTimer->start(); +} + +void QAudioInputPrivate::stopTimers() +{ + audioBuffer->stopFlushTimer(); + intervalTimer->stop(); +} + +void QAudioInputPrivate::deviceStopped() +{ + stopTimers(); + emit stateChanged(stateCode); +} + +// Input callback +OSStatus QAudioInputPrivate::inputCallback(void* inRefCon, + AudioUnitRenderActionFlags* ioActionFlags, + const AudioTimeStamp* inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList* ioData) +{ + Q_UNUSED(ioData); + + QAudioInputPrivate* d = static_cast(inRefCon); + + const int threadState = d->audioThreadState.fetchAndAddAcquire(0); + if (threadState == Stopped) + d->audioDeviceStop(); + else { + qint64 framesWritten; + + framesWritten = d->audioBuffer->renderFromDevice(d->audioUnit, + ioActionFlags, + inTimeStamp, + inBusNumber, + inNumberFrames); + + if (framesWritten > 0) + d->totalFrames += framesWritten; + else if (framesWritten == 0) + d->audioDeviceFull(); + else if (framesWritten < 0) + d->audioDeviceError(); + } + + return noErr; +} + + +QT_END_NAMESPACE + +#include "qaudioinput_mac_p.moc" + diff --git a/src/multimedia/multimedia/audio/qaudioinput_mac_p.h b/src/multimedia/multimedia/audio/qaudioinput_mac_p.h new file mode 100644 index 0000000..7aa4168 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput_mac_p.h @@ -0,0 +1,169 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + + +#ifndef QAUDIOINPUT_MAC_P_H +#define QAUDIOINPUT_MAC_P_H + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QTimer; +class QIODevice; +class QAbstractAudioDeviceInfo; + +namespace QtMultimediaInternal +{ +class QAudioInputBuffer; +} + +class QAudioInputPrivate : public QAbstractAudioInput +{ + Q_OBJECT + +public: + bool isOpen; + int periodSizeBytes; + int internalBufferSize; + qint64 totalFrames; + QAudioFormat audioFormat; + QIODevice* audioIO; + AudioUnit audioUnit; + AudioDeviceID audioDeviceId; + Float64 clockFrequency; + UInt64 startTime; + QAudio::Error errorCode; + QAudio::State stateCode; + QtMultimediaInternal::QAudioInputBuffer* audioBuffer; + QMutex mutex; + QWaitCondition threadFinished; + QAtomicInt audioThreadState; + QTimer* intervalTimer; + AudioStreamBasicDescription streamFormat; + AudioStreamBasicDescription deviceFormat; + QAbstractAudioDeviceInfo *audioDeviceInfo; + + QAudioInputPrivate(const QByteArray& device, QAudioFormat const& format); + ~QAudioInputPrivate(); + + bool open(); + void close(); + + QAudioFormat format() const; + + QIODevice* start(QIODevice* device); + void stop(); + void reset(); + void suspend(); + void resume(); + void idle(); + + int bytesReady() const; + int periodSize() const; + + void setBufferSize(int value); + int bufferSize() const; + + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + + QAudio::Error error() const; + QAudio::State state() const; + + void audioThreadStart(); + void audioThreadStop(); + + void audioDeviceStop(); + void audioDeviceFull(); + void audioDeviceError(); + + void startTimers(); + void stopTimers(); + +private slots: + void deviceStopped(); + +private: + enum { Running, Stopped }; + + // Input callback + static OSStatus inputCallback(void* inRefCon, + AudioUnitRenderActionFlags* ioActionFlags, + const AudioTimeStamp* inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList* ioData); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOINPUT_MAC_P_H diff --git a/src/multimedia/multimedia/audio/qaudioinput_symbian_p.cpp b/src/multimedia/multimedia/audio/qaudioinput_symbian_p.cpp new file mode 100644 index 0000000..52daa88 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput_symbian_p.cpp @@ -0,0 +1,594 @@ +/**************************************************************************** +** +** 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 "qaudioinput_symbian_p.h" + +QT_BEGIN_NAMESPACE + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +const int PushInterval = 50; // ms + + +//----------------------------------------------------------------------------- +// Private class +//----------------------------------------------------------------------------- + +SymbianAudioInputPrivate::SymbianAudioInputPrivate( + QAudioInputPrivate *audioDevice) + : m_audioDevice(audioDevice) +{ + +} + +SymbianAudioInputPrivate::~SymbianAudioInputPrivate() +{ + +} + +qint64 SymbianAudioInputPrivate::readData(char *data, qint64 len) +{ + qint64 totalRead = 0; + + if (m_audioDevice->state() == QAudio::ActiveState || + m_audioDevice->state() == QAudio::IdleState) { + + while (totalRead < len) { + const qint64 read = m_audioDevice->read(data + totalRead, + len - totalRead); + if (read > 0) + totalRead += read; + else + break; + } + } + + return totalRead; +} + +qint64 SymbianAudioInputPrivate::writeData(const char *data, qint64 len) +{ + Q_UNUSED(data) + Q_UNUSED(len) + return 0; +} + +void SymbianAudioInputPrivate::dataReady() +{ + emit readyRead(); +} + + +//----------------------------------------------------------------------------- +// Public functions +//----------------------------------------------------------------------------- + +QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, + const QAudioFormat &format) + : m_device(device) + , m_format(format) + , m_clientBufferSize(SymbianAudio::DefaultBufferSize) + , m_notifyInterval(SymbianAudio::DefaultNotifyInterval) + , m_notifyTimer(new QTimer(this)) + , m_error(QAudio::NoError) + , m_internalState(SymbianAudio::ClosedState) + , m_externalState(QAudio::StoppedState) + , m_pullMode(false) + , m_sink(0) + , m_pullTimer(new QTimer(this)) + , m_devSoundBuffer(0) + , m_devSoundBufferSize(0) + , m_totalBytesReady(0) + , m_devSoundBufferPos(0) + , m_totalSamplesRecorded(0) +{ + connect(m_notifyTimer.data(), SIGNAL(timeout()), this, SIGNAL(notify())); + + SymbianAudio::Utils::formatQtToNative(m_format, m_nativeFourCC, + m_nativeFormat); + + m_pullTimer->setInterval(PushInterval); + connect(m_pullTimer.data(), SIGNAL(timeout()), this, SLOT(pullData())); +} + +QAudioInputPrivate::~QAudioInputPrivate() +{ + close(); +} + +QIODevice* QAudioInputPrivate::start(QIODevice *device) +{ + stop(); + + open(); + if (SymbianAudio::ClosedState != m_internalState) { + if (device) { + m_pullMode = true; + m_sink = device; + } else { + m_sink = new SymbianAudioInputPrivate(this); + m_sink->open(QIODevice::ReadOnly | QIODevice::Unbuffered); + } + + m_elapsed.restart(); + } + + return m_sink; +} + +void QAudioInputPrivate::stop() +{ + close(); +} + +void QAudioInputPrivate::reset() +{ + m_totalSamplesRecorded += getSamplesRecorded(); + m_devSound->Stop(); + startRecording(); +} + +void QAudioInputPrivate::suspend() +{ + if (SymbianAudio::ActiveState == m_internalState + || SymbianAudio::IdleState == m_internalState) { + m_notifyTimer->stop(); + m_pullTimer->stop(); + m_devSound->Pause(); + const qint64 samplesRecorded = getSamplesRecorded(); + m_totalSamplesRecorded += samplesRecorded; + + if (m_devSoundBuffer) { + m_devSoundBufferQ.append(m_devSoundBuffer); + m_devSoundBuffer = 0; + } + + setState(SymbianAudio::SuspendedState); + } +} + +void QAudioInputPrivate::resume() +{ + if (SymbianAudio::SuspendedState == m_internalState) + startDataTransfer(); +} + +int QAudioInputPrivate::bytesReady() const +{ + Q_ASSERT(m_devSoundBufferPos <= m_totalBytesReady); + return m_totalBytesReady - m_devSoundBufferPos; +} + +int QAudioInputPrivate::periodSize() const +{ + return bufferSize(); +} + +void QAudioInputPrivate::setBufferSize(int value) +{ + // Note that DevSound does not allow its client to specify the buffer size. + // This functionality is available via custom interfaces, but since these + // cannot be guaranteed to work across all DevSound implementations, we + // do not use them here. + // In order to comply with the expected bevahiour of QAudioInput, we store + // the value and return it from bufferSize(), but the underlying DevSound + // buffer size remains unchanged. + if (value > 0) + m_clientBufferSize = value; +} + +int QAudioInputPrivate::bufferSize() const +{ + return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize; +} + +void QAudioInputPrivate::setNotifyInterval(int ms) +{ + if (ms > 0) { + const int oldNotifyInterval = m_notifyInterval; + m_notifyInterval = ms; + if (m_notifyTimer->isActive() && ms != oldNotifyInterval) + m_notifyTimer->start(m_notifyInterval); + } +} + +int QAudioInputPrivate::notifyInterval() const +{ + return m_notifyInterval; +} + +qint64 QAudioInputPrivate::processedUSecs() const +{ + int samplesPlayed = 0; + if (m_devSound && SymbianAudio::SuspendedState != m_internalState) + samplesPlayed = getSamplesRecorded(); + + // Protect against division by zero + Q_ASSERT_X(m_format.frequency() > 0, Q_FUNC_INFO, "Invalid frequency"); + + const qint64 result = qint64(1000000) * + (samplesPlayed + m_totalSamplesRecorded) + / m_format.frequency(); + + return result; +} + +qint64 QAudioInputPrivate::elapsedUSecs() const +{ + const qint64 result = (QAudio::StoppedState == state()) ? + 0 : m_elapsed.elapsed() * 1000; + return result; +} + +QAudio::Error QAudioInputPrivate::error() const +{ + return m_error; +} + +QAudio::State QAudioInputPrivate::state() const +{ + return m_externalState; +} + +QAudioFormat QAudioInputPrivate::format() const +{ + return m_format; +} + +//----------------------------------------------------------------------------- +// MDevSoundObserver implementation +//----------------------------------------------------------------------------- + +void QAudioInputPrivate::InitializeComplete(TInt aError) +{ + Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState, + Q_FUNC_INFO, "Invalid state"); + + if (KErrNone == aError) + startRecording(); +} + +void QAudioInputPrivate::ToneFinished(TInt aError) +{ + Q_UNUSED(aError) + // This class doesn't use DevSound's tone playback functions, so should + // never receive this callback. + Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); +} + +void QAudioInputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer) +{ + Q_UNUSED(aBuffer) + // This class doesn't use DevSound in play mode, so should never receive + // this callback. + Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); +} + +void QAudioInputPrivate::PlayError(TInt aError) +{ + Q_UNUSED(aError) + // This class doesn't use DevSound in play mode, so should never receive + // this callback. + Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); +} + +void QAudioInputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer) +{ + // Following receipt of this callback, DevSound should not provide another + // buffer until we have returned the current one. + Q_ASSERT_X(!m_devSoundBuffer, Q_FUNC_INFO, "Buffer already held"); + + CMMFDataBuffer *const buffer = static_cast(aBuffer); + + if (!m_devSoundBufferSize) + m_devSoundBufferSize = buffer->Data().MaxLength(); + + m_totalBytesReady += buffer->Data().Length(); + + if (SymbianAudio::SuspendedState == m_internalState) { + m_devSoundBufferQ.append(buffer); + } else { + // Will be returned to DevSound by bufferEmptied(). + m_devSoundBuffer = buffer; + m_devSoundBufferPos = 0; + + if (bytesReady() && !m_pullMode) + pushData(); + } +} + +void QAudioInputPrivate::RecordError(TInt aError) +{ + Q_UNUSED(aError) + setError(QAudio::IOError); +} + +void QAudioInputPrivate::ConvertError(TInt aError) +{ + Q_UNUSED(aError) + // This class doesn't use DevSound's format conversion functions, so + // should never receive this callback. + Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); +} + +void QAudioInputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) +{ + Q_UNUSED(aMessageType) + Q_UNUSED(aMsg) + // Ignore this callback. +} + +//----------------------------------------------------------------------------- +// Private functions +//----------------------------------------------------------------------------- + +void QAudioInputPrivate::open() +{ + Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState, + Q_FUNC_INFO, "DevSound already opened"); + + QT_TRAP_THROWING( m_devSound.reset(CMMFDevSound::NewL()) ) + + QScopedPointer caps( + new SymbianAudio::DevSoundCapabilities(*m_devSound, QAudio::AudioInput)); + + int err = SymbianAudio::Utils::isFormatSupported(m_format, *caps) ? + KErrNone : KErrNotSupported; + + if (KErrNone == err) { + setState(SymbianAudio::InitializingState); + TRAP(err, m_devSound->InitializeL(*this, m_nativeFourCC, + EMMFStateRecording)); + } + + if (KErrNone != err) { + setError(QAudio::OpenError); + m_devSound.reset(); + } +} + +void QAudioInputPrivate::startRecording() +{ + const int samplesRecorded = m_devSound->SamplesRecorded(); + Q_ASSERT(samplesRecorded == 0); + + TRAPD(err, startDevSoundL()); + if (KErrNone == err) { + startDataTransfer(); + } else { + setError(QAudio::OpenError); + close(); + } +} + +void QAudioInputPrivate::startDevSoundL() +{ + TMMFCapabilities nativeFormat = m_devSound->Config(); + m_nativeFormat.iBufferSize = nativeFormat.iBufferSize; + m_devSound->SetConfigL(m_nativeFormat); + m_devSound->RecordInitL(); +} + +void QAudioInputPrivate::startDataTransfer() +{ + m_notifyTimer->start(m_notifyInterval); + + if (m_pullMode) + m_pullTimer->start(); + + if (bytesReady()) { + setState(SymbianAudio::ActiveState); + if (!m_pullMode) + pushData(); + } else { + if (SymbianAudio::SuspendedState == m_internalState) + setState(SymbianAudio::ActiveState); + else + setState(SymbianAudio::IdleState); + } +} + +CMMFDataBuffer* QAudioInputPrivate::currentBuffer() const +{ + CMMFDataBuffer *result = m_devSoundBuffer; + if (!result && !m_devSoundBufferQ.empty()) + result = m_devSoundBufferQ.front(); + return result; +} + +void QAudioInputPrivate::pushData() +{ + Q_ASSERT_X(bytesReady(), Q_FUNC_INFO, "No data available"); + Q_ASSERT_X(!m_pullMode, Q_FUNC_INFO, "pushData called when in pull mode"); + qobject_cast(m_sink)->dataReady(); +} + +qint64 QAudioInputPrivate::read(char *data, qint64 len) +{ + // SymbianAudioInputPrivate is ready to read data + + Q_ASSERT_X(!m_pullMode, Q_FUNC_INFO, + "read called when in pull mode"); + + qint64 bytesRead = 0; + + CMMFDataBuffer *buffer = 0; + while ((buffer = currentBuffer()) && (bytesRead < len)) { + if (SymbianAudio::IdleState == m_internalState) + setState(SymbianAudio::ActiveState); + + TDesC8 &inputBuffer = buffer->Data(); + + const qint64 inputBytes = bytesReady(); + const qint64 outputBytes = len - bytesRead; + const qint64 copyBytes = outputBytes < inputBytes ? + outputBytes : inputBytes; + + memcpy(data, inputBuffer.Ptr() + m_devSoundBufferPos, copyBytes); + + m_devSoundBufferPos += copyBytes; + data += copyBytes; + bytesRead += copyBytes; + + if (!bytesReady()) + bufferEmptied(); + } + + return bytesRead; +} + +void QAudioInputPrivate::pullData() +{ + Q_ASSERT_X(m_pullMode, Q_FUNC_INFO, + "pullData called when in push mode"); + + CMMFDataBuffer *buffer = 0; + while (buffer = currentBuffer()) { + if (SymbianAudio::IdleState == m_internalState) + setState(SymbianAudio::ActiveState); + + TDesC8 &inputBuffer = buffer->Data(); + + const qint64 inputBytes = bytesReady(); + const qint64 bytesPushed = m_sink->write( + (char*)inputBuffer.Ptr() + m_devSoundBufferPos, inputBytes); + + m_devSoundBufferPos += bytesPushed; + + if (!bytesReady()) + bufferEmptied(); + + if (!bytesPushed) + break; + } +} + +void QAudioInputPrivate::bufferEmptied() +{ + m_devSoundBufferPos = 0; + + if (m_devSoundBuffer) { + m_totalBytesReady -= m_devSoundBuffer->Data().Length(); + m_devSoundBuffer = 0; + m_devSound->RecordData(); + } else { + Q_ASSERT(!m_devSoundBufferQ.empty()); + m_totalBytesReady -= m_devSoundBufferQ.front()->Data().Length(); + m_devSoundBufferQ.erase(m_devSoundBufferQ.begin()); + + // If the queue has been emptied, resume transfer from the hardware + if (m_devSoundBufferQ.empty()) + m_devSound->RecordInitL(); + } + + Q_ASSERT(m_totalBytesReady >= 0); +} + +void QAudioInputPrivate::close() +{ + m_notifyTimer->stop(); + m_pullTimer->stop(); + + m_error = QAudio::NoError; + + if (m_devSound) + m_devSound->Stop(); + m_devSound.reset(); + m_devSoundBuffer = 0; + m_devSoundBufferSize = 0; + m_totalBytesReady = 0; + + if (!m_pullMode) // m_sink is owned + delete m_sink; + m_pullMode = false; + m_sink = 0; + + m_devSoundBufferQ.clear(); + m_devSoundBufferPos = 0; + m_totalSamplesRecorded = 0; + + setState(SymbianAudio::ClosedState); +} + +qint64 QAudioInputPrivate::getSamplesRecorded() const +{ + qint64 result = 0; + if (m_devSound) + result = qint64(m_devSound->SamplesRecorded()); + return result; +} + +void QAudioInputPrivate::setError(QAudio::Error error) +{ + m_error = error; + + // Although no state transition actually occurs here, a stateChanged event + // must be emitted to inform the client that the call to start() was + // unsuccessful. + if (QAudio::OpenError == error) + emit stateChanged(QAudio::StoppedState); + + // Close the DevSound instance. This causes a transition to StoppedState. + // This must be done asynchronously in case the current function was called + // from a DevSound event handler, in which case deleting the DevSound + // instance may cause an exception. + QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection); +} + +void QAudioInputPrivate::setState(SymbianAudio::State newInternalState) +{ + const QAudio::State oldExternalState = m_externalState; + m_internalState = newInternalState; + m_externalState = SymbianAudio::Utils::stateNativeToQt( + m_internalState, initializingState()); + + if (m_externalState != oldExternalState) + emit stateChanged(m_externalState); +} + +QAudio::State QAudioInputPrivate::initializingState() const +{ + return QAudio::IdleState; +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudioinput_symbian_p.h b/src/multimedia/multimedia/audio/qaudioinput_symbian_p.h new file mode 100644 index 0000000..ca3ccf7 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput_symbian_p.h @@ -0,0 +1,188 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + +#ifndef QAUDIOINPUT_SYMBIAN_P_H +#define QAUDIOINPUT_SYMBIAN_P_H + +#include +#include +#include +#include +#include "qaudio_symbian_p.h" + +QT_BEGIN_NAMESPACE + +class QAudioInputPrivate; + +class SymbianAudioInputPrivate : public QIODevice +{ + friend class QAudioInputPrivate; + Q_OBJECT +public: + SymbianAudioInputPrivate(QAudioInputPrivate *audio); + ~SymbianAudioInputPrivate(); + + qint64 readData(char *data, qint64 len); + qint64 writeData(const char *data, qint64 len); + + void dataReady(); + +private: + QAudioInputPrivate *const m_audioDevice; +}; + +class QAudioInputPrivate + : public QAbstractAudioInput + , public MDevSoundObserver +{ + friend class SymbianAudioInputPrivate; + Q_OBJECT +public: + QAudioInputPrivate(const QByteArray &device, + const QAudioFormat &audioFormat); + ~QAudioInputPrivate(); + + // QAbstractAudioInput + QIODevice* start(QIODevice *device = 0); + void stop(); + void reset(); + void suspend(); + void resume(); + int bytesReady() const; + int periodSize() const; + void setBufferSize(int value); + int bufferSize() const; + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + QAudio::Error error() const; + QAudio::State state() const; + QAudioFormat format() const; + + // MDevSoundObserver + void InitializeComplete(TInt aError); + void ToneFinished(TInt aError); + void BufferToBeFilled(CMMFBuffer *aBuffer); + void PlayError(TInt aError); + void BufferToBeEmptied(CMMFBuffer *aBuffer); + void RecordError(TInt aError); + void ConvertError(TInt aError); + void DeviceMessage(TUid aMessageType, const TDesC8 &aMsg); + +private slots: + void pullData(); + +private: + void open(); + void startRecording(); + void startDevSoundL(); + void startDataTransfer(); + CMMFDataBuffer* currentBuffer() const; + void pushData(); + qint64 read(char *data, qint64 len); + void bufferEmptied(); + Q_INVOKABLE void close(); + + qint64 getSamplesRecorded() const; + + void setError(QAudio::Error error); + void setState(SymbianAudio::State state); + + QAudio::State initializingState() const; + +private: + const QByteArray m_device; + const QAudioFormat m_format; + + int m_clientBufferSize; + int m_notifyInterval; + QScopedPointer m_notifyTimer; + QTime m_elapsed; + QAudio::Error m_error; + + SymbianAudio::State m_internalState; + QAudio::State m_externalState; + + bool m_pullMode; + QIODevice *m_sink; + + QScopedPointer m_pullTimer; + + QScopedPointer m_devSound; + TUint32 m_nativeFourCC; + TMMFCapabilities m_nativeFormat; + + // Latest buffer provided by DevSound, to be empied of data. + CMMFDataBuffer *m_devSoundBuffer; + + int m_devSoundBufferSize; + + // Total amount of data in buffers provided by DevSound + int m_totalBytesReady; + + // Queue of buffers returned after call to CMMFDevSound::Pause(). + QList m_devSoundBufferQ; + + // Current read position within m_devSoundBuffer + qint64 m_devSoundBufferPos; + + // Samples recorded up to the last call to suspend(). It is necessary + // to cache this because suspend() is implemented using + // CMMFDevSound::Stop(), which resets DevSound's SamplesRecorded() counter. + quint32 m_totalSamplesRecorded; + +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/multimedia/audio/qaudioinput_win32_p.cpp new file mode 100644 index 0000000..b5d673e --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput_win32_p.cpp @@ -0,0 +1,613 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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 "qaudioinput_win32_p.h" + +QT_BEGIN_NAMESPACE + +//#define DEBUG_AUDIO 1 + +static const int minimumIntervalTime = 50; + +QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): + settings(audioFormat) +{ + bytesAvailable = 0; + buffer_size = 0; + period_size = 0; + m_device = device; + totalTimeValue = 0; + intervalTime = 1000; + errorState = QAudio::NoError; + deviceState = QAudio::StoppedState; + audioSource = 0; + pullMode = true; + resuming = false; + finished = false; + + connect(this,SIGNAL(processMore()),SLOT(deviceReady())); + + InitializeCriticalSection(&waveInCriticalSection); +} + +QAudioInputPrivate::~QAudioInputPrivate() +{ + stop(); + DeleteCriticalSection(&waveInCriticalSection); +} + +void QT_WIN_CALLBACK QAudioInputPrivate::waveInProc( HWAVEIN hWaveIn, UINT uMsg, + DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ) +{ + Q_UNUSED(dwParam1) + Q_UNUSED(dwParam2) + Q_UNUSED(hWaveIn) + + QAudioInputPrivate* qAudio; + qAudio = (QAudioInputPrivate*)(dwInstance); + if(!qAudio) + return; + + switch(uMsg) { + case WIM_OPEN: + break; + case WIM_DATA: + EnterCriticalSection(&qAudio->waveInCriticalSection); + if(qAudio->waveFreeBlockCount > 0) + qAudio->waveFreeBlockCount--; + qAudio->feedback(); + LeaveCriticalSection(&qAudio->waveInCriticalSection); + break; + case WIM_CLOSE: + EnterCriticalSection(&qAudio->waveInCriticalSection); + qAudio->finished = true; + LeaveCriticalSection(&qAudio->waveInCriticalSection); + break; + default: + return; + } +} + +WAVEHDR* QAudioInputPrivate::allocateBlocks(int size, int count) +{ + int i; + unsigned char* buffer; + WAVEHDR* blocks; + DWORD totalBufferSize = (size + sizeof(WAVEHDR))*count; + + if((buffer=(unsigned char*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, + totalBufferSize)) == 0) { + qWarning("QAudioInput: Memory allocation error"); + return 0; + } + blocks = (WAVEHDR*)buffer; + buffer += sizeof(WAVEHDR)*count; + for(i = 0; i < count; i++) { + blocks[i].dwBufferLength = size; + blocks[i].lpData = (LPSTR)buffer; + blocks[i].dwBytesRecorded=0; + blocks[i].dwUser = 0L; + blocks[i].dwFlags = 0L; + blocks[i].dwLoops = 0L; + result = waveInPrepareHeader(hWaveIn,&blocks[i], sizeof(WAVEHDR)); + if(result != MMSYSERR_NOERROR) { + qWarning("QAudioInput: Can't prepare block %d",i); + return 0; + } + buffer += size; + } + return blocks; +} + +void QAudioInputPrivate::freeBlocks(WAVEHDR* blockArray) +{ + WAVEHDR* blocks = blockArray; + + int count = buffer_size/period_size; + + for(int i = 0; i < count; i++) { + waveInUnprepareHeader(hWaveIn,&blocks[i], sizeof(WAVEHDR)); + blocks+=sizeof(WAVEHDR); + } + HeapFree(GetProcessHeap(), 0, blockArray); +} + +QAudio::Error QAudioInputPrivate::error() const +{ + return errorState; +} + +QAudio::State QAudioInputPrivate::state() const +{ + return deviceState; +} + +QAudioFormat QAudioInputPrivate::format() const +{ + return settings; +} + +QIODevice* QAudioInputPrivate::start(QIODevice* device) +{ + if(deviceState != QAudio::StoppedState) + close(); + + if(!pullMode && audioSource) { + delete audioSource; + } + + if(device) { + //set to pull mode + pullMode = true; + audioSource = device; + deviceState = QAudio::ActiveState; + } else { + //set to push mode + pullMode = false; + deviceState = QAudio::IdleState; + audioSource = new InputPrivate(this); + audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered); + } + + if( !open() ) + return 0; + + emit stateChanged(deviceState); + + return audioSource; +} + +void QAudioInputPrivate::stop() +{ + if(deviceState == QAudio::StoppedState) + return; + + close(); + emit stateChanged(deviceState); +} + +bool QAudioInputPrivate::open() +{ +#ifdef DEBUG_AUDIO + QTime now(QTime::currentTime()); + qDebug()<> 3) * wfx.nChannels; + wfx.nAvgBytesPerSec = wfx.nBlockAlign * wfx.nSamplesPerSec; + + UINT_PTR devId = WAVE_MAPPER; + + WAVEINCAPS wic; + unsigned long iNumDevs,ii; + iNumDevs = waveInGetNumDevs(); + for(ii=0;ii 0 && waveBlocks[header].dwFlags & WHDR_DONE) { + if(pullMode) { + l = audioSource->write(waveBlocks[header].lpData, + waveBlocks[header].dwBytesRecorded); +#ifdef DEBUG_AUDIO + qDebug()<<"IN: "<= buffer_size/period_size) + header = 0; + p+=l; + + EnterCriticalSection(&waveInCriticalSection); + if(!pullMode) { + if(l+period_size > len && waveFreeBlockCount == buffer_size/period_size) + done = true; + } else { + if(waveFreeBlockCount == buffer_size/period_size) + done = true; + } + LeaveCriticalSection(&waveInCriticalSection); + + written+=l; + } +#ifdef DEBUG_AUDIO + qDebug()<<"read in len="<= minimumIntervalTime) + intervalTime = ms; + else + intervalTime = minimumIntervalTime; +} + +int QAudioInputPrivate::notifyInterval() const +{ + return intervalTime; +} + +qint64 QAudioInputPrivate::processedUSecs() const +{ + if (deviceState == QAudio::StoppedState) + return 0; + qint64 result = qint64(1000000) * totalTimeValue / + (settings.channels()*(settings.sampleSize()/8)) / + settings.frequency(); + + return result; +} + +void QAudioInputPrivate::suspend() +{ + if(deviceState == QAudio::ActiveState) { + waveInReset(hWaveIn); + deviceState = QAudio::SuspendedState; + emit stateChanged(deviceState); + } +} + +void QAudioInputPrivate::feedback() +{ +#ifdef DEBUG_AUDIO + QTime now(QTime::currentTime()); + qDebug()<(audioSource); + a->trigger(); + } + + if((timeStamp.elapsed() + elapsedTimeOffset) > intervalTime) { + emit notify(); + elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime; + timeStamp.restart(); + } + return true; +} + +qint64 QAudioInputPrivate::elapsedUSecs() const +{ + if (deviceState == QAudio::StoppedState) + return 0; + + return timeStampOpened.elapsed()*1000; +} + +void QAudioInputPrivate::reset() +{ + close(); +} + +InputPrivate::InputPrivate(QAudioInputPrivate* audio) +{ + audioDevice = qobject_cast(audio); +} + +InputPrivate::~InputPrivate() {} + +qint64 InputPrivate::readData( char* data, qint64 len) +{ + // push mode, user read() called + if(audioDevice->deviceState != QAudio::ActiveState && + audioDevice->deviceState != QAudio::IdleState) + return 0; + // Read in some audio data + return audioDevice->read(data,len); +} + +qint64 InputPrivate::writeData(const char* data, qint64 len) +{ + Q_UNUSED(data) + Q_UNUSED(len) + + emit readyRead(); + return 0; +} + +void InputPrivate::trigger() +{ + emit readyRead(); +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudioinput_win32_p.h b/src/multimedia/multimedia/audio/qaudioinput_win32_p.h new file mode 100644 index 0000000..66c2535 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudioinput_win32_p.h @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + +#ifndef QAUDIOINPUTWIN_H +#define QAUDIOINPUTWIN_H + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +QT_BEGIN_NAMESPACE + +class QAudioInputPrivate : public QAbstractAudioInput +{ + Q_OBJECT +public: + QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat); + ~QAudioInputPrivate(); + + qint64 read(char* data, qint64 len); + + QAudioFormat format() const; + QIODevice* start(QIODevice* device = 0); + void stop(); + void reset(); + void suspend(); + void resume(); + int bytesReady() const; + int periodSize() const; + void setBufferSize(int value); + int bufferSize() const; + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + QAudio::Error error() const; + QAudio::State state() const; + + QIODevice* audioSource; + QAudioFormat settings; + QAudio::Error errorState; + QAudio::State deviceState; + +private: + qint32 buffer_size; + qint32 period_size; + qint32 header; + QByteArray m_device; + int bytesAvailable; + int intervalTime; + QTime timeStamp; + qint64 elapsedTimeOffset; + QTime timeStampOpened; + qint64 totalTimeValue; + bool pullMode; + bool resuming; + WAVEFORMATEX wfx; + HWAVEIN hWaveIn; + MMRESULT result; + WAVEHDR* waveBlocks; + volatile bool finished; + volatile int waveFreeBlockCount; + int waveCurrentBlock; + + CRITICAL_SECTION waveInCriticalSection; + static void QT_WIN_CALLBACK waveInProc( HWAVEIN hWaveIn, UINT uMsg, + DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ); + + WAVEHDR* allocateBlocks(int size, int count); + void freeBlocks(WAVEHDR* blockArray); + bool open(); + void close(); + +private slots: + void feedback(); + bool deviceReady(); + +signals: + void processMore(); +}; + +class InputPrivate : public QIODevice +{ + Q_OBJECT +public: + InputPrivate(QAudioInputPrivate* audio); + ~InputPrivate(); + + qint64 readData( char* data, qint64 len); + qint64 writeData(const char* data, qint64 len); + + void trigger(); +private: + QAudioInputPrivate *audioDevice; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/audio/qaudiooutput.cpp b/src/multimedia/multimedia/audio/qaudiooutput.cpp new file mode 100644 index 0000000..b0b5244 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiooutput.cpp @@ -0,0 +1,411 @@ +/**************************************************************************** +** +** 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 + +#include "qaudiodevicefactory_p.h" + + +QT_BEGIN_NAMESPACE + +/*! + \class QAudioOutput + \brief The QAudioOutput class provides an interface for sending audio data to an audio output device. + + \inmodule QtMultimedia + \ingroup multimedia + \since 4.6 + + You can construct an audio output with the system's + \l{QAudioDeviceInfo::defaultOutputDevice()}{default audio output + device}. It is also possible to create QAudioOutput with a + specific QAudioDeviceInfo. When you create the audio output, you + should also send in the QAudioFormat to be used for the playback + (see the QAudioFormat class description for details). + + To play a file: + + Starting to play an audio stream is simply a matter of calling + start() with a QIODevice. QAudioOutput will then fetch the data it + needs from the io device. So playing back an audio file is as + simple as: + + \code + QFile inputFile; // class member. + QAudioOutput* audio; // class member. + \endcode + + \code + inputFile.setFileName("/tmp/test.raw"); + inputFile.open(QIODevice::ReadOnly); + + QAudioFormat format; + // Set up the format, eg. + format.setFrequency(8000); + format.setChannels(1); + format.setSampleSize(8); + format.setCodec("audio/pcm"); + format.setByteOrder(QAudioFormat::LittleEndian); + format.setSampleType(QAudioFormat::UnSignedInt); + + QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice()); + if (!info.isFormatSupported(format)) { + qWarning()<<"raw audio format not supported by backend, cannot play audio."; + return; + } + + audio = new QAudioOutput(format, this); + connect(audio,SIGNAL(stateChanged(QAudio::State)),SLOT(finishedPlaying(QAudio::State))); + audio->start(&inputFile); + + \endcode + + The file will start playing assuming that the audio system and + output device support it. If you run out of luck, check what's + up with the error() function. + + After the file has finished playing, we need to stop the device: + + \code + void finishedPlaying(QAudio::State state) + { + if(state == QAudio::IdleState) { + audio->stop(); + inputFile.close(); + delete audio; + } + } + \endcode + + At any given time, the QAudioOutput will be in one of four states: + active, suspended, stopped, or idle. These states are described + by the QAudio::State enum. + State changes are reported through the stateChanged() signal. You + can use this signal to, for instance, update the GUI of the + application; the mundane example here being changing the state of + a \c { play/pause } button. You request a state change directly + with suspend(), stop(), reset(), resume(), and start(). + + While the stream is playing, you can set a notify interval in + milliseconds with setNotifyInterval(). This interval specifies the + time between two emissions of the notify() signal. This is + relative to the position in the stream, i.e., if the QAudioOutput + is in the SuspendedState or the IdleState, the notify() signal is + not emitted. A typical use-case would be to update a + \l{QSlider}{slider} that allows seeking in the stream. + If you want the time since playback started regardless of which + states the audio output has been in, elapsedUSecs() is the function for you. + + If an error occurs, you can fetch the \l{QAudio::Error}{error + type} with the error() function. Please see the QAudio::Error enum + for a description of the possible errors that are reported. When + an error is encountered, the state changes to QAudio::StoppedState. + You can check for errors by connecting to the stateChanged() + signal: + + \snippet doc/src/snippets/audio/main.cpp 3 + + \sa QAudioInput, QAudioDeviceInfo +*/ + +/*! + Construct a new audio output and attach it to \a parent. + The default audio output device is used with the output + \a format parameters. +*/ + +QAudioOutput::QAudioOutput(const QAudioFormat &format, QObject *parent): + QObject(parent) +{ + d = QAudioDeviceFactory::createDefaultOutputDevice(format); + connect(d, SIGNAL(notify()), SIGNAL(notify())); + connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); +} + +/*! + Construct a new audio output and attach it to \a parent. + The device referenced by \a audioDevice is used with the output + \a format parameters. +*/ + +QAudioOutput::QAudioOutput(const QAudioDeviceInfo &audioDevice, const QAudioFormat &format, QObject *parent): + QObject(parent) +{ + d = QAudioDeviceFactory::createOutputDevice(audioDevice, format); + connect(d, SIGNAL(notify()), SIGNAL(notify())); + connect(d, SIGNAL(stateChanged(QAudio::State)), SIGNAL(stateChanged(QAudio::State))); +} + +/*! + Destroys this audio output. +*/ + +QAudioOutput::~QAudioOutput() +{ + delete d; +} + +/*! + Returns the QAudioFormat being used. + +*/ + +QAudioFormat QAudioOutput::format() const +{ + return d->format(); +} + +/*! + Uses the \a device as the QIODevice to transfer data. + Passing a QIODevice allows the data to be transfered without any extra code. + All that is required is to open the QIODevice. + + If able to successfully output audio data to the systems audio device the + state() is set to QAudio::ActiveState, error() is set to QAudio::NoError + and the stateChanged() signal is emitted. + + If a problem occurs during this process the error() is set to QAudio::OpenError, + state() is set to QAudio::StoppedState and stateChanged() signal is emitted. + + \sa QIODevice +*/ + +void QAudioOutput::start(QIODevice* device) +{ + d->start(device); +} + +/*! + Returns a pointer to the QIODevice being used to handle the data + transfer. This QIODevice can be used to write() audio data directly. + + If able to access the systems audio device the state() is set to + QAudio::IdleState, error() is set to QAudio::NoError + and the stateChanged() signal is emitted. + + If a problem occurs during this process the error() is set to QAudio::OpenError, + state() is set to QAudio::StoppedState and stateChanged() signal is emitted. + + \sa QIODevice +*/ + +QIODevice* QAudioOutput::start() +{ + return d->start(0); +} + +/*! + Stops the audio output, detaching from the system resource. + + Sets error() to QAudio::NoError, state() to QAudio::StoppedState and + emit stateChanged() signal. +*/ + +void QAudioOutput::stop() +{ + d->stop(); +} + +/*! + Drops all audio data in the buffers, resets buffers to zero. +*/ + +void QAudioOutput::reset() +{ + d->reset(); +} + +/*! + Stops processing audio data, preserving buffered audio data. + + Sets error() to QAudio::NoError, state() to QAudio::SuspendedState and + emit stateChanged() signal. +*/ + +void QAudioOutput::suspend() +{ + d->suspend(); +} + +/*! + Resumes processing audio data after a suspend(). + + Sets error() to QAudio::NoError. + Sets state() to QAudio::ActiveState if you previously called start(QIODevice*). + Sets state() to QAudio::IdleState if you previously called start(). + emits stateChanged() signal. +*/ + +void QAudioOutput::resume() +{ + d->resume(); +} + +/*! + Returns the free space available in bytes in the audio buffer. + + NOTE: returned value is only valid while in QAudio::ActiveState or QAudio::IdleState + state, otherwise returns zero. +*/ + +int QAudioOutput::bytesFree() const +{ + return d->bytesFree(); +} + +/*! + Returns the period size in bytes. + + Note: This is the recommended write size in bytes. +*/ + +int QAudioOutput::periodSize() const +{ + return d->periodSize(); +} + +/*! + Sets the audio buffer size to \a value in bytes. + + Note: This function can be called anytime before start(), calls to this + are ignored after start(). It should not be assumed that the buffer size + set is the actual buffer size used, calling bufferSize() anytime after start() + will return the actual buffer size being used. +*/ + +void QAudioOutput::setBufferSize(int value) +{ + d->setBufferSize(value); +} + +/*! + Returns the audio buffer size in bytes. + + If called before start(), returns platform default value. + If called before start() but setBufferSize() was called prior, returns value set by setBufferSize(). + If called after start(), returns the actual buffer size being used. This may not be what was set previously + by setBufferSize(). + +*/ + +int QAudioOutput::bufferSize() const +{ + return d->bufferSize(); +} + +/*! + Sets the interval for notify() signal to be emitted. + This is based on the \a ms of audio data processed + not on actual real-time. + The minimum resolution of the timer is platform specific and values + should be checked with notifyInterval() to confirm actual value + being used. +*/ + +void QAudioOutput::setNotifyInterval(int ms) +{ + d->setNotifyInterval(ms); +} + +/*! + Returns the notify interval in milliseconds. +*/ + +int QAudioOutput::notifyInterval() const +{ + return d->notifyInterval(); +} + +/*! + Returns the amount of audio data processed since start() + was called in microseconds. +*/ + +qint64 QAudioOutput::processedUSecs() const +{ + return d->processedUSecs(); +} + +/*! + Returns the microseconds since start() was called, including time in Idle and + Suspend states. +*/ + +qint64 QAudioOutput::elapsedUSecs() const +{ + return d->elapsedUSecs(); +} + +/*! + Returns the error state. +*/ + +QAudio::Error QAudioOutput::error() const +{ + return d->error(); +} + +/*! + Returns the state of audio processing. +*/ + +QAudio::State QAudioOutput::state() const +{ + return d->state(); +} + +/*! + \fn QAudioOutput::stateChanged(QAudio::State state) + This signal is emitted when the device \a state has changed. + This is the current state of the audio output. +*/ + +/*! + \fn QAudioOutput::notify() + This signal is emitted when x ms of audio data has been processed + the interval set by setNotifyInterval(x). +*/ + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudiooutput.h b/src/multimedia/multimedia/audio/qaudiooutput.h new file mode 100644 index 0000000..0f45b1b --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiooutput.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** 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 QAUDIOOUTPUT_H +#define QAUDIOOUTPUT_H + +#include +#include + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QAbstractAudioOutput; + +class Q_MULTIMEDIA_EXPORT QAudioOutput : public QObject +{ + Q_OBJECT + +public: + explicit QAudioOutput(const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); + explicit QAudioOutput(const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); + ~QAudioOutput(); + + QAudioFormat format() const; + + void start(QIODevice *device); + QIODevice* start(); + + void stop(); + void reset(); + void suspend(); + void resume(); + + void setBufferSize(int bytes); + int bufferSize() const; + + int bytesFree() const; + int periodSize() const; + + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + + QAudio::Error error() const; + QAudio::State state() const; + +Q_SIGNALS: + void stateChanged(QAudio::State); + void notify(); + +private: + Q_DISABLE_COPY(QAudioOutput) + + QAbstractAudioOutput* d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOOUTPUT_H diff --git a/src/multimedia/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/multimedia/audio/qaudiooutput_alsa_p.cpp new file mode 100644 index 0000000..cf3726b --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiooutput_alsa_p.cpp @@ -0,0 +1,780 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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 "qaudiooutput_alsa_p.h" +#include "qaudiodeviceinfo_alsa_p.h" + +QT_BEGIN_NAMESPACE + +//#define DEBUG_AUDIO 1 + +static const int minimumIntervalTime = 50; + +QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): + settings(audioFormat) +{ + bytesAvailable = 0; + handle = 0; + ahandler = 0; + access = SND_PCM_ACCESS_RW_INTERLEAVED; + pcmformat = SND_PCM_FORMAT_S16; + buffer_frames = 0; + period_frames = 0; + buffer_size = 0; + period_size = 0; + buffer_time = 100000; + period_time = 20000; + totalTimeValue = 0; + intervalTime = 1000; + audioBuffer = 0; + errorState = QAudio::NoError; + deviceState = QAudio::StoppedState; + audioSource = 0; + pullMode = true; + resuming = false; + opened = false; + + QStringList list1 = QString(QLatin1String(device)).split(QLatin1String(":")); + m_device = QByteArray(list1.at(0).toLocal8Bit().constData()); + + timer = new QTimer(this); + connect(timer,SIGNAL(timeout()),SLOT(userFeed())); +} + +QAudioOutputPrivate::~QAudioOutputPrivate() +{ + close(); + disconnect(timer, SIGNAL(timeout())); + QCoreApplication::processEvents(); + delete timer; +} + +QAudio::Error QAudioOutputPrivate::error() const +{ + return errorState; +} + +QAudio::State QAudioOutputPrivate::state() const +{ + return deviceState; +} + +void QAudioOutputPrivate::async_callback(snd_async_handler_t *ahandler) +{ + QAudioOutputPrivate* audioOut; + + audioOut = static_cast + (snd_async_handler_get_callback_private(ahandler)); + + if((audioOut->deviceState==QAudio::ActiveState)||(audioOut->resuming)) + audioOut->feedback(); +} + +int QAudioOutputPrivate::xrun_recovery(int err) +{ + int count = 0; + bool reset = false; + + if(err == -EPIPE) { + errorState = QAudio::UnderrunError; + err = snd_pcm_prepare(handle); + if(err < 0) + reset = true; + + } else if((err == -ESTRPIPE)||(err == -EIO)) { + errorState = QAudio::IOError; + while((err = snd_pcm_resume(handle)) == -EAGAIN){ + usleep(100); + count++; + if(count > 5) { + reset = true; + break; + } + } + if(err < 0) { + err = snd_pcm_prepare(handle); + if(err < 0) + reset = true; + } + } + if(reset) { + close(); + open(); + snd_pcm_prepare(handle); + return 0; + } + return err; +} + +int QAudioOutputPrivate::setFormat() +{ + snd_pcm_format_t pcmformat = SND_PCM_FORMAT_S16; + + if(settings.sampleSize() == 8) { + pcmformat = SND_PCM_FORMAT_U8; + + } else if(settings.sampleSize() == 16) { + if(settings.sampleType() == QAudioFormat::SignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + pcmformat = SND_PCM_FORMAT_S16_LE; + else + pcmformat = SND_PCM_FORMAT_S16_BE; + } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + pcmformat = SND_PCM_FORMAT_U16_LE; + else + pcmformat = SND_PCM_FORMAT_U16_BE; + } + } else if(settings.sampleSize() == 24) { + if(settings.sampleType() == QAudioFormat::SignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + pcmformat = SND_PCM_FORMAT_S24_LE; + else + pcmformat = SND_PCM_FORMAT_S24_BE; + } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + pcmformat = SND_PCM_FORMAT_U24_LE; + else + pcmformat = SND_PCM_FORMAT_U24_BE; + } + } else if(settings.sampleSize() == 32) { + if(settings.sampleType() == QAudioFormat::SignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + pcmformat = SND_PCM_FORMAT_S32_LE; + else + pcmformat = SND_PCM_FORMAT_S32_BE; + } else if(settings.sampleType() == QAudioFormat::UnSignedInt) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + pcmformat = SND_PCM_FORMAT_U32_LE; + else + pcmformat = SND_PCM_FORMAT_U32_BE; + } else if(settings.sampleType() == QAudioFormat::Float) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + pcmformat = SND_PCM_FORMAT_FLOAT_LE; + else + pcmformat = SND_PCM_FORMAT_FLOAT_BE; + } + } else if(settings.sampleSize() == 64) { + if(settings.byteOrder() == QAudioFormat::LittleEndian) + pcmformat = SND_PCM_FORMAT_FLOAT64_LE; + else + pcmformat = SND_PCM_FORMAT_FLOAT64_BE; + } + + return snd_pcm_hw_params_set_format( handle, hwparams, pcmformat); +} + +QIODevice* QAudioOutputPrivate::start(QIODevice* device) +{ + if(deviceState != QAudio::StoppedState) + deviceState = QAudio::StoppedState; + + errorState = QAudio::NoError; + + // Handle change of mode + if(audioSource && pullMode && !device) { + // pull -> push + close(); + audioSource = 0; + } else if(audioSource && !pullMode && device) { + // push -> pull + close(); + delete audioSource; + audioSource = 0; + } + + if(device) { + //set to pull mode + pullMode = true; + audioSource = device; + deviceState = QAudio::ActiveState; + } else { + //set to push mode + if(!audioSource) { + audioSource = new OutputPrivate(this); + audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered); + } + pullMode = false; + deviceState = QAudio::IdleState; + } + + open(); + + emit stateChanged(deviceState); + + return audioSource; +} + +void QAudioOutputPrivate::stop() +{ + if(deviceState == QAudio::StoppedState) + return; + errorState = QAudio::NoError; + deviceState = QAudio::StoppedState; + close(); + emit stateChanged(deviceState); +} + +bool QAudioOutputPrivate::open() +{ + if(opened) + return true; + +#ifdef DEBUG_AUDIO + QTime now(QTime::currentTime()); + qDebug()< devices = QAudioDeviceInfoInternal::availableDevices(QAudio::AudioOutput); + if(dev.compare(QLatin1String("default")) == 0) { +#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) + dev = QLatin1String(devices.first().constData()); +#else + dev = QLatin1String("hw:0,0"); +#endif + } else { +#if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) + dev = QLatin1String(m_device); +#else + int idx = 0; + char *name; + + QString shortName = QLatin1String(m_device.mid(m_device.indexOf('=',0)+1).constData()); + + while(snd_card_get_name(idx,&name) == 0) { + if(qstrncmp(shortName.toLocal8Bit().constData(),name,shortName.length()) == 0) + break; + idx++; + } + dev = QString(QLatin1String("hw:%1,0")).arg(idx); +#endif + } + + // Step 1: try and open the device + while((count < 5) && (err < 0)) { + err=snd_pcm_open(&handle,dev.toLocal8Bit().constData(),SND_PCM_STREAM_PLAYBACK,0); + if(err < 0) + count++; + } + if (( err < 0)||(handle == 0)) { + errorState = QAudio::OpenError; + deviceState = QAudio::StoppedState; + return false; + } + snd_pcm_nonblock( handle, 0 ); + + // Step 2: Set the desired HW parameters. + snd_pcm_hw_params_alloca( &hwparams ); + + bool fatal = false; + QString errMessage; + unsigned int chunks = 8; + + err = snd_pcm_hw_params_any( handle, hwparams ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_any: err = %1").arg(err); + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_rate_resample( handle, hwparams, 1 ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_rate_resample: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_access( handle, hwparams, access ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_access: err = %1").arg(err); + } + } + if ( !fatal ) { + err = setFormat(); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_format: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_channels( handle, hwparams, (unsigned int)settings.channels() ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_channels: err = %1").arg(err); + } + } + if ( !fatal ) { + err = snd_pcm_hw_params_set_rate_near( handle, hwparams, &freakuency, 0 ); + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioOutput: snd_pcm_hw_params_set_rate_near: err = %1").arg(err); + } + } + if ( !fatal ) { + unsigned int maxBufferTime = 0; + unsigned int minBufferTime = 0; + unsigned int maxPeriodTime = 0; + unsigned int minPeriodTime = 0; + + err = snd_pcm_hw_params_get_buffer_time_max(hwparams, &maxBufferTime, &dir); + if ( err >= 0) + err = snd_pcm_hw_params_get_buffer_time_min(hwparams, &minBufferTime, &dir); + if ( err >= 0) + err = snd_pcm_hw_params_get_period_time_max(hwparams, &maxPeriodTime, &dir); + if ( err >= 0) + err = snd_pcm_hw_params_get_period_time_min(hwparams, &minPeriodTime, &dir); + + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioOutput: buffer/period min and max: err = %1").arg(err); + } else { + if (maxBufferTime < buffer_time || buffer_time < minBufferTime || maxPeriodTime < period_time || minPeriodTime > period_time) { +#ifdef DEBUG_AUDIO + qDebug()<<"defaults out of range"; + qDebug()<<"pmin="<start(period_time/1000); + + clockStamp.restart(); + timeStamp.restart(); + elapsedTimeOffset = 0; + errorState = QAudio::NoError; + totalTimeValue = 0; + opened = true; + + return true; +} + +void QAudioOutputPrivate::close() +{ + timer->stop(); + + if ( handle ) { + snd_pcm_drain( handle ); + snd_pcm_close( handle ); + handle = 0; + delete [] audioBuffer; + audioBuffer=0; + } + if(!pullMode && audioSource) { + delete audioSource; + audioSource = 0; + } + opened = false; +} + +int QAudioOutputPrivate::bytesFree() const +{ + if(resuming) + return period_size; + + if(deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState) + return 0; + int frames = snd_pcm_avail_update(handle); + if((int)frames > (int)buffer_frames) + frames = buffer_frames; + + return snd_pcm_frames_to_bytes(handle, frames); +} + +qint64 QAudioOutputPrivate::write( const char *data, qint64 len ) +{ + // Write out some audio data + if ( !handle ) + return 0; +#ifdef DEBUG_AUDIO + qDebug()<<"frames to write out = "<< + snd_pcm_bytes_to_frames( handle, (int)len )<<" ("< 0) { + totalTimeValue += err; + resuming = false; + errorState = QAudio::NoError; + if (deviceState != QAudio::ActiveState) { + deviceState = QAudio::ActiveState; + emit stateChanged(deviceState); + } + return snd_pcm_frames_to_bytes( handle, err ); + } else + err = xrun_recovery(err); + + if(err < 0) { + close(); + errorState = QAudio::FatalError; + deviceState = QAudio::StoppedState; + emit stateChanged(deviceState); + } + return 0; +} + +int QAudioOutputPrivate::periodSize() const +{ + return period_size; +} + +void QAudioOutputPrivate::setBufferSize(int value) +{ + if(deviceState == QAudio::StoppedState) + buffer_size = value; +} + +int QAudioOutputPrivate::bufferSize() const +{ + return buffer_size; +} + +void QAudioOutputPrivate::setNotifyInterval(int ms) +{ + if(ms >= minimumIntervalTime) + intervalTime = ms; + else + intervalTime = minimumIntervalTime; +} + +int QAudioOutputPrivate::notifyInterval() const +{ + return intervalTime; +} + +qint64 QAudioOutputPrivate::processedUSecs() const +{ + return qint64(1000000) * totalTimeValue / settings.frequency(); +} + +void QAudioOutputPrivate::resume() +{ + if(deviceState == QAudio::SuspendedState) { + int err = 0; + + if(handle) { + err = snd_pcm_prepare( handle ); + if(err < 0) + xrun_recovery(err); + + err = snd_pcm_start(handle); + if(err < 0) + xrun_recovery(err); + + bytesAvailable = (int)snd_pcm_frames_to_bytes(handle, buffer_frames); + } + resuming = true; + + deviceState = QAudio::ActiveState; + + errorState = QAudio::NoError; + timer->start(period_time/1000); + emit stateChanged(deviceState); + } +} + +QAudioFormat QAudioOutputPrivate::format() const +{ + return settings; +} + +void QAudioOutputPrivate::suspend() +{ + if(deviceState == QAudio::ActiveState || deviceState == QAudio::IdleState || resuming) { + timer->stop(); + deviceState = QAudio::SuspendedState; + errorState = QAudio::NoError; + emit stateChanged(deviceState); + } +} + +void QAudioOutputPrivate::userFeed() +{ + if(deviceState == QAudio::StoppedState || deviceState == QAudio::SuspendedState) + return; +#ifdef DEBUG_AUDIO + QTime now(QTime::currentTime()); + qDebug()<acquireReadRegion((maxFrames - framesRead) * m_bytesPerFrame); + + if (region.second > 0) { + region.second -= region.second % m_bytesPerFrame; + memcpy(data + (framesRead * m_bytesPerFrame), region.first, region.second); + framesRead += region.second / m_bytesPerFrame; + } + else + wecan = false; + + m_buffer->releaseReadRegion(region); + } + + if (framesRead == 0 && m_deviceError) + framesRead = -1; + + return framesRead; + } + + qint64 writeBytes(const char* data, qint64 maxSize) + { + bool wecan = true; + qint64 bytesWritten = 0; + + maxSize -= maxSize % m_bytesPerFrame; + while (wecan && bytesWritten < maxSize) { + QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(maxSize - bytesWritten); + + if (region.second > 0) { + memcpy(region.first, data + bytesWritten, region.second); + bytesWritten += region.second; + } + else + wecan = false; + + m_buffer->releaseWriteRegion(region); + } + + if (bytesWritten > 0) + emit readyRead(); + + return bytesWritten; + } + + int available() const + { + return m_buffer->free(); + } + + void reset() + { + m_buffer->reset(); + m_deviceError = false; + } + + void setPrefetchDevice(QIODevice* device) + { + if (m_device != device) { + m_device = device; + if (m_device != 0) + fillBuffer(); + } + } + + void startFillTimer() + { + if (m_device != 0) + m_fillTimer->start(m_buffer->size() / 2 / m_maxPeriodSize * m_periodTime); + } + + void stopFillTimer() + { + m_fillTimer->stop(); + } + +signals: + void readyRead(); + +private slots: + void fillBuffer() + { + const int free = m_buffer->free(); + const int writeSize = free - (free % m_maxPeriodSize); + + if (writeSize > 0) { + bool wecan = true; + int filled = 0; + + while (!m_deviceError && wecan && filled < writeSize) { + QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(writeSize - filled); + + if (region.second > 0) { + region.second = m_device->read(region.first, region.second); + if (region.second > 0) + filled += region.second; + else if (region.second == 0) + wecan = false; + else if (region.second < 0) { + m_fillTimer->stop(); + region.second = 0; + m_deviceError = true; + } + } + else + wecan = false; + + m_buffer->releaseWriteRegion(region); + } + + if (filled > 0) + emit readyRead(); + } + } + +private: + bool m_deviceError; + int m_maxPeriodSize; + int m_bytesPerFrame; + int m_periodTime; + QIODevice* m_device; + QTimer* m_fillTimer; + QAudioRingBuffer* m_buffer; +}; + + +} + +class MacOutputDevice : public QIODevice +{ + Q_OBJECT + +public: + MacOutputDevice(QtMultimediaInternal::QAudioOutputBuffer* audioBuffer, QObject* parent): + QIODevice(parent), + m_audioBuffer(audioBuffer) + { + open(QIODevice::WriteOnly | QIODevice::Unbuffered); + } + + qint64 readData(char* data, qint64 len) + { + Q_UNUSED(data); + Q_UNUSED(len); + + return 0; + } + + qint64 writeData(const char* data, qint64 len) + { + return m_audioBuffer->writeBytes(data, len); + } + + bool isSequential() const + { + return true; + } + +private: + QtMultimediaInternal::QAudioOutputBuffer* m_audioBuffer; +}; + + +QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray& device, const QAudioFormat& format): + audioFormat(format) +{ + QDataStream ds(device); + quint32 did, mode; + + ds >> did >> mode; + + if (QAudio::Mode(mode) == QAudio::AudioInput) + errorCode = QAudio::OpenError; + else { + isOpen = false; + audioDeviceId = AudioDeviceID(did); + audioUnit = 0; + audioIO = 0; + startTime = 0; + totalFrames = 0; + audioBuffer = 0; + internalBufferSize = QtMultimediaInternal::default_buffer_size; + clockFrequency = AudioGetHostClockFrequency() / 1000; + errorCode = QAudio::NoError; + stateCode = QAudio::StoppedState; + audioThreadState = Stopped; + + intervalTimer = new QTimer(this); + intervalTimer->setInterval(1000); + connect(intervalTimer, SIGNAL(timeout()), SIGNAL(notify())); + } +} + +QAudioOutputPrivate::~QAudioOutputPrivate() +{ + close(); +} + +bool QAudioOutputPrivate::open() +{ + if (errorCode != QAudio::NoError) + return false; + + if (isOpen) + return true; + + ComponentDescription cd; + cd.componentType = kAudioUnitType_Output; + cd.componentSubType = kAudioUnitSubType_HALOutput; + cd.componentManufacturer = kAudioUnitManufacturer_Apple; + cd.componentFlags = 0; + cd.componentFlagsMask = 0; + + // Open + Component cp = FindNextComponent(NULL, &cd); + if (cp == 0) { + qWarning() << "QAudioOutput: Failed to find HAL Output component"; + return false; + } + + if (OpenAComponent(cp, &audioUnit) != noErr) { + qWarning() << "QAudioOutput: Unable to Open Output Component"; + return false; + } + + // register callback + AURenderCallbackStruct cb; + cb.inputProc = renderCallback; + cb.inputProcRefCon = this; + + if (AudioUnitSetProperty(audioUnit, + kAudioUnitProperty_SetRenderCallback, + kAudioUnitScope_Global, + 0, + &cb, + sizeof(cb)) != noErr) { + qWarning() << "QAudioOutput: Failed to set AudioUnit callback"; + return false; + } + + // Set Audio Device + if (AudioUnitSetProperty(audioUnit, + kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, + 0, + &audioDeviceId, + sizeof(audioDeviceId)) != noErr) { + qWarning() << "QAudioOutput: Unable to use configured device"; + return false; + } + + // Set stream format + streamFormat = toAudioStreamBasicDescription(audioFormat); + + UInt32 size = sizeof(deviceFormat); + if (AudioUnitGetProperty(audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, + 0, + &deviceFormat, + &size) != noErr) { + qWarning() << "QAudioOutput: Unable to retrieve device format"; + return false; + } + + if (AudioUnitSetProperty(audioUnit, + kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, + 0, + &streamFormat, + sizeof(streamFormat)) != noErr) { + qWarning() << "QAudioOutput: Unable to Set Stream information"; + return false; + } + + // Allocate buffer + UInt32 numberOfFrames = 0; + size = sizeof(UInt32); + if (AudioUnitGetProperty(audioUnit, + kAudioDevicePropertyBufferFrameSize, + kAudioUnitScope_Global, + 0, + &numberOfFrames, + &size) != noErr) { + qWarning() << "QAudioInput: Failed to get audio period size"; + return false; + } + + periodSizeBytes = (numberOfFrames * streamFormat.mSampleRate / deviceFormat.mSampleRate) * + streamFormat.mBytesPerFrame; + if (internalBufferSize < periodSizeBytes * 2) + internalBufferSize = periodSizeBytes * 2; + else + internalBufferSize -= internalBufferSize % streamFormat.mBytesPerFrame; + + audioBuffer = new QtMultimediaInternal::QAudioOutputBuffer(internalBufferSize, periodSizeBytes, audioFormat); + connect(audioBuffer, SIGNAL(readyRead()), SLOT(inputReady())); // Pull + + audioIO = new MacOutputDevice(audioBuffer, this); + + // Init + if (AudioUnitInitialize(audioUnit)) { + qWarning() << "QAudioOutput: Failed to initialize AudioUnit"; + return false; + } + + isOpen = true; + + return true; +} + +void QAudioOutputPrivate::close() +{ + if (audioUnit != 0) { + AudioOutputUnitStop(audioUnit); + AudioUnitUninitialize(audioUnit); + CloseComponent(audioUnit); + } + + delete audioBuffer; +} + +QAudioFormat QAudioOutputPrivate::format() const +{ + return audioFormat; +} + +QIODevice* QAudioOutputPrivate::start(QIODevice* device) +{ + QIODevice* op = device; + + if (!audioFormat.isValid() || !open()) { + stateCode = QAudio::StoppedState; + errorCode = QAudio::OpenError; + return audioIO; + } + + reset(); + audioBuffer->reset(); + audioBuffer->setPrefetchDevice(op); + + if (op == 0) { + op = audioIO; + stateCode = QAudio::IdleState; + } + else + stateCode = QAudio::ActiveState; + + // Start + errorCode = QAudio::NoError; + totalFrames = 0; + startTime = AudioGetCurrentHostTime(); + + if (stateCode == QAudio::ActiveState) + audioThreadStart(); + + emit stateChanged(stateCode); + + return op; +} + +void QAudioOutputPrivate::stop() +{ + QMutexLocker lock(&mutex); + if (stateCode != QAudio::StoppedState) { + audioThreadDrain(); + + stateCode = QAudio::StoppedState; + errorCode = QAudio::NoError; + QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); + } +} + +void QAudioOutputPrivate::reset() +{ + QMutexLocker lock(&mutex); + if (stateCode != QAudio::StoppedState) { + audioThreadStop(); + + stateCode = QAudio::StoppedState; + errorCode = QAudio::NoError; + QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); + } +} + +void QAudioOutputPrivate::suspend() +{ + QMutexLocker lock(&mutex); + if (stateCode == QAudio::ActiveState || stateCode == QAudio::IdleState) { + audioThreadStop(); + + stateCode = QAudio::SuspendedState; + errorCode = QAudio::NoError; + QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); + } +} + +void QAudioOutputPrivate::resume() +{ + QMutexLocker lock(&mutex); + if (stateCode == QAudio::SuspendedState) { + audioThreadStart(); + + stateCode = QAudio::ActiveState; + errorCode = QAudio::NoError; + QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); + } +} + +int QAudioOutputPrivate::bytesFree() const +{ + return audioBuffer->available(); +} + +int QAudioOutputPrivate::periodSize() const +{ + return periodSizeBytes; +} + +void QAudioOutputPrivate::setBufferSize(int bs) +{ + if (stateCode == QAudio::StoppedState) + internalBufferSize = bs; +} + +int QAudioOutputPrivate::bufferSize() const +{ + return internalBufferSize; +} + +void QAudioOutputPrivate::setNotifyInterval(int milliSeconds) +{ + if (intervalTimer->interval() == milliSeconds) + return; + + if (milliSeconds <= 0) + milliSeconds = 0; + + intervalTimer->setInterval(milliSeconds); +} + +int QAudioOutputPrivate::notifyInterval() const +{ + return intervalTimer->interval(); +} + +qint64 QAudioOutputPrivate::processedUSecs() const +{ + return totalFrames * 1000000 / audioFormat.frequency(); +} + +qint64 QAudioOutputPrivate::elapsedUSecs() const +{ + if (stateCode == QAudio::StoppedState) + return 0; + + return (AudioGetCurrentHostTime() - startTime) / (clockFrequency / 1000); +} + +QAudio::Error QAudioOutputPrivate::error() const +{ + return errorCode; +} + +QAudio::State QAudioOutputPrivate::state() const +{ + return stateCode; +} + +void QAudioOutputPrivate::audioThreadStart() +{ + startTimers(); + audioThreadState = Running; + AudioOutputUnitStart(audioUnit); +} + +void QAudioOutputPrivate::audioThreadStop() +{ + stopTimers(); + if (audioThreadState.testAndSetAcquire(Running, Stopped)) + threadFinished.wait(&mutex); +} + +void QAudioOutputPrivate::audioThreadDrain() +{ + stopTimers(); + if (audioThreadState.testAndSetAcquire(Running, Draining)) + threadFinished.wait(&mutex); +} + +void QAudioOutputPrivate::audioDeviceStop() +{ + AudioOutputUnitStop(audioUnit); + audioThreadState = Stopped; + threadFinished.wakeOne(); +} + +void QAudioOutputPrivate::audioDeviceIdle() +{ + QMutexLocker lock(&mutex); + if (stateCode == QAudio::ActiveState) { + audioDeviceStop(); + + errorCode = QAudio::UnderrunError; + stateCode = QAudio::IdleState; + QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection); + } +} + +void QAudioOutputPrivate::audioDeviceError() +{ + QMutexLocker lock(&mutex); + if (stateCode == QAudio::ActiveState) { + audioDeviceStop(); + + errorCode = QAudio::IOError; + stateCode = QAudio::StoppedState; + QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection); + } +} + +void QAudioOutputPrivate::startTimers() +{ + audioBuffer->startFillTimer(); + if (intervalTimer->interval() > 0) + intervalTimer->start(); +} + +void QAudioOutputPrivate::stopTimers() +{ + audioBuffer->stopFillTimer(); + intervalTimer->stop(); +} + + +void QAudioOutputPrivate::deviceStopped() +{ + intervalTimer->stop(); + emit stateChanged(stateCode); +} + +void QAudioOutputPrivate::inputReady() +{ + QMutexLocker lock(&mutex); + if (stateCode == QAudio::IdleState) { + audioThreadStart(); + + stateCode = QAudio::ActiveState; + errorCode = QAudio::NoError; + + QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); + } +} + + +OSStatus QAudioOutputPrivate::renderCallback(void* inRefCon, + AudioUnitRenderActionFlags* ioActionFlags, + const AudioTimeStamp* inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList* ioData) +{ + Q_UNUSED(ioActionFlags) + Q_UNUSED(inTimeStamp) + Q_UNUSED(inBusNumber) + Q_UNUSED(inNumberFrames) + + QAudioOutputPrivate* d = static_cast(inRefCon); + + const int threadState = d->audioThreadState.fetchAndAddAcquire(0); + if (threadState == Stopped) { + ioData->mBuffers[0].mDataByteSize = 0; + d->audioDeviceStop(); + } + else { + const UInt32 bytesPerFrame = d->streamFormat.mBytesPerFrame; + qint64 framesRead; + + framesRead = d->audioBuffer->readFrames((char*)ioData->mBuffers[0].mData, + ioData->mBuffers[0].mDataByteSize / bytesPerFrame); + + if (framesRead > 0) { + ioData->mBuffers[0].mDataByteSize = framesRead * bytesPerFrame; + d->totalFrames += framesRead; + } + else { + ioData->mBuffers[0].mDataByteSize = 0; + if (framesRead == 0) { + if (threadState == Draining) + d->audioDeviceStop(); + else + d->audioDeviceIdle(); + } + else + d->audioDeviceError(); + } + } + + return noErr; +} + + +QT_END_NAMESPACE + +#include "qaudiooutput_mac_p.moc" + diff --git a/src/multimedia/multimedia/audio/qaudiooutput_mac_p.h b/src/multimedia/multimedia/audio/qaudiooutput_mac_p.h new file mode 100644 index 0000000..752905c --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiooutput_mac_p.h @@ -0,0 +1,167 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + +#ifndef QAUDIOOUTPUT_MAC_P_H +#define QAUDIOOUTPUT_MAC_P_H + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QIODevice; + +namespace QtMultimediaInternal +{ +class QAudioOutputBuffer; +} + +class QAudioOutputPrivate : public QAbstractAudioOutput +{ + Q_OBJECT + +public: + bool isOpen; + int internalBufferSize; + int periodSizeBytes; + qint64 totalFrames; + QAudioFormat audioFormat; + QIODevice* audioIO; + AudioDeviceID audioDeviceId; + AudioUnit audioUnit; + Float64 clockFrequency; + UInt64 startTime; + AudioStreamBasicDescription deviceFormat; + AudioStreamBasicDescription streamFormat; + QtMultimediaInternal::QAudioOutputBuffer* audioBuffer; + QAtomicInt audioThreadState; + QWaitCondition threadFinished; + QMutex mutex; + QTimer* intervalTimer; + + QAudio::Error errorCode; + QAudio::State stateCode; + + QAudioOutputPrivate(const QByteArray& device, const QAudioFormat& format); + ~QAudioOutputPrivate(); + + bool open(); + void close(); + + QAudioFormat format() const; + + QIODevice* start(QIODevice* device); + void stop(); + void reset(); + void suspend(); + void resume(); + + int bytesFree() const; + int periodSize() const; + + void setBufferSize(int value); + int bufferSize() const; + + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + + QAudio::Error error() const; + QAudio::State state() const; + + void audioThreadStart(); + void audioThreadStop(); + void audioThreadDrain(); + + void audioDeviceStop(); + void audioDeviceIdle(); + void audioDeviceError(); + + void startTimers(); + void stopTimers(); + +private slots: + void deviceStopped(); + void inputReady(); + +private: + enum { Running, Draining, Stopped }; + + static OSStatus renderCallback(void* inRefCon, + AudioUnitRenderActionFlags* ioActionFlags, + const AudioTimeStamp* inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList* ioData); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/multimedia/audio/qaudiooutput_symbian_p.cpp b/src/multimedia/multimedia/audio/qaudiooutput_symbian_p.cpp new file mode 100644 index 0000000..3f8e933 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiooutput_symbian_p.cpp @@ -0,0 +1,697 @@ +/**************************************************************************** +** +** 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 "qaudiooutput_symbian_p.h" + +QT_BEGIN_NAMESPACE + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +const int UnderflowTimerInterval = 50; // ms + + +//----------------------------------------------------------------------------- +// Private class +//----------------------------------------------------------------------------- + +SymbianAudioOutputPrivate::SymbianAudioOutputPrivate( + QAudioOutputPrivate *audioDevice) + : m_audioDevice(audioDevice) +{ + +} + +SymbianAudioOutputPrivate::~SymbianAudioOutputPrivate() +{ + +} + +qint64 SymbianAudioOutputPrivate::readData(char *data, qint64 len) +{ + Q_UNUSED(data) + Q_UNUSED(len) + return 0; +} + +qint64 SymbianAudioOutputPrivate::writeData(const char *data, qint64 len) +{ + qint64 totalWritten = 0; + + if (m_audioDevice->state() == QAudio::ActiveState || + m_audioDevice->state() == QAudio::IdleState) { + + while (totalWritten < len) { + const qint64 written = m_audioDevice->pushData(data + totalWritten, + len - totalWritten); + if (written > 0) + totalWritten += written; + else + break; + } + } + + return totalWritten; +} + + +//----------------------------------------------------------------------------- +// Public functions +//----------------------------------------------------------------------------- + +QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, + const QAudioFormat &format) + : m_device(device) + , m_format(format) + , m_clientBufferSize(SymbianAudio::DefaultBufferSize) + , m_notifyInterval(SymbianAudio::DefaultNotifyInterval) + , m_notifyTimer(new QTimer(this)) + , m_error(QAudio::NoError) + , m_internalState(SymbianAudio::ClosedState) + , m_externalState(QAudio::StoppedState) + , m_pullMode(false) + , m_source(0) + , m_devSoundBuffer(0) + , m_devSoundBufferSize(0) + , m_bytesWritten(0) + , m_pushDataReady(false) + , m_bytesPadding(0) + , m_underflow(false) + , m_lastBuffer(false) + , m_underflowTimer(new QTimer(this)) + , m_samplesPlayed(0) + , m_totalSamplesPlayed(0) +{ + connect(m_notifyTimer.data(), SIGNAL(timeout()), this, SIGNAL(notify())); + + SymbianAudio::Utils::formatQtToNative(m_format, m_nativeFourCC, + m_nativeFormat); + + m_underflowTimer->setInterval(UnderflowTimerInterval); + connect(m_underflowTimer.data(), SIGNAL(timeout()), this, + SLOT(underflowTimerExpired())); +} + +QAudioOutputPrivate::~QAudioOutputPrivate() +{ + close(); +} + +QIODevice* QAudioOutputPrivate::start(QIODevice *device) +{ + stop(); + + // We have to set these before the call to open() because of the + // logic in initializingState() + if (device) { + m_pullMode = true; + m_source = device; + } + + open(); + + if (SymbianAudio::ClosedState != m_internalState) { + if (device) { + connect(m_source, SIGNAL(readyRead()), this, SLOT(dataReady())); + } else { + m_source = new SymbianAudioOutputPrivate(this); + m_source->open(QIODevice::WriteOnly | QIODevice::Unbuffered); + } + + m_elapsed.restart(); + } + + return m_source; +} + +void QAudioOutputPrivate::stop() +{ + close(); +} + +void QAudioOutputPrivate::reset() +{ + m_totalSamplesPlayed += getSamplesPlayed(); + m_devSound->Stop(); + m_bytesPadding = 0; + startPlayback(); +} + +void QAudioOutputPrivate::suspend() +{ + if (SymbianAudio::ActiveState == m_internalState + || SymbianAudio::IdleState == m_internalState) { + m_notifyTimer->stop(); + m_underflowTimer->stop(); + + const qint64 samplesWritten = SymbianAudio::Utils::bytesToSamples( + m_format, m_bytesWritten); + + const qint64 samplesPlayed = getSamplesPlayed(); + + m_bytesWritten = 0; + + // CMMFDevSound::Pause() is not guaranteed to work correctly in all + // implementations, for play-mode DevSound sessions. We therefore + // have to implement suspend() by calling CMMFDevSound::Stop(). + // Because this causes buffered data to be dropped, we replace the + // lost data with silence following a call to resume(), in order to + // ensure that processedUSecs() returns the correct value. + m_devSound->Stop(); + m_totalSamplesPlayed += samplesPlayed; + + // Calculate the amount of data dropped + const qint64 paddingSamples = samplesWritten - samplesPlayed; + m_bytesPadding = SymbianAudio::Utils::samplesToBytes(m_format, + paddingSamples); + + setState(SymbianAudio::SuspendedState); + } +} + +void QAudioOutputPrivate::resume() +{ + if (SymbianAudio::SuspendedState == m_internalState) + startPlayback(); +} + +int QAudioOutputPrivate::bytesFree() const +{ + int result = 0; + if (m_devSoundBuffer) { + const TDes8 &outputBuffer = m_devSoundBuffer->Data(); + result = outputBuffer.MaxLength() - outputBuffer.Length(); + } + return result; +} + +int QAudioOutputPrivate::periodSize() const +{ + return bufferSize(); +} + +void QAudioOutputPrivate::setBufferSize(int value) +{ + // Note that DevSound does not allow its client to specify the buffer size. + // This functionality is available via custom interfaces, but since these + // cannot be guaranteed to work across all DevSound implementations, we + // do not use them here. + // In order to comply with the expected bevahiour of QAudioOutput, we store + // the value and return it from bufferSize(), but the underlying DevSound + // buffer size remains unchanged. + if (value > 0) + m_clientBufferSize = value; +} + +int QAudioOutputPrivate::bufferSize() const +{ + return m_devSoundBufferSize ? m_devSoundBufferSize : m_clientBufferSize; +} + +void QAudioOutputPrivate::setNotifyInterval(int ms) +{ + if (ms > 0) { + const int oldNotifyInterval = m_notifyInterval; + m_notifyInterval = ms; + if (m_notifyTimer->isActive() && ms != oldNotifyInterval) + m_notifyTimer->start(m_notifyInterval); + } +} + +int QAudioOutputPrivate::notifyInterval() const +{ + return m_notifyInterval; +} + +qint64 QAudioOutputPrivate::processedUSecs() const +{ + int samplesPlayed = 0; + if (m_devSound && SymbianAudio::SuspendedState != m_internalState) + samplesPlayed = getSamplesPlayed(); + + // Protect against division by zero + Q_ASSERT_X(m_format.frequency() > 0, Q_FUNC_INFO, "Invalid frequency"); + + const qint64 result = qint64(1000000) * + (samplesPlayed + m_totalSamplesPlayed) + / m_format.frequency(); + + return result; +} + +qint64 QAudioOutputPrivate::elapsedUSecs() const +{ + const qint64 result = (QAudio::StoppedState == state()) ? + 0 : m_elapsed.elapsed() * 1000; + return result; +} + +QAudio::Error QAudioOutputPrivate::error() const +{ + return m_error; +} + +QAudio::State QAudioOutputPrivate::state() const +{ + return m_externalState; +} + +QAudioFormat QAudioOutputPrivate::format() const +{ + return m_format; +} + +//----------------------------------------------------------------------------- +// MDevSoundObserver implementation +//----------------------------------------------------------------------------- + +void QAudioOutputPrivate::InitializeComplete(TInt aError) +{ + Q_ASSERT_X(SymbianAudio::InitializingState == m_internalState, + Q_FUNC_INFO, "Invalid state"); + + if (KErrNone == aError) + startPlayback(); +} + +void QAudioOutputPrivate::ToneFinished(TInt aError) +{ + Q_UNUSED(aError) + // This class doesn't use DevSound's tone playback functions, so should + // never receive this callback. + Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); +} + +void QAudioOutputPrivate::BufferToBeFilled(CMMFBuffer *aBuffer) +{ + // Following receipt of this callback, DevSound should not provide another + // buffer until we have returned the current one. + Q_ASSERT_X(!m_devSoundBuffer, Q_FUNC_INFO, "Buffer already held"); + + // Will be returned to DevSound by bufferFilled(). + m_devSoundBuffer = static_cast(aBuffer); + + if (!m_devSoundBufferSize) + m_devSoundBufferSize = m_devSoundBuffer->Data().MaxLength(); + + writePaddingData(); + + if (m_pullMode && isDataReady() && !m_bytesPadding) + pullData(); +} + +void QAudioOutputPrivate::PlayError(TInt aError) +{ + switch (aError) { + case KErrUnderflow: + m_underflow = true; + if (m_pullMode && !m_lastBuffer) + setError(QAudio::UnderrunError); + else + setState(SymbianAudio::IdleState); + break; + default: + setError(QAudio::IOError); + break; + } +} + +void QAudioOutputPrivate::BufferToBeEmptied(CMMFBuffer *aBuffer) +{ + Q_UNUSED(aBuffer) + // This class doesn't use DevSound in record mode, so should never receive + // this callback. + Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); +} + +void QAudioOutputPrivate::RecordError(TInt aError) +{ + Q_UNUSED(aError) + // This class doesn't use DevSound in record mode, so should never receive + // this callback. + Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); +} + +void QAudioOutputPrivate::ConvertError(TInt aError) +{ + Q_UNUSED(aError) + // This class doesn't use DevSound's format conversion functions, so + // should never receive this callback. + Q_ASSERT_X(false, Q_FUNC_INFO, "Unexpected callback"); +} + +void QAudioOutputPrivate::DeviceMessage(TUid aMessageType, const TDesC8 &aMsg) +{ + Q_UNUSED(aMessageType) + Q_UNUSED(aMsg) + // Ignore this callback. +} + +//----------------------------------------------------------------------------- +// Private functions +//----------------------------------------------------------------------------- + +void QAudioOutputPrivate::dataReady() +{ + // Client-provided QIODevice has data ready to read. + + Q_ASSERT_X(m_source->bytesAvailable(), Q_FUNC_INFO, + "readyRead signal received, but no data available"); + + if (!m_bytesPadding) + pullData(); +} + +void QAudioOutputPrivate::underflowTimerExpired() +{ + const TInt samplesPlayed = getSamplesPlayed(); + if (m_samplesPlayed && (samplesPlayed == m_samplesPlayed)) { + setError(QAudio::UnderrunError); + } else { + m_samplesPlayed = samplesPlayed; + m_underflowTimer->start(); + } +} + +void QAudioOutputPrivate::open() +{ + Q_ASSERT_X(SymbianAudio::ClosedState == m_internalState, + Q_FUNC_INFO, "DevSound already opened"); + + QT_TRAP_THROWING( m_devSound.reset(CMMFDevSound::NewL()) ) + + QScopedPointer caps( + new SymbianAudio::DevSoundCapabilities(*m_devSound, + QAudio::AudioOutput)); + + int err = SymbianAudio::Utils::isFormatSupported(m_format, *caps) ? + KErrNone : KErrNotSupported; + + if (KErrNone == err) { + setState(SymbianAudio::InitializingState); + TRAP(err, m_devSound->InitializeL(*this, m_nativeFourCC, + EMMFStatePlaying)); + } + + if (KErrNone != err) { + setError(QAudio::OpenError); + m_devSound.reset(); + } +} + +void QAudioOutputPrivate::startPlayback() +{ + TRAPD(err, startDevSoundL()); + if (KErrNone == err) { + if (isDataReady()) + setState(SymbianAudio::ActiveState); + else + setState(SymbianAudio::IdleState); + + m_notifyTimer->start(m_notifyInterval); + m_underflow = false; + + Q_ASSERT(m_devSound->SamplesPlayed() == 0); + + writePaddingData(); + + if (m_pullMode && m_source->bytesAvailable() && !m_bytesPadding) + dataReady(); + } else { + setError(QAudio::OpenError); + close(); + } +} + +void QAudioOutputPrivate::startDevSoundL() +{ + TMMFCapabilities nativeFormat = m_devSound->Config(); + m_nativeFormat.iBufferSize = nativeFormat.iBufferSize; + m_devSound->SetConfigL(m_nativeFormat); + m_devSound->PlayInitL(); +} + +void QAudioOutputPrivate::writePaddingData() +{ + // See comments in suspend() + + while (m_devSoundBuffer && m_bytesPadding) { + if (SymbianAudio::IdleState == m_internalState) + setState(SymbianAudio::ActiveState); + + TDes8 &outputBuffer = m_devSoundBuffer->Data(); + const qint64 outputBytes = bytesFree(); + const qint64 paddingBytes = outputBytes < m_bytesPadding ? + outputBytes : m_bytesPadding; + unsigned char *ptr = const_cast(outputBuffer.Ptr()); + Mem::FillZ(ptr, paddingBytes); + outputBuffer.SetLength(outputBuffer.Length() + paddingBytes); + m_bytesPadding -= paddingBytes; + + if (m_pullMode && m_source->atEnd()) + lastBufferFilled(); + if (paddingBytes == outputBytes) + bufferFilled(); + } +} + +qint64 QAudioOutputPrivate::pushData(const char *data, qint64 len) +{ + // Data has been written to SymbianAudioOutputPrivate + + Q_ASSERT_X(!m_pullMode, Q_FUNC_INFO, + "pushData called when in pull mode"); + + const unsigned char *const inputPtr = + reinterpret_cast(data); + qint64 bytesWritten = 0; + + if (SymbianAudio::IdleState == m_internalState) + setState(SymbianAudio::ActiveState); + + while (m_devSoundBuffer && (bytesWritten < len)) { + // writePaddingData() is called from BufferToBeFilled(), so we should + // never have any padding data left at this point. + Q_ASSERT_X(0 == m_bytesPadding, Q_FUNC_INFO, + "Padding bytes remaining in pushData"); + + TDes8 &outputBuffer = m_devSoundBuffer->Data(); + + const qint64 outputBytes = bytesFree(); + const qint64 inputBytes = len - bytesWritten; + const qint64 copyBytes = outputBytes < inputBytes ? + outputBytes : inputBytes; + + outputBuffer.Append(inputPtr + bytesWritten, copyBytes); + bytesWritten += copyBytes; + + bufferFilled(); + } + + m_pushDataReady = (bytesWritten < len); + + // If DevSound is still initializing (m_internalState == InitializingState), + // we cannot transition m_internalState to ActiveState, but we must emit + // an (external) state change from IdleState to ActiveState. The following + // call triggers this signal. + setState(m_internalState); + + return bytesWritten; +} + +void QAudioOutputPrivate::pullData() +{ + Q_ASSERT_X(m_pullMode, Q_FUNC_INFO, + "pullData called when in push mode"); + + if (m_bytesPadding) + m_bytesPadding = 1; + + // writePaddingData() is called by BufferToBeFilled() before pullData(), + // so we should never have any padding data left at this point. + Q_ASSERT_X(0 == m_bytesPadding, Q_FUNC_INFO, + "Padding bytes remaining in pullData"); + + qint64 inputBytes = m_source->bytesAvailable(); + while (m_devSoundBuffer && inputBytes) { + if (SymbianAudio::IdleState == m_internalState) + setState(SymbianAudio::ActiveState); + + TDes8 &outputBuffer = m_devSoundBuffer->Data(); + + const qint64 outputBytes = bytesFree(); + const qint64 copyBytes = outputBytes < inputBytes ? + outputBytes : inputBytes; + + char *outputPtr = (char*)(outputBuffer.Ptr() + outputBuffer.Length()); + const qint64 bytesCopied = m_source->read(outputPtr, copyBytes); + Q_ASSERT(bytesCopied == copyBytes); + outputBuffer.SetLength(outputBuffer.Length() + bytesCopied); + inputBytes -= bytesCopied; + + if (m_source->atEnd()) + lastBufferFilled(); + else if (copyBytes == outputBytes) + bufferFilled(); + } +} + +void QAudioOutputPrivate::bufferFilled() +{ + Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to return"); + + const TDes8 &outputBuffer = m_devSoundBuffer->Data(); + m_bytesWritten += outputBuffer.Length(); + + m_devSoundBuffer = 0; + + m_samplesPlayed = getSamplesPlayed(); + m_underflowTimer->start(); + + if (QAudio::UnderrunError == m_error) + m_error = QAudio::NoError; + + m_devSound->PlayData(); +} + +void QAudioOutputPrivate::lastBufferFilled() +{ + Q_ASSERT_X(m_devSoundBuffer, Q_FUNC_INFO, "No buffer to fill"); + Q_ASSERT_X(!m_lastBuffer, Q_FUNC_INFO, "Last buffer already sent"); + m_lastBuffer = true; + m_devSoundBuffer->SetLastBuffer(ETrue); + bufferFilled(); +} + +void QAudioOutputPrivate::close() +{ + m_notifyTimer->stop(); + m_underflowTimer->stop(); + + m_error = QAudio::NoError; + + if (m_devSound) + m_devSound->Stop(); + m_devSound.reset(); + m_devSoundBuffer = 0; + m_devSoundBufferSize = 0; + + if (!m_pullMode) // m_source is owned + delete m_source; + m_pullMode = false; + m_source = 0; + + m_bytesWritten = 0; + m_pushDataReady = false; + m_bytesPadding = 0; + m_underflow = false; + m_lastBuffer = false; + m_samplesPlayed = 0; + m_totalSamplesPlayed = 0; + + setState(SymbianAudio::ClosedState); +} + +qint64 QAudioOutputPrivate::getSamplesPlayed() const +{ + qint64 result = 0; + if (m_devSound) { + const qint64 samplesWritten = SymbianAudio::Utils::bytesToSamples( + m_format, m_bytesWritten); + + if (m_underflow) { + result = samplesWritten; + } else { + // This is necessary because some DevSound implementations report + // that they have played more data than has actually been provided to them + // by the client. + const qint64 devSoundSamplesPlayed(m_devSound->SamplesPlayed()); + result = qMin(devSoundSamplesPlayed, samplesWritten); + } + } + return result; +} + +void QAudioOutputPrivate::setError(QAudio::Error error) +{ + m_error = error; + + // Although no state transition actually occurs here, a stateChanged event + // must be emitted to inform the client that the call to start() was + // unsuccessful. + if (QAudio::OpenError == error) + emit stateChanged(QAudio::StoppedState); + + if (QAudio::UnderrunError == error) + setState(SymbianAudio::IdleState); + else + // Close the DevSound instance. This causes a transition to + // StoppedState. This must be done asynchronously in case the + // current function was called from a DevSound event handler, in which + // case deleting the DevSound instance may cause an exception. + QMetaObject::invokeMethod(this, "close", Qt::QueuedConnection); +} + +void QAudioOutputPrivate::setState(SymbianAudio::State newInternalState) +{ + const QAudio::State oldExternalState = m_externalState; + m_internalState = newInternalState; + m_externalState = SymbianAudio::Utils::stateNativeToQt( + m_internalState, initializingState()); + + if (m_externalState != oldExternalState) + emit stateChanged(m_externalState); +} + +bool QAudioOutputPrivate::isDataReady() const +{ + return (m_source && m_source->bytesAvailable()) + || m_bytesPadding + || m_pushDataReady; +} + +QAudio::State QAudioOutputPrivate::initializingState() const +{ + return isDataReady() ? QAudio::ActiveState : QAudio::IdleState; +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudiooutput_symbian_p.h b/src/multimedia/multimedia/audio/qaudiooutput_symbian_p.h new file mode 100644 index 0000000..00ccb24 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiooutput_symbian_p.h @@ -0,0 +1,210 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + +#ifndef QAUDIOOUTPUT_SYMBIAN_P_H +#define QAUDIOOUTPUT_SYMBIAN_P_H + +#include +#include +#include +#include +#include "qaudio_symbian_p.h" + +QT_BEGIN_NAMESPACE + +class QAudioOutputPrivate; + +class SymbianAudioOutputPrivate : public QIODevice +{ + friend class QAudioOutputPrivate; + Q_OBJECT +public: + SymbianAudioOutputPrivate(QAudioOutputPrivate *audio); + ~SymbianAudioOutputPrivate(); + + qint64 readData(char *data, qint64 len); + qint64 writeData(const char *data, qint64 len); + +private: + QAudioOutputPrivate *const m_audioDevice; +}; + +class QAudioOutputPrivate + : public QAbstractAudioOutput + , public MDevSoundObserver +{ + friend class SymbianAudioOutputPrivate; + Q_OBJECT +public: + QAudioOutputPrivate(const QByteArray &device, + const QAudioFormat &audioFormat); + ~QAudioOutputPrivate(); + + // QAbstractAudioOutput + QIODevice* start(QIODevice *device = 0); + void stop(); + void reset(); + void suspend(); + void resume(); + int bytesFree() const; + int periodSize() const; + void setBufferSize(int value); + int bufferSize() const; + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + QAudio::Error error() const; + QAudio::State state() const; + QAudioFormat format() const; + + // MDevSoundObserver + void InitializeComplete(TInt aError); + void ToneFinished(TInt aError); + void BufferToBeFilled(CMMFBuffer *aBuffer); + void PlayError(TInt aError); + void BufferToBeEmptied(CMMFBuffer *aBuffer); + void RecordError(TInt aError); + void ConvertError(TInt aError); + void DeviceMessage(TUid aMessageType, const TDesC8 &aMsg); + +private slots: + void dataReady(); + void underflowTimerExpired(); + +private: + void open(); + void startPlayback(); + void startDevSoundL(); + void writePaddingData(); + qint64 pushData(const char *data, qint64 len); + void pullData(); + void bufferFilled(); + void lastBufferFilled(); + Q_INVOKABLE void close(); + + qint64 getSamplesPlayed() const; + + void setError(QAudio::Error error); + void setState(SymbianAudio::State state); + + bool isDataReady() const; + QAudio::State initializingState() const; + +private: + const QByteArray m_device; + const QAudioFormat m_format; + + int m_clientBufferSize; + int m_notifyInterval; + QScopedPointer m_notifyTimer; + QTime m_elapsed; + QAudio::Error m_error; + + SymbianAudio::State m_internalState; + QAudio::State m_externalState; + + bool m_pullMode; + QIODevice *m_source; + + QScopedPointer m_devSound; + TUint32 m_nativeFourCC; + TMMFCapabilities m_nativeFormat; + + // Buffer provided by DevSound, to be filled with data. + CMMFDataBuffer *m_devSoundBuffer; + + int m_devSoundBufferSize; + + // Number of bytes transferred from QIODevice to QAudioOutput. It is + // necessary to count this because data is dropped when suspend() is + // called. The difference between the position reported by DevSound and + // this value allows us to calculate m_bytesPadding; + quint32 m_bytesWritten; + + // True if client has provided data while the audio subsystem was not + // ready to consume it. + bool m_pushDataReady; + + // Number of zero bytes which will be written when client calls resume(). + quint32 m_bytesPadding; + + // True if PlayError(KErrUnderflow) has been called. + bool m_underflow; + + // True if a buffer marked with the "last buffer" flag has been provided + // to DevSound. + bool m_lastBuffer; + + // Some DevSound implementations ignore all underflow errors raised by the + // audio driver, unless the last buffer flag has been set by the client. + // In push-mode playback, this flag will never be set, so the underflow + // error will never be reported. In order to work around this, a timer + // is used, which gets reset every time the client provides more data. If + // the timer expires, an underflow error is raised by this object. + QScopedPointer m_underflowTimer; + + // Result of previous call to CMMFDevSound::SamplesPlayed(). This value is + // used to determine whether, when m_underflowTimer expires, an + // underflow error has actually occurred. + quint32 m_samplesPlayed; + + // Samples played up to the last call to suspend(). It is necessary + // to cache this because suspend() is implemented using + // CMMFDevSound::Stop(), which resets DevSound's SamplesPlayed() counter. + quint32 m_totalSamplesPlayed; + +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/multimedia/audio/qaudiooutput_win32_p.cpp new file mode 100644 index 0000000..13bce58 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiooutput_win32_p.cpp @@ -0,0 +1,606 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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 "qaudiooutput_win32_p.h" + +//#define DEBUG_AUDIO 1 + +QT_BEGIN_NAMESPACE + +static const int minimumIntervalTime = 50; + +QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): + settings(audioFormat) +{ + bytesAvailable = 0; + buffer_size = 0; + period_size = 0; + m_device = device; + totalTimeValue = 0; + intervalTime = 1000; + audioBuffer = 0; + errorState = QAudio::NoError; + deviceState = QAudio::StoppedState; + audioSource = 0; + pullMode = true; + finished = false; + InitializeCriticalSection(&waveOutCriticalSection); +} + +QAudioOutputPrivate::~QAudioOutputPrivate() +{ + EnterCriticalSection(&waveOutCriticalSection); + finished = true; + LeaveCriticalSection(&waveOutCriticalSection); + + close(); + DeleteCriticalSection(&waveOutCriticalSection); +} + +void CALLBACK QAudioOutputPrivate::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg, + DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ) +{ + Q_UNUSED(dwParam1) + Q_UNUSED(dwParam2) + Q_UNUSED(hWaveOut) + + QAudioOutputPrivate* qAudio; + qAudio = (QAudioOutputPrivate*)(dwInstance); + if(!qAudio) + return; + + switch(uMsg) { + case WOM_OPEN: + qAudio->feedback(); + break; + case WOM_CLOSE: + return; + case WOM_DONE: + EnterCriticalSection(&qAudio->waveOutCriticalSection); + if(qAudio->finished || qAudio->buffer_size == 0 || qAudio->period_size == 0) { + LeaveCriticalSection(&qAudio->waveOutCriticalSection); + return; + } + qAudio->waveFreeBlockCount++; + if(qAudio->waveFreeBlockCount >= qAudio->buffer_size/qAudio->period_size) + qAudio->waveFreeBlockCount = qAudio->buffer_size/qAudio->period_size; + qAudio->feedback(); + LeaveCriticalSection(&qAudio->waveOutCriticalSection); + break; + default: + return; + } +} + +WAVEHDR* QAudioOutputPrivate::allocateBlocks(int size, int count) +{ + int i; + unsigned char* buffer; + WAVEHDR* blocks; + DWORD totalBufferSize = (size + sizeof(WAVEHDR))*count; + + if((buffer=(unsigned char*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, + totalBufferSize)) == 0) { + qWarning("QAudioOutput: Memory allocation error"); + return 0; + } + blocks = (WAVEHDR*)buffer; + buffer += sizeof(WAVEHDR)*count; + for(i = 0; i < count; i++) { + blocks[i].dwBufferLength = size; + blocks[i].lpData = (LPSTR)buffer; + buffer += size; + } + return blocks; +} + +void QAudioOutputPrivate::freeBlocks(WAVEHDR* blockArray) +{ + WAVEHDR* blocks = blockArray; + + int count = buffer_size/period_size; + + for(int i = 0; i < count; i++) { + waveOutUnprepareHeader(hWaveOut,&blocks[i], sizeof(WAVEHDR)); + blocks+=sizeof(WAVEHDR); + } + HeapFree(GetProcessHeap(), 0, blockArray); +} + +QAudioFormat QAudioOutputPrivate::format() const +{ + return settings; +} + +QIODevice* QAudioOutputPrivate::start(QIODevice* device) +{ + if(deviceState != QAudio::StoppedState) + close(); + + if(!pullMode && audioSource) { + delete audioSource; + } + + if(device) { + //set to pull mode + pullMode = true; + audioSource = device; + deviceState = QAudio::ActiveState; + } else { + //set to push mode + pullMode = false; + audioSource = new OutputPrivate(this); + audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered); + deviceState = QAudio::IdleState; + } + + if( !open() ) + return 0; + + emit stateChanged(deviceState); + + return audioSource; +} + +void QAudioOutputPrivate::stop() +{ + if(deviceState == QAudio::StoppedState) + return; + close(); + if(!pullMode && audioSource) { + delete audioSource; + audioSource = 0; + } + emit stateChanged(deviceState); +} + +bool QAudioOutputPrivate::open() +{ +#ifdef DEBUG_AUDIO + QTime now(QTime::currentTime()); + qDebug()<= 8000 && settings.frequency() <= 48000)) { + errorState = QAudio::OpenError; + deviceState = QAudio::StoppedState; + emit stateChanged(deviceState); + qWarning("QAudioOutput: open error, frequency out of range."); + return false; + } + if(buffer_size == 0) { + // Default buffer size, 200ms, default period size is 40ms + buffer_size = settings.frequency()*settings.channels()*(settings.sampleSize()/8)*0.2; + period_size = buffer_size/5; + } else { + period_size = buffer_size/5; + } + waveBlocks = allocateBlocks(period_size, buffer_size/period_size); + + EnterCriticalSection(&waveOutCriticalSection); + waveFreeBlockCount = buffer_size/period_size; + LeaveCriticalSection(&waveOutCriticalSection); + + waveCurrentBlock = 0; + + if(audioBuffer == 0) + audioBuffer = new char[buffer_size]; + + timeStamp.restart(); + elapsedTimeOffset = 0; + + wfx.nSamplesPerSec = settings.frequency(); + wfx.wBitsPerSample = settings.sampleSize(); + wfx.nChannels = settings.channels(); + wfx.cbSize = 0; + + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nBlockAlign = (wfx.wBitsPerSample >> 3) * wfx.nChannels; + wfx.nAvgBytesPerSec = wfx.nBlockAlign * wfx.nSamplesPerSec; + + UINT_PTR devId = WAVE_MAPPER; + + WAVEOUTCAPS woc; + unsigned long iNumDevs,ii; + iNumDevs = waveOutGetNumDevs(); + for(ii=0;ii= minimumIntervalTime) + intervalTime = ms; + else + intervalTime = minimumIntervalTime; +} + +int QAudioOutputPrivate::notifyInterval() const +{ + return intervalTime; +} + +qint64 QAudioOutputPrivate::processedUSecs() const +{ + if (deviceState == QAudio::StoppedState) + return 0; + qint64 result = qint64(1000000) * totalTimeValue / + (settings.channels()*(settings.sampleSize()/8)) / + settings.frequency(); + + return result; +} + +qint64 QAudioOutputPrivate::write( const char *data, qint64 len ) +{ + // Write out some audio data + if (deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState) + return 0; + + char* p = (char*)data; + int l = (int)len; + + WAVEHDR* current; + int remain; + current = &waveBlocks[waveCurrentBlock]; + while(l > 0) { + EnterCriticalSection(&waveOutCriticalSection); + if(waveFreeBlockCount==0) { + LeaveCriticalSection(&waveOutCriticalSection); + break; + } + LeaveCriticalSection(&waveOutCriticalSection); + + if(current->dwFlags & WHDR_PREPARED) + waveOutUnprepareHeader(hWaveOut, current, sizeof(WAVEHDR)); + + if(l < period_size) + remain = l; + else + remain = period_size; + memcpy(current->lpData, p, remain); + + l -= remain; + p += remain; + current->dwBufferLength = remain; + waveOutPrepareHeader(hWaveOut, current, sizeof(WAVEHDR)); + waveOutWrite(hWaveOut, current, sizeof(WAVEHDR)); + + EnterCriticalSection(&waveOutCriticalSection); + waveFreeBlockCount--; + LeaveCriticalSection(&waveOutCriticalSection); +#ifdef DEBUG_AUDIO + EnterCriticalSection(&waveOutCriticalSection); + qDebug("write out l=%d, waveFreeBlockCount=%d", + current->dwBufferLength,waveFreeBlockCount); + LeaveCriticalSection(&waveOutCriticalSection); +#endif + totalTimeValue += current->dwBufferLength; + waveCurrentBlock++; + waveCurrentBlock %= buffer_size/period_size; + current = &waveBlocks[waveCurrentBlock]; + current->dwUser = 0; + errorState = QAudio::NoError; + if (deviceState != QAudio::ActiveState) { + deviceState = QAudio::ActiveState; + emit stateChanged(deviceState); + } + } + return (len-l); +} + +void QAudioOutputPrivate::resume() +{ + if(deviceState == QAudio::SuspendedState) { + deviceState = QAudio::ActiveState; + errorState = QAudio::NoError; + waveOutRestart(hWaveOut); + QTimer::singleShot(10, this, SLOT(feedback())); + emit stateChanged(deviceState); + } +} + +void QAudioOutputPrivate::suspend() +{ + if(deviceState == QAudio::ActiveState || deviceState == QAudio::IdleState) { + int delay = (buffer_size-bytesFree())*1000/(settings.frequency() + *settings.channels()*(settings.sampleSize()/8)); + waveOutPause(hWaveOut); + Sleep(delay+10); + deviceState = QAudio::SuspendedState; + errorState = QAudio::NoError; + emit stateChanged(deviceState); + } +} + +void QAudioOutputPrivate::feedback() +{ +#ifdef DEBUG_AUDIO + QTime now(QTime::currentTime()); + qDebug()<= period_size) + QMetaObject::invokeMethod(this, "deviceReady", Qt::QueuedConnection); + } +} + +bool QAudioOutputPrivate::deviceReady() +{ + if(deviceState == QAudio::StoppedState) + return false; + + if(pullMode) { + int chunks = bytesAvailable/period_size; +#ifdef DEBUG_AUDIO + qDebug()<<"deviceReady() avail="< intervalTime ) { + emit notify(); + elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime; + timeStamp.restart(); + } + return true; + } + + if(startup) + waveOutPause(hWaveOut); + int input = period_size*chunks; + int l = audioSource->read(audioBuffer,input); + if(l > 0) { + int out= write(audioBuffer,l); + if(out > 0) { + if (deviceState != QAudio::ActiveState) { + deviceState = QAudio::ActiveState; + emit stateChanged(deviceState); + } + } + if ( out < l) { + // Didnt write all data + audioSource->seek(audioSource->pos()-(l-out)); + } + if(startup) + waveOutRestart(hWaveOut); + } else if(l == 0) { + bytesAvailable = bytesFree(); + + int check = 0; + EnterCriticalSection(&waveOutCriticalSection); + check = waveFreeBlockCount; + LeaveCriticalSection(&waveOutCriticalSection); + if(check == buffer_size/period_size) { + errorState = QAudio::UnderrunError; + if (deviceState != QAudio::IdleState) { + deviceState = QAudio::IdleState; + emit stateChanged(deviceState); + } + } + + } else if(l < 0) { + bytesAvailable = bytesFree(); + errorState = QAudio::IOError; + } + } else { + int buffered; + EnterCriticalSection(&waveOutCriticalSection); + buffered = waveFreeBlockCount; + LeaveCriticalSection(&waveOutCriticalSection); + errorState = QAudio::UnderrunError; + if (buffered >= buffer_size/period_size && deviceState == QAudio::ActiveState) { + deviceState = QAudio::IdleState; + emit stateChanged(deviceState); + } + } + if(deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState) + return true; + + if((timeStamp.elapsed() + elapsedTimeOffset) > intervalTime) { + emit notify(); + elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime; + timeStamp.restart(); + } + + return true; +} + +qint64 QAudioOutputPrivate::elapsedUSecs() const +{ + if (deviceState == QAudio::StoppedState) + return 0; + + return timeStampOpened.elapsed()*1000; +} + +QAudio::Error QAudioOutputPrivate::error() const +{ + return errorState; +} + +QAudio::State QAudioOutputPrivate::state() const +{ + return deviceState; +} + +void QAudioOutputPrivate::reset() +{ + close(); +} + +OutputPrivate::OutputPrivate(QAudioOutputPrivate* audio) +{ + audioDevice = qobject_cast(audio); +} + +OutputPrivate::~OutputPrivate() {} + +qint64 OutputPrivate::readData( char* data, qint64 len) +{ + Q_UNUSED(data) + Q_UNUSED(len) + + return 0; +} + +qint64 OutputPrivate::writeData(const char* data, qint64 len) +{ + int retry = 0; + qint64 written = 0; + + if((audioDevice->deviceState == QAudio::ActiveState) + ||(audioDevice->deviceState == QAudio::IdleState)) { + qint64 l = len; + while(written < l) { + int chunk = audioDevice->write(data+written,(l-written)); + if(chunk <= 0) + retry++; + else + written+=chunk; + + if(retry > 10) + return written; + } + audioDevice->deviceState = QAudio::ActiveState; + } + return written; +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/audio/qaudiooutput_win32_p.h b/src/multimedia/multimedia/audio/qaudiooutput_win32_p.h new file mode 100644 index 0000000..68a40f7 --- /dev/null +++ b/src/multimedia/multimedia/audio/qaudiooutput_win32_p.h @@ -0,0 +1,156 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// +// 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. +// + +#ifndef QAUDIOOUTPUTWIN_H +#define QAUDIOOUTPUTWIN_H + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + + +QT_BEGIN_NAMESPACE + +class QAudioOutputPrivate : public QAbstractAudioOutput +{ + Q_OBJECT +public: + QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat); + ~QAudioOutputPrivate(); + + qint64 write( const char *data, qint64 len ); + + QAudioFormat format() const; + QIODevice* start(QIODevice* device = 0); + void stop(); + void reset(); + void suspend(); + void resume(); + int bytesFree() const; + int periodSize() const; + void setBufferSize(int value); + int bufferSize() const; + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + QAudio::Error error() const; + QAudio::State state() const; + + QIODevice* audioSource; + QAudioFormat settings; + QAudio::Error errorState; + QAudio::State deviceState; + +private slots: + void feedback(); + bool deviceReady(); + +private: + QByteArray m_device; + bool resuming; + int bytesAvailable; + QTime timeStamp; + qint64 elapsedTimeOffset; + QTime timeStampOpened; + qint32 buffer_size; + qint32 period_size; + qint64 totalTimeValue; + bool pullMode; + int intervalTime; + static void QT_WIN_CALLBACK waveOutProc( HWAVEOUT hWaveOut, UINT uMsg, + DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 ); + + CRITICAL_SECTION waveOutCriticalSection; + + WAVEHDR* allocateBlocks(int size, int count); + void freeBlocks(WAVEHDR* blockArray); + bool open(); + void close(); + + WAVEFORMATEX wfx; + HWAVEOUT hWaveOut; + MMRESULT result; + WAVEHDR header; + WAVEHDR* waveBlocks; + volatile bool finished; + volatile int waveFreeBlockCount; + int waveCurrentBlock; + char* audioBuffer; +}; + +class OutputPrivate : public QIODevice +{ + Q_OBJECT +public: + OutputPrivate(QAudioOutputPrivate* audio); + ~OutputPrivate(); + + qint64 readData( char* data, qint64 len); + qint64 writeData(const char* data, qint64 len); + +private: + QAudioOutputPrivate *audioDevice; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/multimedia.pro b/src/multimedia/multimedia/multimedia.pro new file mode 100644 index 0000000..8d130bd --- /dev/null +++ b/src/multimedia/multimedia/multimedia.pro @@ -0,0 +1,14 @@ +TARGET = QtMultimedia +QPRO_PWD = $$PWD +QT = core gui + +DEFINES += QT_BUILD_MULTIMEDIA_LIB QT_NO_USING_NAMESPACE + +unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui + +include(../../qbase.pri) + +include(audio/audio.pri) +include(video/video.pri) + +symbian: TARGET.UID3 = 0x2001E627 diff --git a/src/multimedia/multimedia/video/qabstractvideobuffer.cpp b/src/multimedia/multimedia/video/qabstractvideobuffer.cpp new file mode 100644 index 0000000..e9d30d0 --- /dev/null +++ b/src/multimedia/multimedia/video/qabstractvideobuffer.cpp @@ -0,0 +1,200 @@ +/**************************************************************************** +** +** 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 "qabstractvideobuffer_p.h" + +#include + +QT_BEGIN_NAMESPACE + +/*! + \class QAbstractVideoBuffer + \brief The QAbstractVideoBuffer class is an abstraction for video data. + \since 4.6 + + The QVideoFrame class makes use of a QAbstractVideoBuffer internally to reference a buffer of + video data. Creating a subclass of QAbstractVideoBuffer will allow you to construct video + frames from preallocated or static buffers. + + The contents of a buffer can be accessed by mapping the buffer to memory using the map() + function which returns a pointer to memory containing the contents of the the video buffer. + The memory returned by map() is released by calling the unmap() function. + + The handle() of a buffer may also be used to manipulate it's contents using type specific APIs. + The type of a buffer's handle is given by the handleType() function. + + \sa QVideoFrame +*/ + +/*! + \enum QAbstractVideoBuffer::HandleType + + Identifies the type of a video buffers handle. + + \value NoHandle The buffer has no handle, its data can only be accessed by mapping the buffer. + \value GLTextureHandle The handle of the buffer is an OpenGL texture ID. + \value XvShmImageHandle The handle contains pointer to shared memory XVideo image. + \value CoreImageHandle The handle contains pointer to Mac OS X CIImage. + \value UserHandle Start value for user defined handle types. + + \sa handleType() +*/ + +/*! + \enum QAbstractVideoBuffer::MapMode + + Enumerates how a video buffer's data is mapped to memory. + + \value NotMapped The video buffer has is not mapped to memory. + \value ReadOnly The mapped memory is populated with data from the video buffer when mapped, but + the content of the mapped memory may be discarded when unmapped. + \value WriteOnly The mapped memory in unitialized when mapped, and the content will be used to + populate the video buffer when unmapped. + \value ReadWrite The mapped memory is populated with data from the video buffer, and the + video buffer is repopulated with the content of the mapped memory. + + \sa mapMode(), map() +*/ + +/*! + Constructs an abstract video buffer of the given \a type. +*/ + +QAbstractVideoBuffer::QAbstractVideoBuffer(HandleType type) + : d_ptr(new QAbstractVideoBufferPrivate) +{ + Q_D(QAbstractVideoBuffer); + + d->handleType = type; +} + +/*! + \internal +*/ + +QAbstractVideoBuffer::QAbstractVideoBuffer(QAbstractVideoBufferPrivate &dd, HandleType type) + : d_ptr(&dd) +{ + Q_D(QAbstractVideoBuffer); + + d->handleType = type; +} + +/*! + Destroys an abstract video buffer. +*/ + +QAbstractVideoBuffer::~QAbstractVideoBuffer() +{ + delete d_ptr; +} + +/*! + Returns the type of a video buffer's handle. + + \sa handle() +*/ + +QAbstractVideoBuffer::HandleType QAbstractVideoBuffer::handleType() const +{ + return d_func()->handleType; +} + +/*! + \fn QAbstractVideoBuffer::mapMode() const + + Returns the mode a video buffer is mapped in. + + \sa map() +*/ + +/*! + \fn QAbstractVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine) + + Maps the contents of a video buffer to memory. + + The map \a mode indicates whether the contents of the mapped memory should be read from and/or + written to the buffer. If the map mode includes the QAbstractVideoBuffer::ReadOnly flag the + mapped memory will be populated with the content of the video buffer when mapped. If the map + mode includes the QAbstractVideoBuffer::WriteOnly flag the content of the mapped memory will be + persisted in the buffer when unmapped. + + When access to the data is no longer needed be sure to call the unmap() function to release the + mapped memory. + + Returns a pointer to the mapped memory region, or a null pointer if the mapping failed. The + size in bytes of the mapped memory region is returned in \a numBytes, and the line stride in \a + bytesPerLine. + + When access to the data is no longer needed be sure to unmap() the buffer. + + \note Writing to memory that is mapped as read-only is undefined, and may result in changes + to shared data. + + \sa unmap(), mapMode() +*/ + +/*! + \fn QAbstractVideoBuffer::unmap() + + Releases the memory mapped by the map() function + + If the \l {QAbstractVideoBuffer::MapMode}{MapMode} included the QAbstractVideoBuffer::WriteOnly + flag this will persist the current content of the mapped memory to the video frame. + + \sa map() +*/ + +/*! + Returns a type specific handle to the data buffer. + + The type of the handle is given by handleType() function. + + \sa handleType() +*/ + +QVariant QAbstractVideoBuffer::handle() const +{ + return QVariant(); +} + + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/video/qabstractvideobuffer.h b/src/multimedia/multimedia/video/qabstractvideobuffer.h new file mode 100644 index 0000000..a8389db --- /dev/null +++ b/src/multimedia/multimedia/video/qabstractvideobuffer.h @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** 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 QABSTRACTVIDEOBUFFER_H +#define QABSTRACTVIDEOBUFFER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QVariant; + +class QAbstractVideoBufferPrivate; + +class Q_MULTIMEDIA_EXPORT QAbstractVideoBuffer +{ +public: + enum HandleType + { + NoHandle, + GLTextureHandle, + XvShmImageHandle, + CoreImageHandle, + UserHandle = 1000 + }; + + enum MapMode + { + NotMapped = 0x00, + ReadOnly = 0x01, + WriteOnly = 0x02, + ReadWrite = ReadOnly | WriteOnly + }; + + QAbstractVideoBuffer(HandleType type); + virtual ~QAbstractVideoBuffer(); + + HandleType handleType() const; + + virtual MapMode mapMode() const = 0; + + virtual uchar *map(MapMode mode, int *numBytes, int *bytesPerLine) = 0; + virtual void unmap() = 0; + + virtual QVariant handle() const; + +protected: + QAbstractVideoBuffer(QAbstractVideoBufferPrivate &dd, HandleType type); + + QAbstractVideoBufferPrivate *d_ptr; + +private: + Q_DECLARE_PRIVATE(QAbstractVideoBuffer) + Q_DISABLE_COPY(QAbstractVideoBuffer) +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QAbstractVideoBuffer::HandleType) +Q_DECLARE_METATYPE(QAbstractVideoBuffer::MapMode) + +QT_END_HEADER + +#endif diff --git a/src/multimedia/multimedia/video/qabstractvideobuffer_p.h b/src/multimedia/multimedia/video/qabstractvideobuffer_p.h new file mode 100644 index 0000000..c72f303 --- /dev/null +++ b/src/multimedia/multimedia/video/qabstractvideobuffer_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** 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 QABSTRACTVIDEOBUFFER_P_H +#define QABSTRACTVIDEOBUFFER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +class QAbstractVideoBufferPrivate +{ +public: + QAbstractVideoBufferPrivate() + : handleType(QAbstractVideoBuffer::NoHandle) + {} + + QAbstractVideoBuffer::HandleType handleType; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/video/qabstractvideosurface.cpp b/src/multimedia/multimedia/video/qabstractvideosurface.cpp new file mode 100644 index 0000000..3dabb6b --- /dev/null +++ b/src/multimedia/multimedia/video/qabstractvideosurface.cpp @@ -0,0 +1,283 @@ +/**************************************************************************** +** +** 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 "qabstractvideosurface_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \class QAbstractVideoSurface + \brief The QAbstractVideoSurface class is a base class for video presentation surfaces. + \since 4.6 + + The QAbstractVideoSurface class defines the standard interface that video producers use to + inter-operate with video presentation surfaces. It is not supposed to be instantiated directly. + Instead, you should subclass it to create new video surfaces. + + A video surface presents a continuous stream of identically formatted frames, where the format + of each frame is compatible with a stream format supplied when starting a presentation. + + A list of pixel formats a surface can present is given by the supportedPixelFormats() function, + and the isFormatSupported() function will test if a video surface format is supported. If a + format is not supported the nearestFormat() function may be able to suggest a similar format. + For example if a surface supports fixed set of resolutions it may suggest the smallest + supported resolution that contains the proposed resolution. + + The start() function takes a supported format and enables a video surface. Once started a + surface will begin displaying the frames it receives in the present() function. Surfaces may + hold a reference to the buffer of a presented video frame until a new frame is presented or + streaming is stopped. The stop() function will disable a surface and a release any video + buffers it holds references to. +*/ + +/*! + \enum QAbstractVideoSurface::Error + This enum describes the errors that may be returned by the error() function. + + \value NoError No error occurred. + \value UnsupportedFormatError A video format was not supported. + \value IncorrectFormatError A video frame was not compatible with the format of the surface. + \value StoppedError The surface has not been started. + \value ResourceError The surface could not allocate some resource. +*/ + +/*! + Constructs a video surface with the given \a parent. +*/ + +QAbstractVideoSurface::QAbstractVideoSurface(QObject *parent) + : QObject(*new QAbstractVideoSurfacePrivate, parent) +{ +} + +/*! + \internal +*/ + +QAbstractVideoSurface::QAbstractVideoSurface(QAbstractVideoSurfacePrivate &dd, QObject *parent) + : QObject(dd, parent) +{ +} + +/*! + Destroys a video surface. +*/ + +QAbstractVideoSurface::~QAbstractVideoSurface() +{ +} + +/*! + \fn QAbstractVideoSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType type) const + + Returns a list of pixel formats a video surface can present for a given handle \a type. + + The pixel formats returned for the QAbstractVideoBuffer::NoHandle type are valid for any buffer + that can be mapped in read-only mode. + + Types that are first in the list can be assumed to be faster to render. +*/ + +/*! + Tests a video surface \a format to determine if a surface can accept it. + + Returns true if the format is supported by the surface, and false otherwise. +*/ + +bool QAbstractVideoSurface::isFormatSupported(const QVideoSurfaceFormat &format) const +{ + return supportedPixelFormats(format.handleType()).contains(format.pixelFormat()); +} + +/*! + Returns a supported video surface format that is similar to \a format. + + A similar surface format is one that has the same \l {QVideoSurfaceFormat::pixelFormat()}{pixel + format} and \l {QVideoSurfaceFormat::handleType()}{handle type} but differs in some of the other + properties. For example if there are restrictions on the \l {QVideoSurfaceFormat::frameSize()} + {frame sizes} a video surface can accept it may suggest a format with a larger frame size and + a \l {QVideoSurfaceFormat::viewport()}{viewport} the size of the original frame size. + + If the format is already supported it will be returned unchanged, or if there is no similar + supported format an invalid format will be returned. +*/ + +QVideoSurfaceFormat QAbstractVideoSurface::nearestFormat(const QVideoSurfaceFormat &format) const +{ + return isFormatSupported(format) + ? format + : QVideoSurfaceFormat(); +} + +/*! + \fn QAbstractVideoSurface::supportedFormatsChanged() + + Signals that the set of formats supported by a video surface has changed. + + \sa supportedPixelFormats(), isFormatSupported() +*/ + +/*! + Returns the format of a video surface. +*/ + +QVideoSurfaceFormat QAbstractVideoSurface::surfaceFormat() const +{ + return d_func()->format; +} + +/*! + \fn QAbstractVideoSurface::surfaceFormatChanged(const QVideoSurfaceFormat &format) + + Signals that the configured \a format of a video surface has changed. + + \sa surfaceFormat(), start() +*/ + +/*! + Starts a video surface presenting \a format frames. + + Returns true if the surface was started, and false if an error occurred. + + \sa isActive(), stop() +*/ + +bool QAbstractVideoSurface::start(const QVideoSurfaceFormat &format) +{ + Q_D(QAbstractVideoSurface); + + bool wasActive = d->active; + + d->active = true; + d->format = format; + d->error = NoError; + + emit surfaceFormatChanged(d->format); + + if (!wasActive) + emit activeChanged(true); + + return true; +} + +/*! + Stops a video surface presenting frames and releases any resources acquired in start(). + + \sa isActive(), start() +*/ + +void QAbstractVideoSurface::stop() +{ + Q_D(QAbstractVideoSurface); + + if (d->active) { + d->format = QVideoSurfaceFormat(); + d->active = false; + + emit activeChanged(false); + emit surfaceFormatChanged(d->format); + } +} + +/*! + Indicates whether a video surface has been started. + + Returns true if the surface has been started, and false otherwise. +*/ + +bool QAbstractVideoSurface::isActive() const +{ + return d_func()->active; +} + +/*! + \fn QAbstractVideoSurface::activeChanged(bool active) + + Signals that the \a active state of a video surface has changed. + + \sa isActive(), start(), stop() +*/ + +/*! + \fn QAbstractVideoSurface::present(const QVideoFrame &frame) + + Presents a video \a frame. + + Returns true if the frame was presented, and false if an error occurred. + + Not all surfaces will block until the presentation of a frame has completed. Calling present() + on a non-blocking surface may fail if called before the presentation of a previous frame has + completed. In such cases the surface may not return to a ready state until it's had an + opportunity to process events. + + If present() fails for any other reason the surface will immediately enter the stopped state + and an error() value will be set. + + A video surface must be in the started state for present() to succeed, and the format of the + video frame must be compatible with the current video surface format. + + \sa error() +*/ + +/*! + Returns the last error that occurred. + + If a surface fails to start(), or stops unexpectedly this function can be called to discover + what error occurred. +*/ + +QAbstractVideoSurface::Error QAbstractVideoSurface::error() const +{ + return d_func()->error; +} + +/*! + Sets the value of error() to \a error. +*/ + +void QAbstractVideoSurface::setError(Error error) +{ + Q_D(QAbstractVideoSurface); + + d->error = error; +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/video/qabstractvideosurface.h b/src/multimedia/multimedia/video/qabstractvideosurface.h new file mode 100644 index 0000000..f2cae17 --- /dev/null +++ b/src/multimedia/multimedia/video/qabstractvideosurface.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** 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 QABSTRACTVIDEOSURFACE_H +#define QABSTRACTVIDEOSURFACE_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QRectF; +class QVideoSurfaceFormat; + +class QAbstractVideoSurfacePrivate; + +class Q_MULTIMEDIA_EXPORT QAbstractVideoSurface : public QObject +{ + Q_OBJECT + +public: + enum Error + { + NoError, + UnsupportedFormatError, + IncorrectFormatError, + StoppedError, + ResourceError + }; + + explicit QAbstractVideoSurface(QObject *parent = 0); + ~QAbstractVideoSurface(); + + virtual QList supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const = 0; + virtual bool isFormatSupported(const QVideoSurfaceFormat &format) const; + virtual QVideoSurfaceFormat nearestFormat(const QVideoSurfaceFormat &format) const; + + QVideoSurfaceFormat surfaceFormat() const; + + virtual bool start(const QVideoSurfaceFormat &format); + virtual void stop(); + + bool isActive() const; + + virtual bool present(const QVideoFrame &frame) = 0; + + Error error() const; + +Q_SIGNALS: + void activeChanged(bool active); + void surfaceFormatChanged(const QVideoSurfaceFormat &format); + void supportedFormatsChanged(); + +protected: + QAbstractVideoSurface(QAbstractVideoSurfacePrivate &dd, QObject *parent); + + void setError(Error error); + +private: + Q_DECLARE_PRIVATE(QAbstractVideoSurface) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/multimedia/video/qabstractvideosurface_p.h b/src/multimedia/multimedia/video/qabstractvideosurface_p.h new file mode 100644 index 0000000..42df112 --- /dev/null +++ b/src/multimedia/multimedia/video/qabstractvideosurface_p.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** 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 QABSTRACTVIDEOSURFACE_P_H +#define QABSTRACTVIDEOSURFACE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QAbstractVideoSurfacePrivate : public QObjectPrivate +{ +public: + QAbstractVideoSurfacePrivate() + : error(QAbstractVideoSurface::NoError) + , active(false) + { + } + + mutable QAbstractVideoSurface::Error error; + QVideoSurfaceFormat format; + bool active; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/video/qimagevideobuffer.cpp b/src/multimedia/multimedia/video/qimagevideobuffer.cpp new file mode 100644 index 0000000..e3e1585 --- /dev/null +++ b/src/multimedia/multimedia/video/qimagevideobuffer.cpp @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** 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 "qimagevideobuffer_p.h" + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +class QImageVideoBufferPrivate : public QAbstractVideoBufferPrivate +{ +public: + QImageVideoBufferPrivate() + : mapMode(QAbstractVideoBuffer::NotMapped) + { + } + + QAbstractVideoBuffer::MapMode mapMode; + QImage image; +}; + +QImageVideoBuffer::QImageVideoBuffer(const QImage &image) + : QAbstractVideoBuffer(*new QImageVideoBufferPrivate, NoHandle) +{ + Q_D(QImageVideoBuffer); + + d->image = image; +} + +QImageVideoBuffer::~QImageVideoBuffer() +{ +} + +QAbstractVideoBuffer::MapMode QImageVideoBuffer::mapMode() const +{ + return d_func()->mapMode; +} + +uchar *QImageVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine) +{ + Q_D(QImageVideoBuffer); + + if (d->mapMode == NotMapped && d->image.bits() && mode != NotMapped) { + d->mapMode = mode; + + if (numBytes) + *numBytes = d->image.byteCount(); + + if (bytesPerLine) + *bytesPerLine = d->image.bytesPerLine(); + + return d->image.bits(); + } else { + return 0; + } +} + +void QImageVideoBuffer::unmap() +{ + Q_D(QImageVideoBuffer); + + d->mapMode = NotMapped; +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/video/qimagevideobuffer_p.h b/src/multimedia/multimedia/video/qimagevideobuffer_p.h new file mode 100644 index 0000000..82075d7 --- /dev/null +++ b/src/multimedia/multimedia/video/qimagevideobuffer_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** 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 QIMAGEVIDEOBUFFER_P_H +#define QIMAGEVIDEOBUFFER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QImage; + +class QImageVideoBufferPrivate; + +class Q_MULTIMEDIA_EXPORT QImageVideoBuffer : public QAbstractVideoBuffer +{ + Q_DECLARE_PRIVATE(QImageVideoBuffer) +public: + QImageVideoBuffer(const QImage &image); + ~QImageVideoBuffer(); + + MapMode mapMode() const; + + uchar *map(MapMode mode, int *numBytes, int *bytesPerLine); + void unmap(); +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/multimedia/multimedia/video/qmemoryvideobuffer.cpp b/src/multimedia/multimedia/video/qmemoryvideobuffer.cpp new file mode 100644 index 0000000..2e892b7 --- /dev/null +++ b/src/multimedia/multimedia/video/qmemoryvideobuffer.cpp @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** 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 "qmemoryvideobuffer_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +class QMemoryVideoBufferPrivate : public QAbstractVideoBufferPrivate +{ +public: + QMemoryVideoBufferPrivate() + : bytesPerLine(0) + , mapMode(QAbstractVideoBuffer::NotMapped) + { + } + + int bytesPerLine; + QAbstractVideoBuffer::MapMode mapMode; + QByteArray data; +}; + +/*! + \class QMemoryVideoBuffer + \brief The QMemoryVideoBuffer class provides a system memory allocated video data buffer. + \internal + + QMemoryVideoBuffer is the default video buffer for allocating system memory. It may be used to + allocate memory for a QVideoFrame without implementing your own QAbstractVideoBuffer. +*/ + +/*! + Constructs a video buffer with an image stride of \a bytesPerLine from a byte \a array. +*/ +QMemoryVideoBuffer::QMemoryVideoBuffer(const QByteArray &array, int bytesPerLine) + : QAbstractVideoBuffer(*new QMemoryVideoBufferPrivate, NoHandle) +{ + Q_D(QMemoryVideoBuffer); + + d->data = array; + d->bytesPerLine = bytesPerLine; +} + +/*! + Destroys a system memory allocated video buffer. +*/ +QMemoryVideoBuffer::~QMemoryVideoBuffer() +{ +} + +/*! + \reimp +*/ +QAbstractVideoBuffer::MapMode QMemoryVideoBuffer::mapMode() const +{ + return d_func()->mapMode; +} + +/*! + \reimp +*/ +uchar *QMemoryVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine) +{ + Q_D(QMemoryVideoBuffer); + + if (d->mapMode == NotMapped && d->data.data() && mode != NotMapped) { + d->mapMode = mode; + + if (numBytes) + *numBytes = d->data.size(); + + if (bytesPerLine) + *bytesPerLine = d->bytesPerLine; + + return reinterpret_cast(d->data.data()); + } else { + return 0; + } +} + +/*! + \reimp +*/ +void QMemoryVideoBuffer::unmap() +{ + d_func()->mapMode = NotMapped; +} + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/video/qmemoryvideobuffer_p.h b/src/multimedia/multimedia/video/qmemoryvideobuffer_p.h new file mode 100644 index 0000000..c66cf93 --- /dev/null +++ b/src/multimedia/multimedia/video/qmemoryvideobuffer_p.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** 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 QMEMORYVIDEOBUFFER_P_H +#define QMEMORYVIDEOBUFFER_P_H + +#include + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QMemoryVideoBufferPrivate; + +class Q_MULTIMEDIA_EXPORT QMemoryVideoBuffer : public QAbstractVideoBuffer +{ + Q_DECLARE_PRIVATE(QMemoryVideoBuffer) +public: + QMemoryVideoBuffer(const QByteArray &data, int bytesPerLine); + ~QMemoryVideoBuffer(); + + MapMode mapMode() const; + + uchar *map(MapMode mode, int *numBytes, int *bytesPerLine); + void unmap(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/multimedia/multimedia/video/qvideoframe.cpp b/src/multimedia/multimedia/video/qvideoframe.cpp new file mode 100644 index 0000000..2d66d9e --- /dev/null +++ b/src/multimedia/multimedia/video/qvideoframe.cpp @@ -0,0 +1,741 @@ +/**************************************************************************** +** +** 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 "qvideoframe.h" + +#include +#include + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QVideoFramePrivate : public QSharedData +{ +public: + QVideoFramePrivate() + : startTime(-1) + , endTime(-1) + , data(0) + , mappedBytes(0) + , bytesPerLine(0) + , pixelFormat(QVideoFrame::Format_Invalid) + , fieldType(QVideoFrame::ProgressiveFrame) + , buffer(0) + { + } + + QVideoFramePrivate(const QSize &size, QVideoFrame::PixelFormat format) + : size(size) + , startTime(-1) + , endTime(-1) + , data(0) + , mappedBytes(0) + , bytesPerLine(0) + , pixelFormat(format) + , fieldType(QVideoFrame::ProgressiveFrame) + , buffer(0) + { + } + + ~QVideoFramePrivate() + { + delete buffer; + } + + QSize size; + qint64 startTime; + qint64 endTime; + uchar *data; + int mappedBytes; + int bytesPerLine; + QVideoFrame::PixelFormat pixelFormat; + QVideoFrame::FieldType fieldType; + QAbstractVideoBuffer *buffer; + +private: + Q_DISABLE_COPY(QVideoFramePrivate) +}; + +/*! + \class QVideoFrame + \brief The QVideoFrame class provides a representation of a frame of video data. + \since 4.6 + + A QVideoFrame encapsulates the data of a video frame, and information about the frame. + + The contents of a video frame can be mapped to memory using the map() function. While + mapped the video data can accessed using the bits() function which returns a pointer to a + buffer, the total size of which is given by the mappedBytes(), and the size of each line is given + by bytesPerLine(). The return value of the handle() function may be used to access frame data + using the internal buffer's native APIs. + + The video data in a QVideoFrame is encapsulated in a QAbstractVideoBuffer. A QVideoFrame + may be constructed from any buffer type by subclassing the QAbstractVideoBuffer class. + + \note QVideoFrame is explicitly shared, any change made to video frame will also apply to any + copies. +*/ + +/*! + \enum QVideoFrame::PixelFormat + + Enumerates video data types. + + \value Format_Invalid + The frame is invalid. + + \value Format_ARGB32 + The frame is stored using a 32-bit ARGB format (0xAARRGGBB). This is equivalent to + QImage::Format_ARGB32. + + \value Format_ARGB32_Premultiplied + The frame stored using a premultiplied 32-bit ARGB format (0xAARRGGBB). This is equivalent + to QImage::Format_ARGB32_Premultiplied. + + \value Format_RGB32 + The frame stored using a 32-bit RGB format (0xffRRGGBB). This is equivalent to + QImage::Format_RGB32 + + \value Format_RGB24 + The frame is stored using a 24-bit RGB format (8-8-8). This is equivalent to + QImage::Format_RGB888 + + \value Format_RGB565 + The frame is stored using a 16-bit RGB format (5-6-5). This is equivalent to + QImage::Format_RGB16. + + \value Format_RGB555 + The frame is stored using a 16-bit RGB format (5-5-5). This is equivalent to + QImage::Format_RGB555. + + \value Format_ARGB8565_Premultiplied + The frame is stored using a 24-bit premultiplied ARGB format (8-6-6-5). + + \value Format_BGRA32 + The frame is stored using a 32-bit ARGB format (0xBBGGRRAA). + + \value Format_BGRA32_Premultiplied + The frame is stored using a premultiplied 32bit BGRA format. + + \value Format_BGR32 + The frame is stored using a 32-bit BGR format (0xBBGGRRff). + + \value Format_BGR24 + The frame is stored using a 24-bit BGR format (0xBBGGRR). + + \value Format_BGR565 + The frame is stored using a 16-bit BGR format (5-6-5). + + \value Format_BGR555 + The frame is stored using a 16-bit BGR format (5-5-5). + + \value Format_BGRA5658_Premultiplied + The frame is stored using a 24-bit premultiplied BGRA format (5-6-5-8). + + \value Format_AYUV444 + The frame is stored using a packed 32-bit AYUV format (0xAAYYUUVV). + + \value Format_AYUV444_Premultiplied + The frame is stored using a packed premultiplied 32-bit AYUV format (0xAAYYUUVV). + + \value Format_YUV444 + The frame is stored using a 24-bit packed YUV format (8-8-8). + + \value Format_YUV420P + The frame is stored using an 8-bit per component planar YUV format with the U and V planes + horizontally and vertically sub-sampled, i.e. the height and width of the U and V planes are + half that of the Y plane. + + \value Format_YV12 + The frame is stored using an 8-bit per component planar YVU format with the V and U planes + horizontally and vertically sub-sampled, i.e. the height and width of the V and U planes are + half that of the Y plane. + + \value Format_UYVY + The frame is stored using an 8-bit per component packed YUV format with the U and V planes + horizontally sub-sampled (U-Y-V-Y), i.e. two horizontally adjacent pixels are stored as a 32-bit + macropixel which has a Y value for each pixel and common U and V values. + + \value Format_YUYV + The frame is stored using an 8-bit per component packed YUV format with the U and V planes + horizontally sub-sampled (Y-U-Y-V), i.e. two horizontally adjacent pixels are stored as a 32-bit + macropixel which has a Y value for each pixel and common U and V values. + + \value Format_NV12 + The frame is stored using an 8-bit per component semi-planar YUV format with a Y plane (Y) + followed by a horizontally and vertically sub-sampled, packed UV plane (U-V). + + \value Format_NV21 + The frame is stored using an 8-bit per component semi-planar YUV format with a Y plane (Y) + followed by a horizontally and vertically sub-sampled, packed VU plane (V-U). + + \value Format_IMC1 + The frame is stored using an 8-bit per component planar YUV format with the U and V planes + horizontally and vertically sub-sampled. This is similar to the Format_YUV420P type, except + that the bytes per line of the U and V planes are padded out to the same stride as the Y plane. + + \value Format_IMC2 + The frame is stored using an 8-bit per component planar YUV format with the U and V planes + horizontally and vertically sub-sampled. This is similar to the Format_YUV420P type, except + that the lines of the U and V planes are interleaved, i.e. each line of U data is followed by a + line of V data creating a single line of the same stride as the Y data. + + \value Format_IMC3 + The frame is stored using an 8-bit per component planar YVU format with the V and U planes + horizontally and vertically sub-sampled. This is similar to the Format_YV12 type, except that + the bytes per line of the V and U planes are padded out to the same stride as the Y plane. + + \value Format_IMC4 + The frame is stored using an 8-bit per component planar YVU format with the V and U planes + horizontally and vertically sub-sampled. This is similar to the Format_YV12 type, except that + the lines of the V and U planes are interleaved, i.e. each line of V data is followed by a line + of U data creating a single line of the same stride as the Y data. + + \value Format_Y8 + The frame is stored using an 8-bit greyscale format. + + \value Format_Y16 + The frame is stored using a 16-bit linear greyscale format. Little endian. + + \value Format_User + Start value for user defined pixel formats. +*/ + +/*! + \enum QVideoFrame::FieldType + + Specifies the field an interlaced video frame belongs to. + + \value ProgressiveFrame The frame is not interlaced. + \value TopField The frame contains a top field. + \value BottomField The frame contains a bottom field. + \value InterlacedFrame The frame contains a merged top and bottom field. +*/ + +/*! + Constructs a null video frame. +*/ + +QVideoFrame::QVideoFrame() + : d(new QVideoFramePrivate) +{ +} + +/*! + Constructs a video frame from a \a buffer of the given pixel \a format and \a size in pixels. + + \note This doesn't increment the reference count of the video buffer. +*/ + +QVideoFrame::QVideoFrame( + QAbstractVideoBuffer *buffer, const QSize &size, PixelFormat format) + : d(new QVideoFramePrivate(size, format)) +{ + d->buffer = buffer; +} + +/*! + Constructs a video frame of the given pixel \a format and \a size in pixels. + + The \a bytesPerLine (stride) is the length of each scan line in bytes, and \a bytes is the total + number of bytes that must be allocated for the frame. +*/ + +QVideoFrame::QVideoFrame(int bytes, const QSize &size, int bytesPerLine, PixelFormat format) + : d(new QVideoFramePrivate(size, format)) +{ + if (bytes > 0) { + QByteArray data; + data.resize(bytes); + + // Check the memory was successfully allocated. + if (!data.isEmpty()) + d->buffer = new QMemoryVideoBuffer(data, bytesPerLine); + } +} + +/*! + Constructs a video frame from an \a image. + + \note This will construct an invalid video frame if there is no frame type equivalent to the + image format. + + \sa pixelFormatFromImageFormat() +*/ + +QVideoFrame::QVideoFrame(const QImage &image) + : d(new QVideoFramePrivate( + image.size(), pixelFormatFromImageFormat(image.format()))) +{ + if (d->pixelFormat != Format_Invalid) + d->buffer = new QImageVideoBuffer(image); +} + +/*! + Constructs a copy of \a other. +*/ + +QVideoFrame::QVideoFrame(const QVideoFrame &other) + : d(other.d) +{ +} + +/*! + Assigns the contents of \a other to a video frame. +*/ + +QVideoFrame &QVideoFrame::operator =(const QVideoFrame &other) +{ + d = other.d; + + return *this; +} + +/*! + Destroys a video frame. +*/ + +QVideoFrame::~QVideoFrame() +{ +} + +/*! + Identifies whether a video frame is valid. + + An invalid frame has no video buffer associated with it. + + Returns true if the frame is valid, and false if it is not. +*/ + +bool QVideoFrame::isValid() const +{ + return d->buffer != 0; +} + +/*! + Returns the color format of a video frame. +*/ + +QVideoFrame::PixelFormat QVideoFrame::pixelFormat() const +{ + return d->pixelFormat; +} + +/*! + Returns the type of a video frame's handle. +*/ + +QAbstractVideoBuffer::HandleType QVideoFrame::handleType() const +{ + return d->buffer ? d->buffer->handleType() : QAbstractVideoBuffer::NoHandle; +} + +/*! + Returns the size of a video frame. +*/ + +QSize QVideoFrame::size() const +{ + return d->size; +} + +/*! + Returns the width of a video frame. +*/ + +int QVideoFrame::width() const +{ + return d->size.width(); +} + +/*! + Returns the height of a video frame. +*/ + +int QVideoFrame::height() const +{ + return d->size.height(); +} + +/*! + Returns the field an interlaced video frame belongs to. + + If the video is not interlaced this will return WholeFrame. +*/ + +QVideoFrame::FieldType QVideoFrame::fieldType() const +{ + return d->fieldType; +} + +/*! + Sets the \a field an interlaced video frame belongs to. +*/ + +void QVideoFrame::setFieldType(QVideoFrame::FieldType field) +{ + d->fieldType = field; +} + +/*! + Identifies if a video frame's contents are currently mapped to system memory. + + This is a convenience function which checks that the \l {QAbstractVideoBuffer::MapMode}{MapMode} + of the frame is not equal to QAbstractVideoBuffer::NotMapped. + + Returns true if the contents of the video frame are mapped to system memory, and false + otherwise. + + \sa mapMode() QAbstractVideoBuffer::MapMode +*/ + +bool QVideoFrame::isMapped() const +{ + return d->buffer != 0 && d->buffer->mapMode() != QAbstractVideoBuffer::NotMapped; +} + +/*! + Identifies if the mapped contents of a video frame will be persisted when the frame is unmapped. + + This is a convenience function which checks if the \l {QAbstractVideoBuffer::MapMode}{MapMode} + contains the QAbstractVideoBuffer::WriteOnly flag. + + Returns true if the video frame will be updated when unmapped, and false otherwise. + + \note The result of altering the data of a frame that is mapped in read-only mode is undefined. + Depending on the buffer implementation the changes may be persisted, or worse alter a shared + buffer. + + \sa mapMode(), QAbstractVideoBuffer::MapMode +*/ + +bool QVideoFrame::isWritable() const +{ + return d->buffer != 0 && (d->buffer->mapMode() & QAbstractVideoBuffer::WriteOnly); +} + +/*! + Identifies if the mapped contents of a video frame were read from the frame when it was mapped. + + This is a convenience function which checks if the \l {QAbstractVideoBuffer::MapMode}{MapMode} + contains the QAbstractVideoBuffer::WriteOnly flag. + + Returns true if the contents of the mapped memory were read from the video frame, and false + otherwise. + + \sa mapMode(), QAbstractVideoBuffer::MapMode +*/ + +bool QVideoFrame::isReadable() const +{ + return d->buffer != 0 && (d->buffer->mapMode() & QAbstractVideoBuffer::ReadOnly); +} + +/*! + Returns the mode a video frame was mapped to system memory in. + + \sa map(), QAbstractVideoBuffer::MapMode +*/ + +QAbstractVideoBuffer::MapMode QVideoFrame::mapMode() const +{ + return d->buffer != 0 ? d->buffer->mapMode() : QAbstractVideoBuffer::NotMapped; +} + +/*! + Maps the contents of a video frame to memory. + + The map \a mode indicates whether the contents of the mapped memory should be read from and/or + written to the frame. If the map mode includes the QAbstractVideoBuffer::ReadOnly flag the + mapped memory will be populated with the content of the video frame when mapped. If the map + mode inclues the QAbstractVideoBuffer::WriteOnly flag the content of the mapped memory will be + persisted in the frame when unmapped. + + While mapped the contents of a video frame can be accessed directly through the pointer returned + by the bits() function. + + When access to the data is no longer needed be sure to call the unmap() function to release the + mapped memory. + + Returns true if the buffer was mapped to memory in the given \a mode and false otherwise. + + \sa unmap(), mapMode(), bits() +*/ + +bool QVideoFrame::map(QAbstractVideoBuffer::MapMode mode) +{ + if (d->buffer != 0 && d->data == 0) { + Q_ASSERT(d->bytesPerLine == 0); + Q_ASSERT(d->mappedBytes == 0); + + d->data = d->buffer->map(mode, &d->mappedBytes, &d->bytesPerLine); + + return d->data != 0; + } + + return false; +} + +/*! + Releases the memory mapped by the map() function. + + If the \l {QAbstractVideoBuffer::MapMode}{MapMode} included the QAbstractVideoBuffer::WriteOnly + flag this will persist the current content of the mapped memory to the video frame. + + \sa map() +*/ + +void QVideoFrame::unmap() +{ + if (d->data != 0) { + d->mappedBytes = 0; + d->bytesPerLine = 0; + d->data = 0; + + d->buffer->unmap(); + } +} + +/*! + Returns the number of bytes in a scan line. + + \note This is the bytes per line of the first plane only. The bytes per line of subsequent + planes should be calculated as per the frame type. + + This value is only valid while the frame data is \l {map()}{mapped}. + + \sa bits(), map(), mappedBytes() +*/ + +int QVideoFrame::bytesPerLine() const +{ + return d->bytesPerLine; +} + +/*! + Returns a pointer to the start of the frame data buffer. + + This value is only valid while the frame data is \l {map()}{mapped}. + + \sa map(), mappedBytes(), bytesPerLine() +*/ + +uchar *QVideoFrame::bits() +{ + return d->data; +} + +/*! + Returns a pointer to the start of the frame data buffer. + + This value is only valid while the frame data is \l {map()}{mapped}. + + \sa map(), mappedBytes(), bytesPerLine() +*/ + +const uchar *QVideoFrame::bits() const +{ + return d->data; +} + +/*! + Returns the number of bytes occupied by the mapped frame data. + + This value is only valid while the frame data is \l {map()}{mapped}. + + \sa map() +*/ + +int QVideoFrame::mappedBytes() const +{ + return d->mappedBytes; +} + +/*! + Returns a type specific handle to a video frame's buffer. + + For an OpenGL texture this would be the texture ID. + + \sa QAbstractVideoBuffer::handle() +*/ + +QVariant QVideoFrame::handle() const +{ + return d->buffer != 0 ? d->buffer->handle() : QVariant(); +} + +/*! + Returns the presentation time when the frame should be displayed. +*/ + +qint64 QVideoFrame::startTime() const +{ + return d->startTime; +} + +/*! + Sets the presentation \a time when the frame should be displayed. +*/ + +void QVideoFrame::setStartTime(qint64 time) +{ + d->startTime = time; +} + +/*! + Returns the presentation time when a frame should stop being displayed. +*/ + +qint64 QVideoFrame::endTime() const +{ + return d->endTime; +} + +/*! + Sets the presentation \a time when a frame should stop being displayed. +*/ + +void QVideoFrame::setEndTime(qint64 time) +{ + d->endTime = time; +} + +/*! + Returns an video pixel format equivalent to an image \a format. If there is no equivalent + format QVideoFrame::InvalidType is returned instead. +*/ + +QVideoFrame::PixelFormat QVideoFrame::pixelFormatFromImageFormat(QImage::Format format) +{ + switch (format) { + case QImage::Format_Invalid: + case QImage::Format_Mono: + case QImage::Format_MonoLSB: + case QImage::Format_Indexed8: + return Format_Invalid; + case QImage::Format_RGB32: + return Format_RGB32; + case QImage::Format_ARGB32: + return Format_ARGB32; + case QImage::Format_ARGB32_Premultiplied: + return Format_ARGB32_Premultiplied; + case QImage::Format_RGB16: + return Format_RGB565; + case QImage::Format_ARGB8565_Premultiplied: + case QImage::Format_RGB666: + case QImage::Format_ARGB6666_Premultiplied: + return Format_Invalid; + case QImage::Format_RGB555: + return Format_RGB555; + case QImage::Format_ARGB8555_Premultiplied: + return Format_Invalid; + case QImage::Format_RGB888: + return Format_RGB24; + case QImage::Format_RGB444: + case QImage::Format_ARGB4444_Premultiplied: + return Format_Invalid; + case QImage::NImageFormats: + return Format_Invalid; + } + return Format_Invalid; +} + +/*! + Returns an image format equivalent to a video frame pixel \a format. If there is no equivalent + format QImage::Format_Invalid is returned instead. +*/ + +QImage::Format QVideoFrame::imageFormatFromPixelFormat(PixelFormat format) +{ + switch (format) { + case Format_Invalid: + return QImage::Format_Invalid; + case Format_ARGB32: + return QImage::Format_ARGB32; + case Format_ARGB32_Premultiplied: + return QImage::Format_ARGB32_Premultiplied; + case Format_RGB32: + return QImage::Format_RGB32; + case Format_RGB24: + return QImage::Format_RGB888; + case Format_RGB565: + return QImage::Format_RGB16; + case Format_RGB555: + return QImage::Format_RGB555; + case Format_ARGB8565_Premultiplied: + return QImage::Format_ARGB8565_Premultiplied; + case Format_BGRA32: + case Format_BGRA32_Premultiplied: + case Format_BGR32: + case Format_BGR24: + return QImage::Format_Invalid; + case Format_BGR565: + case Format_BGR555: + case Format_BGRA5658_Premultiplied: + case Format_AYUV444: + case Format_AYUV444_Premultiplied: + case Format_YUV444: + case Format_YUV420P: + case Format_YV12: + case Format_UYVY: + case Format_YUYV: + case Format_NV12: + case Format_NV21: + case Format_IMC1: + case Format_IMC2: + case Format_IMC3: + case Format_IMC4: + case Format_Y8: + case Format_Y16: + return QImage::Format_Invalid; + case Format_User: + return QImage::Format_Invalid; + } + return QImage::Format_Invalid; +} + +QT_END_NAMESPACE + diff --git a/src/multimedia/multimedia/video/qvideoframe.h b/src/multimedia/multimedia/video/qvideoframe.h new file mode 100644 index 0000000..668a738 --- /dev/null +++ b/src/multimedia/multimedia/video/qvideoframe.h @@ -0,0 +1,169 @@ +/**************************************************************************** +** +** 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 QVIDEOFRAME_H +#define QVIDEOFRAME_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QSize; +class QVariant; + +class QVideoFramePrivate; + +class Q_MULTIMEDIA_EXPORT QVideoFrame +{ +public: + enum FieldType + { + ProgressiveFrame, + TopField, + BottomField, + InterlacedFrame + }; + + enum PixelFormat + { + Format_Invalid, + Format_ARGB32, + Format_ARGB32_Premultiplied, + Format_RGB32, + Format_RGB24, + Format_RGB565, + Format_RGB555, + Format_ARGB8565_Premultiplied, + Format_BGRA32, + Format_BGRA32_Premultiplied, + Format_BGR32, + Format_BGR24, + Format_BGR565, + Format_BGR555, + Format_BGRA5658_Premultiplied, + + Format_AYUV444, + Format_AYUV444_Premultiplied, + Format_YUV444, + Format_YUV420P, + Format_YV12, + Format_UYVY, + Format_YUYV, + Format_NV12, + Format_NV21, + Format_IMC1, + Format_IMC2, + Format_IMC3, + Format_IMC4, + Format_Y8, + Format_Y16, + + Format_User = 1000 + }; + + QVideoFrame(); + QVideoFrame(QAbstractVideoBuffer *buffer, const QSize &size, PixelFormat format); + QVideoFrame(int bytes, const QSize &size, int bytesPerLine, PixelFormat format); + QVideoFrame(const QImage &image); + QVideoFrame(const QVideoFrame &other); + ~QVideoFrame(); + + QVideoFrame &operator =(const QVideoFrame &other); + + bool isValid() const; + + PixelFormat pixelFormat() const; + + QAbstractVideoBuffer::HandleType handleType() const; + + QSize size() const; + int width() const; + int height() const; + + FieldType fieldType() const; + void setFieldType(FieldType); + + bool isMapped() const; + bool isReadable() const; + bool isWritable() const; + + QAbstractVideoBuffer::MapMode mapMode() const; + + bool map(QAbstractVideoBuffer::MapMode mode); + void unmap(); + + int bytesPerLine() const; + + uchar *bits(); + const uchar *bits() const; + int mappedBytes() const; + + QVariant handle() const; + + qint64 startTime() const; + void setStartTime(qint64 time); + + qint64 endTime() const; + void setEndTime(qint64 time); + + static PixelFormat pixelFormatFromImageFormat(QImage::Format format); + static QImage::Format imageFormatFromPixelFormat(PixelFormat format); + +private: + QExplicitlySharedDataPointer d; +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QVideoFrame::FieldType) +Q_DECLARE_METATYPE(QVideoFrame::PixelFormat) + +QT_END_HEADER + +#endif + diff --git a/src/multimedia/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/multimedia/video/qvideosurfaceformat.cpp new file mode 100644 index 0000000..1fc13a6 --- /dev/null +++ b/src/multimedia/multimedia/video/qvideosurfaceformat.cpp @@ -0,0 +1,704 @@ +/**************************************************************************** +** +** 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 "qvideosurfaceformat.h" + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QVideoSurfaceFormatPrivate : public QSharedData +{ +public: + QVideoSurfaceFormatPrivate() + : pixelFormat(QVideoFrame::Format_Invalid) + , handleType(QAbstractVideoBuffer::NoHandle) + , scanLineDirection(QVideoSurfaceFormat::TopToBottom) + , pixelAspectRatio(1, 1) + , ycbcrColorSpace(QVideoSurfaceFormat::YCbCr_Undefined) + , frameRate(0.0) + { + } + + QVideoSurfaceFormatPrivate( + const QSize &size, + QVideoFrame::PixelFormat format, + QAbstractVideoBuffer::HandleType type) + : pixelFormat(format) + , handleType(type) + , scanLineDirection(QVideoSurfaceFormat::TopToBottom) + , frameSize(size) + , pixelAspectRatio(1, 1) + , ycbcrColorSpace(QVideoSurfaceFormat::YCbCr_Undefined) + , viewport(QPoint(0, 0), size) + , frameRate(0.0) + { + } + + QVideoSurfaceFormatPrivate(const QVideoSurfaceFormatPrivate &other) + : QSharedData(other) + , pixelFormat(other.pixelFormat) + , handleType(other.handleType) + , scanLineDirection(other.scanLineDirection) + , frameSize(other.frameSize) + , pixelAspectRatio(other.pixelAspectRatio) + , ycbcrColorSpace(other.ycbcrColorSpace) + , viewport(other.viewport) + , frameRate(other.frameRate) + , propertyNames(other.propertyNames) + , propertyValues(other.propertyValues) + { + } + + bool operator ==(const QVideoSurfaceFormatPrivate &other) const + { + if (pixelFormat == other.pixelFormat + && handleType == other.handleType + && scanLineDirection == other.scanLineDirection + && frameSize == other.frameSize + && pixelAspectRatio == other.pixelAspectRatio + && viewport == other.viewport + && frameRatesEqual(frameRate, other.frameRate) + && ycbcrColorSpace == other.ycbcrColorSpace + && propertyNames.count() == other.propertyNames.count()) { + for (int i = 0; i < propertyNames.count(); ++i) { + int j = other.propertyNames.indexOf(propertyNames.at(i)); + + if (j == -1 || propertyValues.at(i) != other.propertyValues.at(j)) + return false; + } + return true; + } else { + return false; + } + } + + inline static bool frameRatesEqual(qreal r1, qreal r2) + { + return qAbs(r1 - r2) <= 0.00001 * qMin(qAbs(r1), qAbs(r2)); + } + + QVideoFrame::PixelFormat pixelFormat; + QAbstractVideoBuffer::HandleType handleType; + QVideoSurfaceFormat::Direction scanLineDirection; + QSize frameSize; + QSize pixelAspectRatio; + QVideoSurfaceFormat::YCbCrColorSpace ycbcrColorSpace; + QRect viewport; + qreal frameRate; + QList propertyNames; + QList propertyValues; +}; + +/*! + \class QVideoSurfaceFormat + \brief The QVideoSurfaceFormat class specifies the stream format of a video presentation + surface. + \since 4.6 + + A video surface presents a stream of video frames. The surface's format describes the type of + the frames and determines how they should be presented. + + The core properties of a video stream required to setup a video surface are the pixel format + given by pixelFormat(), and the frame dimensions given by frameSize(). + + If the surface is to present frames using a frame's handle a surface format will also include + a handle type which is given by the handleType() function. + + The region of a frame that is actually displayed on a video surface is given by the viewport(). + A stream may have a viewport less than the entire region of a frame to allow for videos smaller + than the nearest optimal size of a video frame. For example the width of a frame may be + extended so that the start of each scan line is eight byte aligned. + + Other common properties are the pixelAspectRatio(), scanLineDirection(), and frameRate(). + Additionally a stream may have some additional type specific properties which are listed by the + dynamicPropertyNames() function and can be accessed using the property(), and setProperty() + functions. +*/ + +/*! + \enum QVideoSurfaceFormat::Direction + + Enumerates the layout direction of video scan lines. + + \value TopToBottom Scan lines are arranged from the top of the frame to the bottom. + \value BottomToTop Scan lines are arranged from the bottom of the frame to the top. +*/ + +/*! + \enum QVideoSurfaceFormat::YCbCrColorSpace + + Enumerates the Y'CbCr color space of video frames. + + \value YCbCr_Undefined + No color space is specified. + + \value YCbCr_BT601 + A Y'CbCr color space defined by ITU-R recommendation BT.601 + with Y value range from 16 to 235, and Cb/Cr range from 16 to 240. + Used in standard definition video. + + \value YCbCr_BT709 + A Y'CbCr color space defined by ITU-R BT.709 with the same values range as YCbCr_BT601. Used + for HDTV. + + \value YCbCr_xvYCC601 + The BT.601 color space with the value range extended to 0 to 255. + It is backward compatibile with BT.601 and uses values outside BT.601 range to represent + wider colors range. + + \value YCbCr_xvYCC709 + The BT.709 color space with the value range extended to 0 to 255. + + \value YCbCr_JPEG + The full range Y'CbCr color space used in JPEG files. +*/ + +/*! + Constructs a null video stream format. +*/ + +QVideoSurfaceFormat::QVideoSurfaceFormat() + : d(new QVideoSurfaceFormatPrivate) +{ +} + +/*! + Contructs a description of stream which receives stream of \a type buffers with given frame + \a size and pixel \a format. +*/ + +QVideoSurfaceFormat::QVideoSurfaceFormat( + const QSize& size, QVideoFrame::PixelFormat format, QAbstractVideoBuffer::HandleType type) + : d(new QVideoSurfaceFormatPrivate(size, format, type)) +{ +} + +/*! + Constructs a copy of \a other. +*/ + +QVideoSurfaceFormat::QVideoSurfaceFormat(const QVideoSurfaceFormat &other) + : d(other.d) +{ +} + +/*! + Assigns the values of \a other to a video stream description. +*/ + +QVideoSurfaceFormat &QVideoSurfaceFormat::operator =(const QVideoSurfaceFormat &other) +{ + d = other.d; + + return *this; +} + +/*! + Destroys a video stream description. +*/ + +QVideoSurfaceFormat::~QVideoSurfaceFormat() +{ +} + +/*! + Identifies if a video surface format has a valid pixel format and frame size. + + Returns true if the format is valid, and false otherwise. +*/ + +bool QVideoSurfaceFormat::isValid() const +{ + return d->pixelFormat == QVideoFrame::Format_Invalid && d->frameSize.isValid(); +} + +/*! + Returns true if \a other is the same as a video format, and false if they are the different. +*/ + +bool QVideoSurfaceFormat::operator ==(const QVideoSurfaceFormat &other) const +{ + return d == other.d || *d == *other.d; +} + +/*! + Returns true if \a other is different to a video format, and false if they are the same. +*/ + +bool QVideoSurfaceFormat::operator !=(const QVideoSurfaceFormat &other) const +{ + return d != other.d && !(*d == *other.d); +} + +/*! + Returns the pixel format of frames in a video stream. +*/ + +QVideoFrame::PixelFormat QVideoSurfaceFormat::pixelFormat() const +{ + return d->pixelFormat; +} + +/*! + Returns the type of handle the surface uses to present the frame data. + + If the handle type is QAbstractVideoBuffer::NoHandle buffers with any handle type are valid + provided they can be \l {QAbstractVideoBuffer::map()}{mapped} with the + QAbstractVideoBuffer::ReadOnly flag. If the handleType() is not QAbstractVideoBuffer::NoHandle + then the handle type of the buffer be the same as that of the surface format. +*/ + +QAbstractVideoBuffer::HandleType QVideoSurfaceFormat::handleType() const +{ + return d->handleType; +} + +/*! + Returns the size of frames in a video stream. + + \sa frameWidth(), frameHeight() +*/ + +QSize QVideoSurfaceFormat::frameSize() const +{ + return d->frameSize; +} + +/*! + Returns the width of frames in a video stream. + + \sa frameSize(), frameHeight() +*/ + +int QVideoSurfaceFormat::frameWidth() const +{ + return d->frameSize.width(); +} + +/*! + Returns the height of frame in a video stream. +*/ + +int QVideoSurfaceFormat::frameHeight() const +{ + return d->frameSize.height(); +} + +/*! + Sets the size of frames in a video stream to \a size. + + This will reset the viewport() to fill the entire frame. +*/ + +void QVideoSurfaceFormat::setFrameSize(const QSize &size) +{ + d->frameSize = size; + d->viewport = QRect(QPoint(0, 0), size); +} + +/*! + \overload + + Sets the \a width and \a height of frames in a video stream. + + This will reset the viewport() to fill the entire frame. +*/ + +void QVideoSurfaceFormat::setFrameSize(int width, int height) +{ + d->frameSize = QSize(width, height); + d->viewport = QRect(0, 0, width, height); +} + +/*! + Returns the viewport of a video stream. + + The viewport is the region of a video frame that is actually displayed. + + By default the viewport covers an entire frame. +*/ + +QRect QVideoSurfaceFormat::viewport() const +{ + return d->viewport; +} + +/*! + Sets the viewport of a video stream to \a viewport. +*/ + +void QVideoSurfaceFormat::setViewport(const QRect &viewport) +{ + d->viewport = viewport; +} + +/*! + Returns the direction of scan lines. +*/ + +QVideoSurfaceFormat::Direction QVideoSurfaceFormat::scanLineDirection() const +{ + return d->scanLineDirection; +} + +/*! + Sets the \a direction of scan lines. +*/ + +void QVideoSurfaceFormat::setScanLineDirection(Direction direction) +{ + d->scanLineDirection = direction; +} + +/*! + Returns the frame rate of a video stream in frames per second. +*/ + +qreal QVideoSurfaceFormat::frameRate() const +{ + return d->frameRate; +} + +/*! + Sets the frame \a rate of a video stream in frames per second. +*/ + +void QVideoSurfaceFormat::setFrameRate(qreal rate) +{ + d->frameRate = rate; +} + +/*! + Returns a video stream's pixel aspect ratio. +*/ + +QSize QVideoSurfaceFormat::pixelAspectRatio() const +{ + return d->pixelAspectRatio; +} + +/*! + Sets a video stream's pixel aspect \a ratio. +*/ + +void QVideoSurfaceFormat::setPixelAspectRatio(const QSize &ratio) +{ + d->pixelAspectRatio = ratio; +} + +/*! + \overload + + Sets the \a horizontal and \a vertical elements of a video stream's pixel aspect ratio. +*/ + +void QVideoSurfaceFormat::setPixelAspectRatio(int horizontal, int vertical) +{ + d->pixelAspectRatio = QSize(horizontal, vertical); +} + +/*! + Returns the Y'CbCr color space of a video stream. +*/ + +QVideoSurfaceFormat::YCbCrColorSpace QVideoSurfaceFormat::yCbCrColorSpace() const +{ + return d->ycbcrColorSpace; +} + +/*! + Sets the Y'CbCr color \a space of a video stream. + It is only used with raw YUV frame types. +*/ + +void QVideoSurfaceFormat::setYCbCrColorSpace(QVideoSurfaceFormat::YCbCrColorSpace space) +{ + d->ycbcrColorSpace = space; +} + +/*! + Returns a suggested size in pixels for the video stream. + + This is the size of the viewport scaled according to the pixel aspect ratio. +*/ + +QSize QVideoSurfaceFormat::sizeHint() const +{ + QSize size = d->viewport.size(); + + if (d->pixelAspectRatio.height() != 0) + size.setWidth(size.width() * d->pixelAspectRatio.width() / d->pixelAspectRatio.height()); + + return size; +} + +/*! + Returns a list of video format dynamic property names. +*/ + +QList QVideoSurfaceFormat::propertyNames() const +{ + return (QList() + << "handleType" + << "pixelFormat" + << "frameSize" + << "frameWidth" + << "viewport" + << "scanLineDirection" + << "frameRate" + << "pixelAspectRatio" + << "sizeHint" + << "yCbCrColorSpace") + + d->propertyNames; +} + +/*! + Returns the value of the video format's \a name property. +*/ + +QVariant QVideoSurfaceFormat::property(const char *name) const +{ + if (qstrcmp(name, "handleType") == 0) { + return qVariantFromValue(d->handleType); + } else if (qstrcmp(name, "pixelFormat") == 0) { + return qVariantFromValue(d->pixelFormat); + } else if (qstrcmp(name, "handleType") == 0) { + return qVariantFromValue(d->handleType); + } else if (qstrcmp(name, "frameSize") == 0) { + return d->frameSize; + } else if (qstrcmp(name, "frameWidth") == 0) { + return d->frameSize.width(); + } else if (qstrcmp(name, "frameHeight") == 0) { + return d->frameSize.height(); + } else if (qstrcmp(name, "viewport") == 0) { + return d->viewport; + } else if (qstrcmp(name, "scanLineDirection") == 0) { + return qVariantFromValue(d->scanLineDirection); + } else if (qstrcmp(name, "frameRate") == 0) { + return qVariantFromValue(d->frameRate); + } else if (qstrcmp(name, "pixelAspectRatio") == 0) { + return qVariantFromValue(d->pixelAspectRatio); + } else if (qstrcmp(name, "sizeHint") == 0) { + return sizeHint(); + } else if (qstrcmp(name, "yCbCrColorSpace") == 0) { + return qVariantFromValue(d->ycbcrColorSpace); + } else { + int id = 0; + for (; id < d->propertyNames.count() && d->propertyNames.at(id) != name; ++id) {} + + return id < d->propertyValues.count() + ? d->propertyValues.at(id) + : QVariant(); + } +} + +/*! + Sets the video format's \a name property to \a value. +*/ + +void QVideoSurfaceFormat::setProperty(const char *name, const QVariant &value) +{ + if (qstrcmp(name, "handleType") == 0) { + // read only. + } else if (qstrcmp(name, "pixelFormat") == 0) { + // read only. + } else if (qstrcmp(name, "frameSize") == 0) { + if (qVariantCanConvert(value)) { + d->frameSize = qvariant_cast(value); + d->viewport = QRect(QPoint(0, 0), d->frameSize); + } + } else if (qstrcmp(name, "frameWidth") == 0) { + // read only. + } else if (qstrcmp(name, "frameHeight") == 0) { + // read only. + } else if (qstrcmp(name, "viewport") == 0) { + if (qVariantCanConvert(value)) + d->viewport = qvariant_cast(value); + } else if (qstrcmp(name, "scanLineDirection") == 0) { + if (qVariantCanConvert(value)) + d->scanLineDirection = qvariant_cast(value); + } else if (qstrcmp(name, "frameRate") == 0) { + if (qVariantCanConvert(value)) + d->frameRate = qvariant_cast(value); + } else if (qstrcmp(name, "pixelAspectRatio") == 0) { + if (qVariantCanConvert(value)) + d->pixelAspectRatio = qvariant_cast(value); + } else if (qstrcmp(name, "sizeHint") == 0) { + // read only. + } else if (qstrcmp(name, "yCbCrColorSpace") == 0) { + if (qVariantCanConvert(value)) + d->ycbcrColorSpace = qvariant_cast(value); + } else { + int id = 0; + for (; id < d->propertyNames.count() && d->propertyNames.at(id) != name; ++id) {} + + if (id < d->propertyValues.count()) { + if (value.isNull()) { + d->propertyNames.removeAt(id); + d->propertyValues.removeAt(id); + } else { + d->propertyValues[id] = value; + } + } else if (!value.isNull()) { + d->propertyNames.append(QByteArray(name)); + d->propertyValues.append(value); + } + } +} + + +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QVideoSurfaceFormat &f) +{ + QString typeName; + switch (f.pixelFormat()) { + case QVideoFrame::Format_Invalid: + typeName = QLatin1String("Format_Invalid"); + break; + case QVideoFrame::Format_ARGB32: + typeName = QLatin1String("Format_ARGB32"); + break; + case QVideoFrame::Format_ARGB32_Premultiplied: + typeName = QLatin1String("Format_ARGB32_Premultiplied"); + break; + case QVideoFrame::Format_RGB32: + typeName = QLatin1String("Format_RGB32"); + break; + case QVideoFrame::Format_RGB24: + typeName = QLatin1String("Format_RGB24"); + break; + case QVideoFrame::Format_RGB565: + typeName = QLatin1String("Format_RGB565"); + break; + case QVideoFrame::Format_RGB555: + typeName = QLatin1String("Format_RGB555"); + break; + case QVideoFrame::Format_ARGB8565_Premultiplied: + typeName = QLatin1String("Format_ARGB8565_Premultiplied"); + break; + case QVideoFrame::Format_BGRA32: + typeName = QLatin1String("Format_BGRA32"); + break; + case QVideoFrame::Format_BGRA32_Premultiplied: + typeName = QLatin1String("Format_BGRA32_Premultiplied"); + break; + case QVideoFrame::Format_BGR32: + typeName = QLatin1String("Format_BGR32"); + break; + case QVideoFrame::Format_BGR24: + typeName = QLatin1String("Format_BGR24"); + break; + case QVideoFrame::Format_BGR565: + typeName = QLatin1String("Format_BGR565"); + break; + case QVideoFrame::Format_BGR555: + typeName = QLatin1String("Format_BGR555"); + break; + case QVideoFrame::Format_BGRA5658_Premultiplied: + typeName = QLatin1String("Format_BGRA5658_Premultiplied"); + break; + case QVideoFrame::Format_AYUV444: + typeName = QLatin1String("Format_AYUV444"); + break; + case QVideoFrame::Format_AYUV444_Premultiplied: + typeName = QLatin1String("Format_AYUV444_Premultiplied"); + break; + case QVideoFrame::Format_YUV444: + typeName = QLatin1String("Format_YUV444"); + break; + case QVideoFrame::Format_YUV420P: + typeName = QLatin1String("Format_YUV420P"); + break; + case QVideoFrame::Format_YV12: + typeName = QLatin1String("Format_YV12"); + break; + case QVideoFrame::Format_UYVY: + typeName = QLatin1String("Format_UYVY"); + break; + case QVideoFrame::Format_YUYV: + typeName = QLatin1String("Format_YUYV"); + break; + case QVideoFrame::Format_NV12: + typeName = QLatin1String("Format_NV12"); + break; + case QVideoFrame::Format_NV21: + typeName = QLatin1String("Format_NV21"); + break; + case QVideoFrame::Format_IMC1: + typeName = QLatin1String("Format_IMC1"); + break; + case QVideoFrame::Format_IMC2: + typeName = QLatin1String("Format_IMC2"); + break; + case QVideoFrame::Format_IMC3: + typeName = QLatin1String("Format_IMC3"); + break; + case QVideoFrame::Format_IMC4: + typeName = QLatin1String("Format_IMC4"); + break; + case QVideoFrame::Format_Y8: + typeName = QLatin1String("Format_Y8"); + break; + case QVideoFrame::Format_Y16: + typeName = QLatin1String("Format_Y16"); + default: + typeName = QString(QLatin1String("UserType(%1)" )).arg(int(f.pixelFormat())); + } + + dbg.nospace() << "QVideoSurfaceFormat(" << typeName; + dbg.nospace() << ", " << f.frameSize(); + dbg.nospace() << ", viewport=" << f.viewport(); + dbg.nospace() << ", pixelAspectRatio=" << f.pixelAspectRatio(); + dbg.nospace() << ")"; + + foreach(const QByteArray& propertyName, f.propertyNames()) + dbg << "\n " << propertyName.data() << " = " << f.property(propertyName.data()); + + return dbg.space(); +} +#endif + +QT_END_NAMESPACE diff --git a/src/multimedia/multimedia/video/qvideosurfaceformat.h b/src/multimedia/multimedia/video/qvideosurfaceformat.h new file mode 100644 index 0000000..9c73f5f --- /dev/null +++ b/src/multimedia/multimedia/video/qvideosurfaceformat.h @@ -0,0 +1,147 @@ +/**************************************************************************** +** +** 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 QVIDEOSURFACEFORMAT_H +#define QVIDEOSURFACEFORMAT_H + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QDebug; + +class QVideoSurfaceFormatPrivate; + +class Q_MULTIMEDIA_EXPORT QVideoSurfaceFormat +{ +public: + enum Direction + { + TopToBottom, + BottomToTop + }; + + enum YCbCrColorSpace + { + YCbCr_Undefined, + YCbCr_BT601, + YCbCr_BT709, + YCbCr_xvYCC601, + YCbCr_xvYCC709, + YCbCr_JPEG, +#ifndef qdoc + YCbCr_CustomMatrix +#endif + }; + + QVideoSurfaceFormat(); + QVideoSurfaceFormat( + const QSize &size, + QVideoFrame::PixelFormat pixelFormat, + QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle); + QVideoSurfaceFormat(const QVideoSurfaceFormat &format); + ~QVideoSurfaceFormat(); + + QVideoSurfaceFormat &operator =(const QVideoSurfaceFormat &format); + + bool operator ==(const QVideoSurfaceFormat &format) const; + bool operator !=(const QVideoSurfaceFormat &format) const; + + bool isValid() const; + + QVideoFrame::PixelFormat pixelFormat() const; + QAbstractVideoBuffer::HandleType handleType() const; + + QSize frameSize() const; + void setFrameSize(const QSize &size); + void setFrameSize(int width, int height); + + int frameWidth() const; + int frameHeight() const; + + QRect viewport() const; + void setViewport(const QRect &viewport); + + Direction scanLineDirection() const; + void setScanLineDirection(Direction direction); + + qreal frameRate() const; + void setFrameRate(qreal rate); + + QSize pixelAspectRatio() const; + void setPixelAspectRatio(const QSize &ratio); + void setPixelAspectRatio(int width, int height); + + YCbCrColorSpace yCbCrColorSpace() const; + void setYCbCrColorSpace(YCbCrColorSpace colorSpace); + + QSize sizeHint() const; + + QList propertyNames() const; + QVariant property(const char *name) const; + void setProperty(const char *name, const QVariant &value); + +private: + QSharedDataPointer d; +}; + +#ifndef QT_NO_DEBUG_STREAM +Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QVideoSurfaceFormat &); +#endif + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QVideoSurfaceFormat::Direction) +Q_DECLARE_METATYPE(QVideoSurfaceFormat::YCbCrColorSpace) + +QT_END_HEADER + +#endif + diff --git a/src/multimedia/multimedia/video/video.pri b/src/multimedia/multimedia/video/video.pri new file mode 100644 index 0000000..0547a4c --- /dev/null +++ b/src/multimedia/multimedia/video/video.pri @@ -0,0 +1,21 @@ + +INCLUDEPATH += $$PWD + +HEADERS += \ + $$PWD/qabstractvideobuffer.h \ + $$PWD/qabstractvideobuffer_p.h \ + $$PWD/qabstractvideosurface.h \ + $$PWD/qabstractvideosurface_p.h \ + $$PWD/qimagevideobuffer_p.h \ + $$PWD/qmemoryvideobuffer_p.h \ + $$PWD/qvideoframe.h \ + $$PWD/qvideosurfaceformat.h + +SOURCES += \ + $$PWD/qabstractvideobuffer.cpp \ + $$PWD/qabstractvideosurface.cpp \ + $$PWD/qimagevideobuffer.cpp \ + $$PWD/qmemoryvideobuffer.cpp \ + $$PWD/qvideoframe.cpp \ + $$PWD/qvideosurfaceformat.cpp + diff --git a/src/multimedia/playback/playback.pri b/src/multimedia/playback/playback.pri deleted file mode 100644 index 09a81c9..0000000 --- a/src/multimedia/playback/playback.pri +++ /dev/null @@ -1,11 +0,0 @@ - -HEADERS += \ - $$PWD/qmediaplayer.h \ - $$PWD/qmediaplayercontrol.h - -SOURCES += \ - $$PWD/qmediaplayer.cpp \ - $$PWD/qmediaplayercontrol.cpp - - - diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp deleted file mode 100644 index 9466cad..0000000 --- a/src/multimedia/playback/qmediaplayer.cpp +++ /dev/null @@ -1,982 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -//#define DEBUG_PLAYER_STATE - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -/*! - \class QMediaPlayer - \brief The QMediaPlayer class allows the playing of a media source. - \ingroup multimedia - \since 4.7 - \preliminary - - The QMediaPlayer class is a high level media playback class. It can be used - to playback such content as songs, movies and internet radio. The content - to playback is specified as a QMediaContent, which can be thought of as a - main or canonical URL with addition information attached. When provided - with a QMediaContent playback may be able to commence. - - \code - player = new QMediaPlayer; - connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64))); - player->setMedia(QUrl::fromLocalFile("/Users/me/Music/coolsong.mp3")); - player->setVolume(50); - player->play(); - \endcode - - QVideoWidget can be used with QMediaPlayer for video rendering and QMediaPlaylist - for accessing playlist functionality. - - \code - player = new QMediaPlayer; - - playlist = new QMediaPlaylist; - playlist->setMediaObject(player); - playlist->append(QUrl("http://example.com/movie1.mp4")); - playlist->append(QUrl("http://example.com/movie2.mp4")); - - widget = new QVideoWidget; - widget->setMediaObject(player); - widget->show(); - - player->play(); - \endcode - - \sa QMediaObject, QMediaService, QVideoWidget, QMediaPlaylist -*/ - -namespace -{ -class MediaPlayerRegisterMetaTypes -{ -public: - MediaPlayerRegisterMetaTypes() - { - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - } -} _registerPlayerMetaTypes; -} - -class QMediaPlayerPrivate : public QMediaObjectPrivate -{ - Q_DECLARE_NON_CONST_PUBLIC(QMediaPlayer) - -public: - QMediaPlayerPrivate() - : provider(0) - , control(0) - , playlistControl(0) - , state(QMediaPlayer::StoppedState) - , error(QMediaPlayer::NoError) - , filterStates(false) - , playlist(0) - {} - - QMediaServiceProvider *provider; - QMediaPlayerControl* control; - QMediaPlaylistControl* playlistControl; - QMediaPlayer::State state; - QMediaPlayer::Error error; - QString errorString; - bool filterStates; - - QMediaPlaylist *playlist; - QPointer videoWidget; - QPointer videoItem; - - void _q_stateChanged(QMediaPlayer::State state); - void _q_mediaStatusChanged(QMediaPlayer::MediaStatus status); - void _q_error(int error, const QString &errorString); - void _q_updateMedia(const QMediaContent&); - void _q_playlistDestroyed(); -}; - -#define ENUM_NAME(c,e,v) (c::staticMetaObject.enumerator(c::staticMetaObject.indexOfEnumerator(e)).valueToKey((v))) - -void QMediaPlayerPrivate::_q_stateChanged(QMediaPlayer::State ps) -{ - Q_Q(QMediaPlayer); - -#ifdef DEBUG_PLAYER_STATE - qDebug() << "State changed:" << ENUM_NAME(QMediaPlayer, "State", ps) << (filterStates ? "(filtered)" : ""); -#endif - - if (filterStates) - return; - - if (playlist - && !playlistControl //service should do this itself - && ps != state && ps == QMediaPlayer::StoppedState - && control->mediaStatus() == QMediaPlayer::EndOfMedia) { - playlist->next(); - ps = control->state(); - } - - if (ps != state) { - state = ps; - - if (ps == QMediaPlayer::PlayingState) - q->addPropertyWatch("position"); - else - q->removePropertyWatch("position"); - - emit q->stateChanged(ps); - } -} - -void QMediaPlayerPrivate::_q_mediaStatusChanged(QMediaPlayer::MediaStatus status) -{ - Q_Q(QMediaPlayer); - -#ifdef DEBUG_PLAYER_STATE - qDebug() << "MediaStatus changed:" << ENUM_NAME(QMediaPlayer, "MediaStatus", status); -#endif - - switch (status) { - case QMediaPlayer::StalledMedia: - case QMediaPlayer::BufferingMedia: - q->addPropertyWatch("bufferStatus"); - emit q->mediaStatusChanged(status); - break; - default: - q->removePropertyWatch("bufferStatus"); - emit q->mediaStatusChanged(status); - break; - } - -} - -void QMediaPlayerPrivate::_q_error(int error, const QString &errorString) -{ - Q_Q(QMediaPlayer); - - this->error = QMediaPlayer::Error(error); - this->errorString = errorString; - - emit q->error(this->error); -} - -void QMediaPlayerPrivate::_q_updateMedia(const QMediaContent &media) -{ - const QMediaPlayer::State currentState = state; - - filterStates = true; - control->setMedia(media, 0); - - if (!media.isNull()) { - switch (currentState) { - case QMediaPlayer::PlayingState: - control->play(); - break; - case QMediaPlayer::PausedState: - control->pause(); - break; - default: - break; - } - } - filterStates = false; - - state = control->state(); - - if (state != currentState) { -#ifdef DEBUG_PLAYER_STATE - qDebug() << "State changed:" << ENUM_NAME(QMediaPlayer, "State", state); -#endif - emit q_func()->stateChanged(state); - } -} - -void QMediaPlayerPrivate::_q_playlistDestroyed() -{ - playlist = 0; - - control->setMedia(QMediaContent(), 0); -} - -static QMediaService *playerService(QMediaPlayer::Flags flags, QMediaServiceProvider *provider) -{ - if (flags) { - QMediaServiceProviderHint::Features features = 0; - if (flags & QMediaPlayer::LowLatency) - features |= QMediaServiceProviderHint::LowLatencyPlayback; - - if (flags & QMediaPlayer::StreamPlayback) - features |= QMediaServiceProviderHint::StreamPlayback; - - return provider->requestService(Q_MEDIASERVICE_MEDIAPLAYER, - QMediaServiceProviderHint(features)); - } else - return provider->requestService(Q_MEDIASERVICE_MEDIAPLAYER); -} - - -/*! - Construct a QMediaPlayer that uses the playback service from \a provider, - parented to \a parent and with \a flags. - - If a playback service is not specified the system default will be used. -*/ - -QMediaPlayer::QMediaPlayer(QObject *parent, QMediaPlayer::Flags flags, QMediaServiceProvider *provider): - QMediaObject(*new QMediaPlayerPrivate, - parent, - playerService(flags,provider)) -{ - Q_D(QMediaPlayer); - - d->provider = provider; - - if (d->service == 0) { - d->error = ServiceMissingError; - } else { - d->control = qobject_cast(d->service->control(QMediaPlayerControl_iid)); - d->playlistControl = qobject_cast(d->service->control(QMediaPlaylistControl_iid)); - if (d->control != 0) { - connect(d->control, SIGNAL(mediaChanged(QMediaContent)), SIGNAL(mediaChanged(QMediaContent))); - connect(d->control, SIGNAL(stateChanged(QMediaPlayer::State)), SLOT(_q_stateChanged(QMediaPlayer::State))); - connect(d->control, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), - SLOT(_q_mediaStatusChanged(QMediaPlayer::MediaStatus))); - connect(d->control, SIGNAL(error(int,QString)), SLOT(_q_error(int,QString))); - - connect(d->control, SIGNAL(durationChanged(qint64)), SIGNAL(durationChanged(qint64))); - connect(d->control, SIGNAL(positionChanged(qint64)), SIGNAL(positionChanged(qint64))); - connect(d->control, SIGNAL(audioAvailableChanged(bool)), SIGNAL(audioAvailableChanged(bool))); - connect(d->control, SIGNAL(videoAvailableChanged(bool)), SIGNAL(videoAvailableChanged(bool))); - connect(d->control, SIGNAL(volumeChanged(int)), SIGNAL(volumeChanged(int))); - connect(d->control, SIGNAL(mutedChanged(bool)), SIGNAL(mutedChanged(bool))); - connect(d->control, SIGNAL(seekableChanged(bool)), SIGNAL(seekableChanged(bool))); - connect(d->control, SIGNAL(playbackRateChanged(qreal)), SIGNAL(playbackRateChanged(qreal))); - - if (d->control->state() == PlayingState) - addPropertyWatch("position"); - - if (d->control->mediaStatus() == StalledMedia || d->control->mediaStatus() == BufferingMedia) - addPropertyWatch("bufferStatus"); - } - } -} - - -/*! - Destroys the player object. -*/ - -QMediaPlayer::~QMediaPlayer() -{ - Q_D(QMediaPlayer); - - d->provider->releaseService(d->service); -} - -QMediaContent QMediaPlayer::media() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->media(); - - return QMediaContent(); -} - -/*! - Returns the stream source of media data. - - This is only valid if a stream was passed to setMedia(). - - \sa setMedia() -*/ - -const QIODevice *QMediaPlayer::mediaStream() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->mediaStream(); - - return 0; -} - -QMediaPlayer::State QMediaPlayer::state() const -{ - return d_func()->state; -} - -QMediaPlayer::MediaStatus QMediaPlayer::mediaStatus() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->mediaStatus(); - - return QMediaPlayer::UnknownMediaStatus; -} - -qint64 QMediaPlayer::duration() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->duration(); - - return -1; -} - -qint64 QMediaPlayer::position() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->position(); - - return 0; -} - -int QMediaPlayer::volume() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->volume(); - - return 0; -} - -bool QMediaPlayer::isMuted() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->isMuted(); - - return false; -} - -int QMediaPlayer::bufferStatus() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->bufferStatus(); - - return 0; -} - -bool QMediaPlayer::isAudioAvailable() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->isAudioAvailable(); - - return false; -} - -bool QMediaPlayer::isVideoAvailable() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->isVideoAvailable(); - - return false; -} - -bool QMediaPlayer::isSeekable() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->isSeekable(); - - return false; -} - -qreal QMediaPlayer::playbackRate() const -{ - Q_D(const QMediaPlayer); - - if (d->control != 0) - return d->control->playbackRate(); - - return 0.0; -} - -/*! - Returns the current error state. -*/ - -QMediaPlayer::Error QMediaPlayer::error() const -{ - return d_func()->error; -} - -QString QMediaPlayer::errorString() const -{ - return d_func()->errorString; -} - -//public Q_SLOTS: -/*! - Start or resume playing the current source. -*/ - -void QMediaPlayer::play() -{ - Q_D(QMediaPlayer); - - if (d->control == 0) { - QMetaObject::invokeMethod(this, "_q_error", Qt::QueuedConnection); - Q_ARG(int, QMediaPlayer::ServiceMissingError), - Q_ARG(QString, tr("The QMediaPlayer object does not have a valid service")); - return; - } - - //if playlist control is available, the service should advance itself - if (d->playlist && !d->playlistControl && d->playlist->currentIndex() == -1 && !d->playlist->isEmpty()) - d->playlist->setCurrentIndex(0); - - // Reset error conditions - d->error = NoError; - d->errorString = QString(); - - d->control->play(); -} - -/*! - Pause playing the current source. -*/ - -void QMediaPlayer::pause() -{ - Q_D(QMediaPlayer); - - if (d->control != 0) - d->control->pause(); -} - -/*! - Stop playing, and reset the play position to the beginning. -*/ - -void QMediaPlayer::stop() -{ - Q_D(QMediaPlayer); - - if (d->control != 0) - d->control->stop(); -} - -void QMediaPlayer::setPosition(qint64 position) -{ - Q_D(QMediaPlayer); - - if (d->control == 0 || !isSeekable()) - return; - - d->control->setPosition(qBound(qint64(0), duration(), position)); -} - -void QMediaPlayer::setVolume(int v) -{ - Q_D(QMediaPlayer); - - if (d->control == 0) - return; - - int clamped = qBound(0, v, 100); - if (clamped == volume()) - return; - - d->control->setVolume(clamped); -} - -void QMediaPlayer::setMuted(bool muted) -{ - Q_D(QMediaPlayer); - - if (d->control == 0 || muted == isMuted()) - return; - - d->control->setMuted(muted); -} - -void QMediaPlayer::setPlaybackRate(qreal rate) -{ - Q_D(QMediaPlayer); - - if (d->control != 0) - d->control->setPlaybackRate(rate); -} - -/*! - Sets the current \a media source. - - If a \a stream is supplied; media data will be read from it instead of resolving the media - source. In this case the media source may still be used to resolve additional information - about the media such as mime type. - - Setting the media to a null QMediaContent will cause the player to discard all - information relating to the current media source and to cease all I/O operations related - to that media. -*/ - -void QMediaPlayer::setMedia(const QMediaContent &media, QIODevice *stream) -{ - Q_D(QMediaPlayer); - - if (d->control != 0) - d_func()->control->setMedia(media, stream); -} - -/*! - \internal -*/ - -void QMediaPlayer::bind(QObject *obj) -{ - Q_D(QMediaPlayer); - - if (d->control != 0) { - QMediaPlaylist *playlist = qobject_cast(obj); - - if (playlist) { - if (d->playlist) - d->playlist->setMediaObject(0); - - d->playlist = playlist; - connect(d->playlist, SIGNAL(currentMediaChanged(QMediaContent)), - this, SLOT(_q_updateMedia(QMediaContent))); - connect(d->playlist, SIGNAL(destroyed()), this, SLOT(_q_playlistDestroyed())); - - setMedia(playlist->currentMedia()); - - return; - } - - QVideoWidget *videoWidget = qobject_cast(obj); - QGraphicsVideoItem *videoItem = qobject_cast(obj); - - if (videoWidget || videoItem) { - //detach the current video output - if (d->videoWidget) { - d->videoWidget->setMediaObject(0); - d->videoWidget = 0; - } - - if (d->videoItem) { - d->videoItem->setMediaObject(0); - d->videoItem = 0; - } - } - - if (videoWidget) - d->videoWidget = videoWidget; - - if (videoItem) - d->videoItem = videoItem; - } -} - -/*! - \internal -*/ - -void QMediaPlayer::unbind(QObject *obj) -{ - Q_D(QMediaPlayer); - - if (obj == d->videoWidget) { - d->videoWidget = 0; - } else if (obj == d->videoItem) { - d->videoItem = 0; - } else if (obj == d->playlist) { - disconnect(d->playlist, SIGNAL(currentMediaChanged(QMediaContent)), - this, SLOT(_q_updateMedia(QMediaContent))); - disconnect(d->playlist, SIGNAL(destroyed()), this, SLOT(_q_playlistDestroyed())); - d->playlist = 0; - setMedia(QMediaContent()); - } -} - -/*! - Returns the level of support a media player has for a \a mimeType and a set of \a codecs. - - The \a flags argument allows additional requirements such as performance indicators to be - specified. -*/ -QtMultimedia::SupportEstimate QMediaPlayer::hasSupport(const QString &mimeType, - const QStringList& codecs, - Flags flags) -{ - return QMediaServiceProvider::defaultServiceProvider()->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), - mimeType, - codecs, - flags); -} - -/*! - Returns a list of MIME types supported by the media player. - - The \a flags argument causes the resultant list to be restricted to MIME types which can be supported - given additional requirements, such as performance indicators. -*/ -QStringList QMediaPlayer::supportedMimeTypes(Flags flags) -{ - return QMediaServiceProvider::defaultServiceProvider()->supportedMimeTypes(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), - flags); -} - - -// Enums -/*! - \enum QMediaPlayer::State - - Defines the current state of a media player. - - \value PlayingState The media player is currently playing content. - \value PausedState The media player has paused playback, playback of the current track will - resume from the position the player was paused at. - \value StoppedState The media player is not playing content, playback will begin from the start - of the current track. -*/ - -/*! - \enum QMediaPlayer::MediaStatus - - Defines the status of a media player's current media. - - \value UnknownMediaStatus The status of the media cannot be determined. - \value NoMedia The is no current media. The player is in the StoppedState. - \value LoadingMedia The current media is being loaded. The player may be in any state. - \value LoadedMedia The current media has been loaded. The player is in the StoppedState. - \value StalledMedia Playback of the current media has stalled due to insufficient buffering or - some other temporary interruption. The player is in the PlayingState or PausedState. - \value BufferingMedia The player is buffering data but has enough data buffered for playback to - continue for the immediate future. The player is in the PlayingState or PausedState. - \value BufferedMedia The player has fully buffered the current media. The player is in the - PlayingState or PausedState. - \value EndOfMedia Playback has reached the end of the current media. The player is in the - StoppedState. - \value InvalidMedia The current media cannot be played. The player is in the StoppedState. -*/ - -/*! - \enum QMediaPlayer::Error - - Defines a media player error condition. - - \value NoError No error has occurred. - \value ResourceError A media resource couldn't be resolved. - \value FormatError The format of a media resource isn't (fully) supported. Playback may still - be possible, but without an audio or video component. - \value NetworkError A network error occurred. - \value AccessDeniedError There are not the appropriate permissions to play a media resource. - \value ServiceMissingError A valid playback service was not found, playback cannot proceed. -*/ - -// Signals -/*! - \fn QMediaPlayer::error(QMediaPlayer::Error error) - - Signals that an \a error condition has occurred. - - \sa errorString() -*/ - -/*! - \fn void QMediaPlayer::stateChanged(State state) - - Signal the \a state of the Player object has changed. -*/ - -/*! - \fn QMediaPlayer::mediaStatusChanged(QMediaPlayer::MediaStatus status) - - Signals that the \a status of the current media has changed. - - \sa mediaStatus() -*/ - -/*! - \fn void QMediaPlayer::mediaChanged(const QMediaContent &media); - - Signals that the current playing content will be obtained from \a media. - - \sa media() -*/ - -/*! - \fn void QMediaPlayer::playbackRateChanged(qreal rate); - - Signals the playbackRate has changed to \a rate. -*/ - -/*! - \fn void QMediaPlayer::seekableChanged(bool seekable); - - Signals the \a seekable status of the player object has changed. -*/ - -// Properties -/*! - \property QMediaPlayer::state - \brief the media player's playback state. - - By default this property is QMediaPlayer::Stopped - - \sa mediaStatus(), play(), pause(), stop() -*/ - -/*! - \property QMediaPlayer::error - \brief a string describing the last error condition. - - \sa error() -*/ - -/*! - \property QMediaPlayer::media - \brief the active media source being used by the player object. - - The player object will use the QMediaContent for selection of the content to - be played. - - By default this property has a null QMediaContent. - - Setting this property to a null QMediaContent will cause the player to discard all - information relating to the current media source and to cease all I/O operations related - to that media. - - \sa QMediaContent -*/ - -/*! - \property QMediaPlayer::mediaStatus - \brief the status of the current media stream. - - The stream status describes how the playback of the current stream is - progressing. - - By default this property is QMediaPlayer::NoMedia - - \sa state -*/ - -/*! - \property QMediaPlayer::duration - \brief the duration of the current media. - - The value is the total playback time in milliseconds of the current media. - The value may change across the life time of the QMediaPlayer object and - may not be available when initial playback begins, connect to the - durationChanged() signal to receive status notifications. -*/ - -/*! - \property QMediaPlayer::position - \brief the playback position of the current media. - - The value is the current playback position, expressed in milliseconds since - the beginning of the media. Periodically changes in the position will be - indicated with the signal positionChanged(), the interval between updates - can be set with QMediaObject's method setNotifyInterval(). -*/ - -/*! - \property QMediaPlayer::volume - \brief the current playback volume. - - The playback volume is a linear in effect and the value can range from 0 - - 100, values outside this range will be clamped. -*/ - -/*! - \property QMediaPlayer::muted - \brief the muted state of the current media. - - The value will be true if the playback volume is muted; otherwise false. -*/ - -/*! - \property QMediaPlayer::bufferStatus - \brief the percentage of the temporary buffer filled before playback begins. - - When the player object is buffering; this property holds the percentage of - the temporary buffer that is filled. The buffer will need to reach 100% - filled before playback can resume, at which time the MediaStatus will be - BufferedMedia. - - \sa mediaStatus() -*/ - -/*! - \property QMediaPlayer::audioAvailable - \brief the audio availabilty status for the current media. - - As the life time of QMediaPlayer can be longer than the playback of one - QMediaContent, this property may change over time, the - audioAvailableChanged signal can be used to monitor it's status. -*/ - -/*! - \property QMediaPlayer::videoAvailable - \brief the video availability status for the current media. - - If available, the QVideoWidget class can be used to view the video. As the - life time of QMediaPlayer can be longer than the playback of one - QMediaContent, this property may change over time, the - videoAvailableChanged signal can be used to monitor it's status. - - \sa QVideoWidget, QMediaContent -*/ - -/*! - \property QMediaPlayer::seekable - \brief the seek-able status of the current media - - If seeking is supported this property will be true; false otherwise. The - status of this property may change across the life time of the QMediaPlayer - object, use the seekableChanged signal to monitor changes. -*/ - -/*! - \property QMediaPlayer::playbackRate - \brief the playback rate of the current media. - - This value is a multiplier applied to the media's standard play rate. By - default this value is 1.0, indicating that the media is playing at the - standard pace. Values higher than 1.0 will increase the rate of play. - Values less than zero can be set and indicate the media will rewind at the - multiplier of the standard pace. - - Not all playback services support change of the playback rate. It is - framework defined as to the status and quality of audio and video - while fast forwarding or rewinding. -*/ - -/*! - \fn void QMediaPlayer::durationChanged(qint64 duration) - - Signal the duration of the content has changed to \a duration, expressed in milliseconds. -*/ - -/*! - \fn void QMediaPlayer::positionChanged(qint64 position) - - Signal the position of the content has changed to \a position, expressed in - milliseconds. -*/ - -/*! - \fn void QMediaPlayer::volumeChanged(int volume) - - Signal the playback volume has changed to \a volume. -*/ - -/*! - \fn void QMediaPlayer::mutedChanged(bool muted) - - Signal the mute state has changed to \a muted. -*/ - -/*! - \fn void QMediaPlayer::audioAvailableChanged(bool available) - - Signals the availability of audio content has changed to \a available. -*/ - -/*! - \fn void QMediaPlayer::videoAvailableChanged(bool videoAvailable) - - Signal the availability of visual content has changed to \a videoAvailable. -*/ - -/*! - \fn void QMediaPlayer::bufferStatusChanged(int percentFilled) - - Signal the amount of the local buffer filled as a percentage by \a percentFilled. -*/ - -/*! - \enum QMediaPlayer::Flag - - \value LowLatency - The player is expected to be used with simple audio formats, - but playback should start without significant delay. - Such playback service can be used for beeps, ringtones, etc. - - \value StreamPlayback - The player is expected to play QIODevice based streams. - If passed to QMediaPlayer constructor, the service supporting - streams playback will be choosen. -*/ - -QT_END_NAMESPACE - -QT_END_HEADER - -#include "moc_qmediaplayer.cpp" diff --git a/src/multimedia/playback/qmediaplayer.h b/src/multimedia/playback/qmediaplayer.h deleted file mode 100644 index 129b244..0000000 --- a/src/multimedia/playback/qmediaplayer.h +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIAPLAYER_H -#define QMEDIAPLAYER_H - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QMediaPlaylist; - -class QMediaPlayerPrivate; -class Q_MULTIMEDIA_EXPORT QMediaPlayer : public QMediaObject -{ - Q_OBJECT - Q_PROPERTY(QMediaContent media READ media WRITE setMedia NOTIFY mediaChanged) - Q_PROPERTY(qint64 duration READ duration NOTIFY durationChanged) - Q_PROPERTY(qint64 position READ position WRITE setPosition NOTIFY positionChanged) - Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) - Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) - Q_PROPERTY(int bufferStatus READ bufferStatus NOTIFY bufferStatusChanged) - Q_PROPERTY(bool audioAvailable READ isAudioAvailable NOTIFY audioAvailableChanged) - Q_PROPERTY(bool videoAvailable READ isVideoAvailable NOTIFY videoAvailableChanged) - Q_PROPERTY(bool seekable READ isSeekable NOTIFY seekableChanged) - Q_PROPERTY(qreal playbackRate READ playbackRate WRITE setPlaybackRate NOTIFY playbackRateChanged) - Q_PROPERTY(State state READ state NOTIFY stateChanged) - Q_PROPERTY(MediaStatus mediaStatus READ mediaStatus NOTIFY mediaStatusChanged) - Q_PROPERTY(QString error READ errorString) - Q_ENUMS(State) - Q_ENUMS(MediaStatus) - -public: - enum State - { - StoppedState, - PlayingState, - PausedState - }; - - enum MediaStatus - { - UnknownMediaStatus, - NoMedia, - LoadingMedia, - LoadedMedia, - StalledMedia, - BufferingMedia, - BufferedMedia, - EndOfMedia, - InvalidMedia - }; - - enum Flag - { - LowLatency = 0x01, - StreamPlayback = 0x02 - }; - Q_DECLARE_FLAGS(Flags, Flag) - - enum Error - { - NoError, - ResourceError, - FormatError, - NetworkError, - AccessDeniedError, - ServiceMissingError - }; - - QMediaPlayer(QObject *parent = 0, Flags flags = 0, QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider()); - ~QMediaPlayer(); - - static QtMultimedia::SupportEstimate hasSupport(const QString &mimeType, - const QStringList& codecs = QStringList(), - Flags flags = 0); - static QStringList supportedMimeTypes(Flags flags = 0); - - QMediaContent media() const; - const QIODevice *mediaStream() const; - - State state() const; - MediaStatus mediaStatus() const; - - qint64 duration() const; - qint64 position() const; - - int volume() const; - bool isMuted() const; - bool isAudioAvailable() const; - bool isVideoAvailable() const; - - int bufferStatus() const; - - bool isSeekable() const; - qreal playbackRate() const; - - Error error() const; - QString errorString() const; - -public Q_SLOTS: - void play(); - void pause(); - void stop(); - - void setPosition(qint64 position); - void setVolume(int volume); - void setMuted(bool muted); - - void setPlaybackRate(qreal rate); - - void setMedia(const QMediaContent &media, QIODevice *stream = 0); - -Q_SIGNALS: - void mediaChanged(const QMediaContent &media); - - void stateChanged(QMediaPlayer::State newState); - void mediaStatusChanged(QMediaPlayer::MediaStatus status); - - void durationChanged(qint64 duration); - void positionChanged(qint64 position); - - void volumeChanged(int volume); - void mutedChanged(bool muted); - void audioAvailableChanged(bool audioAvailable); - void videoAvailableChanged(bool videoAvailable); - - void bufferStatusChanged(int percentFilled); - - void seekableChanged(bool seekable); - void playbackRateChanged(qreal rate); - - void error(QMediaPlayer::Error error); - -public: - virtual void bind(QObject*); - virtual void unbind(QObject*); - -private: - Q_DISABLE_COPY(QMediaPlayer) - Q_DECLARE_PRIVATE(QMediaPlayer) - Q_PRIVATE_SLOT(d_func(), void _q_stateChanged(QMediaPlayer::State)) - Q_PRIVATE_SLOT(d_func(), void _q_mediaStatusChanged(QMediaPlayer::MediaStatus)) - Q_PRIVATE_SLOT(d_func(), void _q_error(int, const QString &)) - Q_PRIVATE_SLOT(d_func(), void _q_updateMedia(const QMediaContent&)) - Q_PRIVATE_SLOT(d_func(), void _q_playlistDestroyed()) -}; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QMediaPlayer::State) -Q_DECLARE_METATYPE(QMediaPlayer::MediaStatus) -Q_DECLARE_METATYPE(QMediaPlayer::Error) - -QT_END_HEADER - -#endif // QMEDIAPLAYER_H diff --git a/src/multimedia/playback/qmediaplayercontrol.cpp b/src/multimedia/playback/qmediaplayercontrol.cpp deleted file mode 100644 index 2129098..0000000 --- a/src/multimedia/playback/qmediaplayercontrol.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 - - -QT_BEGIN_NAMESPACE - - -/*! - \class QMediaPlayerControl - \ingroup multimedia-serv - \since 4.7 - \preliminary - \brief The QMediaPlayerControl class provides access to the media playing - functionality of a QMediaService. - - If a QMediaService can play media is will implement QMediaPlayerControl. - This control provides a means to set the \l {setMedia()}{media} to play, - \l {play()}{start}, \l {pause()} {pause} and \l {stop()}{stop} playback, - \l {setPosition()}{seek}, and control the \l {setVolume()}{volume}. - It also provides feedback on the \l {duration()}{duration} of the media, - the current \l {position()}{position}, and \l {bufferStatus()}{buffering} - progress. - - The functionality provided by this control is exposed to application - code through the QMediaPlayer class. - - The interface name of QMediaPlayerControl is \c com.nokia.Qt.QMediaPlayerControl/1.0 as - defined in QMediaPlayerControl_iid. - - \sa QMediaService::control(), QMediaPlayer -*/ - -/*! - \macro QMediaPlayerControl_iid - - \c com.nokia.Qt.QMediaPlayerControl/1.0 - - Defines the interface name of the QMediaPlayerControl class. - - \relates QMediaPlayerControl -*/ - -/*! - Destroys a media player control. -*/ -QMediaPlayerControl::~QMediaPlayerControl() -{ -} - -/*! - Constructs a new media player control with the given \a parent. -*/ -QMediaPlayerControl::QMediaPlayerControl(QObject *parent): - QMediaControl(*new QMediaControlPrivate, parent) -{ -} - -/*! - \fn QMediaPlayerControl::state() const - - Returns the state of a player control. -*/ - -/*! - \fn QMediaPlayerControl::stateChanged(QMediaPlayer::State state) - - Signals that the \a state of a player control has changed. - - \sa state() -*/ - -/*! - \fn QMediaPlayerControl::mediaStatus() const - - Returns the status of the current media. -*/ - -/*! - \fn QMediaPlayerControl::mediaStatusChanged(QMediaPlayer::MediaStatus status) - - Signals that the \a status of the current media has changed. - - \sa mediaStatus() -*/ - - -/*! - \fn QMediaPlayerControl::duration() const - - Returns the duration of the current media in milliseconds. -*/ - -/*! - \fn QMediaPlayerControl::durationChanged(qint64 duration) - - Signals that the \a duration of the current media has changed. - - \sa duration() -*/ - -/*! - \fn QMediaPlayerControl::position() const - - Returns the current playback position in milliseconds. -*/ - -/*! - \fn QMediaPlayerControl::setPosition(qint64 position) - - Sets the playback \a position of the current media. This will initiate a seek and it may take - some time for playback to reach the position set. -*/ - -/*! - \fn QMediaPlayerControl::positionChanged(qint64 position) - - Signals the playback \a position has changed. - - This is only emitted in when there has been a discontinous change in the playback postion, such - as a seek or the position being reset. - - \sa position() -*/ - -/*! - \fn QMediaPlayerControl::volume() const - - Returns the audio volume of a player control. -*/ - -/*! - \fn QMediaPlayerControl::setVolume(int volume) - - Sets the audio \a volume of a player control. -*/ - -/*! - \fn QMediaPlayerControl::volumeChanged(int volume) - - Signals the audio \a volume of a player control has changed. - - \sa volume() -*/ - -/*! - \fn QMediaPlayerControl::isMuted() const - - Returns the mute state of a player control. -*/ - -/*! - \fn QMediaPlayerControl::setMuted(bool mute) - - Sets the \a mute state of a player control. -*/ - -/*! - \fn QMediaPlayerControl::mutedChanged(bool mute) - - Signals a change in the \a mute status of a player control. - - \sa isMuted() -*/ - -/*! - \fn QMediaPlayerControl::bufferStatus() const - - Returns the buffering progress of the current media. Progress is measured in the percentage - of the buffer filled. -*/ - -/*! - \fn QMediaPlayerControl::bufferStatusChanged(int progress) - - Signals that buffering \a progress has changed. - - \sa bufferStatus() -*/ - -/*! - \fn QMediaPlayerControl::isAudioAvailable() const - - Identifies if there is audio output available for the current media. - - Returns true if audio output is available and false otherwise. -*/ - -/*! - \fn QMediaPlayerControl::audioAvailableChanged(bool audio) - - Signals that there has been a change in the availability of \a audio output. - - \sa isAudioAvailable() -*/ - -/*! - \fn QMediaPlayerControl::isVideoAvailable() const - - Identifies if there is video output available for the current media. - - Returns true if video output is available and false otherwise. -*/ - -/*! - \fn QMediaPlayerControl::videoAvailableChanged(bool video) - - Signals that there has been a change in the availability of \a video output. - - \sa isVideoAvailable() -*/ - -/*! - \fn QMediaPlayerControl::isSeekable() const - - Identifies if the current media is seekable. - - Returns true if it possible to seek within the current media, and false otherwise. -*/ - -/*! - \fn QMediaPlayerControl::seekableChanged(bool seekable) - - Signals that the \a seekable state of a player control has changed. - - \sa isSeekable() -*/ - -/*! - \fn QMediaPlayerControl::availablePlaybackRanges() const - - Returns a range of times in milliseconds that can be played back. - - Usually for local files this is a continuous interval equal to [0..duration()] - or an empty time range if seeking is not supported, but for network sources - it refers to the buffered parts of the media. -*/ - -/*! - \fn QMediaPlayerControl::availablePlaybackRangesChanged(const QMediaTimeRange &ranges) - - Signals that the available media playback \a ranges have changed. - - \sa QMediaPlayerControl::availablePlaybackRanges() -*/ - -/*! - \fn qreal QMediaPlayerControl::playbackRate() const - - Returns the rate of playback. -*/ - -/*! - \fn QMediaPlayerControl::setPlaybackRate(qreal rate) - - Sets the \a rate of playback. -*/ - -/*! - \fn QMediaPlayerControl::media() const - - Returns the current media source. -*/ - -/*! - \fn QMediaPlayerControl::mediaStream() const - - Returns the current media stream. This is only a valid if a stream was passed to setMedia(). - - \sa setMedia() -*/ - -/*! - \fn QMediaPlayerControl::setMedia(const QMediaContent &media, QIODevice *stream) - - Sets the current \a media source. If a \a stream is supplied; data will be read from that - instead of attempting to resolve the media source. The media source may still be used to - supply media information such as mime type. - - Setting the media to a null QMediaContent will cause the control to discard all - information relating to the current media source and to cease all I/O operations related - to that media. -*/ - -/*! - \fn QMediaPlayerControl::mediaChanged(const QMediaContent& content) - - Signals that the current media \a content has changed. -*/ - -/*! - \fn QMediaPlayerControl::play() - - Starts playback of the current media. - - If successful the player control will immediately enter the \l {QMediaPlayer::PlayingState} - {playing} state. - - \sa state() -*/ - -/*! - \fn QMediaPlayerControl::pause() - - Pauses playback of the current media. - - If sucessful the player control will immediately enter the \l {QMediaPlayer::PausedState} - {paused} state. - - \sa state(), play(), stop() -*/ - -/*! - \fn QMediaPlayerControl::stop() - - Stops playback of the current media. - - If succesful the player control will immediately enter the \l {QMediaPlayer::StoppedState} - {stopped} state. -*/ - -/*! - \fn QMediaPlayerControl::error(int error, const QString &errorString) - - Signals that an \a error has occurred. The \a errorString provides a more detailed explanation. -*/ - -/*! - \fn QMediaPlayerControl::playbackRateChanged(qreal rate) - - Signal emitted when playback rate changes to \a rate. -*/ - -QT_END_NAMESPACE - -#include "moc_qmediaplayercontrol.cpp" - diff --git a/src/multimedia/playback/qmediaplayercontrol.h b/src/multimedia/playback/qmediaplayercontrol.h deleted file mode 100644 index a7e418b..0000000 --- a/src/multimedia/playback/qmediaplayercontrol.h +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 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 QMEDIAPLAYERCONTROL_H -#define QMEDIAPLAYERCONTROL_H - -#include - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - - -class QMediaPlaylist; - -class Q_MULTIMEDIA_EXPORT QMediaPlayerControl : public QMediaControl -{ - Q_OBJECT - -public: - ~QMediaPlayerControl(); - - virtual QMediaPlayer::State state() const = 0; - - virtual QMediaPlayer::MediaStatus mediaStatus() const = 0; - - virtual qint64 duration() const = 0; - - virtual qint64 position() const = 0; - virtual void setPosition(qint64 position) = 0; - - virtual int volume() const = 0; - virtual void setVolume(int volume) = 0; - - virtual bool isMuted() const = 0; - virtual void setMuted(bool muted) = 0; - - virtual int bufferStatus() const = 0; - - virtual bool isAudioAvailable() const = 0; - virtual bool isVideoAvailable() const = 0; - - virtual bool isSeekable() const = 0; - - virtual QMediaTimeRange availablePlaybackRanges() const = 0; - - virtual qreal playbackRate() const = 0; - virtual void setPlaybackRate(qreal rate) = 0; - - virtual QMediaContent media() const = 0; - virtual const QIODevice *mediaStream() const = 0; - virtual void setMedia(const QMediaContent &media, QIODevice *stream) = 0; - - virtual void play() = 0; - virtual void pause() = 0; - virtual void stop() = 0; - -Q_SIGNALS: - void mediaChanged(const QMediaContent& content); - void durationChanged(qint64 duration); - void positionChanged(qint64 position); - void stateChanged(QMediaPlayer::State newState); - void mediaStatusChanged(QMediaPlayer::MediaStatus status); - void volumeChanged(int volume); - void mutedChanged(bool muted); - void audioAvailableChanged(bool audioAvailable); - void videoAvailableChanged(bool videoAvailable); - void bufferStatusChanged(int percentFilled); - void seekableChanged(bool); - void availablePlaybackRangesChanged(const QMediaTimeRange&); - void playbackRateChanged(qreal rate); - void error(int error, const QString &errorString); - -protected: - QMediaPlayerControl(QObject* parent = 0); -}; - -#define QMediaPlayerControl_iid "com.nokia.Qt.QMediaPlayerControl/1.0" -Q_MEDIA_DECLARE_CONTROL(QMediaPlayerControl, QMediaPlayerControl_iid) - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMEDIAPLAYERCONTROL_H - diff --git a/src/multimedia/video/qabstractvideobuffer.cpp b/src/multimedia/video/qabstractvideobuffer.cpp deleted file mode 100644 index e9d30d0..0000000 --- a/src/multimedia/video/qabstractvideobuffer.cpp +++ /dev/null @@ -1,200 +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 "qabstractvideobuffer_p.h" - -#include - -QT_BEGIN_NAMESPACE - -/*! - \class QAbstractVideoBuffer - \brief The QAbstractVideoBuffer class is an abstraction for video data. - \since 4.6 - - The QVideoFrame class makes use of a QAbstractVideoBuffer internally to reference a buffer of - video data. Creating a subclass of QAbstractVideoBuffer will allow you to construct video - frames from preallocated or static buffers. - - The contents of a buffer can be accessed by mapping the buffer to memory using the map() - function which returns a pointer to memory containing the contents of the the video buffer. - The memory returned by map() is released by calling the unmap() function. - - The handle() of a buffer may also be used to manipulate it's contents using type specific APIs. - The type of a buffer's handle is given by the handleType() function. - - \sa QVideoFrame -*/ - -/*! - \enum QAbstractVideoBuffer::HandleType - - Identifies the type of a video buffers handle. - - \value NoHandle The buffer has no handle, its data can only be accessed by mapping the buffer. - \value GLTextureHandle The handle of the buffer is an OpenGL texture ID. - \value XvShmImageHandle The handle contains pointer to shared memory XVideo image. - \value CoreImageHandle The handle contains pointer to Mac OS X CIImage. - \value UserHandle Start value for user defined handle types. - - \sa handleType() -*/ - -/*! - \enum QAbstractVideoBuffer::MapMode - - Enumerates how a video buffer's data is mapped to memory. - - \value NotMapped The video buffer has is not mapped to memory. - \value ReadOnly The mapped memory is populated with data from the video buffer when mapped, but - the content of the mapped memory may be discarded when unmapped. - \value WriteOnly The mapped memory in unitialized when mapped, and the content will be used to - populate the video buffer when unmapped. - \value ReadWrite The mapped memory is populated with data from the video buffer, and the - video buffer is repopulated with the content of the mapped memory. - - \sa mapMode(), map() -*/ - -/*! - Constructs an abstract video buffer of the given \a type. -*/ - -QAbstractVideoBuffer::QAbstractVideoBuffer(HandleType type) - : d_ptr(new QAbstractVideoBufferPrivate) -{ - Q_D(QAbstractVideoBuffer); - - d->handleType = type; -} - -/*! - \internal -*/ - -QAbstractVideoBuffer::QAbstractVideoBuffer(QAbstractVideoBufferPrivate &dd, HandleType type) - : d_ptr(&dd) -{ - Q_D(QAbstractVideoBuffer); - - d->handleType = type; -} - -/*! - Destroys an abstract video buffer. -*/ - -QAbstractVideoBuffer::~QAbstractVideoBuffer() -{ - delete d_ptr; -} - -/*! - Returns the type of a video buffer's handle. - - \sa handle() -*/ - -QAbstractVideoBuffer::HandleType QAbstractVideoBuffer::handleType() const -{ - return d_func()->handleType; -} - -/*! - \fn QAbstractVideoBuffer::mapMode() const - - Returns the mode a video buffer is mapped in. - - \sa map() -*/ - -/*! - \fn QAbstractVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine) - - Maps the contents of a video buffer to memory. - - The map \a mode indicates whether the contents of the mapped memory should be read from and/or - written to the buffer. If the map mode includes the QAbstractVideoBuffer::ReadOnly flag the - mapped memory will be populated with the content of the video buffer when mapped. If the map - mode includes the QAbstractVideoBuffer::WriteOnly flag the content of the mapped memory will be - persisted in the buffer when unmapped. - - When access to the data is no longer needed be sure to call the unmap() function to release the - mapped memory. - - Returns a pointer to the mapped memory region, or a null pointer if the mapping failed. The - size in bytes of the mapped memory region is returned in \a numBytes, and the line stride in \a - bytesPerLine. - - When access to the data is no longer needed be sure to unmap() the buffer. - - \note Writing to memory that is mapped as read-only is undefined, and may result in changes - to shared data. - - \sa unmap(), mapMode() -*/ - -/*! - \fn QAbstractVideoBuffer::unmap() - - Releases the memory mapped by the map() function - - If the \l {QAbstractVideoBuffer::MapMode}{MapMode} included the QAbstractVideoBuffer::WriteOnly - flag this will persist the current content of the mapped memory to the video frame. - - \sa map() -*/ - -/*! - Returns a type specific handle to the data buffer. - - The type of the handle is given by handleType() function. - - \sa handleType() -*/ - -QVariant QAbstractVideoBuffer::handle() const -{ - return QVariant(); -} - - -QT_END_NAMESPACE diff --git a/src/multimedia/video/qabstractvideobuffer.h b/src/multimedia/video/qabstractvideobuffer.h deleted file mode 100644 index a8389db..0000000 --- a/src/multimedia/video/qabstractvideobuffer.h +++ /dev/null @@ -1,106 +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 QABSTRACTVIDEOBUFFER_H -#define QABSTRACTVIDEOBUFFER_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QVariant; - -class QAbstractVideoBufferPrivate; - -class Q_MULTIMEDIA_EXPORT QAbstractVideoBuffer -{ -public: - enum HandleType - { - NoHandle, - GLTextureHandle, - XvShmImageHandle, - CoreImageHandle, - UserHandle = 1000 - }; - - enum MapMode - { - NotMapped = 0x00, - ReadOnly = 0x01, - WriteOnly = 0x02, - ReadWrite = ReadOnly | WriteOnly - }; - - QAbstractVideoBuffer(HandleType type); - virtual ~QAbstractVideoBuffer(); - - HandleType handleType() const; - - virtual MapMode mapMode() const = 0; - - virtual uchar *map(MapMode mode, int *numBytes, int *bytesPerLine) = 0; - virtual void unmap() = 0; - - virtual QVariant handle() const; - -protected: - QAbstractVideoBuffer(QAbstractVideoBufferPrivate &dd, HandleType type); - - QAbstractVideoBufferPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QAbstractVideoBuffer) - Q_DISABLE_COPY(QAbstractVideoBuffer) -}; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QAbstractVideoBuffer::HandleType) -Q_DECLARE_METATYPE(QAbstractVideoBuffer::MapMode) - -QT_END_HEADER - -#endif diff --git a/src/multimedia/video/qabstractvideobuffer_p.h b/src/multimedia/video/qabstractvideobuffer_p.h deleted file mode 100644 index c72f303..0000000 --- a/src/multimedia/video/qabstractvideobuffer_p.h +++ /dev/null @@ -1,73 +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 QABSTRACTVIDEOBUFFER_P_H -#define QABSTRACTVIDEOBUFFER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class QAbstractVideoBufferPrivate -{ -public: - QAbstractVideoBufferPrivate() - : handleType(QAbstractVideoBuffer::NoHandle) - {} - - QAbstractVideoBuffer::HandleType handleType; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/video/qabstractvideosurface.cpp b/src/multimedia/video/qabstractvideosurface.cpp deleted file mode 100644 index 3dabb6b..0000000 --- a/src/multimedia/video/qabstractvideosurface.cpp +++ /dev/null @@ -1,283 +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 "qabstractvideosurface_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \class QAbstractVideoSurface - \brief The QAbstractVideoSurface class is a base class for video presentation surfaces. - \since 4.6 - - The QAbstractVideoSurface class defines the standard interface that video producers use to - inter-operate with video presentation surfaces. It is not supposed to be instantiated directly. - Instead, you should subclass it to create new video surfaces. - - A video surface presents a continuous stream of identically formatted frames, where the format - of each frame is compatible with a stream format supplied when starting a presentation. - - A list of pixel formats a surface can present is given by the supportedPixelFormats() function, - and the isFormatSupported() function will test if a video surface format is supported. If a - format is not supported the nearestFormat() function may be able to suggest a similar format. - For example if a surface supports fixed set of resolutions it may suggest the smallest - supported resolution that contains the proposed resolution. - - The start() function takes a supported format and enables a video surface. Once started a - surface will begin displaying the frames it receives in the present() function. Surfaces may - hold a reference to the buffer of a presented video frame until a new frame is presented or - streaming is stopped. The stop() function will disable a surface and a release any video - buffers it holds references to. -*/ - -/*! - \enum QAbstractVideoSurface::Error - This enum describes the errors that may be returned by the error() function. - - \value NoError No error occurred. - \value UnsupportedFormatError A video format was not supported. - \value IncorrectFormatError A video frame was not compatible with the format of the surface. - \value StoppedError The surface has not been started. - \value ResourceError The surface could not allocate some resource. -*/ - -/*! - Constructs a video surface with the given \a parent. -*/ - -QAbstractVideoSurface::QAbstractVideoSurface(QObject *parent) - : QObject(*new QAbstractVideoSurfacePrivate, parent) -{ -} - -/*! - \internal -*/ - -QAbstractVideoSurface::QAbstractVideoSurface(QAbstractVideoSurfacePrivate &dd, QObject *parent) - : QObject(dd, parent) -{ -} - -/*! - Destroys a video surface. -*/ - -QAbstractVideoSurface::~QAbstractVideoSurface() -{ -} - -/*! - \fn QAbstractVideoSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType type) const - - Returns a list of pixel formats a video surface can present for a given handle \a type. - - The pixel formats returned for the QAbstractVideoBuffer::NoHandle type are valid for any buffer - that can be mapped in read-only mode. - - Types that are first in the list can be assumed to be faster to render. -*/ - -/*! - Tests a video surface \a format to determine if a surface can accept it. - - Returns true if the format is supported by the surface, and false otherwise. -*/ - -bool QAbstractVideoSurface::isFormatSupported(const QVideoSurfaceFormat &format) const -{ - return supportedPixelFormats(format.handleType()).contains(format.pixelFormat()); -} - -/*! - Returns a supported video surface format that is similar to \a format. - - A similar surface format is one that has the same \l {QVideoSurfaceFormat::pixelFormat()}{pixel - format} and \l {QVideoSurfaceFormat::handleType()}{handle type} but differs in some of the other - properties. For example if there are restrictions on the \l {QVideoSurfaceFormat::frameSize()} - {frame sizes} a video surface can accept it may suggest a format with a larger frame size and - a \l {QVideoSurfaceFormat::viewport()}{viewport} the size of the original frame size. - - If the format is already supported it will be returned unchanged, or if there is no similar - supported format an invalid format will be returned. -*/ - -QVideoSurfaceFormat QAbstractVideoSurface::nearestFormat(const QVideoSurfaceFormat &format) const -{ - return isFormatSupported(format) - ? format - : QVideoSurfaceFormat(); -} - -/*! - \fn QAbstractVideoSurface::supportedFormatsChanged() - - Signals that the set of formats supported by a video surface has changed. - - \sa supportedPixelFormats(), isFormatSupported() -*/ - -/*! - Returns the format of a video surface. -*/ - -QVideoSurfaceFormat QAbstractVideoSurface::surfaceFormat() const -{ - return d_func()->format; -} - -/*! - \fn QAbstractVideoSurface::surfaceFormatChanged(const QVideoSurfaceFormat &format) - - Signals that the configured \a format of a video surface has changed. - - \sa surfaceFormat(), start() -*/ - -/*! - Starts a video surface presenting \a format frames. - - Returns true if the surface was started, and false if an error occurred. - - \sa isActive(), stop() -*/ - -bool QAbstractVideoSurface::start(const QVideoSurfaceFormat &format) -{ - Q_D(QAbstractVideoSurface); - - bool wasActive = d->active; - - d->active = true; - d->format = format; - d->error = NoError; - - emit surfaceFormatChanged(d->format); - - if (!wasActive) - emit activeChanged(true); - - return true; -} - -/*! - Stops a video surface presenting frames and releases any resources acquired in start(). - - \sa isActive(), start() -*/ - -void QAbstractVideoSurface::stop() -{ - Q_D(QAbstractVideoSurface); - - if (d->active) { - d->format = QVideoSurfaceFormat(); - d->active = false; - - emit activeChanged(false); - emit surfaceFormatChanged(d->format); - } -} - -/*! - Indicates whether a video surface has been started. - - Returns true if the surface has been started, and false otherwise. -*/ - -bool QAbstractVideoSurface::isActive() const -{ - return d_func()->active; -} - -/*! - \fn QAbstractVideoSurface::activeChanged(bool active) - - Signals that the \a active state of a video surface has changed. - - \sa isActive(), start(), stop() -*/ - -/*! - \fn QAbstractVideoSurface::present(const QVideoFrame &frame) - - Presents a video \a frame. - - Returns true if the frame was presented, and false if an error occurred. - - Not all surfaces will block until the presentation of a frame has completed. Calling present() - on a non-blocking surface may fail if called before the presentation of a previous frame has - completed. In such cases the surface may not return to a ready state until it's had an - opportunity to process events. - - If present() fails for any other reason the surface will immediately enter the stopped state - and an error() value will be set. - - A video surface must be in the started state for present() to succeed, and the format of the - video frame must be compatible with the current video surface format. - - \sa error() -*/ - -/*! - Returns the last error that occurred. - - If a surface fails to start(), or stops unexpectedly this function can be called to discover - what error occurred. -*/ - -QAbstractVideoSurface::Error QAbstractVideoSurface::error() const -{ - return d_func()->error; -} - -/*! - Sets the value of error() to \a error. -*/ - -void QAbstractVideoSurface::setError(Error error) -{ - Q_D(QAbstractVideoSurface); - - d->error = error; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/video/qabstractvideosurface.h b/src/multimedia/video/qabstractvideosurface.h deleted file mode 100644 index f2cae17..0000000 --- a/src/multimedia/video/qabstractvideosurface.h +++ /dev/null @@ -1,110 +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 QABSTRACTVIDEOSURFACE_H -#define QABSTRACTVIDEOSURFACE_H - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QRectF; -class QVideoSurfaceFormat; - -class QAbstractVideoSurfacePrivate; - -class Q_MULTIMEDIA_EXPORT QAbstractVideoSurface : public QObject -{ - Q_OBJECT - -public: - enum Error - { - NoError, - UnsupportedFormatError, - IncorrectFormatError, - StoppedError, - ResourceError - }; - - explicit QAbstractVideoSurface(QObject *parent = 0); - ~QAbstractVideoSurface(); - - virtual QList supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const = 0; - virtual bool isFormatSupported(const QVideoSurfaceFormat &format) const; - virtual QVideoSurfaceFormat nearestFormat(const QVideoSurfaceFormat &format) const; - - QVideoSurfaceFormat surfaceFormat() const; - - virtual bool start(const QVideoSurfaceFormat &format); - virtual void stop(); - - bool isActive() const; - - virtual bool present(const QVideoFrame &frame) = 0; - - Error error() const; - -Q_SIGNALS: - void activeChanged(bool active); - void surfaceFormatChanged(const QVideoSurfaceFormat &format); - void supportedFormatsChanged(); - -protected: - QAbstractVideoSurface(QAbstractVideoSurfacePrivate &dd, QObject *parent); - - void setError(Error error); - -private: - Q_DECLARE_PRIVATE(QAbstractVideoSurface) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/video/qabstractvideosurface_p.h b/src/multimedia/video/qabstractvideosurface_p.h deleted file mode 100644 index 42df112..0000000 --- a/src/multimedia/video/qabstractvideosurface_p.h +++ /dev/null @@ -1,78 +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 QABSTRACTVIDEOSURFACE_P_H -#define QABSTRACTVIDEOSURFACE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QAbstractVideoSurfacePrivate : public QObjectPrivate -{ -public: - QAbstractVideoSurfacePrivate() - : error(QAbstractVideoSurface::NoError) - , active(false) - { - } - - mutable QAbstractVideoSurface::Error error; - QVideoSurfaceFormat format; - bool active; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/video/qimagevideobuffer.cpp b/src/multimedia/video/qimagevideobuffer.cpp deleted file mode 100644 index e3e1585..0000000 --- a/src/multimedia/video/qimagevideobuffer.cpp +++ /dev/null @@ -1,106 +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 "qimagevideobuffer_p.h" - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class QImageVideoBufferPrivate : public QAbstractVideoBufferPrivate -{ -public: - QImageVideoBufferPrivate() - : mapMode(QAbstractVideoBuffer::NotMapped) - { - } - - QAbstractVideoBuffer::MapMode mapMode; - QImage image; -}; - -QImageVideoBuffer::QImageVideoBuffer(const QImage &image) - : QAbstractVideoBuffer(*new QImageVideoBufferPrivate, NoHandle) -{ - Q_D(QImageVideoBuffer); - - d->image = image; -} - -QImageVideoBuffer::~QImageVideoBuffer() -{ -} - -QAbstractVideoBuffer::MapMode QImageVideoBuffer::mapMode() const -{ - return d_func()->mapMode; -} - -uchar *QImageVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine) -{ - Q_D(QImageVideoBuffer); - - if (d->mapMode == NotMapped && d->image.bits() && mode != NotMapped) { - d->mapMode = mode; - - if (numBytes) - *numBytes = d->image.byteCount(); - - if (bytesPerLine) - *bytesPerLine = d->image.bytesPerLine(); - - return d->image.bits(); - } else { - return 0; - } -} - -void QImageVideoBuffer::unmap() -{ - Q_D(QImageVideoBuffer); - - d->mapMode = NotMapped; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/video/qimagevideobuffer_p.h b/src/multimedia/video/qimagevideobuffer_p.h deleted file mode 100644 index 82075d7..0000000 --- a/src/multimedia/video/qimagevideobuffer_p.h +++ /dev/null @@ -1,79 +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 QIMAGEVIDEOBUFFER_P_H -#define QIMAGEVIDEOBUFFER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QImage; - -class QImageVideoBufferPrivate; - -class Q_MULTIMEDIA_EXPORT QImageVideoBuffer : public QAbstractVideoBuffer -{ - Q_DECLARE_PRIVATE(QImageVideoBuffer) -public: - QImageVideoBuffer(const QImage &image); - ~QImageVideoBuffer(); - - MapMode mapMode() const; - - uchar *map(MapMode mode, int *numBytes, int *bytesPerLine); - void unmap(); -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/multimedia/video/qmemoryvideobuffer.cpp b/src/multimedia/video/qmemoryvideobuffer.cpp deleted file mode 100644 index 2e892b7..0000000 --- a/src/multimedia/video/qmemoryvideobuffer.cpp +++ /dev/null @@ -1,129 +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 "qmemoryvideobuffer_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -class QMemoryVideoBufferPrivate : public QAbstractVideoBufferPrivate -{ -public: - QMemoryVideoBufferPrivate() - : bytesPerLine(0) - , mapMode(QAbstractVideoBuffer::NotMapped) - { - } - - int bytesPerLine; - QAbstractVideoBuffer::MapMode mapMode; - QByteArray data; -}; - -/*! - \class QMemoryVideoBuffer - \brief The QMemoryVideoBuffer class provides a system memory allocated video data buffer. - \internal - - QMemoryVideoBuffer is the default video buffer for allocating system memory. It may be used to - allocate memory for a QVideoFrame without implementing your own QAbstractVideoBuffer. -*/ - -/*! - Constructs a video buffer with an image stride of \a bytesPerLine from a byte \a array. -*/ -QMemoryVideoBuffer::QMemoryVideoBuffer(const QByteArray &array, int bytesPerLine) - : QAbstractVideoBuffer(*new QMemoryVideoBufferPrivate, NoHandle) -{ - Q_D(QMemoryVideoBuffer); - - d->data = array; - d->bytesPerLine = bytesPerLine; -} - -/*! - Destroys a system memory allocated video buffer. -*/ -QMemoryVideoBuffer::~QMemoryVideoBuffer() -{ -} - -/*! - \reimp -*/ -QAbstractVideoBuffer::MapMode QMemoryVideoBuffer::mapMode() const -{ - return d_func()->mapMode; -} - -/*! - \reimp -*/ -uchar *QMemoryVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine) -{ - Q_D(QMemoryVideoBuffer); - - if (d->mapMode == NotMapped && d->data.data() && mode != NotMapped) { - d->mapMode = mode; - - if (numBytes) - *numBytes = d->data.size(); - - if (bytesPerLine) - *bytesPerLine = d->bytesPerLine; - - return reinterpret_cast(d->data.data()); - } else { - return 0; - } -} - -/*! - \reimp -*/ -void QMemoryVideoBuffer::unmap() -{ - d_func()->mapMode = NotMapped; -} - -QT_END_NAMESPACE diff --git a/src/multimedia/video/qmemoryvideobuffer_p.h b/src/multimedia/video/qmemoryvideobuffer_p.h deleted file mode 100644 index c66cf93..0000000 --- a/src/multimedia/video/qmemoryvideobuffer_p.h +++ /dev/null @@ -1,83 +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 QMEMORYVIDEOBUFFER_P_H -#define QMEMORYVIDEOBUFFER_P_H - -#include - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QMemoryVideoBufferPrivate; - -class Q_MULTIMEDIA_EXPORT QMemoryVideoBuffer : public QAbstractVideoBuffer -{ - Q_DECLARE_PRIVATE(QMemoryVideoBuffer) -public: - QMemoryVideoBuffer(const QByteArray &data, int bytesPerLine); - ~QMemoryVideoBuffer(); - - MapMode mapMode() const; - - uchar *map(MapMode mode, int *numBytes, int *bytesPerLine); - void unmap(); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp deleted file mode 100644 index 2d66d9e..0000000 --- a/src/multimedia/video/qvideoframe.cpp +++ /dev/null @@ -1,741 +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 "qvideoframe.h" - -#include -#include - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QVideoFramePrivate : public QSharedData -{ -public: - QVideoFramePrivate() - : startTime(-1) - , endTime(-1) - , data(0) - , mappedBytes(0) - , bytesPerLine(0) - , pixelFormat(QVideoFrame::Format_Invalid) - , fieldType(QVideoFrame::ProgressiveFrame) - , buffer(0) - { - } - - QVideoFramePrivate(const QSize &size, QVideoFrame::PixelFormat format) - : size(size) - , startTime(-1) - , endTime(-1) - , data(0) - , mappedBytes(0) - , bytesPerLine(0) - , pixelFormat(format) - , fieldType(QVideoFrame::ProgressiveFrame) - , buffer(0) - { - } - - ~QVideoFramePrivate() - { - delete buffer; - } - - QSize size; - qint64 startTime; - qint64 endTime; - uchar *data; - int mappedBytes; - int bytesPerLine; - QVideoFrame::PixelFormat pixelFormat; - QVideoFrame::FieldType fieldType; - QAbstractVideoBuffer *buffer; - -private: - Q_DISABLE_COPY(QVideoFramePrivate) -}; - -/*! - \class QVideoFrame - \brief The QVideoFrame class provides a representation of a frame of video data. - \since 4.6 - - A QVideoFrame encapsulates the data of a video frame, and information about the frame. - - The contents of a video frame can be mapped to memory using the map() function. While - mapped the video data can accessed using the bits() function which returns a pointer to a - buffer, the total size of which is given by the mappedBytes(), and the size of each line is given - by bytesPerLine(). The return value of the handle() function may be used to access frame data - using the internal buffer's native APIs. - - The video data in a QVideoFrame is encapsulated in a QAbstractVideoBuffer. A QVideoFrame - may be constructed from any buffer type by subclassing the QAbstractVideoBuffer class. - - \note QVideoFrame is explicitly shared, any change made to video frame will also apply to any - copies. -*/ - -/*! - \enum QVideoFrame::PixelFormat - - Enumerates video data types. - - \value Format_Invalid - The frame is invalid. - - \value Format_ARGB32 - The frame is stored using a 32-bit ARGB format (0xAARRGGBB). This is equivalent to - QImage::Format_ARGB32. - - \value Format_ARGB32_Premultiplied - The frame stored using a premultiplied 32-bit ARGB format (0xAARRGGBB). This is equivalent - to QImage::Format_ARGB32_Premultiplied. - - \value Format_RGB32 - The frame stored using a 32-bit RGB format (0xffRRGGBB). This is equivalent to - QImage::Format_RGB32 - - \value Format_RGB24 - The frame is stored using a 24-bit RGB format (8-8-8). This is equivalent to - QImage::Format_RGB888 - - \value Format_RGB565 - The frame is stored using a 16-bit RGB format (5-6-5). This is equivalent to - QImage::Format_RGB16. - - \value Format_RGB555 - The frame is stored using a 16-bit RGB format (5-5-5). This is equivalent to - QImage::Format_RGB555. - - \value Format_ARGB8565_Premultiplied - The frame is stored using a 24-bit premultiplied ARGB format (8-6-6-5). - - \value Format_BGRA32 - The frame is stored using a 32-bit ARGB format (0xBBGGRRAA). - - \value Format_BGRA32_Premultiplied - The frame is stored using a premultiplied 32bit BGRA format. - - \value Format_BGR32 - The frame is stored using a 32-bit BGR format (0xBBGGRRff). - - \value Format_BGR24 - The frame is stored using a 24-bit BGR format (0xBBGGRR). - - \value Format_BGR565 - The frame is stored using a 16-bit BGR format (5-6-5). - - \value Format_BGR555 - The frame is stored using a 16-bit BGR format (5-5-5). - - \value Format_BGRA5658_Premultiplied - The frame is stored using a 24-bit premultiplied BGRA format (5-6-5-8). - - \value Format_AYUV444 - The frame is stored using a packed 32-bit AYUV format (0xAAYYUUVV). - - \value Format_AYUV444_Premultiplied - The frame is stored using a packed premultiplied 32-bit AYUV format (0xAAYYUUVV). - - \value Format_YUV444 - The frame is stored using a 24-bit packed YUV format (8-8-8). - - \value Format_YUV420P - The frame is stored using an 8-bit per component planar YUV format with the U and V planes - horizontally and vertically sub-sampled, i.e. the height and width of the U and V planes are - half that of the Y plane. - - \value Format_YV12 - The frame is stored using an 8-bit per component planar YVU format with the V and U planes - horizontally and vertically sub-sampled, i.e. the height and width of the V and U planes are - half that of the Y plane. - - \value Format_UYVY - The frame is stored using an 8-bit per component packed YUV format with the U and V planes - horizontally sub-sampled (U-Y-V-Y), i.e. two horizontally adjacent pixels are stored as a 32-bit - macropixel which has a Y value for each pixel and common U and V values. - - \value Format_YUYV - The frame is stored using an 8-bit per component packed YUV format with the U and V planes - horizontally sub-sampled (Y-U-Y-V), i.e. two horizontally adjacent pixels are stored as a 32-bit - macropixel which has a Y value for each pixel and common U and V values. - - \value Format_NV12 - The frame is stored using an 8-bit per component semi-planar YUV format with a Y plane (Y) - followed by a horizontally and vertically sub-sampled, packed UV plane (U-V). - - \value Format_NV21 - The frame is stored using an 8-bit per component semi-planar YUV format with a Y plane (Y) - followed by a horizontally and vertically sub-sampled, packed VU plane (V-U). - - \value Format_IMC1 - The frame is stored using an 8-bit per component planar YUV format with the U and V planes - horizontally and vertically sub-sampled. This is similar to the Format_YUV420P type, except - that the bytes per line of the U and V planes are padded out to the same stride as the Y plane. - - \value Format_IMC2 - The frame is stored using an 8-bit per component planar YUV format with the U and V planes - horizontally and vertically sub-sampled. This is similar to the Format_YUV420P type, except - that the lines of the U and V planes are interleaved, i.e. each line of U data is followed by a - line of V data creating a single line of the same stride as the Y data. - - \value Format_IMC3 - The frame is stored using an 8-bit per component planar YVU format with the V and U planes - horizontally and vertically sub-sampled. This is similar to the Format_YV12 type, except that - the bytes per line of the V and U planes are padded out to the same stride as the Y plane. - - \value Format_IMC4 - The frame is stored using an 8-bit per component planar YVU format with the V and U planes - horizontally and vertically sub-sampled. This is similar to the Format_YV12 type, except that - the lines of the V and U planes are interleaved, i.e. each line of V data is followed by a line - of U data creating a single line of the same stride as the Y data. - - \value Format_Y8 - The frame is stored using an 8-bit greyscale format. - - \value Format_Y16 - The frame is stored using a 16-bit linear greyscale format. Little endian. - - \value Format_User - Start value for user defined pixel formats. -*/ - -/*! - \enum QVideoFrame::FieldType - - Specifies the field an interlaced video frame belongs to. - - \value ProgressiveFrame The frame is not interlaced. - \value TopField The frame contains a top field. - \value BottomField The frame contains a bottom field. - \value InterlacedFrame The frame contains a merged top and bottom field. -*/ - -/*! - Constructs a null video frame. -*/ - -QVideoFrame::QVideoFrame() - : d(new QVideoFramePrivate) -{ -} - -/*! - Constructs a video frame from a \a buffer of the given pixel \a format and \a size in pixels. - - \note This doesn't increment the reference count of the video buffer. -*/ - -QVideoFrame::QVideoFrame( - QAbstractVideoBuffer *buffer, const QSize &size, PixelFormat format) - : d(new QVideoFramePrivate(size, format)) -{ - d->buffer = buffer; -} - -/*! - Constructs a video frame of the given pixel \a format and \a size in pixels. - - The \a bytesPerLine (stride) is the length of each scan line in bytes, and \a bytes is the total - number of bytes that must be allocated for the frame. -*/ - -QVideoFrame::QVideoFrame(int bytes, const QSize &size, int bytesPerLine, PixelFormat format) - : d(new QVideoFramePrivate(size, format)) -{ - if (bytes > 0) { - QByteArray data; - data.resize(bytes); - - // Check the memory was successfully allocated. - if (!data.isEmpty()) - d->buffer = new QMemoryVideoBuffer(data, bytesPerLine); - } -} - -/*! - Constructs a video frame from an \a image. - - \note This will construct an invalid video frame if there is no frame type equivalent to the - image format. - - \sa pixelFormatFromImageFormat() -*/ - -QVideoFrame::QVideoFrame(const QImage &image) - : d(new QVideoFramePrivate( - image.size(), pixelFormatFromImageFormat(image.format()))) -{ - if (d->pixelFormat != Format_Invalid) - d->buffer = new QImageVideoBuffer(image); -} - -/*! - Constructs a copy of \a other. -*/ - -QVideoFrame::QVideoFrame(const QVideoFrame &other) - : d(other.d) -{ -} - -/*! - Assigns the contents of \a other to a video frame. -*/ - -QVideoFrame &QVideoFrame::operator =(const QVideoFrame &other) -{ - d = other.d; - - return *this; -} - -/*! - Destroys a video frame. -*/ - -QVideoFrame::~QVideoFrame() -{ -} - -/*! - Identifies whether a video frame is valid. - - An invalid frame has no video buffer associated with it. - - Returns true if the frame is valid, and false if it is not. -*/ - -bool QVideoFrame::isValid() const -{ - return d->buffer != 0; -} - -/*! - Returns the color format of a video frame. -*/ - -QVideoFrame::PixelFormat QVideoFrame::pixelFormat() const -{ - return d->pixelFormat; -} - -/*! - Returns the type of a video frame's handle. -*/ - -QAbstractVideoBuffer::HandleType QVideoFrame::handleType() const -{ - return d->buffer ? d->buffer->handleType() : QAbstractVideoBuffer::NoHandle; -} - -/*! - Returns the size of a video frame. -*/ - -QSize QVideoFrame::size() const -{ - return d->size; -} - -/*! - Returns the width of a video frame. -*/ - -int QVideoFrame::width() const -{ - return d->size.width(); -} - -/*! - Returns the height of a video frame. -*/ - -int QVideoFrame::height() const -{ - return d->size.height(); -} - -/*! - Returns the field an interlaced video frame belongs to. - - If the video is not interlaced this will return WholeFrame. -*/ - -QVideoFrame::FieldType QVideoFrame::fieldType() const -{ - return d->fieldType; -} - -/*! - Sets the \a field an interlaced video frame belongs to. -*/ - -void QVideoFrame::setFieldType(QVideoFrame::FieldType field) -{ - d->fieldType = field; -} - -/*! - Identifies if a video frame's contents are currently mapped to system memory. - - This is a convenience function which checks that the \l {QAbstractVideoBuffer::MapMode}{MapMode} - of the frame is not equal to QAbstractVideoBuffer::NotMapped. - - Returns true if the contents of the video frame are mapped to system memory, and false - otherwise. - - \sa mapMode() QAbstractVideoBuffer::MapMode -*/ - -bool QVideoFrame::isMapped() const -{ - return d->buffer != 0 && d->buffer->mapMode() != QAbstractVideoBuffer::NotMapped; -} - -/*! - Identifies if the mapped contents of a video frame will be persisted when the frame is unmapped. - - This is a convenience function which checks if the \l {QAbstractVideoBuffer::MapMode}{MapMode} - contains the QAbstractVideoBuffer::WriteOnly flag. - - Returns true if the video frame will be updated when unmapped, and false otherwise. - - \note The result of altering the data of a frame that is mapped in read-only mode is undefined. - Depending on the buffer implementation the changes may be persisted, or worse alter a shared - buffer. - - \sa mapMode(), QAbstractVideoBuffer::MapMode -*/ - -bool QVideoFrame::isWritable() const -{ - return d->buffer != 0 && (d->buffer->mapMode() & QAbstractVideoBuffer::WriteOnly); -} - -/*! - Identifies if the mapped contents of a video frame were read from the frame when it was mapped. - - This is a convenience function which checks if the \l {QAbstractVideoBuffer::MapMode}{MapMode} - contains the QAbstractVideoBuffer::WriteOnly flag. - - Returns true if the contents of the mapped memory were read from the video frame, and false - otherwise. - - \sa mapMode(), QAbstractVideoBuffer::MapMode -*/ - -bool QVideoFrame::isReadable() const -{ - return d->buffer != 0 && (d->buffer->mapMode() & QAbstractVideoBuffer::ReadOnly); -} - -/*! - Returns the mode a video frame was mapped to system memory in. - - \sa map(), QAbstractVideoBuffer::MapMode -*/ - -QAbstractVideoBuffer::MapMode QVideoFrame::mapMode() const -{ - return d->buffer != 0 ? d->buffer->mapMode() : QAbstractVideoBuffer::NotMapped; -} - -/*! - Maps the contents of a video frame to memory. - - The map \a mode indicates whether the contents of the mapped memory should be read from and/or - written to the frame. If the map mode includes the QAbstractVideoBuffer::ReadOnly flag the - mapped memory will be populated with the content of the video frame when mapped. If the map - mode inclues the QAbstractVideoBuffer::WriteOnly flag the content of the mapped memory will be - persisted in the frame when unmapped. - - While mapped the contents of a video frame can be accessed directly through the pointer returned - by the bits() function. - - When access to the data is no longer needed be sure to call the unmap() function to release the - mapped memory. - - Returns true if the buffer was mapped to memory in the given \a mode and false otherwise. - - \sa unmap(), mapMode(), bits() -*/ - -bool QVideoFrame::map(QAbstractVideoBuffer::MapMode mode) -{ - if (d->buffer != 0 && d->data == 0) { - Q_ASSERT(d->bytesPerLine == 0); - Q_ASSERT(d->mappedBytes == 0); - - d->data = d->buffer->map(mode, &d->mappedBytes, &d->bytesPerLine); - - return d->data != 0; - } - - return false; -} - -/*! - Releases the memory mapped by the map() function. - - If the \l {QAbstractVideoBuffer::MapMode}{MapMode} included the QAbstractVideoBuffer::WriteOnly - flag this will persist the current content of the mapped memory to the video frame. - - \sa map() -*/ - -void QVideoFrame::unmap() -{ - if (d->data != 0) { - d->mappedBytes = 0; - d->bytesPerLine = 0; - d->data = 0; - - d->buffer->unmap(); - } -} - -/*! - Returns the number of bytes in a scan line. - - \note This is the bytes per line of the first plane only. The bytes per line of subsequent - planes should be calculated as per the frame type. - - This value is only valid while the frame data is \l {map()}{mapped}. - - \sa bits(), map(), mappedBytes() -*/ - -int QVideoFrame::bytesPerLine() const -{ - return d->bytesPerLine; -} - -/*! - Returns a pointer to the start of the frame data buffer. - - This value is only valid while the frame data is \l {map()}{mapped}. - - \sa map(), mappedBytes(), bytesPerLine() -*/ - -uchar *QVideoFrame::bits() -{ - return d->data; -} - -/*! - Returns a pointer to the start of the frame data buffer. - - This value is only valid while the frame data is \l {map()}{mapped}. - - \sa map(), mappedBytes(), bytesPerLine() -*/ - -const uchar *QVideoFrame::bits() const -{ - return d->data; -} - -/*! - Returns the number of bytes occupied by the mapped frame data. - - This value is only valid while the frame data is \l {map()}{mapped}. - - \sa map() -*/ - -int QVideoFrame::mappedBytes() const -{ - return d->mappedBytes; -} - -/*! - Returns a type specific handle to a video frame's buffer. - - For an OpenGL texture this would be the texture ID. - - \sa QAbstractVideoBuffer::handle() -*/ - -QVariant QVideoFrame::handle() const -{ - return d->buffer != 0 ? d->buffer->handle() : QVariant(); -} - -/*! - Returns the presentation time when the frame should be displayed. -*/ - -qint64 QVideoFrame::startTime() const -{ - return d->startTime; -} - -/*! - Sets the presentation \a time when the frame should be displayed. -*/ - -void QVideoFrame::setStartTime(qint64 time) -{ - d->startTime = time; -} - -/*! - Returns the presentation time when a frame should stop being displayed. -*/ - -qint64 QVideoFrame::endTime() const -{ - return d->endTime; -} - -/*! - Sets the presentation \a time when a frame should stop being displayed. -*/ - -void QVideoFrame::setEndTime(qint64 time) -{ - d->endTime = time; -} - -/*! - Returns an video pixel format equivalent to an image \a format. If there is no equivalent - format QVideoFrame::InvalidType is returned instead. -*/ - -QVideoFrame::PixelFormat QVideoFrame::pixelFormatFromImageFormat(QImage::Format format) -{ - switch (format) { - case QImage::Format_Invalid: - case QImage::Format_Mono: - case QImage::Format_MonoLSB: - case QImage::Format_Indexed8: - return Format_Invalid; - case QImage::Format_RGB32: - return Format_RGB32; - case QImage::Format_ARGB32: - return Format_ARGB32; - case QImage::Format_ARGB32_Premultiplied: - return Format_ARGB32_Premultiplied; - case QImage::Format_RGB16: - return Format_RGB565; - case QImage::Format_ARGB8565_Premultiplied: - case QImage::Format_RGB666: - case QImage::Format_ARGB6666_Premultiplied: - return Format_Invalid; - case QImage::Format_RGB555: - return Format_RGB555; - case QImage::Format_ARGB8555_Premultiplied: - return Format_Invalid; - case QImage::Format_RGB888: - return Format_RGB24; - case QImage::Format_RGB444: - case QImage::Format_ARGB4444_Premultiplied: - return Format_Invalid; - case QImage::NImageFormats: - return Format_Invalid; - } - return Format_Invalid; -} - -/*! - Returns an image format equivalent to a video frame pixel \a format. If there is no equivalent - format QImage::Format_Invalid is returned instead. -*/ - -QImage::Format QVideoFrame::imageFormatFromPixelFormat(PixelFormat format) -{ - switch (format) { - case Format_Invalid: - return QImage::Format_Invalid; - case Format_ARGB32: - return QImage::Format_ARGB32; - case Format_ARGB32_Premultiplied: - return QImage::Format_ARGB32_Premultiplied; - case Format_RGB32: - return QImage::Format_RGB32; - case Format_RGB24: - return QImage::Format_RGB888; - case Format_RGB565: - return QImage::Format_RGB16; - case Format_RGB555: - return QImage::Format_RGB555; - case Format_ARGB8565_Premultiplied: - return QImage::Format_ARGB8565_Premultiplied; - case Format_BGRA32: - case Format_BGRA32_Premultiplied: - case Format_BGR32: - case Format_BGR24: - return QImage::Format_Invalid; - case Format_BGR565: - case Format_BGR555: - case Format_BGRA5658_Premultiplied: - case Format_AYUV444: - case Format_AYUV444_Premultiplied: - case Format_YUV444: - case Format_YUV420P: - case Format_YV12: - case Format_UYVY: - case Format_YUYV: - case Format_NV12: - case Format_NV21: - case Format_IMC1: - case Format_IMC2: - case Format_IMC3: - case Format_IMC4: - case Format_Y8: - case Format_Y16: - return QImage::Format_Invalid; - case Format_User: - return QImage::Format_Invalid; - } - return QImage::Format_Invalid; -} - -QT_END_NAMESPACE - diff --git a/src/multimedia/video/qvideoframe.h b/src/multimedia/video/qvideoframe.h deleted file mode 100644 index 668a738..0000000 --- a/src/multimedia/video/qvideoframe.h +++ /dev/null @@ -1,169 +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 QVIDEOFRAME_H -#define QVIDEOFRAME_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QSize; -class QVariant; - -class QVideoFramePrivate; - -class Q_MULTIMEDIA_EXPORT QVideoFrame -{ -public: - enum FieldType - { - ProgressiveFrame, - TopField, - BottomField, - InterlacedFrame - }; - - enum PixelFormat - { - Format_Invalid, - Format_ARGB32, - Format_ARGB32_Premultiplied, - Format_RGB32, - Format_RGB24, - Format_RGB565, - Format_RGB555, - Format_ARGB8565_Premultiplied, - Format_BGRA32, - Format_BGRA32_Premultiplied, - Format_BGR32, - Format_BGR24, - Format_BGR565, - Format_BGR555, - Format_BGRA5658_Premultiplied, - - Format_AYUV444, - Format_AYUV444_Premultiplied, - Format_YUV444, - Format_YUV420P, - Format_YV12, - Format_UYVY, - Format_YUYV, - Format_NV12, - Format_NV21, - Format_IMC1, - Format_IMC2, - Format_IMC3, - Format_IMC4, - Format_Y8, - Format_Y16, - - Format_User = 1000 - }; - - QVideoFrame(); - QVideoFrame(QAbstractVideoBuffer *buffer, const QSize &size, PixelFormat format); - QVideoFrame(int bytes, const QSize &size, int bytesPerLine, PixelFormat format); - QVideoFrame(const QImage &image); - QVideoFrame(const QVideoFrame &other); - ~QVideoFrame(); - - QVideoFrame &operator =(const QVideoFrame &other); - - bool isValid() const; - - PixelFormat pixelFormat() const; - - QAbstractVideoBuffer::HandleType handleType() const; - - QSize size() const; - int width() const; - int height() const; - - FieldType fieldType() const; - void setFieldType(FieldType); - - bool isMapped() const; - bool isReadable() const; - bool isWritable() const; - - QAbstractVideoBuffer::MapMode mapMode() const; - - bool map(QAbstractVideoBuffer::MapMode mode); - void unmap(); - - int bytesPerLine() const; - - uchar *bits(); - const uchar *bits() const; - int mappedBytes() const; - - QVariant handle() const; - - qint64 startTime() const; - void setStartTime(qint64 time); - - qint64 endTime() const; - void setEndTime(qint64 time); - - static PixelFormat pixelFormatFromImageFormat(QImage::Format format); - static QImage::Format imageFormatFromPixelFormat(PixelFormat format); - -private: - QExplicitlySharedDataPointer d; -}; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QVideoFrame::FieldType) -Q_DECLARE_METATYPE(QVideoFrame::PixelFormat) - -QT_END_HEADER - -#endif - diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp deleted file mode 100644 index 1fc13a6..0000000 --- a/src/multimedia/video/qvideosurfaceformat.cpp +++ /dev/null @@ -1,704 +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 "qvideosurfaceformat.h" - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QVideoSurfaceFormatPrivate : public QSharedData -{ -public: - QVideoSurfaceFormatPrivate() - : pixelFormat(QVideoFrame::Format_Invalid) - , handleType(QAbstractVideoBuffer::NoHandle) - , scanLineDirection(QVideoSurfaceFormat::TopToBottom) - , pixelAspectRatio(1, 1) - , ycbcrColorSpace(QVideoSurfaceFormat::YCbCr_Undefined) - , frameRate(0.0) - { - } - - QVideoSurfaceFormatPrivate( - const QSize &size, - QVideoFrame::PixelFormat format, - QAbstractVideoBuffer::HandleType type) - : pixelFormat(format) - , handleType(type) - , scanLineDirection(QVideoSurfaceFormat::TopToBottom) - , frameSize(size) - , pixelAspectRatio(1, 1) - , ycbcrColorSpace(QVideoSurfaceFormat::YCbCr_Undefined) - , viewport(QPoint(0, 0), size) - , frameRate(0.0) - { - } - - QVideoSurfaceFormatPrivate(const QVideoSurfaceFormatPrivate &other) - : QSharedData(other) - , pixelFormat(other.pixelFormat) - , handleType(other.handleType) - , scanLineDirection(other.scanLineDirection) - , frameSize(other.frameSize) - , pixelAspectRatio(other.pixelAspectRatio) - , ycbcrColorSpace(other.ycbcrColorSpace) - , viewport(other.viewport) - , frameRate(other.frameRate) - , propertyNames(other.propertyNames) - , propertyValues(other.propertyValues) - { - } - - bool operator ==(const QVideoSurfaceFormatPrivate &other) const - { - if (pixelFormat == other.pixelFormat - && handleType == other.handleType - && scanLineDirection == other.scanLineDirection - && frameSize == other.frameSize - && pixelAspectRatio == other.pixelAspectRatio - && viewport == other.viewport - && frameRatesEqual(frameRate, other.frameRate) - && ycbcrColorSpace == other.ycbcrColorSpace - && propertyNames.count() == other.propertyNames.count()) { - for (int i = 0; i < propertyNames.count(); ++i) { - int j = other.propertyNames.indexOf(propertyNames.at(i)); - - if (j == -1 || propertyValues.at(i) != other.propertyValues.at(j)) - return false; - } - return true; - } else { - return false; - } - } - - inline static bool frameRatesEqual(qreal r1, qreal r2) - { - return qAbs(r1 - r2) <= 0.00001 * qMin(qAbs(r1), qAbs(r2)); - } - - QVideoFrame::PixelFormat pixelFormat; - QAbstractVideoBuffer::HandleType handleType; - QVideoSurfaceFormat::Direction scanLineDirection; - QSize frameSize; - QSize pixelAspectRatio; - QVideoSurfaceFormat::YCbCrColorSpace ycbcrColorSpace; - QRect viewport; - qreal frameRate; - QList propertyNames; - QList propertyValues; -}; - -/*! - \class QVideoSurfaceFormat - \brief The QVideoSurfaceFormat class specifies the stream format of a video presentation - surface. - \since 4.6 - - A video surface presents a stream of video frames. The surface's format describes the type of - the frames and determines how they should be presented. - - The core properties of a video stream required to setup a video surface are the pixel format - given by pixelFormat(), and the frame dimensions given by frameSize(). - - If the surface is to present frames using a frame's handle a surface format will also include - a handle type which is given by the handleType() function. - - The region of a frame that is actually displayed on a video surface is given by the viewport(). - A stream may have a viewport less than the entire region of a frame to allow for videos smaller - than the nearest optimal size of a video frame. For example the width of a frame may be - extended so that the start of each scan line is eight byte aligned. - - Other common properties are the pixelAspectRatio(), scanLineDirection(), and frameRate(). - Additionally a stream may have some additional type specific properties which are listed by the - dynamicPropertyNames() function and can be accessed using the property(), and setProperty() - functions. -*/ - -/*! - \enum QVideoSurfaceFormat::Direction - - Enumerates the layout direction of video scan lines. - - \value TopToBottom Scan lines are arranged from the top of the frame to the bottom. - \value BottomToTop Scan lines are arranged from the bottom of the frame to the top. -*/ - -/*! - \enum QVideoSurfaceFormat::YCbCrColorSpace - - Enumerates the Y'CbCr color space of video frames. - - \value YCbCr_Undefined - No color space is specified. - - \value YCbCr_BT601 - A Y'CbCr color space defined by ITU-R recommendation BT.601 - with Y value range from 16 to 235, and Cb/Cr range from 16 to 240. - Used in standard definition video. - - \value YCbCr_BT709 - A Y'CbCr color space defined by ITU-R BT.709 with the same values range as YCbCr_BT601. Used - for HDTV. - - \value YCbCr_xvYCC601 - The BT.601 color space with the value range extended to 0 to 255. - It is backward compatibile with BT.601 and uses values outside BT.601 range to represent - wider colors range. - - \value YCbCr_xvYCC709 - The BT.709 color space with the value range extended to 0 to 255. - - \value YCbCr_JPEG - The full range Y'CbCr color space used in JPEG files. -*/ - -/*! - Constructs a null video stream format. -*/ - -QVideoSurfaceFormat::QVideoSurfaceFormat() - : d(new QVideoSurfaceFormatPrivate) -{ -} - -/*! - Contructs a description of stream which receives stream of \a type buffers with given frame - \a size and pixel \a format. -*/ - -QVideoSurfaceFormat::QVideoSurfaceFormat( - const QSize& size, QVideoFrame::PixelFormat format, QAbstractVideoBuffer::HandleType type) - : d(new QVideoSurfaceFormatPrivate(size, format, type)) -{ -} - -/*! - Constructs a copy of \a other. -*/ - -QVideoSurfaceFormat::QVideoSurfaceFormat(const QVideoSurfaceFormat &other) - : d(other.d) -{ -} - -/*! - Assigns the values of \a other to a video stream description. -*/ - -QVideoSurfaceFormat &QVideoSurfaceFormat::operator =(const QVideoSurfaceFormat &other) -{ - d = other.d; - - return *this; -} - -/*! - Destroys a video stream description. -*/ - -QVideoSurfaceFormat::~QVideoSurfaceFormat() -{ -} - -/*! - Identifies if a video surface format has a valid pixel format and frame size. - - Returns true if the format is valid, and false otherwise. -*/ - -bool QVideoSurfaceFormat::isValid() const -{ - return d->pixelFormat == QVideoFrame::Format_Invalid && d->frameSize.isValid(); -} - -/*! - Returns true if \a other is the same as a video format, and false if they are the different. -*/ - -bool QVideoSurfaceFormat::operator ==(const QVideoSurfaceFormat &other) const -{ - return d == other.d || *d == *other.d; -} - -/*! - Returns true if \a other is different to a video format, and false if they are the same. -*/ - -bool QVideoSurfaceFormat::operator !=(const QVideoSurfaceFormat &other) const -{ - return d != other.d && !(*d == *other.d); -} - -/*! - Returns the pixel format of frames in a video stream. -*/ - -QVideoFrame::PixelFormat QVideoSurfaceFormat::pixelFormat() const -{ - return d->pixelFormat; -} - -/*! - Returns the type of handle the surface uses to present the frame data. - - If the handle type is QAbstractVideoBuffer::NoHandle buffers with any handle type are valid - provided they can be \l {QAbstractVideoBuffer::map()}{mapped} with the - QAbstractVideoBuffer::ReadOnly flag. If the handleType() is not QAbstractVideoBuffer::NoHandle - then the handle type of the buffer be the same as that of the surface format. -*/ - -QAbstractVideoBuffer::HandleType QVideoSurfaceFormat::handleType() const -{ - return d->handleType; -} - -/*! - Returns the size of frames in a video stream. - - \sa frameWidth(), frameHeight() -*/ - -QSize QVideoSurfaceFormat::frameSize() const -{ - return d->frameSize; -} - -/*! - Returns the width of frames in a video stream. - - \sa frameSize(), frameHeight() -*/ - -int QVideoSurfaceFormat::frameWidth() const -{ - return d->frameSize.width(); -} - -/*! - Returns the height of frame in a video stream. -*/ - -int QVideoSurfaceFormat::frameHeight() const -{ - return d->frameSize.height(); -} - -/*! - Sets the size of frames in a video stream to \a size. - - This will reset the viewport() to fill the entire frame. -*/ - -void QVideoSurfaceFormat::setFrameSize(const QSize &size) -{ - d->frameSize = size; - d->viewport = QRect(QPoint(0, 0), size); -} - -/*! - \overload - - Sets the \a width and \a height of frames in a video stream. - - This will reset the viewport() to fill the entire frame. -*/ - -void QVideoSurfaceFormat::setFrameSize(int width, int height) -{ - d->frameSize = QSize(width, height); - d->viewport = QRect(0, 0, width, height); -} - -/*! - Returns the viewport of a video stream. - - The viewport is the region of a video frame that is actually displayed. - - By default the viewport covers an entire frame. -*/ - -QRect QVideoSurfaceFormat::viewport() const -{ - return d->viewport; -} - -/*! - Sets the viewport of a video stream to \a viewport. -*/ - -void QVideoSurfaceFormat::setViewport(const QRect &viewport) -{ - d->viewport = viewport; -} - -/*! - Returns the direction of scan lines. -*/ - -QVideoSurfaceFormat::Direction QVideoSurfaceFormat::scanLineDirection() const -{ - return d->scanLineDirection; -} - -/*! - Sets the \a direction of scan lines. -*/ - -void QVideoSurfaceFormat::setScanLineDirection(Direction direction) -{ - d->scanLineDirection = direction; -} - -/*! - Returns the frame rate of a video stream in frames per second. -*/ - -qreal QVideoSurfaceFormat::frameRate() const -{ - return d->frameRate; -} - -/*! - Sets the frame \a rate of a video stream in frames per second. -*/ - -void QVideoSurfaceFormat::setFrameRate(qreal rate) -{ - d->frameRate = rate; -} - -/*! - Returns a video stream's pixel aspect ratio. -*/ - -QSize QVideoSurfaceFormat::pixelAspectRatio() const -{ - return d->pixelAspectRatio; -} - -/*! - Sets a video stream's pixel aspect \a ratio. -*/ - -void QVideoSurfaceFormat::setPixelAspectRatio(const QSize &ratio) -{ - d->pixelAspectRatio = ratio; -} - -/*! - \overload - - Sets the \a horizontal and \a vertical elements of a video stream's pixel aspect ratio. -*/ - -void QVideoSurfaceFormat::setPixelAspectRatio(int horizontal, int vertical) -{ - d->pixelAspectRatio = QSize(horizontal, vertical); -} - -/*! - Returns the Y'CbCr color space of a video stream. -*/ - -QVideoSurfaceFormat::YCbCrColorSpace QVideoSurfaceFormat::yCbCrColorSpace() const -{ - return d->ycbcrColorSpace; -} - -/*! - Sets the Y'CbCr color \a space of a video stream. - It is only used with raw YUV frame types. -*/ - -void QVideoSurfaceFormat::setYCbCrColorSpace(QVideoSurfaceFormat::YCbCrColorSpace space) -{ - d->ycbcrColorSpace = space; -} - -/*! - Returns a suggested size in pixels for the video stream. - - This is the size of the viewport scaled according to the pixel aspect ratio. -*/ - -QSize QVideoSurfaceFormat::sizeHint() const -{ - QSize size = d->viewport.size(); - - if (d->pixelAspectRatio.height() != 0) - size.setWidth(size.width() * d->pixelAspectRatio.width() / d->pixelAspectRatio.height()); - - return size; -} - -/*! - Returns a list of video format dynamic property names. -*/ - -QList QVideoSurfaceFormat::propertyNames() const -{ - return (QList() - << "handleType" - << "pixelFormat" - << "frameSize" - << "frameWidth" - << "viewport" - << "scanLineDirection" - << "frameRate" - << "pixelAspectRatio" - << "sizeHint" - << "yCbCrColorSpace") - + d->propertyNames; -} - -/*! - Returns the value of the video format's \a name property. -*/ - -QVariant QVideoSurfaceFormat::property(const char *name) const -{ - if (qstrcmp(name, "handleType") == 0) { - return qVariantFromValue(d->handleType); - } else if (qstrcmp(name, "pixelFormat") == 0) { - return qVariantFromValue(d->pixelFormat); - } else if (qstrcmp(name, "handleType") == 0) { - return qVariantFromValue(d->handleType); - } else if (qstrcmp(name, "frameSize") == 0) { - return d->frameSize; - } else if (qstrcmp(name, "frameWidth") == 0) { - return d->frameSize.width(); - } else if (qstrcmp(name, "frameHeight") == 0) { - return d->frameSize.height(); - } else if (qstrcmp(name, "viewport") == 0) { - return d->viewport; - } else if (qstrcmp(name, "scanLineDirection") == 0) { - return qVariantFromValue(d->scanLineDirection); - } else if (qstrcmp(name, "frameRate") == 0) { - return qVariantFromValue(d->frameRate); - } else if (qstrcmp(name, "pixelAspectRatio") == 0) { - return qVariantFromValue(d->pixelAspectRatio); - } else if (qstrcmp(name, "sizeHint") == 0) { - return sizeHint(); - } else if (qstrcmp(name, "yCbCrColorSpace") == 0) { - return qVariantFromValue(d->ycbcrColorSpace); - } else { - int id = 0; - for (; id < d->propertyNames.count() && d->propertyNames.at(id) != name; ++id) {} - - return id < d->propertyValues.count() - ? d->propertyValues.at(id) - : QVariant(); - } -} - -/*! - Sets the video format's \a name property to \a value. -*/ - -void QVideoSurfaceFormat::setProperty(const char *name, const QVariant &value) -{ - if (qstrcmp(name, "handleType") == 0) { - // read only. - } else if (qstrcmp(name, "pixelFormat") == 0) { - // read only. - } else if (qstrcmp(name, "frameSize") == 0) { - if (qVariantCanConvert(value)) { - d->frameSize = qvariant_cast(value); - d->viewport = QRect(QPoint(0, 0), d->frameSize); - } - } else if (qstrcmp(name, "frameWidth") == 0) { - // read only. - } else if (qstrcmp(name, "frameHeight") == 0) { - // read only. - } else if (qstrcmp(name, "viewport") == 0) { - if (qVariantCanConvert(value)) - d->viewport = qvariant_cast(value); - } else if (qstrcmp(name, "scanLineDirection") == 0) { - if (qVariantCanConvert(value)) - d->scanLineDirection = qvariant_cast(value); - } else if (qstrcmp(name, "frameRate") == 0) { - if (qVariantCanConvert(value)) - d->frameRate = qvariant_cast(value); - } else if (qstrcmp(name, "pixelAspectRatio") == 0) { - if (qVariantCanConvert(value)) - d->pixelAspectRatio = qvariant_cast(value); - } else if (qstrcmp(name, "sizeHint") == 0) { - // read only. - } else if (qstrcmp(name, "yCbCrColorSpace") == 0) { - if (qVariantCanConvert(value)) - d->ycbcrColorSpace = qvariant_cast(value); - } else { - int id = 0; - for (; id < d->propertyNames.count() && d->propertyNames.at(id) != name; ++id) {} - - if (id < d->propertyValues.count()) { - if (value.isNull()) { - d->propertyNames.removeAt(id); - d->propertyValues.removeAt(id); - } else { - d->propertyValues[id] = value; - } - } else if (!value.isNull()) { - d->propertyNames.append(QByteArray(name)); - d->propertyValues.append(value); - } - } -} - - -#ifndef QT_NO_DEBUG_STREAM -QDebug operator<<(QDebug dbg, const QVideoSurfaceFormat &f) -{ - QString typeName; - switch (f.pixelFormat()) { - case QVideoFrame::Format_Invalid: - typeName = QLatin1String("Format_Invalid"); - break; - case QVideoFrame::Format_ARGB32: - typeName = QLatin1String("Format_ARGB32"); - break; - case QVideoFrame::Format_ARGB32_Premultiplied: - typeName = QLatin1String("Format_ARGB32_Premultiplied"); - break; - case QVideoFrame::Format_RGB32: - typeName = QLatin1String("Format_RGB32"); - break; - case QVideoFrame::Format_RGB24: - typeName = QLatin1String("Format_RGB24"); - break; - case QVideoFrame::Format_RGB565: - typeName = QLatin1String("Format_RGB565"); - break; - case QVideoFrame::Format_RGB555: - typeName = QLatin1String("Format_RGB555"); - break; - case QVideoFrame::Format_ARGB8565_Premultiplied: - typeName = QLatin1String("Format_ARGB8565_Premultiplied"); - break; - case QVideoFrame::Format_BGRA32: - typeName = QLatin1String("Format_BGRA32"); - break; - case QVideoFrame::Format_BGRA32_Premultiplied: - typeName = QLatin1String("Format_BGRA32_Premultiplied"); - break; - case QVideoFrame::Format_BGR32: - typeName = QLatin1String("Format_BGR32"); - break; - case QVideoFrame::Format_BGR24: - typeName = QLatin1String("Format_BGR24"); - break; - case QVideoFrame::Format_BGR565: - typeName = QLatin1String("Format_BGR565"); - break; - case QVideoFrame::Format_BGR555: - typeName = QLatin1String("Format_BGR555"); - break; - case QVideoFrame::Format_BGRA5658_Premultiplied: - typeName = QLatin1String("Format_BGRA5658_Premultiplied"); - break; - case QVideoFrame::Format_AYUV444: - typeName = QLatin1String("Format_AYUV444"); - break; - case QVideoFrame::Format_AYUV444_Premultiplied: - typeName = QLatin1String("Format_AYUV444_Premultiplied"); - break; - case QVideoFrame::Format_YUV444: - typeName = QLatin1String("Format_YUV444"); - break; - case QVideoFrame::Format_YUV420P: - typeName = QLatin1String("Format_YUV420P"); - break; - case QVideoFrame::Format_YV12: - typeName = QLatin1String("Format_YV12"); - break; - case QVideoFrame::Format_UYVY: - typeName = QLatin1String("Format_UYVY"); - break; - case QVideoFrame::Format_YUYV: - typeName = QLatin1String("Format_YUYV"); - break; - case QVideoFrame::Format_NV12: - typeName = QLatin1String("Format_NV12"); - break; - case QVideoFrame::Format_NV21: - typeName = QLatin1String("Format_NV21"); - break; - case QVideoFrame::Format_IMC1: - typeName = QLatin1String("Format_IMC1"); - break; - case QVideoFrame::Format_IMC2: - typeName = QLatin1String("Format_IMC2"); - break; - case QVideoFrame::Format_IMC3: - typeName = QLatin1String("Format_IMC3"); - break; - case QVideoFrame::Format_IMC4: - typeName = QLatin1String("Format_IMC4"); - break; - case QVideoFrame::Format_Y8: - typeName = QLatin1String("Format_Y8"); - break; - case QVideoFrame::Format_Y16: - typeName = QLatin1String("Format_Y16"); - default: - typeName = QString(QLatin1String("UserType(%1)" )).arg(int(f.pixelFormat())); - } - - dbg.nospace() << "QVideoSurfaceFormat(" << typeName; - dbg.nospace() << ", " << f.frameSize(); - dbg.nospace() << ", viewport=" << f.viewport(); - dbg.nospace() << ", pixelAspectRatio=" << f.pixelAspectRatio(); - dbg.nospace() << ")"; - - foreach(const QByteArray& propertyName, f.propertyNames()) - dbg << "\n " << propertyName.data() << " = " << f.property(propertyName.data()); - - return dbg.space(); -} -#endif - -QT_END_NAMESPACE diff --git a/src/multimedia/video/qvideosurfaceformat.h b/src/multimedia/video/qvideosurfaceformat.h deleted file mode 100644 index 9c73f5f..0000000 --- a/src/multimedia/video/qvideosurfaceformat.h +++ /dev/null @@ -1,147 +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 QVIDEOSURFACEFORMAT_H -#define QVIDEOSURFACEFORMAT_H - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Multimedia) - -class QDebug; - -class QVideoSurfaceFormatPrivate; - -class Q_MULTIMEDIA_EXPORT QVideoSurfaceFormat -{ -public: - enum Direction - { - TopToBottom, - BottomToTop - }; - - enum YCbCrColorSpace - { - YCbCr_Undefined, - YCbCr_BT601, - YCbCr_BT709, - YCbCr_xvYCC601, - YCbCr_xvYCC709, - YCbCr_JPEG, -#ifndef qdoc - YCbCr_CustomMatrix -#endif - }; - - QVideoSurfaceFormat(); - QVideoSurfaceFormat( - const QSize &size, - QVideoFrame::PixelFormat pixelFormat, - QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle); - QVideoSurfaceFormat(const QVideoSurfaceFormat &format); - ~QVideoSurfaceFormat(); - - QVideoSurfaceFormat &operator =(const QVideoSurfaceFormat &format); - - bool operator ==(const QVideoSurfaceFormat &format) const; - bool operator !=(const QVideoSurfaceFormat &format) const; - - bool isValid() const; - - QVideoFrame::PixelFormat pixelFormat() const; - QAbstractVideoBuffer::HandleType handleType() const; - - QSize frameSize() const; - void setFrameSize(const QSize &size); - void setFrameSize(int width, int height); - - int frameWidth() const; - int frameHeight() const; - - QRect viewport() const; - void setViewport(const QRect &viewport); - - Direction scanLineDirection() const; - void setScanLineDirection(Direction direction); - - qreal frameRate() const; - void setFrameRate(qreal rate); - - QSize pixelAspectRatio() const; - void setPixelAspectRatio(const QSize &ratio); - void setPixelAspectRatio(int width, int height); - - YCbCrColorSpace yCbCrColorSpace() const; - void setYCbCrColorSpace(YCbCrColorSpace colorSpace); - - QSize sizeHint() const; - - QList propertyNames() const; - QVariant property(const char *name) const; - void setProperty(const char *name, const QVariant &value); - -private: - QSharedDataPointer d; -}; - -#ifndef QT_NO_DEBUG_STREAM -Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QVideoSurfaceFormat &); -#endif - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QVideoSurfaceFormat::Direction) -Q_DECLARE_METATYPE(QVideoSurfaceFormat::YCbCrColorSpace) - -QT_END_HEADER - -#endif - diff --git a/src/multimedia/video/video.pri b/src/multimedia/video/video.pri deleted file mode 100644 index 0547a4c..0000000 --- a/src/multimedia/video/video.pri +++ /dev/null @@ -1,21 +0,0 @@ - -INCLUDEPATH += $$PWD - -HEADERS += \ - $$PWD/qabstractvideobuffer.h \ - $$PWD/qabstractvideobuffer_p.h \ - $$PWD/qabstractvideosurface.h \ - $$PWD/qabstractvideosurface_p.h \ - $$PWD/qimagevideobuffer_p.h \ - $$PWD/qmemoryvideobuffer_p.h \ - $$PWD/qvideoframe.h \ - $$PWD/qvideosurfaceformat.h - -SOURCES += \ - $$PWD/qabstractvideobuffer.cpp \ - $$PWD/qabstractvideosurface.cpp \ - $$PWD/qimagevideobuffer.cpp \ - $$PWD/qmemoryvideobuffer.cpp \ - $$PWD/qvideoframe.cpp \ - $$PWD/qvideosurfaceformat.cpp - diff --git a/src/plugins/mediaservices/directshow/directshow.pro b/src/plugins/mediaservices/directshow/directshow.pro index ea133f9..973c2b1 100644 --- a/src/plugins/mediaservices/directshow/directshow.pro +++ b/src/plugins/mediaservices/directshow/directshow.pro @@ -1,7 +1,7 @@ -TARGET = dsengine +TARGET = qdsengine include(../../qpluginbase.pri) -QT += multimedia +QT += mediaservices HEADERS += dsserviceplugin.h SOURCES += dsserviceplugin.cpp diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h index 2faac13..d7e3499 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h @@ -42,7 +42,7 @@ #ifndef DIRECTSHOWAUDIOENDPOINTCONTROL_H #define DIRECTSHOWAUDIOENDPOINTCONTROL_H -#include +#include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp index 89821c4..53b8787 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp @@ -57,76 +57,76 @@ namespace { struct QWMMetaDataKeyLookup { - QtMultimedia::MetaData key; + QtMediaservices::MetaData key; const wchar_t *token; }; } static const QWMMetaDataKeyLookup qt_wmMetaDataKeys[] = { - { QtMultimedia::Title, L"Title" }, - { QtMultimedia::SubTitle, L"WM/SubTitle" }, - { QtMultimedia::Author, L"Author" }, - { QtMultimedia::Comment, L"Comment" }, - { QtMultimedia::Description, L"Description" }, - { QtMultimedia::Category, L"WM/Category" }, - { QtMultimedia::Genre, L"WM/Genre" }, - //{ QtMultimedia::Date, 0 }, - { QtMultimedia::Year, L"WM/Year" }, - { QtMultimedia::UserRating, L"UserRating" }, - //{ QtMultimedia::MetaDatawords, 0 }, - { QtMultimedia::Language, L"Language" }, - { QtMultimedia::Publisher, L"WM/Publisher" }, - { QtMultimedia::Copyright, L"Copyright" }, - { QtMultimedia::ParentalRating, L"ParentalRating" }, - { QtMultimedia::RatingOrganisation, L"RatingOrganisation" }, + { QtMediaservices::Title, L"Title" }, + { QtMediaservices::SubTitle, L"WM/SubTitle" }, + { QtMediaservices::Author, L"Author" }, + { QtMediaservices::Comment, L"Comment" }, + { QtMediaservices::Description, L"Description" }, + { QtMediaservices::Category, L"WM/Category" }, + { QtMediaservices::Genre, L"WM/Genre" }, + //{ QtMediaservices::Date, 0 }, + { QtMediaservices::Year, L"WM/Year" }, + { QtMediaservices::UserRating, L"UserRating" }, + //{ QtMediaservices::MetaDatawords, 0 }, + { QtMediaservices::Language, L"Language" }, + { QtMediaservices::Publisher, L"WM/Publisher" }, + { QtMediaservices::Copyright, L"Copyright" }, + { QtMediaservices::ParentalRating, L"ParentalRating" }, + { QtMediaservices::RatingOrganisation, L"RatingOrganisation" }, // Media - { QtMultimedia::Size, L"FileSize" }, - { QtMultimedia::MediaType, L"MediaType" }, - { QtMultimedia::Duration, L"Duration" }, + { QtMediaservices::Size, L"FileSize" }, + { QtMediaservices::MediaType, L"MediaType" }, + { QtMediaservices::Duration, L"Duration" }, // Audio - { QtMultimedia::AudioBitRate, L"AudioBitRate" }, - { QtMultimedia::AudioCodec, L"AudioCodec" }, - { QtMultimedia::ChannelCount, L"ChannelCount" }, - { QtMultimedia::SampleRate, L"Frequency" }, + { QtMediaservices::AudioBitRate, L"AudioBitRate" }, + { QtMediaservices::AudioCodec, L"AudioCodec" }, + { QtMediaservices::ChannelCount, L"ChannelCount" }, + { QtMediaservices::SampleRate, L"Frequency" }, // Music - { QtMultimedia::AlbumTitle, L"WM/AlbumTitle" }, - { QtMultimedia::AlbumArtist, L"WM/AlbumArtist" }, - { QtMultimedia::ContributingArtist, L"Author" }, - { QtMultimedia::Composer, L"WM/Composer" }, - { QtMultimedia::Conductor, L"WM/Conductor" }, - { QtMultimedia::Lyrics, L"WM/Lyrics" }, - { QtMultimedia::Mood, L"WM/Mood" }, - { QtMultimedia::TrackNumber, L"WM/TrackNumber" }, - //{ QtMultimedia::TrackCount, 0 }, - //{ QtMultimedia::CoverArtUriSmall, 0 }, - //{ QtMultimedia::CoverArtUriLarge, 0 }, + { QtMediaservices::AlbumTitle, L"WM/AlbumTitle" }, + { QtMediaservices::AlbumArtist, L"WM/AlbumArtist" }, + { QtMediaservices::ContributingArtist, L"Author" }, + { QtMediaservices::Composer, L"WM/Composer" }, + { QtMediaservices::Conductor, L"WM/Conductor" }, + { QtMediaservices::Lyrics, L"WM/Lyrics" }, + { QtMediaservices::Mood, L"WM/Mood" }, + { QtMediaservices::TrackNumber, L"WM/TrackNumber" }, + //{ QtMediaservices::TrackCount, 0 }, + //{ QtMediaservices::CoverArtUriSmall, 0 }, + //{ QtMediaservices::CoverArtUriLarge, 0 }, // Image/Video - //{ QtMultimedia::Resolution, 0 }, - //{ QtMultimedia::PixelAspectRatio, 0 }, + //{ QtMediaservices::Resolution, 0 }, + //{ QtMediaservices::PixelAspectRatio, 0 }, // Video - //{ QtMultimedia::FrameRate, 0 }, - { QtMultimedia::VideoBitRate, L"VideoBitRate" }, - { QtMultimedia::VideoCodec, L"VideoCodec" }, + //{ QtMediaservices::FrameRate, 0 }, + { QtMediaservices::VideoBitRate, L"VideoBitRate" }, + { QtMediaservices::VideoCodec, L"VideoCodec" }, - //{ QtMultimedia::PosterUri, 0 }, + //{ QtMediaservices::PosterUri, 0 }, // Movie - { QtMultimedia::ChapterNumber, L"ChapterNumber" }, - { QtMultimedia::Director, L"WM/Director" }, - { QtMultimedia::LeadPerformer, L"LeadPerformer" }, - { QtMultimedia::Writer, L"WM/Writer" }, + { QtMediaservices::ChapterNumber, L"ChapterNumber" }, + { QtMediaservices::Director, L"WM/Director" }, + { QtMediaservices::LeadPerformer, L"LeadPerformer" }, + { QtMediaservices::Writer, L"WM/Writer" }, // Photos - { QtMultimedia::CameraManufacturer, L"CameraManufacturer" }, - { QtMultimedia::CameraModel, L"CameraModel" }, - { QtMultimedia::Event, L"Event" }, - { QtMultimedia::Subject, L"Subject" } + { QtMediaservices::CameraManufacturer, L"CameraManufacturer" }, + { QtMediaservices::CameraModel, L"CameraModel" }, + { QtMediaservices::Event, L"Event" }, + { QtMediaservices::Subject, L"Subject" } }; static QVariant getValue(IWMHeaderInfo *header, const wchar_t *key) @@ -257,7 +257,7 @@ bool DirectShowMetaDataControl::isMetaDataAvailable() const #endif } -QVariant DirectShowMetaDataControl::metaData(QtMultimedia::MetaData key) const +QVariant DirectShowMetaDataControl::metaData(QtMediaservices::MetaData key) const { QVariant value; @@ -277,19 +277,19 @@ QVariant DirectShowMetaDataControl::metaData(QtMultimedia::MetaData key) const BSTR string = 0; switch (key) { - case QtMultimedia::Author: + case QtMediaservices::Author: m_content->get_AuthorName(&string); break; - case QtMultimedia::Title: + case QtMediaservices::Title: m_content->get_Title(&string); break; - case QtMultimedia::ParentalRating: + case QtMediaservices::ParentalRating: m_content->get_Rating(&string); break; - case QtMultimedia::Description: + case QtMediaservices::Description: m_content->get_Description(&string); break; - case QtMultimedia::Copyright: + case QtMediaservices::Copyright: m_content->get_Copyright(&string); break; default: @@ -305,13 +305,13 @@ QVariant DirectShowMetaDataControl::metaData(QtMultimedia::MetaData key) const return value; } -void DirectShowMetaDataControl::setMetaData(QtMultimedia::MetaData, const QVariant &) +void DirectShowMetaDataControl::setMetaData(QtMediaservices::MetaData, const QVariant &) { } -QList DirectShowMetaDataControl::availableMetaData() const +QList DirectShowMetaDataControl::availableMetaData() const { - return QList(); + return QList(); } QVariant DirectShowMetaDataControl::extendedMetaData(const QString &) const diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h index 9a81ba8..c67c6eb 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h @@ -44,7 +44,7 @@ #include "directshowglobal.h" -#include +#include #include @@ -72,9 +72,9 @@ public: bool isWritable() const; bool isMetaDataAvailable() const; - QVariant metaData(QtMultimedia::MetaData key) const; - void setMetaData(QtMultimedia::MetaData key, const QVariant &value); - QList availableMetaData() const; + QVariant metaData(QtMediaservices::MetaData key) const; + void setMetaData(QtMediaservices::MetaData key, const QVariant &value); + QList availableMetaData() const; QVariant extendedMetaData(const QString &key) const; void setExtendedMetaData(const QString &key, const QVariant &value); diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowpinenum.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowpinenum.cpp index 19f65da..4dd9b0e 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowpinenum.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowpinenum.cpp @@ -41,7 +41,7 @@ #include "directshowpinenum.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.h index dd25d30..b22a45b 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.h @@ -42,8 +42,8 @@ #ifndef DIRECTSHOWPLAYERCONTROL_H #define DIRECTSHOWPLAYERCONTROL_H -#include -#include +#include +#include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp index a5f143f..93ae3ad 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp @@ -49,7 +49,7 @@ #include "directshowvideorenderercontrol.h" #include "vmr9videowindowcontrol.h" -#include +#include #include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h index d3ef809..1a90b7e 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h @@ -42,10 +42,10 @@ #ifndef DIRECTSHOWPLAYERSERVICE_H #define DIRECTSHOWPLAYERSERVICE_H -#include -#include -#include -#include +#include +#include +#include +#include #include "directshoweventloop.h" #include "directshowglobal.h" diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowvideooutputcontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowvideooutputcontrol.h index acb2937..c4e9bed 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowvideooutputcontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowvideooutputcontrol.h @@ -42,7 +42,7 @@ #ifndef DIRECTSHOWVIDEOUTPUTCONTROL_H #define DIRECTSHOWVIDEOOUPUTCONTROL_H -#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowvideorenderercontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowvideorenderercontrol.h index 6b4f4a2..c341487 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowvideorenderercontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowvideorenderercontrol.h @@ -42,7 +42,7 @@ #ifndef DIRECTSHOWVIDEORENDERERCONTROL_H #define DIRECTSHOWVIDEORENDERERCONTROL_H -#include +#include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h b/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h index 06dc31c..5820225 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h @@ -42,7 +42,7 @@ #ifndef MEDIASAMPLEVIDEOBUFFER_H #define MEDIASAMPLEVIDEOBUFFER_H -#include +#include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.h index beac433..9906fae 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.h @@ -42,7 +42,7 @@ #ifndef VMR9VIDEOWINDOWCONTROL_H #define VMR9VIDEOWINDOWCONTROL_H -#include +#include #include #include diff --git a/src/plugins/mediaservices/gstreamer/gstreamer.pro b/src/plugins/mediaservices/gstreamer/gstreamer.pro index d1bfe44..0273139 100644 --- a/src/plugins/mediaservices/gstreamer/gstreamer.pro +++ b/src/plugins/mediaservices/gstreamer/gstreamer.pro @@ -1,7 +1,7 @@ -TARGET = gstengine +TARGET = qgstengine include(../../qpluginbase.pri) -QT += multimedia +QT += mediaservices unix:contains(QT_CONFIG, alsa) { DEFINES += HAVE_ALSA diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp index eff6ea4..05b924a 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp @@ -49,77 +49,77 @@ QT_BEGIN_NAMESPACE struct QGstreamerMetaDataKeyLookup { - QtMultimedia::MetaData key; + QtMediaservices::MetaData key; const char *token; }; static const QGstreamerMetaDataKeyLookup qt_gstreamerMetaDataKeys[] = { - { QtMultimedia::Title, GST_TAG_TITLE }, - //{ QtMultimedia::SubTitle, 0 }, - //{ QtMultimedia::Author, 0 }, - { QtMultimedia::Comment, GST_TAG_COMMENT }, - { QtMultimedia::Description, GST_TAG_DESCRIPTION }, - //{ QtMultimedia::Category, 0 }, - { QtMultimedia::Genre, GST_TAG_GENRE }, - { QtMultimedia::Year, "year" }, - //{ QtMultimedia::UserRating, 0 }, - - { QtMultimedia::Language, GST_TAG_LANGUAGE_CODE }, - - { QtMultimedia::Publisher, GST_TAG_ORGANIZATION }, - { QtMultimedia::Copyright, GST_TAG_COPYRIGHT }, - //{ QtMultimedia::ParentalRating, 0 }, - //{ QtMultimedia::RatingOrganisation, 0 }, + { QtMediaservices::Title, GST_TAG_TITLE }, + //{ QtMediaservices::SubTitle, 0 }, + //{ QtMediaservices::Author, 0 }, + { QtMediaservices::Comment, GST_TAG_COMMENT }, + { QtMediaservices::Description, GST_TAG_DESCRIPTION }, + //{ QtMediaservices::Category, 0 }, + { QtMediaservices::Genre, GST_TAG_GENRE }, + { QtMediaservices::Year, "year" }, + //{ QtMediaservices::UserRating, 0 }, + + { QtMediaservices::Language, GST_TAG_LANGUAGE_CODE }, + + { QtMediaservices::Publisher, GST_TAG_ORGANIZATION }, + { QtMediaservices::Copyright, GST_TAG_COPYRIGHT }, + //{ QtMediaservices::ParentalRating, 0 }, + //{ QtMediaservices::RatingOrganisation, 0 }, // Media - //{ QtMultimedia::Size, 0 }, - //{ QtMultimedia::MediaType, 0 }, - { QtMultimedia::Duration, GST_TAG_DURATION }, + //{ QtMediaservices::Size, 0 }, + //{ QtMediaservices::MediaType, 0 }, + { QtMediaservices::Duration, GST_TAG_DURATION }, // Audio - { QtMultimedia::AudioBitRate, GST_TAG_BITRATE }, - { QtMultimedia::AudioCodec, GST_TAG_AUDIO_CODEC }, - //{ QtMultimedia::ChannelCount, 0 }, - //{ QtMultimedia::Frequency, 0 }, + { QtMediaservices::AudioBitRate, GST_TAG_BITRATE }, + { QtMediaservices::AudioCodec, GST_TAG_AUDIO_CODEC }, + //{ QtMediaservices::ChannelCount, 0 }, + //{ QtMediaservices::Frequency, 0 }, // Music - { QtMultimedia::AlbumTitle, GST_TAG_ALBUM }, - { QtMultimedia::AlbumArtist, GST_TAG_ARTIST}, - { QtMultimedia::ContributingArtist, GST_TAG_PERFORMER }, + { QtMediaservices::AlbumTitle, GST_TAG_ALBUM }, + { QtMediaservices::AlbumArtist, GST_TAG_ARTIST}, + { QtMediaservices::ContributingArtist, GST_TAG_PERFORMER }, #if (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19) - { QtMultimedia::Composer, GST_TAG_COMPOSER }, + { QtMediaservices::Composer, GST_TAG_COMPOSER }, #endif - //{ QtMultimedia::Conductor, 0 }, - //{ QtMultimedia::Lyrics, 0 }, - //{ QtMultimedia::Mood, 0 }, - { QtMultimedia::TrackNumber, GST_TAG_TRACK_NUMBER }, + //{ QtMediaservices::Conductor, 0 }, + //{ QtMediaservices::Lyrics, 0 }, + //{ QtMediaservices::Mood, 0 }, + { QtMediaservices::TrackNumber, GST_TAG_TRACK_NUMBER }, - //{ QtMultimedia::CoverArtUrlSmall, 0 }, - //{ QtMultimedia::CoverArtUrlLarge, 0 }, + //{ QtMediaservices::CoverArtUrlSmall, 0 }, + //{ QtMediaservices::CoverArtUrlLarge, 0 }, // Image/Video - //{ QtMultimedia::Resolution, 0 }, - //{ QtMultimedia::PixelAspectRatio, 0 }, + //{ QtMediaservices::Resolution, 0 }, + //{ QtMediaservices::PixelAspectRatio, 0 }, // Video - //{ QtMultimedia::VideoFrameRate, 0 }, - //{ QtMultimedia::VideoBitRate, 0 }, - { QtMultimedia::VideoCodec, GST_TAG_VIDEO_CODEC }, + //{ QtMediaservices::VideoFrameRate, 0 }, + //{ QtMediaservices::VideoBitRate, 0 }, + { QtMediaservices::VideoCodec, GST_TAG_VIDEO_CODEC }, - //{ QtMultimedia::PosterUrl, 0 }, + //{ QtMediaservices::PosterUrl, 0 }, // Movie - //{ QtMultimedia::ChapterNumber, 0 }, - //{ QtMultimedia::Director, 0 }, - { QtMultimedia::LeadPerformer, GST_TAG_PERFORMER }, - //{ QtMultimedia::Writer, 0 }, + //{ QtMediaservices::ChapterNumber, 0 }, + //{ QtMediaservices::Director, 0 }, + { QtMediaservices::LeadPerformer, GST_TAG_PERFORMER }, + //{ QtMediaservices::Writer, 0 }, // Photos - //{ QtMultimedia::CameraManufacturer, 0 }, - //{ QtMultimedia::CameraModel, 0 }, - //{ QtMultimedia::Event, 0 }, - //{ QtMultimedia::Subject, 0 } + //{ QtMediaservices::CameraManufacturer, 0 }, + //{ QtMediaservices::CameraModel, 0 }, + //{ QtMediaservices::Event, 0 }, + //{ QtMediaservices::Subject, 0 } }; QGstreamerMetaDataProvider::QGstreamerMetaDataProvider(QGstreamerPlayerSession *session, QObject *parent) @@ -142,7 +142,7 @@ bool QGstreamerMetaDataProvider::isWritable() const return false; } -QVariant QGstreamerMetaDataProvider::metaData(QtMultimedia::MetaData key) const +QVariant QGstreamerMetaDataProvider::metaData(QtMediaservices::MetaData key) const { static const int count = sizeof(qt_gstreamerMetaDataKeys) / sizeof(QGstreamerMetaDataKeyLookup); @@ -154,15 +154,15 @@ QVariant QGstreamerMetaDataProvider::metaData(QtMultimedia::MetaData key) const return QVariant(); } -void QGstreamerMetaDataProvider::setMetaData(QtMultimedia::MetaData key, QVariant const &value) +void QGstreamerMetaDataProvider::setMetaData(QtMediaservices::MetaData key, QVariant const &value) { Q_UNUSED(key); Q_UNUSED(value); } -QList QGstreamerMetaDataProvider::availableMetaData() const +QList QGstreamerMetaDataProvider::availableMetaData() const { - static QMap keysMap; + static QMap keysMap; if (keysMap.isEmpty()) { const int count = sizeof(qt_gstreamerMetaDataKeys) / sizeof(QGstreamerMetaDataKeyLookup); for (int i = 0; i < count; ++i) { @@ -170,9 +170,9 @@ QList QGstreamerMetaDataProvider::availableMetaData() co } } - QList res; + QList res; foreach (const QByteArray &key, m_session->tags().keys()) { - QtMultimedia::MetaData tag = keysMap.value(key, QtMultimedia::MetaData(-1)); + QtMediaservices::MetaData tag = keysMap.value(key, QtMultimedia::MetaData(-1)); if (tag != -1) res.append(tag); } diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.h index 267c2d7..98803c2 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERMETADATAPROVIDER_H #define QGSTREAMERMETADATAPROVIDER_H -#include +#include QT_BEGIN_HEADER @@ -61,9 +61,9 @@ public: bool isMetaDataAvailable() const; bool isWritable() const; - QVariant metaData(QtMultimedia::MetaData key) const; - void setMetaData(QtMultimedia::MetaData key, const QVariant &value); - QList availableMetaData() const; + QVariant metaData(QtMediaservices::MetaData key) const; + void setMetaData(QtMediaservices::MetaData key, const QVariant &value); + QList availableMetaData() const; QVariant extendedMetaData(const QString &key) const ; void setExtendedMetaData(const QString &key, const QVariant &value); diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h index 1764eb0..bb77eff 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include #include diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp index 56cdb04..33454d4 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -812,7 +812,7 @@ void QGstreamerPlayerSession::getStreamsInfo() for (int i=0; i streamProperties; + QMap streamProperties; int streamIndex = i - m_playbin2StreamOffset[streamType]; @@ -834,7 +834,7 @@ void QGstreamerPlayerSession::getStreamsInfo() if (tags && gst_is_tag_list(tags)) { gchar *languageCode = 0; if (gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &languageCode)) - streamProperties[QtMultimedia::Language] = QString::fromUtf8(languageCode); + streamProperties[QtMediaservices::Language] = QString::fromUtf8(languageCode); //qDebug() << "language for setream" << i << QString::fromUtf8(languageCode); g_free (languageCode); @@ -889,8 +889,8 @@ void QGstreamerPlayerSession::getStreamsInfo() // break; // } // -// QMap streamProperties; -// streamProperties[QtMultimedia::Language] = QString::fromUtf8(languageCode); +// QMap streamProperties; +// streamProperties[QtMediaservices::Language] = QString::fromUtf8(languageCode); // // m_streamProperties.append(streamProperties); // m_streamTypes.append(streamType); diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h index 867a0e0..61b5f51 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h @@ -46,7 +46,7 @@ #include #include "qgstreamerplayercontrol.h" #include "qgstreamerbushelper.h" -#include +#include //#include #include @@ -92,7 +92,7 @@ public: void setPlaybackRate(qreal rate); QMap tags() const { return m_tags; } - QMap streamProperties(int streamNumber) const { return m_streamProperties[streamNumber]; } + QMap streamProperties(int streamNumber) const { return m_streamProperties[streamNumber]; } // int streamCount() const { return m_streamProperties.count(); } // QMediaStreamsControl::StreamType streamType(int streamNumber) { return m_streamTypes.value(streamNumber, QMediaStreamsControl::UnknownStream); } // @@ -153,7 +153,7 @@ private: QGstreamerVideoRendererInterface *m_renderer; QMap m_tags; - QList< QMap > m_streamProperties; + QList< QMap > m_streamProperties; // QList m_streamTypes; // QMap m_playbin2StreamOffset; diff --git a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp index 98068ac..443e738 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp @@ -52,7 +52,7 @@ #ifdef QMEDIA_GSTREAMER_CAPTURE #include "qgstreamercaptureservice.h" #endif -#include +#include #ifdef QMEDIA_GSTREAMER_CAPTURE #include diff --git a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.h b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.h index d6d6899..6908bb3 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.h @@ -43,7 +43,7 @@ #ifndef QGSTREAMERSERVICEPLUGIN_H #define QGSTREAMERSERVICEPLUGIN_H -#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.h b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.h index 6762bab..35174cf 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEOINPUTDEVICECONTROL_H #define QGSTREAMERVIDEOINPUTDEVICECONTROL_H -#include +#include #include diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.h b/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.h index 7685239..c4d76a4 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEOOUTPUTCONTROL_H #define QGSTREAMERVIDEOOUTPUTCONTROL_H -#include +#include #include diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.h b/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.h index 1188074..63079c8 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEOOVERLAY_H #define QGSTREAMERVIDEOOVERLAY_H -#include +#include #include "qgstreamervideorendererinterface.h" diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.h b/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.h index ba3f806..903ffbb 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEORENDERER_H #define QGSTREAMERVIDEORENDERER_H -#include +#include #include "qvideosurfacegstsink.h" #include "qgstreamervideorendererinterface.h" diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h index 28b48af..e99a3cf 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEOWIDGET_H #define QGSTREAMERVIDEOWIDGET_H -#include +#include #include "qgstreamervideorendererinterface.h" diff --git a/src/plugins/mediaservices/mediaservices.pro b/src/plugins/mediaservices/mediaservices.pro index 19d678b..6a00a14 100644 --- a/src/plugins/mediaservices/mediaservices.pro +++ b/src/plugins/mediaservices/mediaservices.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -contains(QT_CONFIG, mediaservice) { +contains(QT_CONFIG, media-backend) { win32:!wince*: SUBDIRS += directshow mac: SUBDIRS += qt7 diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.h index 907d13d..a546ca1 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.h +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.h @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.mm index 0f4ac41..90c6035 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.mm @@ -42,7 +42,7 @@ #include "qt7playercontrol.h" #include "qt7playersession.h" -#include +#include #include #include diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.h index f16807a..e13df95 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.h +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.h @@ -42,7 +42,7 @@ #ifndef QT7PLAYERMETADATACONTROL_H #define QT7PLAYERMETADATACONTROL_H -#include +#include QT_BEGIN_HEADER @@ -61,9 +61,9 @@ public: bool isMetaDataAvailable() const; bool isWritable() const; - QVariant metaData(QtMultimedia::MetaData key) const; - void setMetaData(QtMultimedia::MetaData key, const QVariant &value); - QList availableMetaData() const; + QVariant metaData(QtMediaservices::MetaData key) const; + void setMetaData(QtMediaservices::MetaData key, const QVariant &value); + QList availableMetaData() const; QVariant extendedMetaData(const QString &key) const ; void setExtendedMetaData(const QString &key, const QVariant &value); @@ -74,7 +74,7 @@ private slots: private: QT7PlayerSession *m_session; - QMap m_tags; + QMap m_tags; }; QT_END_NAMESPACE diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm index 59d01a2..e12daf5 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm @@ -72,18 +72,18 @@ bool QT7PlayerMetaDataControl::isWritable() const return false; } -QVariant QT7PlayerMetaDataControl::metaData(QtMultimedia::MetaData key) const +QVariant QT7PlayerMetaDataControl::metaData(QtMediaservices::MetaData key) const { return m_tags.value(key); } -void QT7PlayerMetaDataControl::setMetaData(QtMultimedia::MetaData key, QVariant const &value) +void QT7PlayerMetaDataControl::setMetaData(QtMediaservices::MetaData key, QVariant const &value) { Q_UNUSED(key); Q_UNUSED(value); } -QList QT7PlayerMetaDataControl::availableMetaData() const +QList QT7PlayerMetaDataControl::availableMetaData() const { return m_tags.keys(); } @@ -256,13 +256,13 @@ void QT7PlayerMetaDataControl::updateTags() metaMap.insert(QLatin1String("nam"), QString::fromUtf8([name UTF8String])); #endif // QUICKTIME_C_API_AVAILABLE - m_tags.insert(QtMultimedia::AlbumArtist, metaMap.value(QLatin1String("ART"))); - m_tags.insert(QtMultimedia::AlbumTitle, metaMap.value(QLatin1String("alb"))); - m_tags.insert(QtMultimedia::Title, metaMap.value(QLatin1String("nam"))); - m_tags.insert(QtMultimedia::Date, metaMap.value(QLatin1String("day"))); - m_tags.insert(QtMultimedia::Genre, metaMap.value(QLatin1String("gnre"))); - m_tags.insert(QtMultimedia::TrackNumber, metaMap.value(QLatin1String("trk"))); - m_tags.insert(QtMultimedia::Description, metaMap.value(QLatin1String("des"))); + m_tags.insert(QtMediaservices::AlbumArtist, metaMap.value(QLatin1String("ART"))); + m_tags.insert(QtMediaservices::AlbumTitle, metaMap.value(QLatin1String("alb"))); + m_tags.insert(QtMediaservices::Title, metaMap.value(QLatin1String("nam"))); + m_tags.insert(QtMediaservices::Date, metaMap.value(QLatin1String("day"))); + m_tags.insert(QtMediaservices::Genre, metaMap.value(QLatin1String("gnre"))); + m_tags.insert(QtMediaservices::TrackNumber, metaMap.value(QLatin1String("trk"))); + m_tags.insert(QtMediaservices::Description, metaMap.value(QLatin1String("des"))); } if (!wasEmpty || !m_tags.isEmpty()) diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.h index d4b30b8..3d3a3ff 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.h +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.h @@ -43,7 +43,7 @@ #define QT7PLAYERSERVICE_H #include -#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm index 205e862..0b3505e 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm @@ -54,8 +54,8 @@ #include "qt7movievideowidget.h" #include "qt7playermetadata.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h index 0ba3041..780776c 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm index 65c9f7d..863b3c8 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm @@ -49,7 +49,7 @@ #include "qt7videooutputcontrol.h" #include -#include +#include #include #include diff --git a/src/plugins/mediaservices/qt7/qt7.pro b/src/plugins/mediaservices/qt7/qt7.pro index 8791d73..baac224 100644 --- a/src/plugins/mediaservices/qt7/qt7.pro +++ b/src/plugins/mediaservices/qt7/qt7.pro @@ -1,7 +1,7 @@ -TARGET = qt7 +TARGET = qqt7 include(../../qpluginbase.pri) -QT += opengl multimedia +QT += opengl mediaservices LIBS += -framework AppKit -framework AudioUnit \ -framework AudioToolbox -framework CoreAudio \ diff --git a/src/plugins/mediaservices/qt7/qt7movieviewoutput.h b/src/plugins/mediaservices/qt7/qt7movieviewoutput.h index 0fee41c..ed3eebc 100644 --- a/src/plugins/mediaservices/qt7/qt7movieviewoutput.h +++ b/src/plugins/mediaservices/qt7/qt7movieviewoutput.h @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include #include #include "qt7videooutputcontrol.h" diff --git a/src/plugins/mediaservices/qt7/qt7movieviewrenderer.h b/src/plugins/mediaservices/qt7/qt7movieviewrenderer.h index 0b515ae..334ea6a 100644 --- a/src/plugins/mediaservices/qt7/qt7movieviewrenderer.h +++ b/src/plugins/mediaservices/qt7/qt7movieviewrenderer.h @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include #include #include "qt7videooutputcontrol.h" diff --git a/src/plugins/mediaservices/qt7/qt7serviceplugin.h b/src/plugins/mediaservices/qt7/qt7serviceplugin.h index c5afda1..7e8acf9 100644 --- a/src/plugins/mediaservices/qt7/qt7serviceplugin.h +++ b/src/plugins/mediaservices/qt7/qt7serviceplugin.h @@ -43,7 +43,7 @@ #ifndef QT7SERVICEPLUGIN_H #define QT7SERVICEPLUGIN_H -#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/qt7/qt7serviceplugin.mm b/src/plugins/mediaservices/qt7/qt7serviceplugin.mm index c59a453..fe4ca44 100644 --- a/src/plugins/mediaservices/qt7/qt7serviceplugin.mm +++ b/src/plugins/mediaservices/qt7/qt7serviceplugin.mm @@ -45,7 +45,7 @@ #include "qt7serviceplugin.h" #include "qt7playerservice.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/mediaservices/qt7/qt7videooutputcontrol.h b/src/plugins/mediaservices/qt7/qt7videooutputcontrol.h index 3c74cb8..39a13ee 100644 --- a/src/plugins/mediaservices/qt7/qt7videooutputcontrol.h +++ b/src/plugins/mediaservices/qt7/qt7videooutputcontrol.h @@ -45,11 +45,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/src/src.pro b/src/src.pro index c74b0ca..e8a3e98 100644 --- a/src/src.pro +++ b/src/src.pro @@ -17,6 +17,7 @@ contains(QT_CONFIG, openvg): SRC_SUBDIRS += src_openvg contains(QT_CONFIG, xmlpatterns): SRC_SUBDIRS += src_xmlpatterns contains(QT_CONFIG, phonon): SRC_SUBDIRS += src_phonon contains(QT_CONFIG, multimedia): SRC_SUBDIRS += src_multimedia +contains(QT_CONFIG, mediaservices): SRC_SUBDIRS += src_mediaservices contains(QT_CONFIG, svg): SRC_SUBDIRS += src_svg contains(QT_CONFIG, webkit) { exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro): SRC_SUBDIRS += src_javascriptcore @@ -66,8 +67,10 @@ src_qt3support.subdir = $$QT_SOURCE_TREE/src/qt3support src_qt3support.target = sub-qt3support src_phonon.subdir = $$QT_SOURCE_TREE/src/phonon src_phonon.target = sub-phonon -src_multimedia.subdir = $$QT_SOURCE_TREE/src/multimedia +src_multimedia.subdir = $$QT_SOURCE_TREE/src/multimedia/multimedia src_multimedia.target = sub-multimedia +src_mediaservices.subdir = $$QT_SOURCE_TREE/src/multimedia/mediaservices +src_mediaservices.target = sub-mediaservices src_activeqt.subdir = $$QT_SOURCE_TREE/src/activeqt src_activeqt.target = sub-activeqt src_plugins.subdir = $$QT_SOURCE_TREE/src/plugins @@ -105,6 +108,7 @@ src_declarative.target = sub-declarative src_phonon.depends = src_gui src_multimedia.depends = src_gui contains(QT_CONFIG, opengl):src_multimedia.depends += src_opengl + src_mediaservices.depends = src_multimedia src_tools_activeqt.depends = src_tools_idc src_gui src_declarative.depends = src_xml src_gui src_script src_network src_svg src_plugins.depends = src_gui src_sql src_svg src_multimedia @@ -112,7 +116,7 @@ src_declarative.target = sub-declarative src_imports.depends = src_gui src_declarative contains(QT_CONFIG, webkit) { src_webkit.depends = src_gui src_sql src_network src_xml - contains(QT_CONFIG, multimedia):src_webkit.depends += src_multimedia + contains(QT_CONFIG, mediaservices):src_webkit.depends += src_mediaservices contains(QT_CONFIG, xmlpatterns): src_webkit.depends += src_xmlpatterns contains(QT_CONFIG, declarative):src_declarative.depends += src_webkit src_imports.depends += src_webkit diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index c0004f7..12ebc75 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -16,6 +16,7 @@ unix:!embedded:contains(QT_CONFIG, dbus): SUBDIRS += dbus.pro contains(QT_CONFIG, script): SUBDIRS += script.pro contains(QT_CONFIG, webkit): SUBDIRS += webkit.pro contains(QT_CONFIG, multimedia): SUBDIRS += multimedia.pro +contains(QT_CONFIG, mediaservices): SUBDIRS += mediaservices.pro contains(QT_CONFIG, phonon): SUBDIRS += phonon.pro contains(QT_CONFIG, svg): SUBDIRS += svg.pro contains(QT_CONFIG, declarative): SUBDIRS += declarative.pro diff --git a/tests/auto/mediaservices.pro b/tests/auto/mediaservices.pro new file mode 100644 index 0000000..1b50cd7 --- /dev/null +++ b/tests/auto/mediaservices.pro @@ -0,0 +1,19 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qsoundeffect \ + qdeclarativeaudio \ + qdeclarativevideo \ + qgraphicsvideoitem \ + qmediacontent \ + qmediaobject \ + qmediaplayer \ + qmediaplaylist \ + qmediaplaylistnavigator \ + qmediapluginloader \ + qmediaresource \ + qmediaservice \ + qmediaserviceprovider \ + qmediatimerange \ + qvideowidget + + diff --git a/tests/auto/multimedia.pro b/tests/auto/multimedia.pro index f55d6e4..876b932 100644 --- a/tests/auto/multimedia.pro +++ b/tests/auto/multimedia.pro @@ -6,21 +6,7 @@ SUBDIRS=\ qaudioformat \ qaudioinput \ qaudiooutput \ - qsoundeffect \ - qdeclarativeaudio \ - qdeclarativevideo \ - qgraphicsvideoitem \ - qmediacontent \ - qmediaobject \ - qmediaplayer \ - qmediaplaylist \ - qmediaplaylistnavigator \ - qmediapluginloader \ - qmediaresource \ - qmediaservice \ - qmediaserviceprovider \ - qmediatimerange \ qvideoframe \ qvideosurfaceformat \ - qvideowidget \ + qvideowidget diff --git a/tests/auto/qdeclarativeaudio/qdeclarativeaudio.pro b/tests/auto/qdeclarativeaudio/qdeclarativeaudio.pro index 7779efc..ecfe299 100644 --- a/tests/auto/qdeclarativeaudio/qdeclarativeaudio.pro +++ b/tests/auto/qdeclarativeaudio/qdeclarativeaudio.pro @@ -11,4 +11,4 @@ SOURCES += \ $$PWD/../../../src/imports/multimedia/qdeclarativemediabase.cpp \ $$PWD/../../../src/imports/multimedia/qmetadatacontrolmetaobject.cpp -QT += multimedia declarative +QT += mediaservices declarative diff --git a/tests/auto/qdeclarativevideo/qdeclarativevideo.pro b/tests/auto/qdeclarativevideo/qdeclarativevideo.pro index 4cd4c71..c2bcdfe 100644 --- a/tests/auto/qdeclarativevideo/qdeclarativevideo.pro +++ b/tests/auto/qdeclarativevideo/qdeclarativevideo.pro @@ -11,4 +11,4 @@ SOURCES += \ $$PWD/../../../src/imports/multimedia/qdeclarativemediabase.cpp \ $$PWD/../../../src/imports/multimedia/qmetadatacontrolmetaobject.cpp -QT += multimedia declarative +QT += mediaservices declarative diff --git a/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro b/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro index da00baf..60e1933 100644 --- a/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro +++ b/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro @@ -1,5 +1,5 @@ load(qttest_p4) SOURCES += tst_qgraphicsvideoitem.cpp -QT += multimedia -requires(contains(QT_CONFIG, multimedia)) +QT += mediaservices +requires(contains(QT_CONFIG, mediaservices)) diff --git a/tests/auto/qmediacontent/qmediacontent.pro b/tests/auto/qmediacontent/qmediacontent.pro index 6c13c8b..e20b4db 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 network multimedia +QT = core network mediaservices diff --git a/tests/auto/qmediaobject/qmediaobject.pro b/tests/auto/qmediaobject/qmediaobject.pro index e59bfdc..d6a0f7b 100644 --- a/tests/auto/qmediaobject/qmediaobject.pro +++ b/tests/auto/qmediaobject/qmediaobject.pro @@ -1,4 +1,4 @@ load(qttest_p4) SOURCES += tst_qmediaobject.cpp -QT = core multimedia +QT = core mediaservices diff --git a/tests/auto/qmediaplayer/qmediaplayer.pro b/tests/auto/qmediaplayer/qmediaplayer.pro index 21008f9..f355078 100644 --- a/tests/auto/qmediaplayer/qmediaplayer.pro +++ b/tests/auto/qmediaplayer/qmediaplayer.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES += tst_qmediaplayer.cpp -QT = core multimedia +QT = core mediaservices diff --git a/tests/auto/qmediaplaylist/qmediaplaylist.pro b/tests/auto/qmediaplaylist/qmediaplaylist.pro index b114bda..809473b 100644 --- a/tests/auto/qmediaplaylist/qmediaplaylist.pro +++ b/tests/auto/qmediaplaylist/qmediaplaylist.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qmediaplaylist.cpp -QT = core multimedia +QT = core mediaservices diff --git a/tests/auto/qmediaplaylistnavigator/qmediaplaylistnavigator.pro b/tests/auto/qmediaplaylistnavigator/qmediaplaylistnavigator.pro index ea9bc0f..3265762 100644 --- a/tests/auto/qmediaplaylistnavigator/qmediaplaylistnavigator.pro +++ b/tests/auto/qmediaplaylistnavigator/qmediaplaylistnavigator.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qmediaplaylistnavigator.cpp -QT = core multimedia +QT = core mediaservices diff --git a/tests/auto/qmediapluginloader/qmediapluginloader.pro b/tests/auto/qmediapluginloader/qmediapluginloader.pro index 66950e9..a47cc57 100644 --- a/tests/auto/qmediapluginloader/qmediapluginloader.pro +++ b/tests/auto/qmediapluginloader/qmediapluginloader.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qmediapluginloader.cpp -QT = core multimedia +QT = core mediaservices diff --git a/tests/auto/qmediaresource/qmediaresource.pro b/tests/auto/qmediaresource/qmediaresource.pro index c8e3d9c..64669a2 100644 --- a/tests/auto/qmediaresource/qmediaresource.pro +++ b/tests/auto/qmediaresource/qmediaresource.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qmediaresource.cpp -QT = core multimedia network +QT = core mediaservices network diff --git a/tests/auto/qmediaservice/qmediaservice.pro b/tests/auto/qmediaservice/qmediaservice.pro index f877665..8acd03a 100644 --- a/tests/auto/qmediaservice/qmediaservice.pro +++ b/tests/auto/qmediaservice/qmediaservice.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qmediaservice.cpp -QT = core gui multimedia +QT = core gui mediaservices diff --git a/tests/auto/qmediaserviceprovider/qmediaserviceprovider.pro b/tests/auto/qmediaserviceprovider/qmediaserviceprovider.pro index 9aaa9e5..69b3864 100644 --- a/tests/auto/qmediaserviceprovider/qmediaserviceprovider.pro +++ b/tests/auto/qmediaserviceprovider/qmediaserviceprovider.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qmediaserviceprovider.cpp -QT = core gui multimedia +QT = core gui mediaservices diff --git a/tests/auto/qmediatimerange/qmediatimerange.pro b/tests/auto/qmediatimerange/qmediatimerange.pro index b1b436e..98c415b 100644 --- a/tests/auto/qmediatimerange/qmediatimerange.pro +++ b/tests/auto/qmediatimerange/qmediatimerange.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qmediatimerange.cpp -QT = core multimedia +QT = core media diff --git a/tests/auto/qsoundeffect/qsoundeffect.pro b/tests/auto/qsoundeffect/qsoundeffect.pro index eaa35b2..4ed7407 100644 --- a/tests/auto/qsoundeffect/qsoundeffect.pro +++ b/tests/auto/qsoundeffect/qsoundeffect.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qsoundeffect.cpp -QT = core multimedia +QT = core media wince* { deploy.sources += 4.wav diff --git a/tests/auto/qvideowidget/qvideowidget.pro b/tests/auto/qvideowidget/qvideowidget.pro index ca0fc24..fde9030 100644 --- a/tests/auto/qvideowidget/qvideowidget.pro +++ b/tests/auto/qvideowidget/qvideowidget.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qvideowidget.cpp -QT = core gui multimedia +QT = core gui media diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index dfd1196..2afc94b 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -247,8 +247,9 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "PHONON" ] = "auto"; dictionary[ "PHONON_BACKEND" ] = "yes"; dictionary[ "MULTIMEDIA" ] = "yes"; + dictionary[ "MEDIASERVICES" ] = "yes"; dictionary[ "AUDIO_BACKEND" ] = "auto"; - dictionary[ "MEDIASERVICE"] = "auto"; + dictionary[ "MEDIA_BACKEND"] = "auto"; dictionary[ "WMSDK" ] = "auto"; dictionary[ "DIRECTSHOW" ] = "no"; dictionary[ "WEBKIT" ] = "auto"; @@ -905,14 +906,18 @@ void Configure::parseCmdLine() dictionary[ "MULTIMEDIA" ] = "no"; } else if( configCmdLine.at(i) == "-multimedia" ) { dictionary[ "MULTIMEDIA" ] = "yes"; + } else if( configCmdLine.at(i) == "-no-mediaservices" ) { + dictionary[ "MEDIASERVICES" ] = "no"; + } else if( configCmdLine.at(i) == "-mediaservices" ) { + dictionary[ "MEDIASERVICES" ] = "yes"; } else if( configCmdLine.at(i) == "-audio-backend" ) { 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) == "-media-backend") { + dictionary[ "MEDIA_BACKEND" ] = "yes"; + } else if (configCmdLine.at(i) == "-no-media-backend") { + dictionary[ "MEDIA_BACKEND" ] = "no"; } else if( configCmdLine.at(i) == "-no-phonon" ) { dictionary[ "PHONON" ] = "no"; } else if( configCmdLine.at(i) == "-phonon" ) { @@ -1598,7 +1603,7 @@ bool Configure::displayHelp() "[-qtnamespace ] [-qtlibinfix ] [-no-phonon]\n" "[-phonon] [-no-phonon-backend] [-phonon-backend]\n" "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n" - "[-no-mediaservice] [-mediaservice]\n" + "[-no-mediaservices] [-mediaservices] [-no-media-backend] [-media-backend]\n" "[-no-script] [-script] [-no-scripttools] [-scripttools]\n" "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7); @@ -1783,8 +1788,10 @@ 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("MEDIASERVICES", "no", "-no-mediaservices","Do not compile the QtMediaservices module"); + desc("MEDIASERVICES", "yes","-mediaservices", "Compile in QtMediaservices module"); + desc("MEDIA_BACKEND", "no","-no-media-backend", "Do not compile in the platform-specific QtMediaservices media service."); + desc("MEDIA_BACKEND", "yes","-media-backend", "Compile in the platform-specific QtMediaservices 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."); @@ -2066,7 +2073,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" || part == "MEDIASERVICE") { + } else if (part == "PHONON" || part == "MEDIA_BACKEND") { 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")) @@ -2226,8 +2233,8 @@ void Configure::autoDetection() dictionary["DECLARATIVE"] = dictionary["SCRIPT"] == "yes" ? "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"; + if (dictionary["MEDIA_BACKEND"] == "auto") + dictionary["MEDIA_BACKEND"] = checkAvailability("MEDIA_BACKEND") ? "yes" : "no"; if (dictionary["WMSDK"] == "auto") dictionary["WMSDK"] = checkAvailability("WMSDK") ? "yes" : "no"; @@ -2628,10 +2635,13 @@ void Configure::generateOutputVars() qtConfig += "multimedia"; if (dictionary["AUDIO_BACKEND"] == "yes") qtConfig += "audio-backend"; - if (dictionary["MEDIASERVICE"] == "yes") { - qtConfig += "mediaservice"; - if (dictionary["WMSDK"] == "yes") - qtConfig += "wmsdk"; + if (dictionary["MEDIASERVICES"] == "yes") { + qtConfig += "mediaservices"; + if (dictionary["MEDIA_BACKEND"] == "yes") { + qtConfig += "media-backend"; + if (dictionary["WMSDK"] == "yes") + qtConfig += "wmsdk"; + } } } @@ -3034,6 +3044,7 @@ void Configure::generateConfigfiles() if(dictionary["DECLARATIVE"] == "no") qconfigList += "QT_NO_DECLARATIVE"; if(dictionary["PHONON"] == "no") qconfigList += "QT_NO_PHONON"; if(dictionary["MULTIMEDIA"] == "no") qconfigList += "QT_NO_MULTIMEDIA"; + if(dictionary["MEDIASERVICES"] == "no") qconfigList += "QT_NO_MEDIASERVICES"; if(dictionary["XMLPATTERNS"] == "no") qconfigList += "QT_NO_XMLPATTERNS"; if(dictionary["SCRIPT"] == "no") qconfigList += "QT_NO_SCRIPT"; if(dictionary["SCRIPTTOOLS"] == "no") qconfigList += "QT_NO_SCRIPTTOOLS"; @@ -3336,6 +3347,7 @@ void Configure::displayConfig() cout << "QtXmlPatterns support......." << dictionary[ "XMLPATTERNS" ] << endl; cout << "Phonon support.............." << dictionary[ "PHONON" ] << endl; cout << "QtMultimedia support........" << dictionary[ "MULTIMEDIA" ] << endl; + cout << "QtMediaservices support....." << dictionary[ "MEDIASERVICES" ] << endl; cout << "WebKit support.............." << dictionary[ "WEBKIT" ] << endl; cout << "Declarative support........." << dictionary[ "DECLARATIVE" ] << endl; cout << "QtScript support............" << dictionary[ "SCRIPT" ] << endl; -- cgit v0.12 From ba0d2829f3e173d4c95c49f3bbbe0cd030ff3f5f Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Fri, 16 Apr 2010 09:41:10 +1000 Subject: Fixed compile errors with gstreamer plugin Reviewed-by:Justin McPherson --- .../mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp | 2 +- .../mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h | 2 +- .../mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp index 05b924a..51d68f9 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp @@ -172,7 +172,7 @@ QList QGstreamerMetaDataProvider::availableMetaData() QList res; foreach (const QByteArray &key, m_session->tags().keys()) { - QtMediaservices::MetaData tag = keysMap.value(key, QtMultimedia::MetaData(-1)); + QtMediaservices::MetaData tag = keysMap.value(key, QtMediaservices::MetaData(-1)); if (tag != -1) res.append(tag); } diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h index bb77eff..5239464 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h @@ -44,7 +44,7 @@ #include -#include +#include #include #include diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.h index f60c72e..fe4a8a9 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.h @@ -45,7 +45,7 @@ #include #include -#include +#include #include "qgstreamervideooutputcontrol.h" -- cgit v0.12 From 506a39d19961aadf02946db1b4496bf98d494d8d Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Fri, 16 Apr 2010 10:08:15 +1000 Subject: Rebuild configure.exe following e85223d233c0e1d6beca748332b8fbaba3ebbf2d --- configure.exe | Bin 1225728 -> 1318400 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index bc1ee20..ab97e1e 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From 16c6227415a05b8bc50162eb2a4941cb993c3377 Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Fri, 16 Apr 2010 10:18:00 +1000 Subject: Fixed compile errors in pulseaudio backend for soundeffect Reviewed-by:Dmytro Poplavskiy --- src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp index e834280..3e3dd91 100644 --- a/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp @@ -51,7 +51,7 @@ // #include -#include +#include #include #include -- cgit v0.12 From 30cd548679d5e2ae026eb5e435e9bdceac6e4987 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Fri, 16 Apr 2010 10:44:47 +1000 Subject: configure; Fixes for changes to use mediaservices. Reviewed-by: Dmytro Poplavskiy --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 12a7710..9cbb0f7 100755 --- a/configure +++ b/configure @@ -5196,7 +5196,7 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then fi # Auto-detect GStreamer support (needed for both Phonon & QtMultimedia) - if [ "$CFG_PHONON" = "yes" -o "$CFG_MULTIMEDIA" = "yes" ]; then + if [ "$CFG_PHONON" = "yes" -o "$CFG_MEDIASERVICES" = "yes" ]; then if [ "$CFG_GLIB" = "yes" -a "$CFG_GSTREAMER" != "no" ]; then if [ -n "$PKG_CONFIG" ]; then QT_CFLAGS_GSTREAMER=`$PKG_CONFIG --cflags gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null` @@ -6872,7 +6872,7 @@ if [ "$CFG_MEDIASERVICES" = "no" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MEDIASERVICES" else QT_CONFIG="$QT_CONFIG mediaservices" - if [ "$CFG_MEDIA_BACKEND" = "yes" ]; then + if [ "$CFG_MEDIA_BACKEND" != "no" ]; then QT_CONFIG="$QT_CONFIG media-backend" fi fi -- cgit v0.12 From 9ec14dcfa1d53b209e7a34b6163aac876771751e Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 16 Apr 2010 11:40:20 +1000 Subject: Class documentation fixes for declarative. --- .../qdeclarativenetworkaccessmanagerfactory.cpp | 5 ++++ src/declarative/qml/qdeclarativeparserstatus.cpp | 32 +++++++++++++++++++-- src/declarative/qml/qdeclarativescriptstring.cpp | 33 ++++++++++++++-------- src/declarative/util/qdeclarativepropertymap.cpp | 4 +-- src/declarative/util/qdeclarativeview.cpp | 6 ++-- 5 files changed, 62 insertions(+), 18 deletions(-) diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp index 9dd7d39..f5f1a1f 100644 --- a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp +++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp @@ -56,12 +56,17 @@ QT_BEGIN_NAMESPACE To implement a factory, subclass QDeclarativeNetworkAccessManagerFactory and implement the create() method. + To use a factory, assign it to the relevant QDeclarativeEngine using + QDeclarativeEngine::setNetworkAccessManagerFactory(). + If the created QNetworkAccessManager becomes invalid, due to a change in proxy settings, for example, call the invalidate() method. This will cause all QNetworkAccessManagers to be recreated. Note: the create() method may be called by multiple threads, so ensure the implementation of this method is reentrant. + + \sa QDeclarativeEngine::setNetworkAccessManagerFactory() */ /*! diff --git a/src/declarative/qml/qdeclarativeparserstatus.cpp b/src/declarative/qml/qdeclarativeparserstatus.cpp index ec6260e..978bfb4 100644 --- a/src/declarative/qml/qdeclarativeparserstatus.cpp +++ b/src/declarative/qml/qdeclarativeparserstatus.cpp @@ -45,8 +45,36 @@ QT_BEGIN_NAMESPACE /*! \class QDeclarativeParserStatus - \since 4.7 - \brief The QDeclarativeParserStatus class provides updates on the parser state. + \since 4.7 + \brief The QDeclarativeParserStatus class provides updates on the QML parser state. + + QDeclarativeParserStatus provides a mechanism for classes instantiated by + a QDeclarativeEngine to receive notification at key points in their creation. + + This class is often used for optimization purposes, as it allows you to defer an + expensive operation until after all the properties have been set on an + object. For example, QML's \l {Text} element uses the parser status + to defer text layout until all of its properties have been set (we + don't want to layout when the \c text is assigned, and then relayout + when the \c font is assigned, and relayout again when the \c width is assigned, + and so on). + + To use QDeclarativeParserStatus, you must inherit both a QObject-derived class + and QDeclarativeParserStatus, and use the Q_INTERFACES() macro. + + \code + class MyObject : public QObject, public QDeclarativeParserStatus + { + Q_OBJECT + Q_INTERFACES(QDeclarativeParserStatus) + + public: + MyObject(QObject *parent = 0); + ... + void classBegin(); + void componentComplete(); + } + \endcode */ /*! \internal */ diff --git a/src/declarative/qml/qdeclarativescriptstring.cpp b/src/declarative/qml/qdeclarativescriptstring.cpp index 5b9afe9..8f717d1 100644 --- a/src/declarative/qml/qdeclarativescriptstring.cpp +++ b/src/declarative/qml/qdeclarativescriptstring.cpp @@ -55,24 +55,35 @@ public: /*! \class QDeclarativeScriptString - \since 4.7 +\since 4.7 \brief The QDeclarativeScriptString class encapsulates a script and its context. -The QDeclarativeScriptString is used by properties that want to accept a script "assignment" from QML. +QDeclarativeScriptString is used to create QObject properties that accept a script "assignment" from QML. -Normally, the following code would result in a binding being established for the \c script -property. If the property had a type of QDeclarativeScriptString, the script - \e {console.log(1921)} - itself -would be passed to the property and it could choose how to handle it. +Normally, the following QML would result in a binding being established for the \c script +property; i.e. \c script would be assigned the value obtained from running \c {myObj.value = Math.max(myValue, 100)} -\code +\qml MyType { - script: console.log(1921) + script: myObj.value = Math.max(myValue, 100) } +\endqml + +If instead the property had a type of QDeclarativeScriptString, +the script itself -- \e {myObj.value = Math.max(myValue, 100)} -- would be passed to the \c script property +and the class could choose how to handle it. Typically, the class will evaluate +the script at some later time using a QDeclarativeExpression. + +\code +QDeclarativeExpression expr(scriptString.context(), scriptString.script(), scriptStr.scopeObject()); +expr.value(); \endcode + +\sa QDeclarativeExpression */ /*! -Construct an empty instance. +Constructs an empty instance. */ QDeclarativeScriptString::QDeclarativeScriptString() : d(new QDeclarativeScriptStringPrivate) @@ -80,7 +91,7 @@ QDeclarativeScriptString::QDeclarativeScriptString() } /*! -Copy \a other. +Copies \a other. */ QDeclarativeScriptString::QDeclarativeScriptString(const QDeclarativeScriptString &other) : d(other.d) @@ -95,7 +106,7 @@ QDeclarativeScriptString::~QDeclarativeScriptString() } /*! -Assign \a other to this. +Assigns \a other to this. */ QDeclarativeScriptString &QDeclarativeScriptString::operator=(const QDeclarativeScriptString &other) { @@ -104,7 +115,7 @@ QDeclarativeScriptString &QDeclarativeScriptString::operator=(const QDeclarative } /*! -Return the context for the script. +Returns the context for the script. */ QDeclarativeContext *QDeclarativeScriptString::context() const { diff --git a/src/declarative/util/qdeclarativepropertymap.cpp b/src/declarative/util/qdeclarativepropertymap.cpp index 0e477b1..c8161a7 100644 --- a/src/declarative/util/qdeclarativepropertymap.cpp +++ b/src/declarative/util/qdeclarativepropertymap.cpp @@ -98,7 +98,7 @@ void QDeclarativePropertyMapMetaObject::propertyCreated(int, QMetaPropertyBuilde /*! \class QDeclarativePropertyMap \since 4.7 - \brief The QDeclarativePropertyMap class allows you to set key-value pairs that can be used in bindings. + \brief The QDeclarativePropertyMap class allows you to set key-value pairs that can be used in QML bindings. QDeclarativePropertyMap provides a convenient way to expose domain data to the UI layer. The following example shows how you might declare data in C++ and then @@ -112,7 +112,7 @@ void QDeclarativePropertyMapMetaObject::propertyCreated(int, QMetaPropertyBuilde ownerData.insert("phone", QVariant(QString("555-5555"))); //expose it to the UI layer - QDeclarativeContext *ctxt = view->bindContext(); + QDeclarativeContext *ctxt = view->rootContext(); ctxt->setProperty("owner", &data); \endcode diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index c0425ef..f786898 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -338,15 +338,15 @@ QDeclarativeContext* QDeclarativeView::rootContext() \value Null This QDeclarativeView has no source set. \value Ready This QDeclarativeView has loaded and created the QML component. \value Loading This QDeclarativeView is loading network data. - \value Error An error has occured. Calling errorDescription() to retrieve a description. + \value Error An error has occured. Call errorDescription() to retrieve a description. */ /*! \enum QDeclarativeView::ResizeMode This enum specifies how to resize the view. - \value SizeViewToRootObject - \value SizeRootObjectToView + \value SizeViewToRootObject The view resizes with the root item in the QML. + \value SizeRootObjectToView The view will automatically resize the root item to the size of the view. */ /*! -- cgit v0.12 From 24d5c396903c1ce12578a32c2cc10e0ae391e6d5 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Fri, 16 Apr 2010 11:25:04 +1000 Subject: QtMediaservices -> QtMediaServices. Reviewed-by: Dmytro Poplavskiy --- bin/syncqt | 2 +- configure | 4 +- demos/multimedia/player/player.cpp | 12 +- demos/multimedia/player/playercontrols.h | 2 +- demos/multimedia/player/videowidget.h | 2 +- mkspecs/features/qt.prf | 2 +- src/imports/multimedia/multimedia.cpp | 2 +- src/imports/multimedia/qdeclarativeaudio.cpp | 2 +- src/imports/multimedia/qdeclarativemediabase.cpp | 8 +- src/imports/multimedia/qdeclarativemediabase_p.h | 2 +- src/imports/multimedia/qdeclarativevideo.cpp | 152 ++++++++++----------- src/imports/multimedia/qdeclarativevideo_p.h | 2 +- .../multimedia/qmetadatacontrolmetaobject.cpp | 152 ++++++++++----------- .../multimedia/qmetadatacontrolmetaobject_p.h | 2 +- .../mediaservices/base/qgraphicsvideoitem.cpp | 12 +- .../mediaservices/base/qgraphicsvideoitem.h | 4 +- .../base/qlocalmediaplaylistprovider.cpp | 6 +- .../base/qlocalmediaplaylistprovider.h | 4 +- .../mediaservices/base/qmediacontent.cpp | 4 +- src/multimedia/mediaservices/base/qmediacontent.h | 4 +- .../mediaservices/base/qmediacontrol.cpp | 6 +- src/multimedia/mediaservices/base/qmediacontrol.h | 2 +- .../mediaservices/base/qmediacontrol_p.h | 2 +- src/multimedia/mediaservices/base/qmediaobject.cpp | 16 +-- src/multimedia/mediaservices/base/qmediaobject.h | 12 +- src/multimedia/mediaservices/base/qmediaobject_p.h | 4 +- .../mediaservices/base/qmediaplaylist.cpp | 16 +-- src/multimedia/mediaservices/base/qmediaplaylist.h | 6 +- .../mediaservices/base/qmediaplaylist_p.h | 12 +- .../mediaservices/base/qmediaplaylistcontrol.cpp | 4 +- .../mediaservices/base/qmediaplaylistcontrol.h | 6 +- .../mediaservices/base/qmediaplaylistioplugin.cpp | 4 +- .../mediaservices/base/qmediaplaylistioplugin.h | 4 +- .../mediaservices/base/qmediaplaylistnavigator.cpp | 8 +- .../mediaservices/base/qmediaplaylistnavigator.h | 6 +- .../mediaservices/base/qmediaplaylistprovider.cpp | 4 +- .../mediaservices/base/qmediaplaylistprovider.h | 6 +- .../mediaservices/base/qmediaplaylistprovider_p.h | 4 +- .../mediaservices/base/qmediapluginloader.cpp | 4 +- .../mediaservices/base/qmediapluginloader_p.h | 2 +- .../mediaservices/base/qmediaresource.cpp | 4 +- src/multimedia/mediaservices/base/qmediaresource.h | 2 +- .../mediaservices/base/qmediaservice.cpp | 4 +- src/multimedia/mediaservices/base/qmediaservice.h | 4 +- .../mediaservices/base/qmediaservice_p.h | 2 +- .../mediaservices/base/qmediaserviceprovider.cpp | 32 ++--- .../mediaservices/base/qmediaserviceprovider.h | 6 +- .../base/qmediaserviceproviderplugin.h | 6 +- .../mediaservices/base/qmediatimerange.cpp | 4 +- .../mediaservices/base/qmediatimerange.h | 4 +- .../mediaservices/base/qmetadatacontrol.cpp | 10 +- .../mediaservices/base/qmetadatacontrol.h | 14 +- .../mediaservices/base/qpaintervideosurface.cpp | 2 +- .../base/qpaintervideosurface_mac_p.h | 2 +- .../mediaservices/base/qpaintervideosurface_p.h | 2 +- .../mediaservices/base/qtmedianamespace.h | 4 +- .../mediaservices/base/qvideodevicecontrol.cpp | 4 +- .../mediaservices/base/qvideodevicecontrol.h | 4 +- .../mediaservices/base/qvideooutputcontrol.cpp | 4 +- .../mediaservices/base/qvideooutputcontrol.h | 4 +- .../mediaservices/base/qvideorenderercontrol.cpp | 4 +- .../mediaservices/base/qvideorenderercontrol.h | 4 +- src/multimedia/mediaservices/base/qvideowidget.cpp | 14 +- src/multimedia/mediaservices/base/qvideowidget.h | 2 +- src/multimedia/mediaservices/base/qvideowidget_p.h | 4 +- .../mediaservices/base/qvideowidgetcontrol.cpp | 4 +- .../mediaservices/base/qvideowidgetcontrol.h | 6 +- .../mediaservices/base/qvideowindowcontrol.cpp | 4 +- .../mediaservices/base/qvideowindowcontrol.h | 6 +- .../mediaservices/effects/qsoundeffect_p.h | 2 +- .../mediaservices/effects/qsoundeffect_pulse_p.cpp | 2 +- .../mediaservices/effects/qsoundeffect_pulse_p.h | 4 +- .../effects/qsoundeffect_qmedia_p.cpp | 6 +- .../mediaservices/effects/qsoundeffect_qmedia_p.h | 4 +- .../effects/qsoundeffect_qsound_p.cpp | 2 +- .../mediaservices/effects/qsoundeffect_qsound_p.h | 2 +- .../mediaservices/effects/wavedecoder_p.cpp | 2 +- .../mediaservices/effects/wavedecoder_p.h | 2 +- src/multimedia/mediaservices/mediaservices.pro | 2 +- .../mediaservices/playback/qmediaplayer.cpp | 22 +-- .../mediaservices/playback/qmediaplayer.h | 10 +- .../mediaservices/playback/qmediaplayercontrol.cpp | 8 +- .../mediaservices/playback/qmediaplayercontrol.h | 8 +- .../mediaplayer/directshowaudioendpointcontrol.h | 2 +- .../mediaplayer/directshowmetadatacontrol.cpp | 116 ++++++++-------- .../mediaplayer/directshowmetadatacontrol.h | 8 +- .../directshow/mediaplayer/directshowpinenum.cpp | 2 +- .../mediaplayer/directshowplayercontrol.h | 4 +- .../mediaplayer/directshowplayerservice.cpp | 2 +- .../mediaplayer/directshowplayerservice.h | 8 +- .../mediaplayer/directshowvideooutputcontrol.h | 2 +- .../mediaplayer/directshowvideorenderercontrol.h | 2 +- .../mediaplayer/mediasamplevideobuffer.h | 2 +- .../mediaplayer/vmr9videowindowcontrol.h | 2 +- .../mediaplayer/qgstreamermetadataprovider.cpp | 108 +++++++-------- .../mediaplayer/qgstreamermetadataprovider.h | 8 +- .../mediaplayer/qgstreamerplayercontrol.h | 4 +- .../mediaplayer/qgstreamerplayerservice.h | 2 +- .../mediaplayer/qgstreamerplayersession.cpp | 8 +- .../mediaplayer/qgstreamerplayersession.h | 6 +- .../gstreamer/qgstreamerserviceplugin.cpp | 2 +- .../gstreamer/qgstreamerserviceplugin.h | 2 +- .../gstreamer/qgstreamervideoinputdevicecontrol.h | 2 +- .../gstreamer/qgstreamervideooutputcontrol.h | 2 +- .../gstreamer/qgstreamervideooverlay.h | 2 +- .../gstreamer/qgstreamervideorenderer.h | 2 +- .../gstreamer/qgstreamervideowidget.h | 2 +- .../qt7/mediaplayer/qt7playercontrol.h | 4 +- .../qt7/mediaplayer/qt7playercontrol.mm | 2 +- .../qt7/mediaplayer/qt7playermetadata.h | 10 +- .../qt7/mediaplayer/qt7playermetadata.mm | 20 +-- .../qt7/mediaplayer/qt7playerservice.h | 2 +- .../qt7/mediaplayer/qt7playerservice.mm | 4 +- .../qt7/mediaplayer/qt7playersession.h | 4 +- .../qt7/mediaplayer/qt7playersession.mm | 2 +- src/plugins/mediaservices/qt7/qt7movieviewoutput.h | 4 +- .../mediaservices/qt7/qt7movieviewrenderer.h | 4 +- src/plugins/mediaservices/qt7/qt7serviceplugin.h | 2 +- src/plugins/mediaservices/qt7/qt7serviceplugin.mm | 2 +- .../mediaservices/qt7/qt7videooutputcontrol.h | 10 +- tools/configure/configureapp.cpp | 10 +- 121 files changed, 565 insertions(+), 565 deletions(-) diff --git a/bin/syncqt b/bin/syncqt index 9fe0009..e36eeb6 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -51,7 +51,7 @@ my %modules = ( # path to module name map "QtWebKit" => "$basedir/src/3rdparty/webkit/WebCore", "phonon" => "$basedir/src/phonon", "QtMultimedia" => "$basedir/src/multimedia/multimedia", - "QtMediaservices" => "$basedir/src/multimedia/mediaservices", + "QtMediaServices" => "$basedir/src/multimedia/mediaservices", ); my %moduleheaders = ( # restrict the module headers to those found in relative path "QtWebKit" => "../WebKit/qt/Api", diff --git a/configure b/configure index 9cbb0f7..fc26a7a 100755 --- a/configure +++ b/configure @@ -3555,8 +3555,8 @@ fi -no-audio-backend .. Do not build the platform audio backend into QtMultimedia. + -audio-backend ..... Build the platform audio backend into QtMultimedia if available. - -no-mediaservices... Do not build the QtMediaservices module. - + -mediaservices...... Build the QtMediaservices module. + -no-mediaservices... Do not build the QtMediaServices module. + + -mediaservices...... Build the QtMediaServices module. -no-media-backend... Do not build platform mediaservices plugin. + -media-backend..... Build the platform mediaservices plugin. diff --git a/demos/multimedia/player/player.cpp b/demos/multimedia/player/player.cpp index 20341bc..6ba19fd 100644 --- a/demos/multimedia/player/player.cpp +++ b/demos/multimedia/player/player.cpp @@ -45,8 +45,8 @@ #include "playlistmodel.h" #include "videowidget.h" -#include -#include +#include +#include #include @@ -204,14 +204,14 @@ void Player::positionChanged(qint64 progress) void Player::metaDataChanged() { - //qDebug() << "update metadata" << player->metaData(QtMediaservices::Title).toString(); + //qDebug() << "update metadata" << player->metaData(QtMediaServices::Title).toString(); if (player->isMetaDataAvailable()) { setTrackInfo(QString("%1 - %2") - .arg(player->metaData(QtMediaservices::AlbumArtist).toString()) - .arg(player->metaData(QtMediaservices::Title).toString())); + .arg(player->metaData(QtMediaServices::AlbumArtist).toString()) + .arg(player->metaData(QtMediaServices::Title).toString())); if (coverLabel) { - QUrl url = player->metaData(QtMediaservices::CoverArtUrlLarge).value(); + QUrl url = player->metaData(QtMediaServices::CoverArtUrlLarge).value(); coverLabel->setPixmap(!url.isEmpty() ? QPixmap(url.toString()) diff --git a/demos/multimedia/player/playercontrols.h b/demos/multimedia/player/playercontrols.h index 0b0b0e6..d2229bd 100644 --- a/demos/multimedia/player/playercontrols.h +++ b/demos/multimedia/player/playercontrols.h @@ -42,7 +42,7 @@ #ifndef PLAYERCONTROLS_H #define PLAYERCONTROLS_H -#include +#include #include diff --git a/demos/multimedia/player/videowidget.h b/demos/multimedia/player/videowidget.h index 0251bfe..b5bf581 100644 --- a/demos/multimedia/player/videowidget.h +++ b/demos/multimedia/player/videowidget.h @@ -41,7 +41,7 @@ #ifndef VIDEOWIDGET_H #define VIDEOWIDGET_H -#include +#include QT_BEGIN_HEADER diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index ff4e986..7b0b4af 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -175,7 +175,7 @@ for(QTLIB, $$list($$lower($$unique(QT)))) { } } else:isEqual(QTLIB, declarative):qlib = QtDeclarative else:isEqual(QTLIB, multimedia):qlib = QtMultimedia - else:isEqual(QTLIB, mediaservices):qlib = QtMediaservices + else:isEqual(QTLIB, mediaservices):qlib = QtMediaServices else:message("Unknown QT: $$QTLIB"):qlib = !isEmpty(qlib) { target_qt:isEqual(TARGET, qlib) { diff --git a/src/imports/multimedia/multimedia.cpp b/src/imports/multimedia/multimedia.cpp index 46ceb34..e2a2821 100644 --- a/src/imports/multimedia/multimedia.cpp +++ b/src/imports/multimedia/multimedia.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include #include "qdeclarativevideo_p.h" #include "qdeclarativeaudio_p.h" diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp index 3367e08..49eabc2 100644 --- a/src/imports/multimedia/qdeclarativeaudio.cpp +++ b/src/imports/multimedia/qdeclarativeaudio.cpp @@ -41,7 +41,7 @@ #include "qdeclarativeaudio_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/imports/multimedia/qdeclarativemediabase.cpp b/src/imports/multimedia/qdeclarativemediabase.cpp index 5ed602a..ee0737b 100644 --- a/src/imports/multimedia/qdeclarativemediabase.cpp +++ b/src/imports/multimedia/qdeclarativemediabase.cpp @@ -44,10 +44,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "qmetadatacontrolmetaobject_p.h" diff --git a/src/imports/multimedia/qdeclarativemediabase_p.h b/src/imports/multimedia/qdeclarativemediabase_p.h index e5115de..34875f9 100644 --- a/src/imports/multimedia/qdeclarativemediabase_p.h +++ b/src/imports/multimedia/qdeclarativemediabase_p.h @@ -54,7 +54,7 @@ // #include -#include +#include QT_BEGIN_HEADER diff --git a/src/imports/multimedia/qdeclarativevideo.cpp b/src/imports/multimedia/qdeclarativevideo.cpp index 6a91656..774c9a4 100644 --- a/src/imports/multimedia/qdeclarativevideo.cpp +++ b/src/imports/multimedia/qdeclarativevideo.cpp @@ -41,11 +41,11 @@ #include "qdeclarativevideo_p.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE @@ -435,7 +435,7 @@ QT_END_NAMESPACE This property holds the tile of the media. - \sa {QtMediaservices::Title} + \sa {QtMediaServices::Title} */ /*! @@ -443,7 +443,7 @@ QT_END_NAMESPACE This property holds the sub-title of the media. - \sa {QtMediaservices::SubTitle} + \sa {QtMediaServices::SubTitle} */ /*! @@ -451,7 +451,7 @@ QT_END_NAMESPACE This property holds the author of the media. - \sa {QtMediaservices::Author} + \sa {QtMediaServices::Author} */ /*! @@ -459,7 +459,7 @@ QT_END_NAMESPACE This property holds a user comment about the media. - \sa {QtMediaservices::Comment} + \sa {QtMediaServices::Comment} */ /*! @@ -467,7 +467,7 @@ QT_END_NAMESPACE This property holds a description of the media. - \sa {QtMediaservices::Description} + \sa {QtMediaServices::Description} */ /*! @@ -475,7 +475,7 @@ QT_END_NAMESPACE This property holds the category of the media - \sa {QtMediaservices::Category} + \sa {QtMediaServices::Category} */ /*! @@ -483,7 +483,7 @@ QT_END_NAMESPACE This property holds the genre of the media. - \sa {QtMediaservices::Genre} + \sa {QtMediaServices::Genre} */ /*! @@ -491,7 +491,7 @@ QT_END_NAMESPACE This property holds the year of release of the media. - \sa {QtMediaservices::Year} + \sa {QtMediaServices::Year} */ /*! @@ -499,7 +499,7 @@ QT_END_NAMESPACE This property holds the date of the media. - \sa {QtMediaservices::Date} + \sa {QtMediaServices::Date} */ /*! @@ -507,7 +507,7 @@ QT_END_NAMESPACE This property holds a user rating of the media in the range of 0 to 100. - \sa {QtMediaservices::UserRating} + \sa {QtMediaServices::UserRating} */ /*! @@ -515,7 +515,7 @@ QT_END_NAMESPACE This property holds a list of keywords describing the media. - \sa {QtMediaservices::Keywords} + \sa {QtMediaServices::Keywords} */ /*! @@ -523,7 +523,7 @@ QT_END_NAMESPACE This property holds the language of the media, as an ISO 639-2 code. - \sa {QtMediaservices::Language} + \sa {QtMediaServices::Language} */ /*! @@ -531,7 +531,7 @@ QT_END_NAMESPACE This property holds the publisher of the media. - \sa {QtMediaservices::Publisher} + \sa {QtMediaServices::Publisher} */ /*! @@ -539,7 +539,7 @@ QT_END_NAMESPACE This property holds the media's copyright notice. - \sa {QtMediaservices::Copyright} + \sa {QtMediaServices::Copyright} */ /*! @@ -547,7 +547,7 @@ QT_END_NAMESPACE This property holds the parental rating of the media. - \sa {QtMediaservices::ParentalRating} + \sa {QtMediaServices::ParentalRating} */ /*! @@ -556,7 +556,7 @@ QT_END_NAMESPACE This property holds the name of the rating organisation responsible for the parental rating of the media. - \sa {QtMediaservices::RatingOrganisation} + \sa {QtMediaServices::RatingOrganisation} */ /*! @@ -564,7 +564,7 @@ QT_END_NAMESPACE This property property holds the size of the media in bytes. - \sa {QtMediaservices::Size} + \sa {QtMediaServices::Size} */ /*! @@ -572,7 +572,7 @@ QT_END_NAMESPACE This property holds the type of the media. - \sa {QtMediaservices::MediaType} + \sa {QtMediaServices::MediaType} */ /*! @@ -581,7 +581,7 @@ QT_END_NAMESPACE This property holds the bit rate of the media's audio stream ni bits per second. - \sa {QtMediaservices::AudioBitRate} + \sa {QtMediaServices::AudioBitRate} */ /*! @@ -589,7 +589,7 @@ QT_END_NAMESPACE This property holds the encoding of the media audio stream. - \sa {QtMediaservices::AudioCodec} + \sa {QtMediaServices::AudioCodec} */ /*! @@ -597,7 +597,7 @@ QT_END_NAMESPACE This property holds the average volume level of the media. - \sa {QtMediaservices::AverageLevel} + \sa {QtMediaServices::AverageLevel} */ /*! @@ -605,7 +605,7 @@ QT_END_NAMESPACE This property holds the number of channels in the media's audio stream. - \sa {QtMediaservices::ChannelCount} + \sa {QtMediaServices::ChannelCount} */ /*! @@ -613,7 +613,7 @@ QT_END_NAMESPACE This property holds the peak volume of media's audio stream. - \sa {QtMediaservices::PeakValue} + \sa {QtMediaServices::PeakValue} */ /*! @@ -621,7 +621,7 @@ QT_END_NAMESPACE This property holds the sample rate of the media's audio stream in hertz. - \sa {QtMediaservices::SampleRate} + \sa {QtMediaServices::SampleRate} */ /*! @@ -629,7 +629,7 @@ QT_END_NAMESPACE This property holds the title of the album the media belongs to. - \sa {QtMediaservices::AlbumTitle} + \sa {QtMediaServices::AlbumTitle} */ /*! @@ -638,7 +638,7 @@ QT_END_NAMESPACE This property holds the name of the principal artist of the album the media belongs to. - \sa {QtMediaservices::AlbumArtist} + \sa {QtMediaServices::AlbumArtist} */ /*! @@ -646,7 +646,7 @@ QT_END_NAMESPACE This property holds the names of artists contributing to the media. - \sa {QtMediaservices::ContributingArtist} + \sa {QtMediaServices::ContributingArtist} */ /*! @@ -654,7 +654,7 @@ QT_END_NAMESPACE This property holds the composer of the media. - \sa {QtMediaservices::Composer} + \sa {QtMediaServices::Composer} */ /*! @@ -662,7 +662,7 @@ QT_END_NAMESPACE This property holds the conductor of the media. - \sa {QtMediaservices::Conductor} + \sa {QtMediaServices::Conductor} */ /*! @@ -670,7 +670,7 @@ QT_END_NAMESPACE This property holds the lyrics to the media. - \sa {QtMediaservices::Lyrics} + \sa {QtMediaServices::Lyrics} */ /*! @@ -678,7 +678,7 @@ QT_END_NAMESPACE This property holds the mood of the media. - \sa {QtMediaservices::Mood} + \sa {QtMediaServices::Mood} */ /*! @@ -686,7 +686,7 @@ QT_END_NAMESPACE This property holds the track number of the media. - \sa {QtMediaservices::TrackNumber} + \sa {QtMediaServices::TrackNumber} */ /*! @@ -694,7 +694,7 @@ QT_END_NAMESPACE This property holds the number of track on the album containing the media. - \sa {QtMediaservices::TrackNumber} + \sa {QtMediaServices::TrackNumber} */ /*! @@ -702,7 +702,7 @@ QT_END_NAMESPACE This property holds the URL of a small cover art image. - \sa {QtMediaservices::CoverArtUrlSmall} + \sa {QtMediaServices::CoverArtUrlSmall} */ /*! @@ -710,7 +710,7 @@ QT_END_NAMESPACE This property holds the URL of a large cover art image. - \sa {QtMediaservices::CoverArtUrlLarge} + \sa {QtMediaServices::CoverArtUrlLarge} */ /*! @@ -718,7 +718,7 @@ QT_END_NAMESPACE This property holds the dimension of an image or video. - \sa {QtMediaservices::Resolution} + \sa {QtMediaServices::Resolution} */ /*! @@ -726,7 +726,7 @@ QT_END_NAMESPACE This property holds the pixel aspect ratio of an image or video. - \sa {QtMediaservices::PixelAspectRatio} + \sa {QtMediaServices::PixelAspectRatio} */ /*! @@ -734,7 +734,7 @@ QT_END_NAMESPACE This property holds the frame rate of the media's video stream. - \sa {QtMediaservices::VideoFrameRate} + \sa {QtMediaServices::VideoFrameRate} */ /*! @@ -743,7 +743,7 @@ QT_END_NAMESPACE This property holds the bit rate of the media's video stream in bits per second. - \sa {QtMediaservices::VideoBitRate} + \sa {QtMediaServices::VideoBitRate} */ /*! @@ -751,7 +751,7 @@ QT_END_NAMESPACE This property holds the encoding of the media's video stream. - \sa {QtMediaservices::VideoCodec} + \sa {QtMediaServices::VideoCodec} */ /*! @@ -759,7 +759,7 @@ QT_END_NAMESPACE This property holds the URL of a poster image. - \sa {QtMediaservices::PosterUrl} + \sa {QtMediaServices::PosterUrl} */ /*! @@ -767,7 +767,7 @@ QT_END_NAMESPACE This property holds the chapter number of the media. - \sa {QtMediaservices::ChapterNumber} + \sa {QtMediaServices::ChapterNumber} */ /*! @@ -775,7 +775,7 @@ QT_END_NAMESPACE This property holds the director of the media. - \sa {QtMediaservices::Director} + \sa {QtMediaServices::Director} */ /*! @@ -783,7 +783,7 @@ QT_END_NAMESPACE This property holds the lead performer in the media. - \sa {QtMediaservices::LeadPerformer} + \sa {QtMediaServices::LeadPerformer} */ /*! @@ -791,7 +791,7 @@ QT_END_NAMESPACE This property holds the writer of the media. - \sa {QtMediaservices::Writer} + \sa {QtMediaServices::Writer} */ // The remaining properties are related to photos, and are technically @@ -801,157 +801,157 @@ QT_END_NAMESPACE /*! \qmlproperty variant Video::cameraManufacturer - \sa {QtMediaservices::CameraManufacturer} + \sa {QtMediaServices::CameraManufacturer} */ /*! \qmlproperty variant Video::cameraModel - \sa {QtMediaservices::CameraModel} + \sa {QtMediaServices::CameraModel} */ /*! \qmlproperty variant Video::event - \sa {QtMediaservices::Event} + \sa {QtMediaServices::Event} */ /*! \qmlproperty variant Video::subject - \sa {QtMediaservices::Subject} + \sa {QtMediaServices::Subject} */ /*! \qmlproperty variant Video::orientation - \sa {QtMediaservices::Orientation} + \sa {QtMediaServices::Orientation} */ /*! \qmlproperty variant Video::exposureTime - \sa {QtMediaservices::ExposureTime} + \sa {QtMediaServices::ExposureTime} */ /*! \qmlproperty variant Video::fNumber - \sa {QtMediaservices::FNumber} + \sa {QtMediaServices::FNumber} */ /*! \qmlproperty variant Video::exposureProgram - \sa {QtMediaservices::ExposureProgram} + \sa {QtMediaServices::ExposureProgram} */ /*! \qmlproperty variant Video::isoSpeedRatings - \sa {QtMediaservices::ISOSpeedRatings} + \sa {QtMediaServices::ISOSpeedRatings} */ /*! \qmlproperty variant Video::exposureBiasValue - \sa {QtMediaservices::ExposureBiasValue} + \sa {QtMediaServices::ExposureBiasValue} */ /*! \qmlproperty variant Video::dateTimeDigitized - \sa {QtMediaservices::DateTimeDigitized} + \sa {QtMediaServices::DateTimeDigitized} */ /*! \qmlproperty variant Video::subjectDistance - \sa {QtMediaservices::SubjectDistance} + \sa {QtMediaServices::SubjectDistance} */ /*! \qmlproperty variant Video::meteringMode - \sa {QtMediaservices::MeteringMode} + \sa {QtMediaServices::MeteringMode} */ /*! \qmlproperty variant Video::lightSource - \sa {QtMediaservices::LightSource} + \sa {QtMediaServices::LightSource} */ /*! \qmlproperty variant Video::flash - \sa {QtMediaservices::Flash} + \sa {QtMediaServices::Flash} */ /*! \qmlproperty variant Video::focalLength - \sa {QtMediaservices::FocalLength} + \sa {QtMediaServices::FocalLength} */ /*! \qmlproperty variant Video::exposureMode - \sa {QtMediaservices::ExposureMode} + \sa {QtMediaServices::ExposureMode} */ /*! \qmlproperty variant Video::whiteBalance - \sa {QtMediaservices::WhiteBalance} + \sa {QtMediaServices::WhiteBalance} */ /*! \qmlproperty variant Video::DigitalZoomRatio - \sa {QtMediaservices::DigitalZoomRatio} + \sa {QtMediaServices::DigitalZoomRatio} */ /*! \qmlproperty variant Video::focalLengthIn35mmFilm - \sa {QtMediaservices::FocalLengthIn35mmFile} + \sa {QtMediaServices::FocalLengthIn35mmFile} */ /*! \qmlproperty variant Video::sceneCaptureType - \sa {QtMediaservices::SceneCaptureType} + \sa {QtMediaServices::SceneCaptureType} */ /*! \qmlproperty variant Video::gainControl - \sa {QtMediaservices::GainControl} + \sa {QtMediaServices::GainControl} */ /*! \qmlproperty variant Video::contrast - \sa {QtMediaservices::contrast} + \sa {QtMediaServices::contrast} */ /*! \qmlproperty variant Video::saturation - \sa {QtMediaservices::Saturation} + \sa {QtMediaServices::Saturation} */ /*! \qmlproperty variant Video::sharpness - \sa {QtMediaservices::Sharpness} + \sa {QtMediaServices::Sharpness} */ /*! \qmlproperty variant Video::deviceSettingDescription - \sa {QtMediaservices::DeviceSettingDescription} + \sa {QtMediaServices::DeviceSettingDescription} */ #endif diff --git a/src/imports/multimedia/qdeclarativevideo_p.h b/src/imports/multimedia/qdeclarativevideo_p.h index 99882ac..c048b7d 100644 --- a/src/imports/multimedia/qdeclarativevideo_p.h +++ b/src/imports/multimedia/qdeclarativevideo_p.h @@ -55,7 +55,7 @@ #include "qdeclarativemediabase_p.h" -#include +#include #include #include diff --git a/src/imports/multimedia/qmetadatacontrolmetaobject.cpp b/src/imports/multimedia/qmetadatacontrolmetaobject.cpp index 2f45b50..5235a87 100644 --- a/src/imports/multimedia/qmetadatacontrolmetaobject.cpp +++ b/src/imports/multimedia/qmetadatacontrolmetaobject.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qmetadatacontrolmetaobject_p.h" -#include +#include QT_BEGIN_NAMESPACE @@ -106,101 +106,101 @@ namespace { struct MetaDataKey { - QtMediaservices::MetaData key; + QtMediaServices::MetaData key; const char *name; }; const MetaDataKey qt_metaDataKeys[] = { - { QtMediaservices::Title, "title" }, - { QtMediaservices::SubTitle, "subTitle" }, - { QtMediaservices::Author, "author" }, - { QtMediaservices::Comment, "comment" }, - { QtMediaservices::Description, "description" }, - { QtMediaservices::Category, "category" }, - { QtMediaservices::Genre, "genre" }, - { QtMediaservices::Year, "year" }, - { QtMediaservices::Date, "date" }, - { QtMediaservices::UserRating, "userRating" }, - { QtMediaservices::Keywords, "keywords" }, - { QtMediaservices::Language, "language" }, - { QtMediaservices::Publisher, "publisher" }, - { QtMediaservices::Copyright, "copyright" }, - { QtMediaservices::ParentalRating, "parentalRating" }, - { QtMediaservices::RatingOrganisation, "ratingOrganisation" }, + { QtMediaServices::Title, "title" }, + { QtMediaServices::SubTitle, "subTitle" }, + { QtMediaServices::Author, "author" }, + { QtMediaServices::Comment, "comment" }, + { QtMediaServices::Description, "description" }, + { QtMediaServices::Category, "category" }, + { QtMediaServices::Genre, "genre" }, + { QtMediaServices::Year, "year" }, + { QtMediaServices::Date, "date" }, + { QtMediaServices::UserRating, "userRating" }, + { QtMediaServices::Keywords, "keywords" }, + { QtMediaServices::Language, "language" }, + { QtMediaServices::Publisher, "publisher" }, + { QtMediaServices::Copyright, "copyright" }, + { QtMediaServices::ParentalRating, "parentalRating" }, + { QtMediaServices::RatingOrganisation, "ratingOrganisation" }, // Media - { QtMediaservices::Size, "size" }, - { QtMediaservices::MediaType, "mediaType" }, -// { QtMediaservices::Duration, "duration" }, + { QtMediaServices::Size, "size" }, + { QtMediaServices::MediaType, "mediaType" }, +// { QtMediaServices::Duration, "duration" }, // Audio - { QtMediaservices::AudioBitRate, "audioBitRate" }, - { QtMediaservices::AudioCodec, "audioCodec" }, - { QtMediaservices::AverageLevel, "averageLevel" }, - { QtMediaservices::ChannelCount, "channelCount" }, - { QtMediaservices::PeakValue, "peakValue" }, - { QtMediaservices::SampleRate, "sampleRate" }, + { QtMediaServices::AudioBitRate, "audioBitRate" }, + { QtMediaServices::AudioCodec, "audioCodec" }, + { QtMediaServices::AverageLevel, "averageLevel" }, + { QtMediaServices::ChannelCount, "channelCount" }, + { QtMediaServices::PeakValue, "peakValue" }, + { QtMediaServices::SampleRate, "sampleRate" }, // Music - { QtMediaservices::AlbumTitle, "albumTitle" }, - { QtMediaservices::AlbumArtist, "albumArtist" }, - { QtMediaservices::ContributingArtist, "contributingArtist" }, - { QtMediaservices::Composer, "composer" }, - { QtMediaservices::Conductor, "conductor" }, - { QtMediaservices::Lyrics, "lyrics" }, - { QtMediaservices::Mood, "mood" }, - { QtMediaservices::TrackNumber, "trackNumber" }, - { QtMediaservices::TrackCount, "trackCount" }, - - { QtMediaservices::CoverArtUrlSmall, "coverArtUrlSmall" }, - { QtMediaservices::CoverArtUrlLarge, "coverArtUrlLarge" }, + { QtMediaServices::AlbumTitle, "albumTitle" }, + { QtMediaServices::AlbumArtist, "albumArtist" }, + { QtMediaServices::ContributingArtist, "contributingArtist" }, + { QtMediaServices::Composer, "composer" }, + { QtMediaServices::Conductor, "conductor" }, + { QtMediaServices::Lyrics, "lyrics" }, + { QtMediaServices::Mood, "mood" }, + { QtMediaServices::TrackNumber, "trackNumber" }, + { QtMediaServices::TrackCount, "trackCount" }, + + { QtMediaServices::CoverArtUrlSmall, "coverArtUrlSmall" }, + { QtMediaServices::CoverArtUrlLarge, "coverArtUrlLarge" }, // Image/Video - { QtMediaservices::Resolution, "resolution" }, - { QtMediaservices::PixelAspectRatio, "pixelAspectRatio" }, + { QtMediaServices::Resolution, "resolution" }, + { QtMediaServices::PixelAspectRatio, "pixelAspectRatio" }, // Video - { QtMediaservices::VideoFrameRate, "videoFrameRate" }, - { QtMediaservices::VideoBitRate, "videoBitRate" }, - { QtMediaservices::VideoCodec, "videoCodec" }, + { QtMediaServices::VideoFrameRate, "videoFrameRate" }, + { QtMediaServices::VideoBitRate, "videoBitRate" }, + { QtMediaServices::VideoCodec, "videoCodec" }, - { QtMediaservices::PosterUrl, "posterUrl" }, + { QtMediaServices::PosterUrl, "posterUrl" }, // Movie - { QtMediaservices::ChapterNumber, "chapterNumber" }, - { QtMediaservices::Director, "director" }, - { QtMediaservices::LeadPerformer, "leadPerformer" }, - { QtMediaservices::Writer, "writer" }, + { QtMediaServices::ChapterNumber, "chapterNumber" }, + { QtMediaServices::Director, "director" }, + { QtMediaServices::LeadPerformer, "leadPerformer" }, + { QtMediaServices::Writer, "writer" }, // Photos - { QtMediaservices::CameraManufacturer, "cameraManufacturer" }, - { QtMediaservices::CameraModel, "cameraModel" }, - { QtMediaservices::Event, "event" }, - { QtMediaservices::Subject, "subject" }, - { QtMediaservices::Orientation, "orientation" }, - { QtMediaservices::ExposureTime, "exposureTime" }, - { QtMediaservices::FNumber, "fNumber" }, - { QtMediaservices::ExposureProgram, "exposureProgram" }, - { QtMediaservices::ISOSpeedRatings, "isoSpeedRatings" }, - { QtMediaservices::ExposureBiasValue, "exposureBiasValue" }, - { QtMediaservices::DateTimeOriginal, "dateTimeOriginal" }, - { QtMediaservices::DateTimeDigitized, "dateTimeDigitized" }, - { QtMediaservices::SubjectDistance, "subjectDistance" }, - { QtMediaservices::MeteringMode, "meteringMode" }, - { QtMediaservices::LightSource, "lightSource" }, - { QtMediaservices::Flash, "flash" }, - { QtMediaservices::FocalLength, "focalLength" }, - { QtMediaservices::ExposureMode, "exposureMode" }, - { QtMediaservices::WhiteBalance, "whiteBalance" }, - { QtMediaservices::DigitalZoomRatio, "digitalZoomRatio" }, - { QtMediaservices::FocalLengthIn35mmFilm, "focalLengthIn35mmFilm" }, - { QtMediaservices::SceneCaptureType, "sceneCaptureType" }, - { QtMediaservices::GainControl, "gainControl" }, - { QtMediaservices::Contrast, "contrast" }, - { QtMediaservices::Saturation, "saturation" }, - { QtMediaservices::Sharpness, "sharpness" }, - { QtMediaservices::DeviceSettingDescription, "deviceSettingDescription" } + { QtMediaServices::CameraManufacturer, "cameraManufacturer" }, + { QtMediaServices::CameraModel, "cameraModel" }, + { QtMediaServices::Event, "event" }, + { QtMediaServices::Subject, "subject" }, + { QtMediaServices::Orientation, "orientation" }, + { QtMediaServices::ExposureTime, "exposureTime" }, + { QtMediaServices::FNumber, "fNumber" }, + { QtMediaServices::ExposureProgram, "exposureProgram" }, + { QtMediaServices::ISOSpeedRatings, "isoSpeedRatings" }, + { QtMediaServices::ExposureBiasValue, "exposureBiasValue" }, + { QtMediaServices::DateTimeOriginal, "dateTimeOriginal" }, + { QtMediaServices::DateTimeDigitized, "dateTimeDigitized" }, + { QtMediaServices::SubjectDistance, "subjectDistance" }, + { QtMediaServices::MeteringMode, "meteringMode" }, + { QtMediaServices::LightSource, "lightSource" }, + { QtMediaServices::Flash, "flash" }, + { QtMediaServices::FocalLength, "focalLength" }, + { QtMediaServices::ExposureMode, "exposureMode" }, + { QtMediaServices::WhiteBalance, "whiteBalance" }, + { QtMediaServices::DigitalZoomRatio, "digitalZoomRatio" }, + { QtMediaServices::FocalLengthIn35mmFilm, "focalLengthIn35mmFilm" }, + { QtMediaServices::SceneCaptureType, "sceneCaptureType" }, + { QtMediaServices::GainControl, "gainControl" }, + { QtMediaServices::Contrast, "contrast" }, + { QtMediaServices::Saturation, "saturation" }, + { QtMediaServices::Sharpness, "sharpness" }, + { QtMediaServices::DeviceSettingDescription, "deviceSettingDescription" } }; class QMetaDataControlObject : public QObject diff --git a/src/imports/multimedia/qmetadatacontrolmetaobject_p.h b/src/imports/multimedia/qmetadatacontrolmetaobject_p.h index 128eaa4..bbbc6fe 100644 --- a/src/imports/multimedia/qmetadatacontrolmetaobject_p.h +++ b/src/imports/multimedia/qmetadatacontrolmetaobject_p.h @@ -54,7 +54,7 @@ // #include -#include +#include #include diff --git a/src/multimedia/mediaservices/base/qgraphicsvideoitem.cpp b/src/multimedia/mediaservices/base/qgraphicsvideoitem.cpp index 8494c2e..d80dec5 100644 --- a/src/multimedia/mediaservices/base/qgraphicsvideoitem.cpp +++ b/src/multimedia/mediaservices/base/qgraphicsvideoitem.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) diff --git a/src/multimedia/mediaservices/base/qgraphicsvideoitem.h b/src/multimedia/mediaservices/base/qgraphicsvideoitem.h index 62e66e8..bb41075 100644 --- a/src/multimedia/mediaservices/base/qgraphicsvideoitem.h +++ b/src/multimedia/mediaservices/base/qgraphicsvideoitem.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -44,7 +44,7 @@ #include -#include +#include #if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW diff --git a/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.cpp b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.cpp index 818b285..51e3bfb 100644 --- a/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.cpp +++ b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include +#include #include "qmediaplaylistprovider_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h index 73ff82d..e6b6dca 100644 --- a/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h +++ b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -42,7 +42,7 @@ #ifndef QLOCALMEDIAPAYLISTPROVIDER_H #define QLOCALMEDIAPAYLISTPROVIDER_H -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmediacontent.cpp b/src/multimedia/mediaservices/base/qmediacontent.cpp index f89e901..50d8e46 100644 --- a/src/multimedia/mediaservices/base/qmediacontent.cpp +++ b/src/multimedia/mediaservices/base/qmediacontent.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -42,7 +42,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qmediacontent.h b/src/multimedia/mediaservices/base/qmediacontent.h index 20f0525..47fa6e1 100644 --- a/src/multimedia/mediaservices/base/qmediacontent.h +++ b/src/multimedia/mediaservices/base/qmediacontent.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -45,7 +45,7 @@ #include #include -#include +#include #include diff --git a/src/multimedia/mediaservices/base/qmediacontrol.cpp b/src/multimedia/mediaservices/base/qmediacontrol.cpp index 98db9fe..09996c8 100644 --- a/src/multimedia/mediaservices/base/qmediacontrol.cpp +++ b/src/multimedia/mediaservices/base/qmediacontrol.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -42,8 +42,8 @@ #include #include -#include -#include +#include +#include diff --git a/src/multimedia/mediaservices/base/qmediacontrol.h b/src/multimedia/mediaservices/base/qmediacontrol.h index be5d95d..819c959 100644 --- a/src/multimedia/mediaservices/base/qmediacontrol.h +++ b/src/multimedia/mediaservices/base/qmediacontrol.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/base/qmediacontrol_p.h b/src/multimedia/mediaservices/base/qmediacontrol_p.h index ad7e947..3f9755b 100644 --- a/src/multimedia/mediaservices/base/qmediacontrol_p.h +++ b/src/multimedia/mediaservices/base/qmediacontrol_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/base/qmediaobject.cpp b/src/multimedia/mediaservices/base/qmediaobject.cpp index 3d92b12..68fb29e 100644 --- a/src/multimedia/mediaservices/base/qmediaobject.cpp +++ b/src/multimedia/mediaservices/base/qmediaobject.cpp @@ -43,8 +43,8 @@ #include "qmediaobject_p.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE @@ -97,9 +97,9 @@ QMediaObject::~QMediaObject() Returns the service availability error state. */ -QtMediaservices::AvailabilityError QMediaObject::availabilityError() const +QtMediaServices::AvailabilityError QMediaObject::availabilityError() const { - return QtMediaservices::ServiceMissingError; + return QtMediaServices::ServiceMissingError; } /*! @@ -306,7 +306,7 @@ bool QMediaObject::isMetaDataWritable() const /*! Returns the value associated with a meta-data \a key. */ -QVariant QMediaObject::metaData(QtMediaservices::MetaData key) const +QVariant QMediaObject::metaData(QtMediaServices::MetaData key) const { Q_D(const QMediaObject); @@ -318,7 +318,7 @@ QVariant QMediaObject::metaData(QtMediaservices::MetaData key) const /*! Sets a \a value for a meta-data \a key. */ -void QMediaObject::setMetaData(QtMediaservices::MetaData key, const QVariant &value) +void QMediaObject::setMetaData(QtMediaServices::MetaData key, const QVariant &value) { Q_D(QMediaObject); @@ -329,13 +329,13 @@ void QMediaObject::setMetaData(QtMediaservices::MetaData key, const QVariant &va /*! Returns a list of keys there is meta-data available for. */ -QList QMediaObject::availableMetaData() const +QList QMediaObject::availableMetaData() const { Q_D(const QMediaObject); return d->metaDataControl ? d->metaDataControl->availableMetaData() - : QList(); + : QList(); } /*! diff --git a/src/multimedia/mediaservices/base/qmediaobject.h b/src/multimedia/mediaservices/base/qmediaobject.h index 461e056..70b4f33 100644 --- a/src/multimedia/mediaservices/base/qmediaobject.h +++ b/src/multimedia/mediaservices/base/qmediaobject.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -45,7 +45,7 @@ #include #include -#include +#include QT_BEGIN_HEADER @@ -67,7 +67,7 @@ public: ~QMediaObject(); virtual bool isAvailable() const; - virtual QtMediaservices::AvailabilityError availabilityError() const; + virtual QtMediaServices::AvailabilityError availabilityError() const; virtual QMediaService* service() const; @@ -80,9 +80,9 @@ public: bool isMetaDataAvailable() const; bool isMetaDataWritable() const; - QVariant metaData(QtMediaservices::MetaData key) const; - void setMetaData(QtMediaservices::MetaData key, const QVariant &value); - QList availableMetaData() const; + QVariant metaData(QtMediaServices::MetaData key) const; + void setMetaData(QtMediaServices::MetaData key, const QVariant &value); + QList availableMetaData() const; QVariant extendedMetaData(const QString &key) const; void setExtendedMetaData(const QString &key, const QVariant &value); diff --git a/src/multimedia/mediaservices/base/qmediaobject_p.h b/src/multimedia/mediaservices/base/qmediaobject_p.h index 4589f03..c31ad46 100644 --- a/src/multimedia/mediaservices/base/qmediaobject_p.h +++ b/src/multimedia/mediaservices/base/qmediaobject_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -57,7 +57,7 @@ #include #include -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmediaplaylist.cpp b/src/multimedia/mediaservices/base/qmediaplaylist.cpp index 174a8ac..93278fe 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylist.cpp +++ b/src/multimedia/mediaservices/base/qmediaplaylist.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -45,14 +45,14 @@ #include #include -#include +#include #include "qmediaplaylist_p.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "qmediapluginloader_p.h" diff --git a/src/multimedia/mediaservices/base/qmediaplaylist.h b/src/multimedia/mediaservices/base/qmediaplaylist.h index 132b58c..9125fd6 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylist.h +++ b/src/multimedia/mediaservices/base/qmediaplaylist.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmediaplaylist_p.h b/src/multimedia/mediaservices/base/qmediaplaylist_p.h index 57c2723..a5f290e 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylist_p.h +++ b/src/multimedia/mediaservices/base/qmediaplaylist_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -53,11 +53,11 @@ // We mean it. // -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "qmediaobject_p.h" #include diff --git a/src/multimedia/mediaservices/base/qmediaplaylistcontrol.cpp b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.cpp index 6f3b2fe..016c55d 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistcontrol.cpp +++ b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -40,7 +40,7 @@ ****************************************************************************/ -#include +#include #include "qmediacontrol_p.h" diff --git a/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h index cf489e3..36f00ae 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h +++ b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -43,8 +43,8 @@ #ifndef QMEDIAPLAYLISTCONTROL_H #define QMEDIAPLAYLISTCONTROL_H -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmediaplaylistioplugin.cpp b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.cpp index ba5dc81..60e80e5 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistioplugin.cpp +++ b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h index 6bc0418..5fc10f7 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h +++ b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -46,7 +46,7 @@ #include #include -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmediaplaylistnavigator.cpp b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.cpp index 134ae77..e3eec5e 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistnavigator.cpp +++ b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include -#include -#include +#include +#include +#include #include "qmediaobject_p.h" #include diff --git a/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h index b6d3d96..6cb9d9c 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h +++ b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmediaplaylistprovider.cpp b/src/multimedia/mediaservices/base/qmediaplaylistprovider.cpp index c546899..3cd766b 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistprovider.cpp +++ b/src/multimedia/mediaservices/base/qmediaplaylistprovider.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -41,7 +41,7 @@ #include -#include +#include #include "qmediaplaylistprovider_p.h" diff --git a/src/multimedia/mediaservices/base/qmediaplaylistprovider.h b/src/multimedia/mediaservices/base/qmediaplaylistprovider.h index 4929287..31e6d5f 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistprovider.h +++ b/src/multimedia/mediaservices/base/qmediaplaylistprovider.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmediaplaylistprovider_p.h b/src/multimedia/mediaservices/base/qmediaplaylistprovider_p.h index 03f72ac..00d1cca 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistprovider_p.h +++ b/src/multimedia/mediaservices/base/qmediaplaylistprovider_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -53,7 +53,7 @@ // We mean it. // -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmediapluginloader.cpp b/src/multimedia/mediaservices/base/qmediapluginloader.cpp index a1975ab..d6da0ba 100644 --- a/src/multimedia/mediaservices/base/qmediapluginloader.cpp +++ b/src/multimedia/mediaservices/base/qmediapluginloader.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -45,7 +45,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qmediapluginloader_p.h b/src/multimedia/mediaservices/base/qmediapluginloader_p.h index 194f6ee..d911180 100644 --- a/src/multimedia/mediaservices/base/qmediapluginloader_p.h +++ b/src/multimedia/mediaservices/base/qmediapluginloader_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/base/qmediaresource.cpp b/src/multimedia/mediaservices/base/qmediaresource.cpp index 9577092..33bd396 100644 --- a/src/multimedia/mediaservices/base/qmediaresource.cpp +++ b/src/multimedia/mediaservices/base/qmediaresource.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -43,7 +43,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qmediaresource.h b/src/multimedia/mediaservices/base/qmediaresource.h index 69078cc..5c381ba 100644 --- a/src/multimedia/mediaservices/base/qmediaresource.h +++ b/src/multimedia/mediaservices/base/qmediaresource.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/base/qmediaservice.cpp b/src/multimedia/mediaservices/base/qmediaservice.cpp index 5d522dc..b343887 100644 --- a/src/multimedia/mediaservices/base/qmediaservice.cpp +++ b/src/multimedia/mediaservices/base/qmediaservice.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -41,7 +41,7 @@ #include -#include +#include #include "qmediaservice_p.h" diff --git a/src/multimedia/mediaservices/base/qmediaservice.h b/src/multimedia/mediaservices/base/qmediaservice.h index 060019b..3963348 100644 --- a/src/multimedia/mediaservices/base/qmediaservice.h +++ b/src/multimedia/mediaservices/base/qmediaservice.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -45,7 +45,7 @@ #include #include -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmediaservice_p.h b/src/multimedia/mediaservices/base/qmediaservice_p.h index e60e669..bebae11 100644 --- a/src/multimedia/mediaservices/base/qmediaservice_p.h +++ b/src/multimedia/mediaservices/base/qmediaservice_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/base/qmediaserviceprovider.cpp b/src/multimedia/mediaservices/base/qmediaserviceprovider.cpp index 48d245d..f27628b 100644 --- a/src/multimedia/mediaservices/base/qmediaserviceprovider.cpp +++ b/src/multimedia/mediaservices/base/qmediaserviceprovider.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -42,11 +42,11 @@ #include #include -#include -#include -#include +#include +#include +#include #include "qmediapluginloader_p.h" -#include +#include QT_BEGIN_NAMESPACE @@ -337,9 +337,9 @@ public: } break; case QMediaServiceProviderHint::ContentType: { - QtMediaservices::SupportEstimate estimate = QtMediaservices::NotSupported; + QtMediaServices::SupportEstimate estimate = QtMediaServices::NotSupported; foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) { - QtMediaservices::SupportEstimate currentEstimate = QtMediaservices::MaybeSupported; + QtMediaServices::SupportEstimate currentEstimate = QtMediaServices::MaybeSupported; QMediaServiceSupportedFormatsInterface *iface = qobject_cast(currentPlugin); @@ -350,7 +350,7 @@ public: estimate = currentEstimate; plugin = currentPlugin; - if (currentEstimate == QtMediaservices::PreferredService) + if (currentEstimate == QtMediaServices::PreferredService) break; } } @@ -381,7 +381,7 @@ public: } } - QtMediaservices::SupportEstimate hasSupport(const QByteArray &serviceType, + QtMediaServices::SupportEstimate hasSupport(const QByteArray &serviceType, const QString &mimeType, const QStringList& codecs, int flags) const @@ -390,10 +390,10 @@ public: QString::fromLatin1(serviceType.constData(),serviceType.length())); if (instances.isEmpty()) - return QtMediaservices::NotSupported; + return QtMediaServices::NotSupported; bool allServicesProvideInterface = true; - QtMediaservices::SupportEstimate supportEstimate = QtMediaservices::NotSupported; + QtMediaServices::SupportEstimate supportEstimate = QtMediaServices::NotSupported; foreach(QObject *obj, instances) { QMediaServiceSupportedFormatsInterface *iface = @@ -427,12 +427,12 @@ public: } //don't return PreferredService - supportEstimate = qMin(supportEstimate, QtMediaservices::ProbablySupported); + supportEstimate = qMin(supportEstimate, QtMediaServices::ProbablySupported); //Return NotSupported only if no services are available of serviceType //or all the services returned NotSupported, otherwise return at least MaybeSupported if (!allServicesProvideInterface) - supportEstimate = qMax(QtMediaservices::MaybeSupported, supportEstimate); + supportEstimate = qMax(QtMediaServices::MaybeSupported, supportEstimate); return supportEstimate; } @@ -540,13 +540,13 @@ Q_GLOBAL_STATIC(QPluginServiceProvider, pluginProvider); */ /*! - \fn QtMediaservices::SupportEstimate QMediaServiceProvider::hasSupport(const QByteArray &serviceType, const QString &mimeType, const QStringList& codecs, int flags) const + \fn QtMediaServices::SupportEstimate QMediaServiceProvider::hasSupport(const QByteArray &serviceType, const QString &mimeType, const QStringList& codecs, int flags) const Returns how confident a media service provider is that is can provide a \a serviceType service that is able to play media of a specific \a mimeType that is encoded using the listed \a codecs while adhearing to constraints identified in \a flags. */ -QtMediaservices::SupportEstimate QMediaServiceProvider::hasSupport(const QByteArray &serviceType, +QtMediaServices::SupportEstimate QMediaServiceProvider::hasSupport(const QByteArray &serviceType, const QString &mimeType, const QStringList& codecs, int flags) const @@ -556,7 +556,7 @@ QtMediaservices::SupportEstimate QMediaServiceProvider::hasSupport(const QByteAr Q_UNUSED(codecs); Q_UNUSED(flags); - return QtMediaservices::MaybeSupported; + return QtMediaServices::MaybeSupported; } /*! diff --git a/src/multimedia/mediaservices/base/qmediaserviceprovider.h b/src/multimedia/mediaservices/base/qmediaserviceprovider.h index 45021c7..24d2078 100644 --- a/src/multimedia/mediaservices/base/qmediaserviceprovider.h +++ b/src/multimedia/mediaservices/base/qmediaserviceprovider.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -45,7 +45,7 @@ #include #include -#include +#include QT_BEGIN_HEADER @@ -106,7 +106,7 @@ public: virtual QMediaService* requestService(const QByteArray &type, const QMediaServiceProviderHint &hint = QMediaServiceProviderHint()) = 0; virtual void releaseService(QMediaService *service) = 0; - virtual QtMediaservices::SupportEstimate hasSupport(const QByteArray &serviceType, + virtual QtMediaServices::SupportEstimate hasSupport(const QByteArray &serviceType, const QString &mimeType, const QStringList& codecs, int flags = 0) const; diff --git a/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h b/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h index bc41845..ab55f84 100644 --- a/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h +++ b/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -46,7 +46,7 @@ #include #include -#include +#include #ifdef Q_MOC_RUN # pragma Q_MOC_EXPAND_MACROS @@ -76,7 +76,7 @@ Q_DECLARE_INTERFACE(QMediaServiceProviderFactoryInterface, QMediaServiceProvider struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedFormatsInterface { virtual ~QMediaServiceSupportedFormatsInterface() {} - virtual QtMediaservices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const = 0; + virtual QtMediaServices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const = 0; virtual QStringList supportedMimeTypes() const = 0; }; diff --git a/src/multimedia/mediaservices/base/qmediatimerange.cpp b/src/multimedia/mediaservices/base/qmediatimerange.cpp index 74f54dd..2dba20c 100644 --- a/src/multimedia/mediaservices/base/qmediatimerange.cpp +++ b/src/multimedia/mediaservices/base/qmediatimerange.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qmediatimerange.h b/src/multimedia/mediaservices/base/qmediatimerange.h index 94beaad..33b2f27 100644 --- a/src/multimedia/mediaservices/base/qmediatimerange.h +++ b/src/multimedia/mediaservices/base/qmediatimerange.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -43,7 +43,7 @@ #define QMEDIATIMERANGE_H #include -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qmetadatacontrol.cpp b/src/multimedia/mediaservices/base/qmetadatacontrol.cpp index 32be987..8bfec7e 100644 --- a/src/multimedia/mediaservices/base/qmetadatacontrol.cpp +++ b/src/multimedia/mediaservices/base/qmetadatacontrol.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "qmediacontrol_p.h" @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE its current media it will implement QMetaDataControl. This control provides functions for both retrieving and setting meta-data values. Meta-data may be addressed by the well defined keys in the - QtMediaservices::MetaData enumeration using the metaData() functions, or by + QtMediaServices::MetaData enumeration using the metaData() functions, or by string keys using the extendedMetaData() functions. The functionality provided by this control is exposed to application @@ -117,13 +117,13 @@ QMetaDataControl::~QMetaDataControl() */ /*! - \fn QVariant QMetaDataControl::metaData(QtMediaservices::MetaData key) const + \fn QVariant QMetaDataControl::metaData(QtMediaServices::MetaData key) const Returns the meta-data for the given \a key. */ /*! - \fn void QMetaDataControl::setMetaData(QtMediaservices::MetaData key, const QVariant &value) + \fn void QMetaDataControl::setMetaData(QtMediaServices::MetaData key, const QVariant &value) Sets the \a value of the meta-data element with the given \a key. */ diff --git a/src/multimedia/mediaservices/base/qmetadatacontrol.h b/src/multimedia/mediaservices/base/qmetadatacontrol.h index cf4a0d3..e91c88b 100644 --- a/src/multimedia/mediaservices/base/qmetadatacontrol.h +++ b/src/multimedia/mediaservices/base/qmetadatacontrol.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -42,9 +42,9 @@ #ifndef QMETADATACONTROL_H #define QMETADATACONTROL_H -#include -#include -#include +#include +#include +#include QT_BEGIN_HEADER @@ -63,9 +63,9 @@ public: virtual bool isWritable() const = 0; virtual bool isMetaDataAvailable() const = 0; - virtual QVariant metaData(QtMediaservices::MetaData key) const = 0; - virtual void setMetaData(QtMediaservices::MetaData key, const QVariant &value) = 0; - virtual QList availableMetaData() const = 0; + virtual QVariant metaData(QtMediaServices::MetaData key) const = 0; + virtual void setMetaData(QtMediaServices::MetaData key, const QVariant &value) = 0; + virtual QList availableMetaData() const = 0; virtual QVariant extendedMetaData(const QString &key) const = 0; virtual void setExtendedMetaData(const QString &key, const QVariant &value) = 0; diff --git a/src/multimedia/mediaservices/base/qpaintervideosurface.cpp b/src/multimedia/mediaservices/base/qpaintervideosurface.cpp index b3e0dd5..302e772 100644 --- a/src/multimedia/mediaservices/base/qpaintervideosurface.cpp +++ b/src/multimedia/mediaservices/base/qpaintervideosurface.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/base/qpaintervideosurface_mac_p.h b/src/multimedia/mediaservices/base/qpaintervideosurface_mac_p.h index 13c22c2..4f8a7a6 100644 --- a/src/multimedia/mediaservices/base/qpaintervideosurface_mac_p.h +++ b/src/multimedia/mediaservices/base/qpaintervideosurface_mac_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/base/qpaintervideosurface_p.h b/src/multimedia/mediaservices/base/qpaintervideosurface_p.h index de9c24a..20628c4 100644 --- a/src/multimedia/mediaservices/base/qpaintervideosurface_p.h +++ b/src/multimedia/mediaservices/base/qpaintervideosurface_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/base/qtmedianamespace.h b/src/multimedia/mediaservices/base/qtmedianamespace.h index 7db7aa8..917c646 100644 --- a/src/multimedia/mediaservices/base/qtmedianamespace.h +++ b/src/multimedia/mediaservices/base/qtmedianamespace.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) -namespace QtMediaservices +namespace QtMediaServices { enum MetaData { diff --git a/src/multimedia/mediaservices/base/qvideodevicecontrol.cpp b/src/multimedia/mediaservices/base/qvideodevicecontrol.cpp index 128cee9..30c56cf 100644 --- a/src/multimedia/mediaservices/base/qvideodevicecontrol.cpp +++ b/src/multimedia/mediaservices/base/qvideodevicecontrol.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qvideodevicecontrol.h b/src/multimedia/mediaservices/base/qvideodevicecontrol.h index df1d4fa..b86a35c 100644 --- a/src/multimedia/mediaservices/base/qvideodevicecontrol.h +++ b/src/multimedia/mediaservices/base/qvideodevicecontrol.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -42,7 +42,7 @@ #ifndef QVIDEODEVICECONTROL_H #define QVIDEODEVICECONTROL_H -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qvideooutputcontrol.cpp b/src/multimedia/mediaservices/base/qvideooutputcontrol.cpp index 7d7ed4b..532c892 100644 --- a/src/multimedia/mediaservices/base/qvideooutputcontrol.cpp +++ b/src/multimedia/mediaservices/base/qvideooutputcontrol.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qvideooutputcontrol.h b/src/multimedia/mediaservices/base/qvideooutputcontrol.h index 05bc164..ad69911 100644 --- a/src/multimedia/mediaservices/base/qvideooutputcontrol.h +++ b/src/multimedia/mediaservices/base/qvideooutputcontrol.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -42,7 +42,7 @@ #ifndef QVIDEOOUTPUTCONTROL_H #define QVIDEOOUTPUTCONTROL_H -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qvideorenderercontrol.cpp b/src/multimedia/mediaservices/base/qvideorenderercontrol.cpp index bd7c78d..6cc3138 100644 --- a/src/multimedia/mediaservices/base/qvideorenderercontrol.cpp +++ b/src/multimedia/mediaservices/base/qvideorenderercontrol.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "qmediacontrol_p.h" diff --git a/src/multimedia/mediaservices/base/qvideorenderercontrol.h b/src/multimedia/mediaservices/base/qvideorenderercontrol.h index fd130ac..29a66ea 100644 --- a/src/multimedia/mediaservices/base/qvideorenderercontrol.h +++ b/src/multimedia/mediaservices/base/qvideorenderercontrol.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -42,7 +42,7 @@ #ifndef QVIDEORENDERERCONTROL_H #define QVIDEORENDERERCONTROL_H -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qvideowidget.cpp b/src/multimedia/mediaservices/base/qvideowidget.cpp index 52291b0..d39b1f4 100644 --- a/src/multimedia/mediaservices/base/qvideowidget.cpp +++ b/src/multimedia/mediaservices/base/qvideowidget.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -41,14 +41,14 @@ #include "qvideowidget_p.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "qpaintervideosurface_p.h" -#include +#include #include #include diff --git a/src/multimedia/mediaservices/base/qvideowidget.h b/src/multimedia/mediaservices/base/qvideowidget.h index 080e19c..8033d40 100644 --- a/src/multimedia/mediaservices/base/qvideowidget.h +++ b/src/multimedia/mediaservices/base/qvideowidget.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/base/qvideowidget_p.h b/src/multimedia/mediaservices/base/qvideowidget_p.h index 4f67117..bb44dfa 100644 --- a/src/multimedia/mediaservices/base/qvideowidget_p.h +++ b/src/multimedia/mediaservices/base/qvideowidget_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -53,7 +53,7 @@ // We mean it. // -#include +#include #ifndef QT_NO_OPENGL #include diff --git a/src/multimedia/mediaservices/base/qvideowidgetcontrol.cpp b/src/multimedia/mediaservices/base/qvideowidgetcontrol.cpp index 1cc7eaf..538f158 100644 --- a/src/multimedia/mediaservices/base/qvideowidgetcontrol.cpp +++ b/src/multimedia/mediaservices/base/qvideowidgetcontrol.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "qmediacontrol_p.h" diff --git a/src/multimedia/mediaservices/base/qvideowidgetcontrol.h b/src/multimedia/mediaservices/base/qvideowidgetcontrol.h index a8105ac..1fe43cc 100644 --- a/src/multimedia/mediaservices/base/qvideowidgetcontrol.h +++ b/src/multimedia/mediaservices/base/qvideowidgetcontrol.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/base/qvideowindowcontrol.cpp b/src/multimedia/mediaservices/base/qvideowindowcontrol.cpp index f73b187..967a2d6 100644 --- a/src/multimedia/mediaservices/base/qvideowindowcontrol.cpp +++ b/src/multimedia/mediaservices/base/qvideowindowcontrol.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qvideowindowcontrol.h b/src/multimedia/mediaservices/base/qvideowindowcontrol.h index 0fabce9..74c1786 100644 --- a/src/multimedia/mediaservices/base/qvideowindowcontrol.h +++ b/src/multimedia/mediaservices/base/qvideowindowcontrol.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_p.h b/src/multimedia/mediaservices/effects/qsoundeffect_p.h index 8c8985a..419e4f8 100644 --- a/src/multimedia/mediaservices/effects/qsoundeffect_p.h +++ b/src/multimedia/mediaservices/effects/qsoundeffect_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp index 3e3dd91..c856157 100644 --- a/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.h b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.h index ef6bff1..1327bf5 100644 --- a/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.h +++ b/src/multimedia/mediaservices/effects/qsoundeffect_pulse_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -58,7 +58,7 @@ #include #include -#include +#include #include diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.cpp b/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.cpp index 8cc2675..5e40bed 100644 --- a/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.cpp +++ b/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -54,8 +54,8 @@ #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.h b/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.h index 5abdcad..82ea000 100644 --- a/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.h +++ b/src/multimedia/mediaservices/effects/qsoundeffect_qmedia_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -56,7 +56,7 @@ #include #include -#include +#include QT_BEGIN_HEADER diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.cpp b/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.cpp index 7746f0c..9247aba 100644 --- a/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.cpp +++ b/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.h b/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.h index 133e6ec..dad7b6f 100644 --- a/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.h +++ b/src/multimedia/mediaservices/effects/qsoundeffect_qsound_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/effects/wavedecoder_p.cpp b/src/multimedia/mediaservices/effects/wavedecoder_p.cpp index 2208461..1c26c8f 100644 --- a/src/multimedia/mediaservices/effects/wavedecoder_p.cpp +++ b/src/multimedia/mediaservices/effects/wavedecoder_p.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/effects/wavedecoder_p.h b/src/multimedia/mediaservices/effects/wavedecoder_p.h index bb22907..dcc5453 100644 --- a/src/multimedia/mediaservices/effects/wavedecoder_p.h +++ b/src/multimedia/mediaservices/effects/wavedecoder_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/multimedia/mediaservices/mediaservices.pro b/src/multimedia/mediaservices/mediaservices.pro index 908f60a..ef552e3 100644 --- a/src/multimedia/mediaservices/mediaservices.pro +++ b/src/multimedia/mediaservices/mediaservices.pro @@ -1,4 +1,4 @@ -TARGET = QtMediaservices +TARGET = QtMediaServices QPRO_PWD = $$PWD QT = core gui multimedia diff --git a/src/multimedia/mediaservices/playback/qmediaplayer.cpp b/src/multimedia/mediaservices/playback/qmediaplayer.cpp index b15464f..e91a64c 100644 --- a/src/multimedia/mediaservices/playback/qmediaplayer.cpp +++ b/src/multimedia/mediaservices/playback/qmediaplayer.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -45,16 +45,16 @@ #include #include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include //#define DEBUG_PLAYER_STATE @@ -682,7 +682,7 @@ void QMediaPlayer::unbind(QObject *obj) The \a flags argument allows additional requirements such as performance indicators to be specified. */ -QtMediaservices::SupportEstimate QMediaPlayer::hasSupport(const QString &mimeType, +QtMediaServices::SupportEstimate QMediaPlayer::hasSupport(const QString &mimeType, const QStringList& codecs, Flags flags) { diff --git a/src/multimedia/mediaservices/playback/qmediaplayer.h b/src/multimedia/mediaservices/playback/qmediaplayer.h index 2b4c443..be66a63 100644 --- a/src/multimedia/mediaservices/playback/qmediaplayer.h +++ b/src/multimedia/mediaservices/playback/qmediaplayer.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -42,9 +42,9 @@ #ifndef QMEDIAPLAYER_H #define QMEDIAPLAYER_H -#include -#include -#include +#include +#include +#include QT_BEGIN_HEADER @@ -117,7 +117,7 @@ public: QMediaPlayer(QObject *parent = 0, Flags flags = 0, QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider()); ~QMediaPlayer(); - static QtMediaservices::SupportEstimate hasSupport(const QString &mimeType, + static QtMediaServices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs = QStringList(), Flags flags = 0); static QStringList supportedMimeTypes(Flags flags = 0); diff --git a/src/multimedia/mediaservices/playback/qmediaplayercontrol.cpp b/src/multimedia/mediaservices/playback/qmediaplayercontrol.cpp index 3b63d93..ca58ce4 100644 --- a/src/multimedia/mediaservices/playback/qmediaplayercontrol.cpp +++ b/src/multimedia/mediaservices/playback/qmediaplayercontrol.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/multimedia/mediaservices/playback/qmediaplayercontrol.h b/src/multimedia/mediaservices/playback/qmediaplayercontrol.h index be10713..25bc2f5 100644 --- a/src/multimedia/mediaservices/playback/qmediaplayercontrol.h +++ b/src/multimedia/mediaservices/playback/qmediaplayercontrol.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtMediaservices module of the Qt Toolkit. +** This file is part of the QtMediaServices module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -44,9 +44,9 @@ #include -#include -#include -#include +#include +#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h index d7e3499..5dd36c3 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h @@ -42,7 +42,7 @@ #ifndef DIRECTSHOWAUDIOENDPOINTCONTROL_H #define DIRECTSHOWAUDIOENDPOINTCONTROL_H -#include +#include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp index 53b8787..7f67a82 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp @@ -57,76 +57,76 @@ namespace { struct QWMMetaDataKeyLookup { - QtMediaservices::MetaData key; + QtMediaServices::MetaData key; const wchar_t *token; }; } static const QWMMetaDataKeyLookup qt_wmMetaDataKeys[] = { - { QtMediaservices::Title, L"Title" }, - { QtMediaservices::SubTitle, L"WM/SubTitle" }, - { QtMediaservices::Author, L"Author" }, - { QtMediaservices::Comment, L"Comment" }, - { QtMediaservices::Description, L"Description" }, - { QtMediaservices::Category, L"WM/Category" }, - { QtMediaservices::Genre, L"WM/Genre" }, - //{ QtMediaservices::Date, 0 }, - { QtMediaservices::Year, L"WM/Year" }, - { QtMediaservices::UserRating, L"UserRating" }, - //{ QtMediaservices::MetaDatawords, 0 }, - { QtMediaservices::Language, L"Language" }, - { QtMediaservices::Publisher, L"WM/Publisher" }, - { QtMediaservices::Copyright, L"Copyright" }, - { QtMediaservices::ParentalRating, L"ParentalRating" }, - { QtMediaservices::RatingOrganisation, L"RatingOrganisation" }, + { QtMediaServices::Title, L"Title" }, + { QtMediaServices::SubTitle, L"WM/SubTitle" }, + { QtMediaServices::Author, L"Author" }, + { QtMediaServices::Comment, L"Comment" }, + { QtMediaServices::Description, L"Description" }, + { QtMediaServices::Category, L"WM/Category" }, + { QtMediaServices::Genre, L"WM/Genre" }, + //{ QtMediaServices::Date, 0 }, + { QtMediaServices::Year, L"WM/Year" }, + { QtMediaServices::UserRating, L"UserRating" }, + //{ QtMediaServices::MetaDatawords, 0 }, + { QtMediaServices::Language, L"Language" }, + { QtMediaServices::Publisher, L"WM/Publisher" }, + { QtMediaServices::Copyright, L"Copyright" }, + { QtMediaServices::ParentalRating, L"ParentalRating" }, + { QtMediaServices::RatingOrganisation, L"RatingOrganisation" }, // Media - { QtMediaservices::Size, L"FileSize" }, - { QtMediaservices::MediaType, L"MediaType" }, - { QtMediaservices::Duration, L"Duration" }, + { QtMediaServices::Size, L"FileSize" }, + { QtMediaServices::MediaType, L"MediaType" }, + { QtMediaServices::Duration, L"Duration" }, // Audio - { QtMediaservices::AudioBitRate, L"AudioBitRate" }, - { QtMediaservices::AudioCodec, L"AudioCodec" }, - { QtMediaservices::ChannelCount, L"ChannelCount" }, - { QtMediaservices::SampleRate, L"Frequency" }, + { QtMediaServices::AudioBitRate, L"AudioBitRate" }, + { QtMediaServices::AudioCodec, L"AudioCodec" }, + { QtMediaServices::ChannelCount, L"ChannelCount" }, + { QtMediaServices::SampleRate, L"Frequency" }, // Music - { QtMediaservices::AlbumTitle, L"WM/AlbumTitle" }, - { QtMediaservices::AlbumArtist, L"WM/AlbumArtist" }, - { QtMediaservices::ContributingArtist, L"Author" }, - { QtMediaservices::Composer, L"WM/Composer" }, - { QtMediaservices::Conductor, L"WM/Conductor" }, - { QtMediaservices::Lyrics, L"WM/Lyrics" }, - { QtMediaservices::Mood, L"WM/Mood" }, - { QtMediaservices::TrackNumber, L"WM/TrackNumber" }, - //{ QtMediaservices::TrackCount, 0 }, - //{ QtMediaservices::CoverArtUriSmall, 0 }, - //{ QtMediaservices::CoverArtUriLarge, 0 }, + { QtMediaServices::AlbumTitle, L"WM/AlbumTitle" }, + { QtMediaServices::AlbumArtist, L"WM/AlbumArtist" }, + { QtMediaServices::ContributingArtist, L"Author" }, + { QtMediaServices::Composer, L"WM/Composer" }, + { QtMediaServices::Conductor, L"WM/Conductor" }, + { QtMediaServices::Lyrics, L"WM/Lyrics" }, + { QtMediaServices::Mood, L"WM/Mood" }, + { QtMediaServices::TrackNumber, L"WM/TrackNumber" }, + //{ QtMediaServices::TrackCount, 0 }, + //{ QtMediaServices::CoverArtUriSmall, 0 }, + //{ QtMediaServices::CoverArtUriLarge, 0 }, // Image/Video - //{ QtMediaservices::Resolution, 0 }, - //{ QtMediaservices::PixelAspectRatio, 0 }, + //{ QtMediaServices::Resolution, 0 }, + //{ QtMediaServices::PixelAspectRatio, 0 }, // Video - //{ QtMediaservices::FrameRate, 0 }, - { QtMediaservices::VideoBitRate, L"VideoBitRate" }, - { QtMediaservices::VideoCodec, L"VideoCodec" }, + //{ QtMediaServices::FrameRate, 0 }, + { QtMediaServices::VideoBitRate, L"VideoBitRate" }, + { QtMediaServices::VideoCodec, L"VideoCodec" }, - //{ QtMediaservices::PosterUri, 0 }, + //{ QtMediaServices::PosterUri, 0 }, // Movie - { QtMediaservices::ChapterNumber, L"ChapterNumber" }, - { QtMediaservices::Director, L"WM/Director" }, - { QtMediaservices::LeadPerformer, L"LeadPerformer" }, - { QtMediaservices::Writer, L"WM/Writer" }, + { QtMediaServices::ChapterNumber, L"ChapterNumber" }, + { QtMediaServices::Director, L"WM/Director" }, + { QtMediaServices::LeadPerformer, L"LeadPerformer" }, + { QtMediaServices::Writer, L"WM/Writer" }, // Photos - { QtMediaservices::CameraManufacturer, L"CameraManufacturer" }, - { QtMediaservices::CameraModel, L"CameraModel" }, - { QtMediaservices::Event, L"Event" }, - { QtMediaservices::Subject, L"Subject" } + { QtMediaServices::CameraManufacturer, L"CameraManufacturer" }, + { QtMediaServices::CameraModel, L"CameraModel" }, + { QtMediaServices::Event, L"Event" }, + { QtMediaServices::Subject, L"Subject" } }; static QVariant getValue(IWMHeaderInfo *header, const wchar_t *key) @@ -257,7 +257,7 @@ bool DirectShowMetaDataControl::isMetaDataAvailable() const #endif } -QVariant DirectShowMetaDataControl::metaData(QtMediaservices::MetaData key) const +QVariant DirectShowMetaDataControl::metaData(QtMediaServices::MetaData key) const { QVariant value; @@ -277,19 +277,19 @@ QVariant DirectShowMetaDataControl::metaData(QtMediaservices::MetaData key) cons BSTR string = 0; switch (key) { - case QtMediaservices::Author: + case QtMediaServices::Author: m_content->get_AuthorName(&string); break; - case QtMediaservices::Title: + case QtMediaServices::Title: m_content->get_Title(&string); break; - case QtMediaservices::ParentalRating: + case QtMediaServices::ParentalRating: m_content->get_Rating(&string); break; - case QtMediaservices::Description: + case QtMediaServices::Description: m_content->get_Description(&string); break; - case QtMediaservices::Copyright: + case QtMediaServices::Copyright: m_content->get_Copyright(&string); break; default: @@ -305,13 +305,13 @@ QVariant DirectShowMetaDataControl::metaData(QtMediaservices::MetaData key) cons return value; } -void DirectShowMetaDataControl::setMetaData(QtMediaservices::MetaData, const QVariant &) +void DirectShowMetaDataControl::setMetaData(QtMediaServices::MetaData, const QVariant &) { } -QList DirectShowMetaDataControl::availableMetaData() const +QList DirectShowMetaDataControl::availableMetaData() const { - return QList(); + return QList(); } QVariant DirectShowMetaDataControl::extendedMetaData(const QString &) const diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h index c67c6eb..e368f00 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h @@ -44,7 +44,7 @@ #include "directshowglobal.h" -#include +#include #include @@ -72,9 +72,9 @@ public: bool isWritable() const; bool isMetaDataAvailable() const; - QVariant metaData(QtMediaservices::MetaData key) const; - void setMetaData(QtMediaservices::MetaData key, const QVariant &value); - QList availableMetaData() const; + QVariant metaData(QtMediaServices::MetaData key) const; + void setMetaData(QtMediaServices::MetaData key, const QVariant &value); + QList availableMetaData() const; QVariant extendedMetaData(const QString &key) const; void setExtendedMetaData(const QString &key, const QVariant &value); diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowpinenum.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowpinenum.cpp index 4dd9b0e..02b1a3b 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowpinenum.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowpinenum.cpp @@ -41,7 +41,7 @@ #include "directshowpinenum.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.h index b22a45b..6b5203e 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.h @@ -42,8 +42,8 @@ #ifndef DIRECTSHOWPLAYERCONTROL_H #define DIRECTSHOWPLAYERCONTROL_H -#include -#include +#include +#include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp index 93ae3ad..8ad8cff 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp @@ -49,7 +49,7 @@ #include "directshowvideorenderercontrol.h" #include "vmr9videowindowcontrol.h" -#include +#include #include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h index 1a90b7e..a3f94e1 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h @@ -42,10 +42,10 @@ #ifndef DIRECTSHOWPLAYERSERVICE_H #define DIRECTSHOWPLAYERSERVICE_H -#include -#include -#include -#include +#include +#include +#include +#include #include "directshoweventloop.h" #include "directshowglobal.h" diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowvideooutputcontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowvideooutputcontrol.h index c4e9bed..9b857ce 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowvideooutputcontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowvideooutputcontrol.h @@ -42,7 +42,7 @@ #ifndef DIRECTSHOWVIDEOUTPUTCONTROL_H #define DIRECTSHOWVIDEOOUPUTCONTROL_H -#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowvideorenderercontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowvideorenderercontrol.h index c341487..adaa0f8 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowvideorenderercontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowvideorenderercontrol.h @@ -42,7 +42,7 @@ #ifndef DIRECTSHOWVIDEORENDERERCONTROL_H #define DIRECTSHOWVIDEORENDERERCONTROL_H -#include +#include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h b/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h index 5820225..1b3776d 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h @@ -42,7 +42,7 @@ #ifndef MEDIASAMPLEVIDEOBUFFER_H #define MEDIASAMPLEVIDEOBUFFER_H -#include +#include #include diff --git a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.h index 9906fae..702dfd6 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.h @@ -42,7 +42,7 @@ #ifndef VMR9VIDEOWINDOWCONTROL_H #define VMR9VIDEOWINDOWCONTROL_H -#include +#include #include #include diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp index 51d68f9..f51d024 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp @@ -49,77 +49,77 @@ QT_BEGIN_NAMESPACE struct QGstreamerMetaDataKeyLookup { - QtMediaservices::MetaData key; + QtMediaServices::MetaData key; const char *token; }; static const QGstreamerMetaDataKeyLookup qt_gstreamerMetaDataKeys[] = { - { QtMediaservices::Title, GST_TAG_TITLE }, - //{ QtMediaservices::SubTitle, 0 }, - //{ QtMediaservices::Author, 0 }, - { QtMediaservices::Comment, GST_TAG_COMMENT }, - { QtMediaservices::Description, GST_TAG_DESCRIPTION }, - //{ QtMediaservices::Category, 0 }, - { QtMediaservices::Genre, GST_TAG_GENRE }, - { QtMediaservices::Year, "year" }, - //{ QtMediaservices::UserRating, 0 }, - - { QtMediaservices::Language, GST_TAG_LANGUAGE_CODE }, - - { QtMediaservices::Publisher, GST_TAG_ORGANIZATION }, - { QtMediaservices::Copyright, GST_TAG_COPYRIGHT }, - //{ QtMediaservices::ParentalRating, 0 }, - //{ QtMediaservices::RatingOrganisation, 0 }, + { QtMediaServices::Title, GST_TAG_TITLE }, + //{ QtMediaServices::SubTitle, 0 }, + //{ QtMediaServices::Author, 0 }, + { QtMediaServices::Comment, GST_TAG_COMMENT }, + { QtMediaServices::Description, GST_TAG_DESCRIPTION }, + //{ QtMediaServices::Category, 0 }, + { QtMediaServices::Genre, GST_TAG_GENRE }, + { QtMediaServices::Year, "year" }, + //{ QtMediaServices::UserRating, 0 }, + + { QtMediaServices::Language, GST_TAG_LANGUAGE_CODE }, + + { QtMediaServices::Publisher, GST_TAG_ORGANIZATION }, + { QtMediaServices::Copyright, GST_TAG_COPYRIGHT }, + //{ QtMediaServices::ParentalRating, 0 }, + //{ QtMediaServices::RatingOrganisation, 0 }, // Media - //{ QtMediaservices::Size, 0 }, - //{ QtMediaservices::MediaType, 0 }, - { QtMediaservices::Duration, GST_TAG_DURATION }, + //{ QtMediaServices::Size, 0 }, + //{ QtMediaServices::MediaType, 0 }, + { QtMediaServices::Duration, GST_TAG_DURATION }, // Audio - { QtMediaservices::AudioBitRate, GST_TAG_BITRATE }, - { QtMediaservices::AudioCodec, GST_TAG_AUDIO_CODEC }, - //{ QtMediaservices::ChannelCount, 0 }, - //{ QtMediaservices::Frequency, 0 }, + { QtMediaServices::AudioBitRate, GST_TAG_BITRATE }, + { QtMediaServices::AudioCodec, GST_TAG_AUDIO_CODEC }, + //{ QtMediaServices::ChannelCount, 0 }, + //{ QtMediaServices::Frequency, 0 }, // Music - { QtMediaservices::AlbumTitle, GST_TAG_ALBUM }, - { QtMediaservices::AlbumArtist, GST_TAG_ARTIST}, - { QtMediaservices::ContributingArtist, GST_TAG_PERFORMER }, + { QtMediaServices::AlbumTitle, GST_TAG_ALBUM }, + { QtMediaServices::AlbumArtist, GST_TAG_ARTIST}, + { QtMediaServices::ContributingArtist, GST_TAG_PERFORMER }, #if (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19) - { QtMediaservices::Composer, GST_TAG_COMPOSER }, + { QtMediaServices::Composer, GST_TAG_COMPOSER }, #endif - //{ QtMediaservices::Conductor, 0 }, - //{ QtMediaservices::Lyrics, 0 }, - //{ QtMediaservices::Mood, 0 }, - { QtMediaservices::TrackNumber, GST_TAG_TRACK_NUMBER }, + //{ QtMediaServices::Conductor, 0 }, + //{ QtMediaServices::Lyrics, 0 }, + //{ QtMediaServices::Mood, 0 }, + { QtMediaServices::TrackNumber, GST_TAG_TRACK_NUMBER }, - //{ QtMediaservices::CoverArtUrlSmall, 0 }, - //{ QtMediaservices::CoverArtUrlLarge, 0 }, + //{ QtMediaServices::CoverArtUrlSmall, 0 }, + //{ QtMediaServices::CoverArtUrlLarge, 0 }, // Image/Video - //{ QtMediaservices::Resolution, 0 }, - //{ QtMediaservices::PixelAspectRatio, 0 }, + //{ QtMediaServices::Resolution, 0 }, + //{ QtMediaServices::PixelAspectRatio, 0 }, // Video - //{ QtMediaservices::VideoFrameRate, 0 }, - //{ QtMediaservices::VideoBitRate, 0 }, - { QtMediaservices::VideoCodec, GST_TAG_VIDEO_CODEC }, + //{ QtMediaServices::VideoFrameRate, 0 }, + //{ QtMediaServices::VideoBitRate, 0 }, + { QtMediaServices::VideoCodec, GST_TAG_VIDEO_CODEC }, - //{ QtMediaservices::PosterUrl, 0 }, + //{ QtMediaServices::PosterUrl, 0 }, // Movie - //{ QtMediaservices::ChapterNumber, 0 }, - //{ QtMediaservices::Director, 0 }, - { QtMediaservices::LeadPerformer, GST_TAG_PERFORMER }, - //{ QtMediaservices::Writer, 0 }, + //{ QtMediaServices::ChapterNumber, 0 }, + //{ QtMediaServices::Director, 0 }, + { QtMediaServices::LeadPerformer, GST_TAG_PERFORMER }, + //{ QtMediaServices::Writer, 0 }, // Photos - //{ QtMediaservices::CameraManufacturer, 0 }, - //{ QtMediaservices::CameraModel, 0 }, - //{ QtMediaservices::Event, 0 }, - //{ QtMediaservices::Subject, 0 } + //{ QtMediaServices::CameraManufacturer, 0 }, + //{ QtMediaServices::CameraModel, 0 }, + //{ QtMediaServices::Event, 0 }, + //{ QtMediaServices::Subject, 0 } }; QGstreamerMetaDataProvider::QGstreamerMetaDataProvider(QGstreamerPlayerSession *session, QObject *parent) @@ -142,7 +142,7 @@ bool QGstreamerMetaDataProvider::isWritable() const return false; } -QVariant QGstreamerMetaDataProvider::metaData(QtMediaservices::MetaData key) const +QVariant QGstreamerMetaDataProvider::metaData(QtMediaServices::MetaData key) const { static const int count = sizeof(qt_gstreamerMetaDataKeys) / sizeof(QGstreamerMetaDataKeyLookup); @@ -154,15 +154,15 @@ QVariant QGstreamerMetaDataProvider::metaData(QtMediaservices::MetaData key) con return QVariant(); } -void QGstreamerMetaDataProvider::setMetaData(QtMediaservices::MetaData key, QVariant const &value) +void QGstreamerMetaDataProvider::setMetaData(QtMediaServices::MetaData key, QVariant const &value) { Q_UNUSED(key); Q_UNUSED(value); } -QList QGstreamerMetaDataProvider::availableMetaData() const +QList QGstreamerMetaDataProvider::availableMetaData() const { - static QMap keysMap; + static QMap keysMap; if (keysMap.isEmpty()) { const int count = sizeof(qt_gstreamerMetaDataKeys) / sizeof(QGstreamerMetaDataKeyLookup); for (int i = 0; i < count; ++i) { @@ -170,9 +170,9 @@ QList QGstreamerMetaDataProvider::availableMetaData() } } - QList res; + QList res; foreach (const QByteArray &key, m_session->tags().keys()) { - QtMediaservices::MetaData tag = keysMap.value(key, QtMediaservices::MetaData(-1)); + QtMediaServices::MetaData tag = keysMap.value(key, QtMediaServices::MetaData(-1)); if (tag != -1) res.append(tag); } diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.h index 98803c2..4cf716a 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERMETADATAPROVIDER_H #define QGSTREAMERMETADATAPROVIDER_H -#include +#include QT_BEGIN_HEADER @@ -61,9 +61,9 @@ public: bool isMetaDataAvailable() const; bool isWritable() const; - QVariant metaData(QtMediaservices::MetaData key) const; - void setMetaData(QtMediaservices::MetaData key, const QVariant &value); - QList availableMetaData() const; + QVariant metaData(QtMediaServices::MetaData key) const; + void setMetaData(QtMediaServices::MetaData key, const QVariant &value); + QList availableMetaData() const; QVariant extendedMetaData(const QString &key) const ; void setExtendedMetaData(const QString &key, const QVariant &value); diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h index 5239464..c95f37a 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.h @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include #include diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.h index fe4a8a9..1283966 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.h @@ -45,7 +45,7 @@ #include #include -#include +#include #include "qgstreamervideooutputcontrol.h" diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp index 33454d4..724a595 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -812,7 +812,7 @@ void QGstreamerPlayerSession::getStreamsInfo() for (int i=0; i streamProperties; + QMap streamProperties; int streamIndex = i - m_playbin2StreamOffset[streamType]; @@ -834,7 +834,7 @@ void QGstreamerPlayerSession::getStreamsInfo() if (tags && gst_is_tag_list(tags)) { gchar *languageCode = 0; if (gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &languageCode)) - streamProperties[QtMediaservices::Language] = QString::fromUtf8(languageCode); + streamProperties[QtMediaServices::Language] = QString::fromUtf8(languageCode); //qDebug() << "language for setream" << i << QString::fromUtf8(languageCode); g_free (languageCode); @@ -889,8 +889,8 @@ void QGstreamerPlayerSession::getStreamsInfo() // break; // } // -// QMap streamProperties; -// streamProperties[QtMediaservices::Language] = QString::fromUtf8(languageCode); +// QMap streamProperties; +// streamProperties[QtMediaServices::Language] = QString::fromUtf8(languageCode); // // m_streamProperties.append(streamProperties); // m_streamTypes.append(streamType); diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h index 61b5f51..6499a84 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.h @@ -46,7 +46,7 @@ #include #include "qgstreamerplayercontrol.h" #include "qgstreamerbushelper.h" -#include +#include //#include #include @@ -92,7 +92,7 @@ public: void setPlaybackRate(qreal rate); QMap tags() const { return m_tags; } - QMap streamProperties(int streamNumber) const { return m_streamProperties[streamNumber]; } + QMap streamProperties(int streamNumber) const { return m_streamProperties[streamNumber]; } // int streamCount() const { return m_streamProperties.count(); } // QMediaStreamsControl::StreamType streamType(int streamNumber) { return m_streamTypes.value(streamNumber, QMediaStreamsControl::UnknownStream); } // @@ -153,7 +153,7 @@ private: QGstreamerVideoRendererInterface *m_renderer; QMap m_tags; - QList< QMap > m_streamProperties; + QList< QMap > m_streamProperties; // QList m_streamTypes; // QMap m_playbin2StreamOffset; diff --git a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp index 443e738..0ca7d54 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp +++ b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.cpp @@ -52,7 +52,7 @@ #ifdef QMEDIA_GSTREAMER_CAPTURE #include "qgstreamercaptureservice.h" #endif -#include +#include #ifdef QMEDIA_GSTREAMER_CAPTURE #include diff --git a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.h b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.h index 6908bb3..e0a5dfd 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamerserviceplugin.h @@ -43,7 +43,7 @@ #ifndef QGSTREAMERSERVICEPLUGIN_H #define QGSTREAMERSERVICEPLUGIN_H -#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.h b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.h index 35174cf..7994f9c 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEOINPUTDEVICECONTROL_H #define QGSTREAMERVIDEOINPUTDEVICECONTROL_H -#include +#include #include diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.h b/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.h index c4d76a4..6d7d47f 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEOOUTPUTCONTROL_H #define QGSTREAMERVIDEOOUTPUTCONTROL_H -#include +#include #include diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.h b/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.h index 63079c8..f44c25b 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEOOVERLAY_H #define QGSTREAMERVIDEOOVERLAY_H -#include +#include #include "qgstreamervideorendererinterface.h" diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.h b/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.h index 903ffbb..0fbbd63 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEORENDERER_H #define QGSTREAMERVIDEORENDERER_H -#include +#include #include "qvideosurfacegstsink.h" #include "qgstreamervideorendererinterface.h" diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h index e99a3cf..d54a1fc 100644 --- a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h +++ b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.h @@ -42,7 +42,7 @@ #ifndef QGSTREAMERVIDEOWIDGET_H #define QGSTREAMERVIDEOWIDGET_H -#include +#include #include "qgstreamervideorendererinterface.h" diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.h index a546ca1..5ac97b1 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.h +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.h @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.mm index 90c6035..ba22552 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playercontrol.mm @@ -42,7 +42,7 @@ #include "qt7playercontrol.h" #include "qt7playersession.h" -#include +#include #include #include diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.h index e13df95..8cbc29a 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.h +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.h @@ -42,7 +42,7 @@ #ifndef QT7PLAYERMETADATACONTROL_H #define QT7PLAYERMETADATACONTROL_H -#include +#include QT_BEGIN_HEADER @@ -61,9 +61,9 @@ public: bool isMetaDataAvailable() const; bool isWritable() const; - QVariant metaData(QtMediaservices::MetaData key) const; - void setMetaData(QtMediaservices::MetaData key, const QVariant &value); - QList availableMetaData() const; + QVariant metaData(QtMediaServices::MetaData key) const; + void setMetaData(QtMediaServices::MetaData key, const QVariant &value); + QList availableMetaData() const; QVariant extendedMetaData(const QString &key) const ; void setExtendedMetaData(const QString &key, const QVariant &value); @@ -74,7 +74,7 @@ private slots: private: QT7PlayerSession *m_session; - QMap m_tags; + QMap m_tags; }; QT_END_NAMESPACE diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm index e12daf5..2ea778d 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm @@ -72,18 +72,18 @@ bool QT7PlayerMetaDataControl::isWritable() const return false; } -QVariant QT7PlayerMetaDataControl::metaData(QtMediaservices::MetaData key) const +QVariant QT7PlayerMetaDataControl::metaData(QtMediaServices::MetaData key) const { return m_tags.value(key); } -void QT7PlayerMetaDataControl::setMetaData(QtMediaservices::MetaData key, QVariant const &value) +void QT7PlayerMetaDataControl::setMetaData(QtMediaServices::MetaData key, QVariant const &value) { Q_UNUSED(key); Q_UNUSED(value); } -QList QT7PlayerMetaDataControl::availableMetaData() const +QList QT7PlayerMetaDataControl::availableMetaData() const { return m_tags.keys(); } @@ -256,13 +256,13 @@ void QT7PlayerMetaDataControl::updateTags() metaMap.insert(QLatin1String("nam"), QString::fromUtf8([name UTF8String])); #endif // QUICKTIME_C_API_AVAILABLE - m_tags.insert(QtMediaservices::AlbumArtist, metaMap.value(QLatin1String("ART"))); - m_tags.insert(QtMediaservices::AlbumTitle, metaMap.value(QLatin1String("alb"))); - m_tags.insert(QtMediaservices::Title, metaMap.value(QLatin1String("nam"))); - m_tags.insert(QtMediaservices::Date, metaMap.value(QLatin1String("day"))); - m_tags.insert(QtMediaservices::Genre, metaMap.value(QLatin1String("gnre"))); - m_tags.insert(QtMediaservices::TrackNumber, metaMap.value(QLatin1String("trk"))); - m_tags.insert(QtMediaservices::Description, metaMap.value(QLatin1String("des"))); + m_tags.insert(QtMediaServices::AlbumArtist, metaMap.value(QLatin1String("ART"))); + m_tags.insert(QtMediaServices::AlbumTitle, metaMap.value(QLatin1String("alb"))); + m_tags.insert(QtMediaServices::Title, metaMap.value(QLatin1String("nam"))); + m_tags.insert(QtMediaServices::Date, metaMap.value(QLatin1String("day"))); + m_tags.insert(QtMediaServices::Genre, metaMap.value(QLatin1String("gnre"))); + m_tags.insert(QtMediaServices::TrackNumber, metaMap.value(QLatin1String("trk"))); + m_tags.insert(QtMediaServices::Description, metaMap.value(QLatin1String("des"))); } if (!wasEmpty || !m_tags.isEmpty()) diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.h index 3d3a3ff..9a22c31 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.h +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.h @@ -43,7 +43,7 @@ #define QT7PLAYERSERVICE_H #include -#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm index 0b3505e..cf79622 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm @@ -54,8 +54,8 @@ #include "qt7movievideowidget.h" #include "qt7playermetadata.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h index 780776c..2450cf8 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm index 863b3c8..024f7b0 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm @@ -49,7 +49,7 @@ #include "qt7videooutputcontrol.h" #include -#include +#include #include #include diff --git a/src/plugins/mediaservices/qt7/qt7movieviewoutput.h b/src/plugins/mediaservices/qt7/qt7movieviewoutput.h index ed3eebc..d6bfd14 100644 --- a/src/plugins/mediaservices/qt7/qt7movieviewoutput.h +++ b/src/plugins/mediaservices/qt7/qt7movieviewoutput.h @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include #include #include "qt7videooutputcontrol.h" diff --git a/src/plugins/mediaservices/qt7/qt7movieviewrenderer.h b/src/plugins/mediaservices/qt7/qt7movieviewrenderer.h index 334ea6a..fa4db4d 100644 --- a/src/plugins/mediaservices/qt7/qt7movieviewrenderer.h +++ b/src/plugins/mediaservices/qt7/qt7movieviewrenderer.h @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include #include #include "qt7videooutputcontrol.h" diff --git a/src/plugins/mediaservices/qt7/qt7serviceplugin.h b/src/plugins/mediaservices/qt7/qt7serviceplugin.h index 7e8acf9..3871e10 100644 --- a/src/plugins/mediaservices/qt7/qt7serviceplugin.h +++ b/src/plugins/mediaservices/qt7/qt7serviceplugin.h @@ -43,7 +43,7 @@ #ifndef QT7SERVICEPLUGIN_H #define QT7SERVICEPLUGIN_H -#include +#include QT_BEGIN_HEADER diff --git a/src/plugins/mediaservices/qt7/qt7serviceplugin.mm b/src/plugins/mediaservices/qt7/qt7serviceplugin.mm index fe4ca44..92b472f 100644 --- a/src/plugins/mediaservices/qt7/qt7serviceplugin.mm +++ b/src/plugins/mediaservices/qt7/qt7serviceplugin.mm @@ -45,7 +45,7 @@ #include "qt7serviceplugin.h" #include "qt7playerservice.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/mediaservices/qt7/qt7videooutputcontrol.h b/src/plugins/mediaservices/qt7/qt7videooutputcontrol.h index 39a13ee..76066ba 100644 --- a/src/plugins/mediaservices/qt7/qt7videooutputcontrol.h +++ b/src/plugins/mediaservices/qt7/qt7videooutputcontrol.h @@ -45,11 +45,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 2afc94b..d803e74 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1788,10 +1788,10 @@ 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("MEDIASERVICES", "no", "-no-mediaservices","Do not compile the QtMediaservices module"); - desc("MEDIASERVICES", "yes","-mediaservices", "Compile in QtMediaservices module"); - desc("MEDIA_BACKEND", "no","-no-media-backend", "Do not compile in the platform-specific QtMediaservices media service."); - desc("MEDIA_BACKEND", "yes","-media-backend", "Compile in the platform-specific QtMediaservices media service."); + desc("MEDIASERVICES", "no", "-no-mediaservices","Do not compile the QtMediaServices module"); + desc("MEDIASERVICES", "yes","-mediaservices", "Compile in QtMediaServices module"); + desc("MEDIA_BACKEND", "no","-no-media-backend", "Do not compile in the platform-specific QtMediaServices media service."); + desc("MEDIA_BACKEND", "yes","-media-backend", "Compile in the platform-specific QtMediaServices 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."); @@ -3347,7 +3347,7 @@ void Configure::displayConfig() cout << "QtXmlPatterns support......." << dictionary[ "XMLPATTERNS" ] << endl; cout << "Phonon support.............." << dictionary[ "PHONON" ] << endl; cout << "QtMultimedia support........" << dictionary[ "MULTIMEDIA" ] << endl; - cout << "QtMediaservices support....." << dictionary[ "MEDIASERVICES" ] << endl; + cout << "QtMediaServices support....." << dictionary[ "MEDIASERVICES" ] << endl; cout << "WebKit support.............." << dictionary[ "WEBKIT" ] << endl; cout << "Declarative support........." << dictionary[ "DECLARATIVE" ] << endl; cout << "QtScript support............" << dictionary[ "SCRIPT" ] << endl; -- cgit v0.12 From 690e0f27ae23189200d98e9300b63914d8e1fe30 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Fri, 16 Apr 2010 12:24:01 +1000 Subject: WebKit; build with change to mediaservices. Reviewed-by: Dmytro Poplavskiy --- .../webkit/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp index 66ffe23..5db94a8 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp @@ -77,7 +77,7 @@ MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& mime, c if (!mime.startsWith("audio/") && !mime.startsWith("video/")) return MediaPlayer::IsNotSupported; - if (QMediaPlayer::hasSupport(mime, QStringList(codec)) >= QtMultimedia::ProbablySupported) + if (QMediaPlayer::hasSupport(mime, QStringList(codec)) >= QtMediaServices::ProbablySupported) return MediaPlayer::IsSupported; return MediaPlayer::MayBeSupported; @@ -344,8 +344,8 @@ unsigned MediaPlayerPrivate::bytesLoaded() const unsigned MediaPlayerPrivate::totalBytes() const { - if (m_mediaPlayer->availableMetaData().contains(QtMultimedia::Size)) - return m_mediaPlayer->metaData(QtMultimedia::Size).toInt(); + if (m_mediaPlayer->availableMetaData().contains(QtMediaServices::Size)) + return m_mediaPlayer->metaData(QtMediaServices::Size).toInt(); return 100; } -- cgit v0.12 From de435ffb63c39bc44045ab4e96282c1bc1836feb Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 16 Apr 2010 12:41:46 +1000 Subject: Cleanup --- src/declarative/qml/qdeclarativeengine.cpp | 4 ++-- src/declarative/qml/qdeclarativeengine_p.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 96145fb..76cd810 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1284,7 +1284,7 @@ QScriptValue QDeclarativeEnginePrivate::consoleLog(QScriptContext *ctxt, QScript return e->newVariant(QVariant(true)); } -void QDeclarativeEnginePrivate::sendQuit () +void QDeclarativeEnginePrivate::sendQuit() { Q_Q(QDeclarativeEngine); emit q->quit(); @@ -1293,7 +1293,7 @@ void QDeclarativeEnginePrivate::sendQuit () QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptEngine *e) { QDeclarativeEnginePrivate *qe = get (e); - qe->sendQuit (); + qe->sendQuit(); return QScriptValue(); } diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h index b3bba43..43d329c 100644 --- a/src/declarative/qml/qdeclarativeengine_p.h +++ b/src/declarative/qml/qdeclarativeengine_p.h @@ -311,7 +311,7 @@ public: QScriptValue scriptValueFromVariant(const QVariant &); QVariant scriptValueToVariant(const QScriptValue &, int hint = QVariant::Invalid); - void sendQuit (); + void sendQuit(); static QScriptValue qmlScriptObject(QObject*, QDeclarativeEngine*); -- cgit v0.12 From 2a26cf1a76c954f8e619b24d61650a0adf655551 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Fri, 16 Apr 2010 12:53:44 +1000 Subject: Fixed configure check for gstreamer. Gstreamer should be detected not only when phonon or mediaservices are enabled, but also when they are not disabled. Reviewed-by: Justin McPherson --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index fc26a7a..fa7c018 100755 --- a/configure +++ b/configure @@ -5196,7 +5196,7 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then fi # Auto-detect GStreamer support (needed for both Phonon & QtMultimedia) - if [ "$CFG_PHONON" = "yes" -o "$CFG_MEDIASERVICES" = "yes" ]; then + if [ "$CFG_PHONON" != "no" -o "$CFG_MEDIASERVICES" != "no" ]; then if [ "$CFG_GLIB" = "yes" -a "$CFG_GSTREAMER" != "no" ]; then if [ -n "$PKG_CONFIG" ]; then QT_CFLAGS_GSTREAMER=`$PKG_CONFIG --cflags gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null` -- cgit v0.12 From 6514ecd97cb455082b6e6a3521dee7c623e6393d Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Fri, 16 Apr 2010 13:06:10 +1000 Subject: Add EXPORT defines for QtMediaServices library. Reviewed-by: Justin McPherson --- src/corelib/global/qglobal.h | 8 ++++++++ src/multimedia/mediaservices/base/qgraphicsvideoitem.h | 2 +- .../mediaservices/base/qlocalmediaplaylistprovider.h | 2 +- src/multimedia/mediaservices/base/qmediacontent.h | 2 +- src/multimedia/mediaservices/base/qmediacontrol.h | 2 +- src/multimedia/mediaservices/base/qmediaobject.h | 2 +- src/multimedia/mediaservices/base/qmediaplaylist.h | 2 +- .../mediaservices/base/qmediaplaylistcontrol.h | 2 +- .../mediaservices/base/qmediaplaylistioplugin.h | 8 ++++---- .../mediaservices/base/qmediaplaylistnavigator.h | 2 +- .../mediaservices/base/qmediaplaylistprovider.h | 2 +- src/multimedia/mediaservices/base/qmediaresource.h | 2 +- src/multimedia/mediaservices/base/qmediaservice.h | 2 +- .../mediaservices/base/qmediaserviceprovider.h | 4 ++-- .../mediaservices/base/qmediaserviceproviderplugin.h | 10 +++++----- src/multimedia/mediaservices/base/qmediatimerange.h | 16 ++++++++-------- src/multimedia/mediaservices/base/qmetadatacontrol.h | 2 +- .../mediaservices/base/qpaintervideosurface_p.h | 2 +- src/multimedia/mediaservices/base/qvideodevicecontrol.h | 2 +- src/multimedia/mediaservices/base/qvideooutputcontrol.h | 2 +- .../mediaservices/base/qvideorenderercontrol.h | 2 +- src/multimedia/mediaservices/base/qvideowidget.h | 2 +- src/multimedia/mediaservices/base/qvideowidgetcontrol.h | 2 +- src/multimedia/mediaservices/base/qvideowindowcontrol.h | 2 +- src/multimedia/mediaservices/effects/qsoundeffect_p.h | 2 +- src/multimedia/mediaservices/playback/qmediaplayer.h | 2 +- .../mediaservices/playback/qmediaplayercontrol.h | 2 +- 27 files changed, 49 insertions(+), 41 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 3118f8f..8359637 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1243,6 +1243,11 @@ class QDataStream; # else # define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT # endif +# if defined(QT_BUILD_MEDIASERVICES_LIB) +# define Q_MEDIASERVICES_EXPORT Q_DECL_EXPORT +# else +# define Q_MEDIASERVICES_EXPORT Q_DECL_IMPORT +# endif # if defined(QT_BUILD_OPENVG_LIB) # define Q_OPENVG_EXPORT Q_DECL_EXPORT # else @@ -1289,6 +1294,7 @@ class QDataStream; # define Q_CANVAS_EXPORT Q_DECL_IMPORT # define Q_OPENGL_EXPORT Q_DECL_IMPORT # define Q_MULTIMEDIA_EXPORT Q_DECL_IMPORT +# define Q_MEDIASERVICES_EXPORT Q_DECL_IMPORT # define Q_OPENVG_EXPORT Q_DECL_IMPORT # define Q_XML_EXPORT Q_DECL_IMPORT # define Q_XMLPATTERNS_EXPORT Q_DECL_IMPORT @@ -1317,6 +1323,7 @@ class QDataStream; # define Q_DECLARATIVE_EXPORT Q_DECL_EXPORT # define Q_OPENGL_EXPORT Q_DECL_EXPORT # define Q_MULTIMEDIA_EXPORT Q_DECL_EXPORT +# define Q_MEDIASERVICES_EXPORT Q_DECL_EXPORT # define Q_OPENVG_EXPORT Q_DECL_EXPORT # define Q_XML_EXPORT Q_DECL_EXPORT # define Q_XMLPATTERNS_EXPORT Q_DECL_EXPORT @@ -1332,6 +1339,7 @@ class QDataStream; # define Q_DECLARATIVE_EXPORT # define Q_OPENGL_EXPORT # define Q_MULTIMEDIA_EXPORT +# define Q_MEDIASERVICES_EXPORT # define Q_XML_EXPORT # define Q_XMLPATTERNS_EXPORT # define Q_SCRIPT_EXPORT diff --git a/src/multimedia/mediaservices/base/qgraphicsvideoitem.h b/src/multimedia/mediaservices/base/qgraphicsvideoitem.h index bb41075..679b353 100644 --- a/src/multimedia/mediaservices/base/qgraphicsvideoitem.h +++ b/src/multimedia/mediaservices/base/qgraphicsvideoitem.h @@ -57,7 +57,7 @@ QT_MODULE(Multimedia) class QVideoSurfaceFormat; class QGraphicsVideoItemPrivate; -class Q_MULTIMEDIA_EXPORT QGraphicsVideoItem : public QGraphicsObject +class Q_MEDIASERVICES_EXPORT QGraphicsVideoItem : public QGraphicsObject { Q_OBJECT Q_PROPERTY(QMediaObject* mediaObject READ mediaObject WRITE setMediaObject) diff --git a/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h index e6b6dca..4dd53df 100644 --- a/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h +++ b/src/multimedia/mediaservices/base/qlocalmediaplaylistprovider.h @@ -52,7 +52,7 @@ QT_MODULE(Multimedia) class QLocalMediaPlaylistProviderPrivate; -class Q_MULTIMEDIA_EXPORT QLocalMediaPlaylistProvider : public QMediaPlaylistProvider +class Q_MEDIASERVICES_EXPORT QLocalMediaPlaylistProvider : public QMediaPlaylistProvider { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qmediacontent.h b/src/multimedia/mediaservices/base/qmediacontent.h index 47fa6e1..c00e443 100644 --- a/src/multimedia/mediaservices/base/qmediacontent.h +++ b/src/multimedia/mediaservices/base/qmediacontent.h @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) class QMediaContentPrivate; -class Q_MULTIMEDIA_EXPORT QMediaContent +class Q_MEDIASERVICES_EXPORT QMediaContent { public: QMediaContent(); diff --git a/src/multimedia/mediaservices/base/qmediacontrol.h b/src/multimedia/mediaservices/base/qmediacontrol.h index 819c959..941c004 100644 --- a/src/multimedia/mediaservices/base/qmediacontrol.h +++ b/src/multimedia/mediaservices/base/qmediacontrol.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) class QMediaControlPrivate; -class Q_MULTIMEDIA_EXPORT QMediaControl : public QObject +class Q_MEDIASERVICES_EXPORT QMediaControl : public QObject { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qmediaobject.h b/src/multimedia/mediaservices/base/qmediaobject.h index 70b4f33..067bb56 100644 --- a/src/multimedia/mediaservices/base/qmediaobject.h +++ b/src/multimedia/mediaservices/base/qmediaobject.h @@ -56,7 +56,7 @@ QT_MODULE(Multimedia) class QMediaService; class QMediaObjectPrivate; -class Q_MULTIMEDIA_EXPORT QMediaObject : public QObject +class Q_MEDIASERVICES_EXPORT QMediaObject : public QObject { Q_OBJECT Q_PROPERTY(int notifyInterval READ notifyInterval WRITE setNotifyInterval NOTIFY notifyIntervalChanged) diff --git a/src/multimedia/mediaservices/base/qmediaplaylist.h b/src/multimedia/mediaservices/base/qmediaplaylist.h index 9125fd6..6cae7c5 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylist.h +++ b/src/multimedia/mediaservices/base/qmediaplaylist.h @@ -57,7 +57,7 @@ QT_MODULE(Multimedia) class QMediaPlaylistProvider; class QMediaPlaylistPrivate; -class Q_MULTIMEDIA_EXPORT QMediaPlaylist : public QObject +class Q_MEDIASERVICES_EXPORT QMediaPlaylist : public QObject { Q_OBJECT Q_PROPERTY(QMediaPlaylist::PlaybackMode playbackMode READ playbackMode WRITE setPlaybackMode NOTIFY playbackModeChanged) diff --git a/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h index 36f00ae..2dc4575 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h +++ b/src/multimedia/mediaservices/base/qmediaplaylistcontrol.h @@ -56,7 +56,7 @@ QT_MODULE(Multimedia) class QMediaPlaylistProvider; -class Q_MULTIMEDIA_EXPORT QMediaPlaylistControl : public QMediaControl +class Q_MEDIASERVICES_EXPORT QMediaPlaylistControl : public QMediaControl { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h index 5fc10f7..ed8e832 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h +++ b/src/multimedia/mediaservices/base/qmediaplaylistioplugin.h @@ -62,7 +62,7 @@ class QByteArray; class QIODevice; class QStringList; -class Q_MULTIMEDIA_EXPORT QMediaPlaylistReader +class Q_MEDIASERVICES_EXPORT QMediaPlaylistReader { public: virtual ~QMediaPlaylistReader(); @@ -72,7 +72,7 @@ public: virtual void close() = 0; }; -class Q_MULTIMEDIA_EXPORT QMediaPlaylistWriter +class Q_MEDIASERVICES_EXPORT QMediaPlaylistWriter { public: virtual ~QMediaPlaylistWriter(); @@ -81,7 +81,7 @@ public: virtual void close() = 0; }; -struct Q_MULTIMEDIA_EXPORT QMediaPlaylistIOInterface : public QFactoryInterface +struct Q_MEDIASERVICES_EXPORT QMediaPlaylistIOInterface : public QFactoryInterface { virtual bool canRead(QIODevice *device, const QByteArray &format = QByteArray() ) const = 0; virtual bool canRead(const QUrl& location, const QByteArray &format = QByteArray()) const = 0; @@ -97,7 +97,7 @@ struct Q_MULTIMEDIA_EXPORT QMediaPlaylistIOInterface : public QFactoryInterface #define QMediaPlaylistIOInterface_iid "com.nokia.Qt.QMediaPlaylistIOInterface" Q_DECLARE_INTERFACE(QMediaPlaylistIOInterface, QMediaPlaylistIOInterface_iid); -class Q_MULTIMEDIA_EXPORT QMediaPlaylistIOPlugin : public QObject, public QMediaPlaylistIOInterface +class Q_MEDIASERVICES_EXPORT QMediaPlaylistIOPlugin : public QObject, public QMediaPlaylistIOInterface { Q_OBJECT Q_INTERFACES(QMediaPlaylistIOInterface:QFactoryInterface) diff --git a/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h index 6cb9d9c..42c76f9 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h +++ b/src/multimedia/mediaservices/base/qmediaplaylistnavigator.h @@ -56,7 +56,7 @@ QT_MODULE(Multimedia) class QMediaPlaylistNavigatorPrivate; -class Q_MULTIMEDIA_EXPORT QMediaPlaylistNavigator : public QObject +class Q_MEDIASERVICES_EXPORT QMediaPlaylistNavigator : public QObject { Q_OBJECT Q_PROPERTY(QMediaPlaylist::PlaybackMode playbackMode READ playbackMode WRITE setPlaybackMode NOTIFY playbackModeChanged) diff --git a/src/multimedia/mediaservices/base/qmediaplaylistprovider.h b/src/multimedia/mediaservices/base/qmediaplaylistprovider.h index 31e6d5f..c68ed89 100644 --- a/src/multimedia/mediaservices/base/qmediaplaylistprovider.h +++ b/src/multimedia/mediaservices/base/qmediaplaylistprovider.h @@ -58,7 +58,7 @@ class QString; class QMediaPlaylistProviderPrivate; -class Q_MULTIMEDIA_EXPORT QMediaPlaylistProvider : public QObject +class Q_MEDIASERVICES_EXPORT QMediaPlaylistProvider : public QObject { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qmediaresource.h b/src/multimedia/mediaservices/base/qmediaresource.h index 5c381ba..0ecf008 100644 --- a/src/multimedia/mediaservices/base/qmediaresource.h +++ b/src/multimedia/mediaservices/base/qmediaresource.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) -class Q_MULTIMEDIA_EXPORT QMediaResource +class Q_MEDIASERVICES_EXPORT QMediaResource { public: QMediaResource(); diff --git a/src/multimedia/mediaservices/base/qmediaservice.h b/src/multimedia/mediaservices/base/qmediaservice.h index 3963348..5df3fd7 100644 --- a/src/multimedia/mediaservices/base/qmediaservice.h +++ b/src/multimedia/mediaservices/base/qmediaservice.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) class QMediaServicePrivate; -class Q_MULTIMEDIA_EXPORT QMediaService : public QObject +class Q_MEDIASERVICES_EXPORT QMediaService : public QObject { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qmediaserviceprovider.h b/src/multimedia/mediaservices/base/qmediaserviceprovider.h index 24d2078..eeea5d2 100644 --- a/src/multimedia/mediaservices/base/qmediaserviceprovider.h +++ b/src/multimedia/mediaservices/base/qmediaserviceprovider.h @@ -57,7 +57,7 @@ QT_MODULE(Multimedia) class QMediaService; class QMediaServiceProviderHintPrivate; -class Q_MULTIMEDIA_EXPORT QMediaServiceProviderHint +class Q_MEDIASERVICES_EXPORT QMediaServiceProviderHint { public: enum Type { Null, ContentType, Device, SupportedFeatures }; @@ -98,7 +98,7 @@ private: QSharedDataPointer d; }; -class Q_MULTIMEDIA_EXPORT QMediaServiceProvider : public QObject +class Q_MEDIASERVICES_EXPORT QMediaServiceProvider : public QObject { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h b/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h index ab55f84..ca25f91 100644 --- a/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h +++ b/src/multimedia/mediaservices/base/qmediaserviceproviderplugin.h @@ -61,7 +61,7 @@ QT_MODULE(Multimedia) class QMediaService; -struct Q_MULTIMEDIA_EXPORT QMediaServiceProviderFactoryInterface : public QFactoryInterface +struct Q_MEDIASERVICES_EXPORT QMediaServiceProviderFactoryInterface : public QFactoryInterface { virtual QStringList keys() const = 0; virtual QMediaService* create(QString const& key) = 0; @@ -73,7 +73,7 @@ struct Q_MULTIMEDIA_EXPORT QMediaServiceProviderFactoryInterface : public QFacto Q_DECLARE_INTERFACE(QMediaServiceProviderFactoryInterface, QMediaServiceProviderFactoryInterface_iid) -struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedFormatsInterface +struct Q_MEDIASERVICES_EXPORT QMediaServiceSupportedFormatsInterface { virtual ~QMediaServiceSupportedFormatsInterface() {} virtual QtMediaServices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const = 0; @@ -85,7 +85,7 @@ struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedFormatsInterface Q_DECLARE_INTERFACE(QMediaServiceSupportedFormatsInterface, QMediaServiceSupportedFormatsInterface_iid) -struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedDevicesInterface +struct Q_MEDIASERVICES_EXPORT QMediaServiceSupportedDevicesInterface { virtual ~QMediaServiceSupportedDevicesInterface() {} virtual QList devices(const QByteArray &service) const = 0; @@ -97,7 +97,7 @@ struct Q_MULTIMEDIA_EXPORT QMediaServiceSupportedDevicesInterface Q_DECLARE_INTERFACE(QMediaServiceSupportedDevicesInterface, QMediaServiceSupportedDevicesInterface_iid) -struct Q_MULTIMEDIA_EXPORT QMediaServiceFeaturesInterface +struct Q_MEDIASERVICES_EXPORT QMediaServiceFeaturesInterface { virtual ~QMediaServiceFeaturesInterface() {} virtual QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const = 0; @@ -107,7 +107,7 @@ struct Q_MULTIMEDIA_EXPORT QMediaServiceFeaturesInterface "com.nokia.Qt.QMediaServiceFeaturesInterface/1.0" Q_DECLARE_INTERFACE(QMediaServiceFeaturesInterface, QMediaServiceFeaturesInterface_iid) -class Q_MULTIMEDIA_EXPORT QMediaServiceProviderPlugin : public QObject, public QMediaServiceProviderFactoryInterface +class Q_MEDIASERVICES_EXPORT QMediaServiceProviderPlugin : public QObject, public QMediaServiceProviderFactoryInterface { Q_OBJECT Q_INTERFACES(QMediaServiceProviderFactoryInterface:QFactoryInterface) diff --git a/src/multimedia/mediaservices/base/qmediatimerange.h b/src/multimedia/mediaservices/base/qmediatimerange.h index 33b2f27..5983db2 100644 --- a/src/multimedia/mediaservices/base/qmediatimerange.h +++ b/src/multimedia/mediaservices/base/qmediatimerange.h @@ -54,7 +54,7 @@ QT_MODULE(Multimedia) class QMediaTimeRangePrivate; -class Q_MULTIMEDIA_EXPORT QMediaTimeInterval +class Q_MEDIASERVICES_EXPORT QMediaTimeInterval { public: QMediaTimeInterval(); @@ -78,10 +78,10 @@ private: qint64 e; }; -Q_MULTIMEDIA_EXPORT bool operator==(const QMediaTimeInterval&, const QMediaTimeInterval&); -Q_MULTIMEDIA_EXPORT bool operator!=(const QMediaTimeInterval&, const QMediaTimeInterval&); +Q_MEDIASERVICES_EXPORT bool operator==(const QMediaTimeInterval&, const QMediaTimeInterval&); +Q_MEDIASERVICES_EXPORT bool operator!=(const QMediaTimeInterval&, const QMediaTimeInterval&); -class Q_MULTIMEDIA_EXPORT QMediaTimeRange +class Q_MEDIASERVICES_EXPORT QMediaTimeRange { public: @@ -122,10 +122,10 @@ private: QSharedDataPointer d; }; -Q_MULTIMEDIA_EXPORT bool operator==(const QMediaTimeRange&, const QMediaTimeRange&); -Q_MULTIMEDIA_EXPORT bool operator!=(const QMediaTimeRange&, const QMediaTimeRange&); -Q_MULTIMEDIA_EXPORT QMediaTimeRange operator+(const QMediaTimeRange&, const QMediaTimeRange&); -Q_MULTIMEDIA_EXPORT QMediaTimeRange operator-(const QMediaTimeRange&, const QMediaTimeRange&); +Q_MEDIASERVICES_EXPORT bool operator==(const QMediaTimeRange&, const QMediaTimeRange&); +Q_MEDIASERVICES_EXPORT bool operator!=(const QMediaTimeRange&, const QMediaTimeRange&); +Q_MEDIASERVICES_EXPORT QMediaTimeRange operator+(const QMediaTimeRange&, const QMediaTimeRange&); +Q_MEDIASERVICES_EXPORT QMediaTimeRange operator-(const QMediaTimeRange&, const QMediaTimeRange&); QT_END_NAMESPACE diff --git a/src/multimedia/mediaservices/base/qmetadatacontrol.h b/src/multimedia/mediaservices/base/qmetadatacontrol.h index e91c88b..48206fa 100644 --- a/src/multimedia/mediaservices/base/qmetadatacontrol.h +++ b/src/multimedia/mediaservices/base/qmetadatacontrol.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) -class Q_MULTIMEDIA_EXPORT QMetaDataControl : public QMediaControl +class Q_MEDIASERVICES_EXPORT QMetaDataControl : public QMediaControl { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qpaintervideosurface_p.h b/src/multimedia/mediaservices/base/qpaintervideosurface_p.h index 20628c4..07b7e01 100644 --- a/src/multimedia/mediaservices/base/qpaintervideosurface_p.h +++ b/src/multimedia/mediaservices/base/qpaintervideosurface_p.h @@ -89,7 +89,7 @@ public: virtual void updateColors(int brightness, int contrast, int hue, int saturation) = 0; }; -class Q_MULTIMEDIA_EXPORT QPainterVideoSurface : public QAbstractVideoSurface +class Q_MEDIASERVICES_EXPORT QPainterVideoSurface : public QAbstractVideoSurface { Q_OBJECT public: diff --git a/src/multimedia/mediaservices/base/qvideodevicecontrol.h b/src/multimedia/mediaservices/base/qvideodevicecontrol.h index b86a35c..0b9235b 100644 --- a/src/multimedia/mediaservices/base/qvideodevicecontrol.h +++ b/src/multimedia/mediaservices/base/qvideodevicecontrol.h @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) -class Q_MULTIMEDIA_EXPORT QVideoDeviceControl : public QMediaControl +class Q_MEDIASERVICES_EXPORT QVideoDeviceControl : public QMediaControl { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qvideooutputcontrol.h b/src/multimedia/mediaservices/base/qvideooutputcontrol.h index ad69911..f87bb3c 100644 --- a/src/multimedia/mediaservices/base/qvideooutputcontrol.h +++ b/src/multimedia/mediaservices/base/qvideooutputcontrol.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) -class Q_MULTIMEDIA_EXPORT QVideoOutputControl : public QMediaControl +class Q_MEDIASERVICES_EXPORT QVideoOutputControl : public QMediaControl { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qvideorenderercontrol.h b/src/multimedia/mediaservices/base/qvideorenderercontrol.h index 29a66ea..28e3d85 100644 --- a/src/multimedia/mediaservices/base/qvideorenderercontrol.h +++ b/src/multimedia/mediaservices/base/qvideorenderercontrol.h @@ -53,7 +53,7 @@ QT_MODULE(Multimedia) class QAbstractVideoSurface; -class Q_MULTIMEDIA_EXPORT QVideoRendererControl : public QMediaControl +class Q_MEDIASERVICES_EXPORT QVideoRendererControl : public QMediaControl { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qvideowidget.h b/src/multimedia/mediaservices/base/qvideowidget.h index 8033d40..3722857 100644 --- a/src/multimedia/mediaservices/base/qvideowidget.h +++ b/src/multimedia/mediaservices/base/qvideowidget.h @@ -55,7 +55,7 @@ QT_MODULE(Multimedia) class QMediaObject; class QVideoWidgetPrivate; -class Q_MULTIMEDIA_EXPORT QVideoWidget : public QWidget +class Q_MEDIASERVICES_EXPORT QVideoWidget : public QWidget { Q_OBJECT Q_PROPERTY(QMediaObject* mediaObject READ mediaObject WRITE setMediaObject) diff --git a/src/multimedia/mediaservices/base/qvideowidgetcontrol.h b/src/multimedia/mediaservices/base/qvideowidgetcontrol.h index 1fe43cc..1013beb 100644 --- a/src/multimedia/mediaservices/base/qvideowidgetcontrol.h +++ b/src/multimedia/mediaservices/base/qvideowidgetcontrol.h @@ -57,7 +57,7 @@ QT_MODULE(Multimedia) class QVideoWidgetControlPrivate; -class Q_MULTIMEDIA_EXPORT QVideoWidgetControl : public QMediaControl +class Q_MEDIASERVICES_EXPORT QVideoWidgetControl : public QMediaControl { Q_OBJECT diff --git a/src/multimedia/mediaservices/base/qvideowindowcontrol.h b/src/multimedia/mediaservices/base/qvideowindowcontrol.h index 74c1786..47ba520 100644 --- a/src/multimedia/mediaservices/base/qvideowindowcontrol.h +++ b/src/multimedia/mediaservices/base/qvideowindowcontrol.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Multimedia) -class Q_MULTIMEDIA_EXPORT QVideoWindowControl : public QMediaControl +class Q_MEDIASERVICES_EXPORT QVideoWindowControl : public QMediaControl { Q_OBJECT diff --git a/src/multimedia/mediaservices/effects/qsoundeffect_p.h b/src/multimedia/mediaservices/effects/qsoundeffect_p.h index 419e4f8..64ddb77 100644 --- a/src/multimedia/mediaservices/effects/qsoundeffect_p.h +++ b/src/multimedia/mediaservices/effects/qsoundeffect_p.h @@ -63,7 +63,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QSoundEffectPrivate; -class Q_MULTIMEDIA_EXPORT QSoundEffect : public QObject +class Q_MEDIASERVICES_EXPORT QSoundEffect : public QObject { Q_OBJECT Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) diff --git a/src/multimedia/mediaservices/playback/qmediaplayer.h b/src/multimedia/mediaservices/playback/qmediaplayer.h index be66a63..d75c58a 100644 --- a/src/multimedia/mediaservices/playback/qmediaplayer.h +++ b/src/multimedia/mediaservices/playback/qmediaplayer.h @@ -57,7 +57,7 @@ QT_MODULE(Multimedia) class QMediaPlaylist; class QMediaPlayerPrivate; -class Q_MULTIMEDIA_EXPORT QMediaPlayer : public QMediaObject +class Q_MEDIASERVICES_EXPORT QMediaPlayer : public QMediaObject { Q_OBJECT Q_PROPERTY(QMediaContent media READ media WRITE setMedia NOTIFY mediaChanged) diff --git a/src/multimedia/mediaservices/playback/qmediaplayercontrol.h b/src/multimedia/mediaservices/playback/qmediaplayercontrol.h index 25bc2f5..7a3c24e 100644 --- a/src/multimedia/mediaservices/playback/qmediaplayercontrol.h +++ b/src/multimedia/mediaservices/playback/qmediaplayercontrol.h @@ -58,7 +58,7 @@ QT_MODULE(Multimedia) class QMediaPlaylist; -class Q_MULTIMEDIA_EXPORT QMediaPlayerControl : public QMediaControl +class Q_MEDIASERVICES_EXPORT QMediaPlayerControl : public QMediaControl { Q_OBJECT -- cgit v0.12 From 575f0064bd91e26daa75805c142c10a04a32c2fd Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 16 Apr 2010 13:25:35 +1000 Subject: Avoid calling QGraphicsItem::setTransformOriginPoint() until needed Task-number: QTBUG-9772 Reviewed-by: Alexis --- src/declarative/graphicsitems/qdeclarativeitem.cpp | 24 ++++++++++++++++++---- src/declarative/graphicsitems/qdeclarativeitem_p.h | 6 +++++- src/gui/graphicsview/qgraphicsitem.cpp | 10 +++++++++ src/gui/graphicsview/qgraphicsitem_p.h | 1 + 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 86dbaf0..0e4e327 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -1794,9 +1794,13 @@ void QDeclarativeItem::geometryChanged(const QRectF &newGeometry, if (transformOrigin() != QDeclarativeItem::TopLeft && (newGeometry.width() != oldGeometry.width() || newGeometry.height() != oldGeometry.height())) { - QPointF origin = d->computeTransformOrigin(); - if (transformOriginPoint() != origin) - setTransformOriginPoint(origin); + if (d->transformData) { + QPointF origin = d->computeTransformOrigin(); + if (transformOriginPoint() != origin) + setTransformOriginPoint(origin); + } else { + d->transformOriginDirty = true; + } } if (newGeometry.x() != oldGeometry.x()) @@ -2656,11 +2660,23 @@ void QDeclarativeItem::setTransformOrigin(TransformOrigin origin) Q_D(QDeclarativeItem); if (origin != d->origin) { d->origin = origin; - QGraphicsItem::setTransformOriginPoint(d->computeTransformOrigin()); + if (d->transformData) + QGraphicsItem::setTransformOriginPoint(d->computeTransformOrigin()); + else + d->transformOriginDirty = true; emit transformOriginChanged(d->origin); } } +void QDeclarativeItemPrivate::transformChanged() +{ + Q_Q(QDeclarativeItem); + if (transformOriginDirty) { + q->QGraphicsItem::setTransformOriginPoint(computeTransformOrigin()); + transformOriginDirty = false; + } +} + /*! \property QDeclarativeItem::smooth \brief whether the item is smoothly transformed. diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h index cf138c3..3f5bf1a 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem_p.h +++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h @@ -116,7 +116,7 @@ public: _stateGroup(0), origin(QDeclarativeItem::Center), widthValid(false), heightValid(false), _componentComplete(true), _keepMouse(false), - smooth(false), keyHandler(0), + smooth(false), transformOriginDirty(true), keyHandler(0), mWidth(0), mHeight(0), implicitWidth(0), implicitHeight(0) { QGraphicsItemPrivate::acceptedMouseButtons = 0; @@ -233,6 +233,7 @@ public: bool _componentComplete:1; bool _keepMouse:1; bool smooth:1; + bool transformOriginDirty : 1; QDeclarativeItemKeyFilter *keyHandler; @@ -269,6 +270,9 @@ public: } } + // Reimplemented from QGraphicsItemPrivate + virtual void transformChanged(); + virtual void focusChanged(bool); static int consistentTime; diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 9759b39..e290c7e 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1237,6 +1237,8 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q } dirtySceneTransform = 1; + if (!inDestructor && (transformData || (newParent && newParent->d_ptr->transformData))) + transformChanged(); // Restore the sub focus chain. if (subFocusItem) { @@ -3622,6 +3624,7 @@ void QGraphicsItemPrivate::setTransformHelper(const QTransform &transform) q_ptr->prepareGeometryChange(); transformData->transform = transform; dirtySceneTransform = 1; + transformChanged(); } /*! @@ -3812,6 +3815,8 @@ void QGraphicsItem::setRotation(qreal angle) if (d_ptr->isObject) emit static_cast(this)->rotationChanged(); + + d_ptr->transformChanged(); } /*! @@ -3876,6 +3881,8 @@ void QGraphicsItem::setScale(qreal factor) if (d_ptr->isObject) emit static_cast(this)->scaleChanged(); + + d_ptr->transformChanged(); } @@ -3931,6 +3938,7 @@ void QGraphicsItem::setTransformations(const QList &transf transformations.at(i)->d_func()->setItem(this); d_ptr->transformData->onlyTransform = false; d_ptr->dirtySceneTransform = 1; + d_ptr->transformChanged(); } /*! @@ -3947,6 +3955,7 @@ void QGraphicsItemPrivate::prependGraphicsTransform(QGraphicsTransform *t) t->d_func()->setItem(q); transformData->onlyTransform = false; dirtySceneTransform = 1; + transformChanged(); } /*! @@ -3963,6 +3972,7 @@ void QGraphicsItemPrivate::appendGraphicsTransform(QGraphicsTransform *t) t->d_func()->setItem(q); transformData->onlyTransform = false; dirtySceneTransform = 1; + transformChanged(); } /*! diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index f922842..8c7fbb4 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -284,6 +284,7 @@ public: void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true); bool discardUpdateRequest(bool ignoreVisibleBit = false, bool ignoreDirtyBit = false, bool ignoreOpacity = false) const; + virtual void transformChanged() {} int depth() const; #ifndef QT_NO_GRAPHICSEFFECT enum InvalidateReason { -- cgit v0.12 From 9c3acf1d307257df02a9ba0b6de6077881bb687b Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 16 Apr 2010 13:41:35 +1000 Subject: Do not set a font pixel size of 0. --- src/declarative/qml/qdeclarativevaluetype.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp index 352a6c0..c5f6d6a 100644 --- a/src/declarative/qml/qdeclarativevaluetype.cpp +++ b/src/declarative/qml/qdeclarativevaluetype.cpp @@ -55,13 +55,13 @@ int qmlRegisterValueTypeEnums(const char *qmlName) QByteArray pointerName(name + '*'); QDeclarativePrivate::RegisterType type = { - 0, + 0, qRegisterMetaType(pointerName.constData()), 0, 0, 0, "Qt", 4, 6, qmlName, &T::staticMetaObject, - 0, 0, + 0, 0, 0, 0, 0, @@ -712,7 +712,7 @@ int QDeclarativeFontValueType::pixelSize() const void QDeclarativeFontValueType::setPixelSize(int size) { - if (size >=0) { + if (size >0) { if (pointSizeSet) qWarning() << "Both point size and pixel size set. Using pixel size."; font.setPixelSize(size); -- cgit v0.12 From 5595ad768309b27c2c20376105f8715082b616bf Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 16 Apr 2010 13:48:58 +1000 Subject: Add parent property to Timer Task-number: QTBUG-9949 --- src/declarative/util/qdeclarativetimer_p.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/util/qdeclarativetimer_p.h b/src/declarative/util/qdeclarativetimer_p.h index d1e6630..08c3d4e 100644 --- a/src/declarative/util/qdeclarativetimer_p.h +++ b/src/declarative/util/qdeclarativetimer_p.h @@ -63,6 +63,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTimer : public QObject, public QDeclarati Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) Q_PROPERTY(bool repeat READ isRepeating WRITE setRepeating NOTIFY repeatChanged) Q_PROPERTY(bool triggeredOnStart READ triggeredOnStart WRITE setTriggeredOnStart NOTIFY triggeredOnStartChanged) + Q_PROPERTY(QObject *parent READ parent CONSTANT) public: QDeclarativeTimer(QObject *parent=0); -- cgit v0.12 From 8ff39e55286e4ce3f01472fafa06941c9e9537fd Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 16 Apr 2010 14:17:23 +1000 Subject: Add test for QTBUG-9949 Task-number: QTBUG-9949 --- .../qdeclarativetimer/tst_qdeclarativetimer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp index a08a91c..da2d173 100644 --- a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp +++ b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include class tst_qdeclarativetimer : public QObject @@ -60,6 +61,7 @@ private slots: void triggeredOnStartRepeat(); void changeDuration(); void restart(); + void parentProperty(); }; class TimerHelper : public QObject @@ -317,6 +319,21 @@ void tst_qdeclarativetimer::restart() delete timer; } +void tst_qdeclarativetimer::parentProperty() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine); + component.setData(QByteArray("import Qt 4.7\nItem { Timer { objectName: \"timer\"; running: parent.visible } }"), QUrl::fromLocalFile("")); + QDeclarativeItem *item = qobject_cast(component.create()); + QVERIFY(item != 0); + QDeclarativeTimer *timer = item->findChild("timer"); + QVERIFY(timer != 0); + + QVERIFY(timer->isRunning()); + + delete timer; +} + QTEST_MAIN(tst_qdeclarativetimer) #include "tst_qdeclarativetimer.moc" -- cgit v0.12 From d6ba9ff7e3d7e67d3718ffa7317bfc2d3941a2bb Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 16 Apr 2010 14:34:19 +1000 Subject: Doc: make note about using clip: true in views slightly more prominent. --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 2 +- src/declarative/graphicsitems/qdeclarativelistview.cpp | 2 +- src/declarative/graphicsitems/qdeclarativepathview.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 562ba2a..a3d585a 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -885,7 +885,7 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m In this case ListModel is a handy way for us to test our UI. In practice the model would be implemented in C++, or perhaps via a SQL data source. - Note that views do not enable \e clip automatically. If the view + \bold Note that views do not enable \e clip automatically. If the view is not clipped by another item or the screen, it will be necessary to set \e {clip: true} in order to have the out of view items clipped nicely. diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 307c0a7..80db730 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1286,7 +1286,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m In this case ListModel is a handy way for us to test our UI. In practice the model would be implemented in C++, or perhaps via a SQL data source. - Note that views do not enable \e clip automatically. If the view + \bold Note that views do not enable \e clip automatically. If the view is not clipped by another item or the screen, it will be necessary to set \e {clip: true} in order to have the out of view items clipped nicely. diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 4aaa28d..d0a3cd1 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -314,7 +314,7 @@ void QDeclarativePathViewPrivate::regenerate() \image pathview.gif - Note that views do not enable \e clip automatically. If the view + \bold Note that views do not enable \e clip automatically. If the view is not clipped by another item or the screen, it will be necessary to set \e {clip: true} in order to have the out of view items clipped nicely. -- cgit v0.12 From 348d1f6d421a6e23b769af99608fa6d81631a6c3 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 16 Apr 2010 14:41:00 +1000 Subject: Throw exceptions on programming errors for global functions. Task-number: QTBUG-7897 --- src/declarative/qml/qdeclarativeengine.cpp | 77 ++++++++++-------- src/testlib/qtestlightxmlstreamer.cpp | 3 +- src/testlib/qtestlogger.cpp | 3 + src/testlib/qtestxmlstreamer.cpp | 3 +- .../qdeclarativeqt/data/createComponent.qml | 9 +- .../qdeclarativeqt/data/createQmlObject.qml | 25 +++--- .../auto/declarative/qdeclarativeqt/data/hsla.qml | 4 +- .../auto/declarative/qdeclarativeqt/data/rgba.qml | 4 +- .../qdeclarativeqt/tst_qdeclarativeqt.cpp | 95 ++++++++++++++-------- 9 files changed, 129 insertions(+), 94 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 96145fb..8e19240 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -957,7 +957,7 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QS Q_ASSERT(context); if(ctxt->argumentCount() != 1) { - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 1 parameter")); }else{ QString arg = ctxt->argument(0).toString(); if (arg.isEmpty()) @@ -977,7 +977,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS QDeclarativeEngine* activeEngine = activeEnginePriv->q_func(); if(ctxt->argumentCount() < 2 || ctxt->argumentCount() > 3) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 2 or 3 parameters")); QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt); Q_ASSERT(context); @@ -997,35 +997,30 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS QObject *parentArg = activeEnginePriv->objectClass->toQObject(ctxt->argument(1)); if(!parentArg) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("parent object not found")); QDeclarativeComponent component(activeEngine); component.setData(qml.toUtf8(), url); if(component.isError()) { QList errors = component.errors(); - qWarning().nospace() << "QDeclarativeEngine::createQmlObject():"; + QString errstr = QLatin1String("Qt.createQmlObject(): "); foreach (const QDeclarativeError &error, errors) - qWarning().nospace() << " " << error; - - return engine->nullValue(); + errstr += QLatin1String(" ") + error.toString() + QLatin1String("\n"); + return ctxt->throwError(errstr); } - if (!component.isReady()) { - qWarning().nospace() << "QDeclarativeEngine::createQmlObject(): Component is not ready"; - - return engine->nullValue(); - } + if (!component.isReady()) + return ctxt->throwError(QDeclarativeEngine::tr("Qt.createQmlObject(): component is not ready")); QObject *obj = component.create(context->asQDeclarativeContext()); if(component.isError()) { QList errors = component.errors(); - qWarning().nospace() << "QDeclarativeEngine::createQmlObject():"; + QString errstr = QLatin1String("Qt.createQmlObject(): "); foreach (const QDeclarativeError &error, errors) - qWarning().nospace() << " " << error; - - return engine->nullValue(); + errstr += QLatin1String(" ") + error.toString() + QLatin1String("\n"); + return ctxt->throwError(errstr); } Q_ASSERT(obj); @@ -1051,7 +1046,7 @@ QScriptValue QDeclarativeEnginePrivate::isQtObject(QScriptContext *ctxt, QScript QScriptValue QDeclarativeEnginePrivate::vector(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 3) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 3 parameters")); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); qsreal z = ctxt->argument(2).toNumber(); @@ -1062,7 +1057,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptE { int argCount = ctxt->argumentCount(); if(argCount == 0 || argCount > 2) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 1 or 2 parameters")); QDate date = ctxt->argument(0).toDateTime().date(); Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate; @@ -1073,7 +1068,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptE } else if (ctxt->argument(1).isNumber()) { enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32()); } else - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("invalid date format")); } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); } @@ -1082,7 +1077,7 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE { int argCount = ctxt->argumentCount(); if(argCount == 0 || argCount > 2) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 1 or 2 parameters")); QTime date = ctxt->argument(0).toDateTime().time(); Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate; @@ -1093,7 +1088,7 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE } else if (ctxt->argument(1).isNumber()) { enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32()); } else - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("invalid time format")); } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); } @@ -1102,7 +1097,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr { int argCount = ctxt->argumentCount(); if(argCount == 0 || argCount > 2) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 1 or 2 parameters")); QDateTime date = ctxt->argument(0).toDateTime(); Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate; @@ -1113,7 +1108,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr } else if (ctxt->argument(1).isNumber()) { enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32()); } else - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("invalid datetiem format")); } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); } @@ -1122,14 +1117,20 @@ QScriptValue QDeclarativeEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine { int argCount = ctxt->argumentCount(); if(argCount < 3 || argCount > 4) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 3 or 4 parameters")); qsreal r = ctxt->argument(0).toNumber(); qsreal g = ctxt->argument(1).toNumber(); qsreal b = ctxt->argument(2).toNumber(); qsreal a = (argCount == 4) ? ctxt->argument(3).toNumber() : 1; - if (r < 0 || r > 1 || g < 0 || g > 1 || b < 0 || b > 1 || a < 0 || a > 1) - return engine->nullValue(); + if (r < 0.0) r=0.0; + if (r > 1.0) r=1.0; + if (g < 0.0) g=0.0; + if (g > 1.0) g=1.0; + if (b < 0.0) b=0.0; + if (b > 1.0) b=1.0; + if (a < 0.0) a=0.0; + if (a > 1.0) a=1.0; return qScriptValueFromValue(engine, qVariantFromValue(QColor::fromRgbF(r, g, b, a))); } @@ -1138,14 +1139,20 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine { int argCount = ctxt->argumentCount(); if(argCount < 3 || argCount > 4) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 3 or 4 parameters")); qsreal h = ctxt->argument(0).toNumber(); qsreal s = ctxt->argument(1).toNumber(); qsreal l = ctxt->argument(2).toNumber(); qsreal a = (argCount == 4) ? ctxt->argument(3).toNumber() : 1; - if (h < 0 || h > 1 || s < 0 || s > 1 || l < 0 || l > 1 || a < 0 || a > 1) - return engine->nullValue(); + if (h < 0.0) h=0.0; + if (h > 1.0) h=1.0; + if (s < 0.0) s=0.0; + if (s > 1.0) s=1.0; + if (l < 0.0) l=0.0; + if (l > 1.0) l=1.0; + if (a < 0.0) a=0.0; + if (a > 1.0) a=1.0; return qScriptValueFromValue(engine, qVariantFromValue(QColor::fromHslF(h, s, l, a))); } @@ -1153,7 +1160,7 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 4) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 4 parameters")); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); @@ -1169,7 +1176,7 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 2) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 2 parameters")); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); return qScriptValueFromValue(engine, qVariantFromValue(QPointF(x, y))); @@ -1178,7 +1185,7 @@ QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngin QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 2) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 2 parameters")); qsreal w = ctxt->argument(0).toNumber(); qsreal h = ctxt->argument(1).toNumber(); return qScriptValueFromValue(engine, qVariantFromValue(QSizeF(w, h))); @@ -1187,7 +1194,7 @@ QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 1) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 1 parameter")); QVariant v = ctxt->argument(0).toVariant(); QColor color; if (v.userType() == QVariant::Color) @@ -1206,7 +1213,7 @@ QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEng QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 1) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 1 parameter")); QVariant v = ctxt->argument(0).toVariant(); QColor color; if (v.userType() == QVariant::Color) @@ -1300,7 +1307,7 @@ QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptE QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 2) - return engine->nullValue(); + return ctxt->throwError(QDeclarativeEngine::tr("expected 2 parameters")); //get color QVariant v = ctxt->argument(0).toVariant(); QColor color; diff --git a/src/testlib/qtestlightxmlstreamer.cpp b/src/testlib/qtestlightxmlstreamer.cpp index 0ac9ea8..8c22a4f 100644 --- a/src/testlib/qtestlightxmlstreamer.cpp +++ b/src/testlib/qtestlightxmlstreamer.cpp @@ -87,12 +87,13 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, QTestCharBu QXmlTestLogger::xmlQuote("edFile, element->attributeValue(QTest::AI_File)); QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description)); - QTest::qt_asprintf(formatted, "\n \n\n", + QTest::qt_asprintf(formatted, "\n %s\n\n", element->attributeValue(QTest::AI_Type), element->attributeName(QTest::AI_File), quotedFile.constData(), element->attributeName(QTest::AI_Line), element->attributeValue(QTest::AI_Line), + element->attributeValue(QTest::AI_Tag) ? element->attributeValue(QTest::AI_Tag) : "", cdataDesc.constData()); break; } diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp index 6c76388..79bb84c 100644 --- a/src/testlib/qtestlogger.cpp +++ b/src/testlib/qtestlogger.cpp @@ -318,6 +318,9 @@ void QTestLogger::addMessage(MessageTypes type, const char *message, const char break; } + const char *tag = QTestResult::currentDataTag(); + if (tag) + errorElement->addAttribute(QTest::AI_Tag, tag); errorElement->addAttribute(QTest::AI_Type, typeBuf); errorElement->addAttribute(QTest::AI_Description, message); diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp index b9946e5..9addb31 100644 --- a/src/testlib/qtestxmlstreamer.cpp +++ b/src/testlib/qtestxmlstreamer.cpp @@ -111,12 +111,13 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, QTestCharBuffer QXmlTestLogger::xmlQuote("edFile, element->attributeValue(QTest::AI_File)); QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description)); - QTest::qt_asprintf(formatted, "\n \n\n", + QTest::qt_asprintf(formatted, "\n %s\n \n\n", element->attributeValue(QTest::AI_Type), element->attributeName(QTest::AI_File), quotedFile.constData(), element->attributeName(QTest::AI_Line), element->attributeValue(QTest::AI_Line), + element->attributeValue(QTest::AI_Tag) ? element->attributeValue(QTest::AI_Tag) : "", cdataDesc.constData()); break; } diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml index d9b70ec..412c467 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml @@ -1,19 +1,16 @@ import Qt 4.6 QtObject { - property bool incorrectArgCount1: false - property bool incorrectArgCount2: false property bool emptyArg: false property string relativeUrl property string absoluteUrl + property QtObject incorectArgCount1: createComponent() + property QtObject incorectArgCount2: createComponent("main.qml", 10) + Component.onCompleted: { - // Test that using incorrect argument count returns a null object - incorrectArgCount1 = (createComponent() == null); - incorrectArgCount2 = (createComponent("main.qml", 10) == null); emptyArg = (createComponent("") == null); - var r = createComponent("createComponentData.qml"); relativeUrl = r.url; diff --git a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml index 54a3e7d..a7edb2b 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml @@ -3,25 +3,26 @@ import Qt 4.6 Item { id: root - property bool incorrectArgCount1: false - property bool incorrectArgCount2: false + // errors resulting in exceptions + property QtObject incorrectArgCount1: createQmlObject() + property QtObject incorrectArgCount2: createQmlObject("import Qt 4.6\nQtObject{}", root, "main.qml", 10) + property QtObject noParent: createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13}", 0) + property QtObject notAvailable: createQmlObject("import Qt 4.6\nQtObject{Blah{}}", root) + property QtObject errors: createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml") + property bool emptyArg: false - property bool noParent: false - property bool notAvailable: false property bool runtimeError: false - property bool errors: false property bool success: false Component.onCompleted: { - // errors - incorrectArgCount1 = (createQmlObject() == null); - incorrectArgCount2 = (createQmlObject("import Qt 4.6\nQtObject{}", root, "main.qml", 10) == null); + // errors resulting in nulls emptyArg = (createQmlObject("", root) == null); - errors = (createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml") == null); - noParent = (createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13}", 0) == null); - notAvailable = (createQmlObject("import Qt 4.6\nQtObject{Blah{}}", root) == null); - runtimeError = (createQmlObject("import Qt 4.6\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root) == null); + try { + createQmlObject("import Qt 4.6\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root) + } catch (error) { + console.log("RunTimeError: ",error.message); + } var o = createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\n}", root); success = (o.test == 13); diff --git a/tests/auto/declarative/qdeclarativeqt/data/hsla.qml b/tests/auto/declarative/qdeclarativeqt/data/hsla.qml index df51ccd..142410b 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/hsla.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/hsla.qml @@ -5,7 +5,7 @@ QtObject { property color test2: Qt.hsla(1, 0.5, 0.3); property color test3: Qt.hsla(1, 1); property color test4: Qt.hsla(1, 1, 1, 1, 1); - property color test5: Qt.hsla(1.2, 1, 1); - property color test6: Qt.hsla(-0.1, 1, 1); + property color test5: Qt.hsla(1.2, 1.3, 1.4, 1.5); + property color test6: Qt.hsla(-0.1, -0.2, -0.3, -0.4); } diff --git a/tests/auto/declarative/qdeclarativeqt/data/rgba.qml b/tests/auto/declarative/qdeclarativeqt/data/rgba.qml index 6dd6565..66305a4 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/rgba.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/rgba.qml @@ -5,6 +5,6 @@ QtObject { property color test2: Qt.rgba(1, 0.5, 0.3); property color test3: Qt.rgba(1, 1); property color test4: Qt.rgba(1, 1, 1, 1, 1); - property color test5: Qt.rgba(1.2, 1, 1); - property color test6: Qt.rgba(-0.1, 1, 1); + property color test5: Qt.rgba(1.2, 1.3, 1.4, 1.5); + property color test6: Qt.rgba(-0.1, -0.2, -0.3, -0.4); } diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index 98f1200..4d22b0a 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -102,14 +102,10 @@ void tst_qdeclarativeqt::rgba() { QDeclarativeComponent component(&engine, TEST_FILE("rgba.qml")); - QString warning1 = component.url().toString() + ":6: Unable to assign null to QColor"; - QString warning2 = component.url().toString() + ":7: Unable to assign null to QColor"; - QString warning3 = component.url().toString() + ":8: Unable to assign null to QColor"; - QString warning4 = component.url().toString() + ":9: Unable to assign null to QColor"; + QString warning1 = component.url().toString() + ":6: Error: expected 3 or 4 parameters"; + QString warning2 = component.url().toString() + ":7: Error: expected 3 or 4 parameters"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning3)); - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning4)); QObject *object = component.create(); QVERIFY(object != 0); @@ -119,8 +115,8 @@ void tst_qdeclarativeqt::rgba() QCOMPARE(qvariant_cast(object->property("test2")), QColor::fromRgbF(1, 0.5, 0.3, 1)); QCOMPARE(qvariant_cast(object->property("test3")), QColor()); QCOMPARE(qvariant_cast(object->property("test4")), QColor()); - QCOMPARE(qvariant_cast(object->property("test5")), QColor()); - QCOMPARE(qvariant_cast(object->property("test6")), QColor()); + QCOMPARE(qvariant_cast(object->property("test5")), QColor::fromRgbF(1, 1, 1, 1)); + QCOMPARE(qvariant_cast(object->property("test6")), QColor::fromRgbF(0, 0, 0, 0)); delete object; } @@ -129,14 +125,10 @@ void tst_qdeclarativeqt::hsla() { QDeclarativeComponent component(&engine, TEST_FILE("hsla.qml")); - QString warning1 = component.url().toString() + ":6: Unable to assign null to QColor"; - QString warning2 = component.url().toString() + ":7: Unable to assign null to QColor"; - QString warning3 = component.url().toString() + ":8: Unable to assign null to QColor"; - QString warning4 = component.url().toString() + ":9: Unable to assign null to QColor"; + QString warning1 = component.url().toString() + ":6: Error: expected 3 or 4 parameters"; + QString warning2 = component.url().toString() + ":7: Error: expected 3 or 4 parameters"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning3)); - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning4)); QObject *object = component.create(); QVERIFY(object != 0); @@ -145,8 +137,8 @@ void tst_qdeclarativeqt::hsla() QCOMPARE(qvariant_cast(object->property("test2")), QColor::fromHslF(1, 0.5, 0.3, 1)); QCOMPARE(qvariant_cast(object->property("test3")), QColor()); QCOMPARE(qvariant_cast(object->property("test4")), QColor()); - QCOMPARE(qvariant_cast(object->property("test5")), QColor()); - QCOMPARE(qvariant_cast(object->property("test6")), QColor()); + QCOMPARE(qvariant_cast(object->property("test5")), QColor::fromHslF(1, 1, 1, 1)); + QCOMPARE(qvariant_cast(object->property("test6")), QColor::fromHslF(0, 0, 0, 0)); delete object; } @@ -154,6 +146,12 @@ void tst_qdeclarativeqt::hsla() void tst_qdeclarativeqt::rect() { QDeclarativeComponent component(&engine, TEST_FILE("rect.qml")); + + QString warning1 = component.url().toString() + ":6: Error: expected 4 parameters"; + QString warning2 = component.url().toString() + ":7: Error: expected 4 parameters"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); + QObject *object = component.create(); QVERIFY(object != 0); @@ -169,6 +167,12 @@ void tst_qdeclarativeqt::rect() void tst_qdeclarativeqt::point() { QDeclarativeComponent component(&engine, TEST_FILE("point.qml")); + + QString warning1 = component.url().toString() + ":6: Error: expected 2 parameters"; + QString warning2 = component.url().toString() + ":7: Error: expected 2 parameters"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); + QObject *object = component.create(); QVERIFY(object != 0); @@ -183,6 +187,12 @@ void tst_qdeclarativeqt::point() void tst_qdeclarativeqt::size() { QDeclarativeComponent component(&engine, TEST_FILE("size.qml")); + + QString warning1 = component.url().toString() + ":7: Error: expected 2 parameters"; + QString warning2 = component.url().toString() + ":8: Error: expected 2 parameters"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); + QObject *object = component.create(); QVERIFY(object != 0); @@ -198,6 +208,12 @@ void tst_qdeclarativeqt::size() void tst_qdeclarativeqt::vector() { QDeclarativeComponent component(&engine, TEST_FILE("vector.qml")); + + QString warning1 = component.url().toString() + ":6: Error: expected 3 parameters"; + QString warning2 = component.url().toString() + ":7: Error: expected 3 parameters"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); + QObject *object = component.create(); QVERIFY(object != 0); @@ -212,6 +228,12 @@ void tst_qdeclarativeqt::vector() void tst_qdeclarativeqt::lighter() { QDeclarativeComponent component(&engine, TEST_FILE("lighter.qml")); + + QString warning1 = component.url().toString() + ":5: Error: expected 1 parameter"; + QString warning2 = component.url().toString() + ":6: Error: expected 1 parameter"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); + QObject *object = component.create(); QVERIFY(object != 0); @@ -228,6 +250,12 @@ void tst_qdeclarativeqt::lighter() void tst_qdeclarativeqt::darker() { QDeclarativeComponent component(&engine, TEST_FILE("darker.qml")); + + QString warning1 = component.url().toString() + ":5: Error: expected 1 parameter"; + QString warning2 = component.url().toString() + ":6: Error: expected 1 parameter"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); + QObject *object = component.create(); QVERIFY(object != 0); @@ -245,8 +273,9 @@ void tst_qdeclarativeqt::tint() { QDeclarativeComponent component(&engine, TEST_FILE("tint.qml")); - QString warning1 = component.url().toString() + ":7: Unable to assign null to QColor"; - QString warning2 = component.url().toString() + ":8: Unable to assign null to QColor"; + QString warning1 = component.url().toString() + ":7: Error: expected 2 parameters"; + QString warning2 = component.url().toString() + ":8: Error: expected 2 parameters"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -305,13 +334,15 @@ void tst_qdeclarativeqt::md5() void tst_qdeclarativeqt::createComponent() { QDeclarativeComponent component(&engine, TEST_FILE("createComponent.qml")); + + QString warning1 = component.url().toString() + ":9: Error: expected 1 parameter"; + QString warning2 = component.url().toString() + ":10: Error: expected 1 parameter"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); + QObject *object = component.create(); QVERIFY(object != 0); - QCOMPARE(object->property("incorrectArgCount1").toBool(), true); - QCOMPARE(object->property("incorrectArgCount2").toBool(), true); - QCOMPARE(object->property("emptyArg").toBool(), true); - QCOMPARE(object->property("absoluteUrl").toString(), QString("http://www.example.com/test.qml")); QCOMPARE(object->property("relativeUrl").toString(), TEST_FILE("createComponentData.qml").toString()); @@ -322,30 +353,24 @@ void tst_qdeclarativeqt::createQmlObject() { QDeclarativeComponent component(&engine, TEST_FILE("createQmlObject.qml")); - QString warning1 = "QDeclarativeEngine::createQmlObject():"; - QString warning2 = " " + TEST_FILE("main.qml").toString() + ":4:1: Duplicate property name"; - QString warning3 = "QDeclarativeEngine::createQmlObject():"; - QString warning4 = " " + TEST_FILE("inline").toString() + ":2:10: Blah is not a type"; - QString warning5 = "QDeclarativeEngine::createQmlObject():"; - QString warning6 = " " + TEST_FILE("inline").toString() + ":3: Cannot assign object type QObject with no default method"; + QString warning1 = component.url().toString() + ":7: Error: expected 2 or 3 parameters"; + QString warning2 = component.url().toString()+ ":10: Error: Qt.createQmlObject(): " + TEST_FILE("inline").toString() + ":2:10: Blah is not a type\n"; + QString warning3 = component.url().toString()+ ":11: Error: Qt.createQmlObject(): " + TEST_FILE("main.qml").toString() + ":4:1: Duplicate property name\n"; + QString warning4 = component.url().toString()+ ":9: Error: parent object not found"; + QString warning5 = component.url().toString()+ ":8: Error: expected 2 or 3 parameters"; + QString warning6 = "RunTimeError: Qt.createQmlObject(): " + TEST_FILE("inline").toString() + ":3: Cannot assign object type QObject with no default method\n"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning3)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning4)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning5)); - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning6)); + QTest::ignoreMessage(QtDebugMsg, qPrintable(warning6)); QObject *object = component.create(); QVERIFY(object != 0); - QCOMPARE(object->property("incorrectArgCount1").toBool(), true); - QCOMPARE(object->property("incorrectArgCount2").toBool(), true); QCOMPARE(object->property("emptyArg").toBool(), true); - QCOMPARE(object->property("errors").toBool(), true); - QCOMPARE(object->property("noParent").toBool(), true); - QCOMPARE(object->property("notAvailable").toBool(), true); - QCOMPARE(object->property("runtimeError").toBool(), true); QCOMPARE(object->property("success").toBool(), true); QDeclarativeItem *item = qobject_cast(object); -- cgit v0.12 From 25419577354f0a6af77e49acd860a84fc4aa26ae Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 16 Apr 2010 14:44:50 +1000 Subject: clean up --- tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml index a7edb2b..8e6c58e 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml @@ -11,7 +11,6 @@ Item { property QtObject errors: createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml") property bool emptyArg: false - property bool runtimeError: false property bool success: false -- cgit v0.12 From 91838257f36ef3431143d59871ecb62def735fe4 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 16 Apr 2010 14:56:36 +1000 Subject: Cleanup photoviewer demo. --- demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml | 6 ++++-- demos/declarative/photoviewer/PhotoViewerCore/Button.qml | 2 +- demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml index cd9ecbc..d39b7bc 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml @@ -77,10 +77,12 @@ Component { } ] - GridView.onAdd: NumberAnimation { target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0 } + GridView.onAdd: NumberAnimation { + target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: "OutQuad" + } GridView.onRemove: SequentialAnimation { PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: true } - NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0 } + NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: "OutQuad" } PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false } } diff --git a/demos/declarative/photoviewer/PhotoViewerCore/Button.qml b/demos/declarative/photoviewer/PhotoViewerCore/Button.qml index fd1fae9..c681064 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/Button.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/Button.qml @@ -4,7 +4,7 @@ Item { id: container property alias label: labelText.text - property string tint: "" + property color tint: "#FFFFFFFF" signal clicked width: labelText.width + 70 ; height: labelText.height + 18 diff --git a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml index e435425..ccfda02 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml @@ -4,7 +4,7 @@ Item { id: container property string label - property string tint: "" + property color tint: "#FFFFFFFF" signal clicked signal labelChanged(string label) -- cgit v0.12 From e1b1b11afbddbe260d4de61f20181ffd3b941996 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 16 Apr 2010 14:32:02 +1000 Subject: Add QML imports to s60installs.pro Task-number: QTBUG-9784 Reviewed-by: Martin Jones --- src/s60installs/s60installs.pro | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index dfce7d2..c3809b2 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -143,6 +143,25 @@ symbian: { contains(QT_CONFIG, declarative): { qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtDeclarative$${QT_LIBINFIX}.dll + + widgetImport.sources = widgets.dll $$QT_BUILD_TREE/src/imports/widgets/qmldir + widgetImport.path = $$QT_IMPORTS_BASE_DIR/Qt/widgets + DEPLOYMENT += widgetImport + + particlesImport.sources = particles.dll $$QT_BUILD_TREE/src/imports/particles/qmldir + particlesImport.path = $$QT_IMPORTS_BASE_DIR/Qt/labs/particles + DEPLOYMENT += particlesImport + + contains(QT_CONFIG, webkit): { + webkitImport.sources = webkitqmlplugin.dll $$QT_BUILD_TREE/src/imports/webkit/qmldir + webkitImport.path = $$QT_IMPORTS_BASE_DIR/org/webkit + DEPLOYMENT += webkitImport + } + contains(QT_CONFIG, multimedia): { + multimediaImport.sources = multimedia.dll $$QT_BUILD_TREE/src/imports/multimedia/qmldir + multimediaImport.path = $$QT_IMPORTS_BASE_DIR/Qt/multimedia + DEPLOYMENT += multimediaImport + } } graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems -- cgit v0.12 From 8693ed5a3fd0814802613c5a8a78b6802751bd0f Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 16 Apr 2010 14:34:36 +1000 Subject: Simplify QML import plugin deployment lines Task-number: Reviewed-by: Martin Jones --- src/imports/gestures/gestures.pro | 3 +-- src/imports/multimedia/multimedia.pro | 3 +-- src/imports/particles/particles.pro | 3 +-- src/imports/webkit/webkit.pro | 3 +-- src/imports/widgets/widgets.pro | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/imports/gestures/gestures.pro b/src/imports/gestures/gestures.pro index b9c5b4e..f55c00e 100644 --- a/src/imports/gestures/gestures.pro +++ b/src/imports/gestures/gestures.pro @@ -17,8 +17,7 @@ symbian:{ load(data_caging_paths) include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - importFiles.sources = gesturesqmlplugin.dll \ - qmldir + importFiles.sources = gesturesqmlplugin.dll qmldir importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH DEPLOYMENT = importFiles diff --git a/src/imports/multimedia/multimedia.pro b/src/imports/multimedia/multimedia.pro index 92f7ec4..c366e54 100644 --- a/src/imports/multimedia/multimedia.pro +++ b/src/imports/multimedia/multimedia.pro @@ -27,8 +27,7 @@ symbian:{ load(data_caging_paths) include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - importFiles.sources = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH/multimedia.dll \ - qmldir + importFiles.sources = multimedia.dll qmldir importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH DEPLOYMENT = importFiles diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro index 58bfe05..79ac543 100644 --- a/src/imports/particles/particles.pro +++ b/src/imports/particles/particles.pro @@ -21,8 +21,7 @@ symbian:{ load(data_caging_paths) include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - importFiles.sources = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH/particles.dll \ - qmldir + importFiles.sources = particles.dll qmldir importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH DEPLOYMENT = importFiles diff --git a/src/imports/webkit/webkit.pro b/src/imports/webkit/webkit.pro index 62db9ac..77cbc4d 100644 --- a/src/imports/webkit/webkit.pro +++ b/src/imports/webkit/webkit.pro @@ -18,8 +18,7 @@ symbian:{ load(data_caging_paths) include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - importFiles.sources = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH/webkitqmlplugin.dll \ - qmldir + importFiles.sources = webkitqmlplugin.dll qmldir importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH DEPLOYMENT = importFiles diff --git a/src/imports/widgets/widgets.pro b/src/imports/widgets/widgets.pro index f26e4b9..234ff1e 100644 --- a/src/imports/widgets/widgets.pro +++ b/src/imports/widgets/widgets.pro @@ -21,8 +21,7 @@ symbian:{ load(data_caging_paths) include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - importFiles.sources = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH/widgets.dll \ - qmldir + importFiles.sources = widgets.dll qmldir importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH DEPLOYMENT = importFiles -- cgit v0.12 From ba3f33401c97c5517abe19f4ea6f6307e4374c6c Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 16 Apr 2010 14:54:19 +1000 Subject: More class documentation fixes for declarative. --- src/declarative/qml/qdeclarativecontext.cpp | 7 ++- src/declarative/qml/qdeclarativeerror.cpp | 51 +++++++++++++++------- .../qml/qdeclarativeextensionplugin.cpp | 11 ++++- src/declarative/qml/qdeclarativeimageprovider.cpp | 22 +++++++--- src/declarative/qml/qdeclarativeimageprovider.h | 2 +- src/declarative/qml/qdeclarativelist.cpp | 15 ++++--- src/declarative/qml/qdeclarativeproperty.cpp | 1 + 7 files changed, 77 insertions(+), 32 deletions(-) diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index 6657fea..5288923 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -114,7 +114,7 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate() \endcode All properties added explicitly by QDeclarativeContext::setContextProperty() take - precedence over context object's properties. + precedence over the context object's properties. Contexts form a hierarchy. The root of this heirarchy is the QDeclarativeEngine's \l {QDeclarativeEngine::rootContext()}{root context}. A component instance can @@ -140,6 +140,11 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate() While QML objects instantiated in a context are not strictly owned by that context, their bindings are. If a context is destroyed, the property bindings of outstanding QML objects will stop evaluating. + + \note Setting the context object or adding new context properties after an object + has been created in that context is an expensive operation (essentially forcing all bindings + to reevaluate). Thus whenever possible you should complete "setup" of the context + before using it to create any objects. */ /*! \internal */ diff --git a/src/declarative/qml/qdeclarativeerror.cpp b/src/declarative/qml/qdeclarativeerror.cpp index 7e8aac0..17e91e3 100644 --- a/src/declarative/qml/qdeclarativeerror.cpp +++ b/src/declarative/qml/qdeclarativeerror.cpp @@ -49,8 +49,27 @@ QT_BEGIN_NAMESPACE /*! \class QDeclarativeError - \since 4.7 - \brief The QDeclarativeError class encapsulates a QML error + \since 4.7 + \brief The QDeclarativeError class encapsulates a QML error. + + QDeclarativeError includes a textual description of the error, as well + as location information (the file, line, and column). The toString() + method creates a single-line, human-readable string containing all of + this information, for example: + \code + file:///home/user/test.qml:7:8: Invalid property assignment: double expected + \endcode + + You can use qDebug() or qWarning() to output errors to the console. This method + will attempt to open the file indicated by the error + and include additional contextual information. + \code + file:///home/user/test.qml:7:8: Invalid property assignment: double expected + y: "hello" + ^ + \endcode + + \sa QDeclarativeView::errors(), QDeclarativeComponent::errors() */ class QDeclarativeErrorPrivate { @@ -69,7 +88,7 @@ QDeclarativeErrorPrivate::QDeclarativeErrorPrivate() } /*! - Create an empty error object. + Creates an empty error object. */ QDeclarativeError::QDeclarativeError() : d(0) @@ -77,7 +96,7 @@ QDeclarativeError::QDeclarativeError() } /*! - Create a copy of \a other. + Creates a copy of \a other. */ QDeclarativeError::QDeclarativeError(const QDeclarativeError &other) : d(0) @@ -86,7 +105,7 @@ QDeclarativeError::QDeclarativeError(const QDeclarativeError &other) } /*! - Assign \a other to this error object. + Assigns \a other to this error object. */ QDeclarativeError &QDeclarativeError::operator=(const QDeclarativeError &other) { @@ -112,7 +131,7 @@ QDeclarativeError::~QDeclarativeError() } /*! - Return true if this error is valid, otherwise false. + Returns true if this error is valid, otherwise false. */ bool QDeclarativeError::isValid() const { @@ -120,7 +139,7 @@ bool QDeclarativeError::isValid() const } /*! - Return the url for the file that caused this error. + Returns the url for the file that caused this error. */ QUrl QDeclarativeError::url() const { @@ -129,7 +148,7 @@ QUrl QDeclarativeError::url() const } /*! - Set the \a url for the file that caused this error. + Sets the \a url for the file that caused this error. */ void QDeclarativeError::setUrl(const QUrl &url) { @@ -138,7 +157,7 @@ void QDeclarativeError::setUrl(const QUrl &url) } /*! - Return the error description. + Returns the error description. */ QString QDeclarativeError::description() const { @@ -147,7 +166,7 @@ QString QDeclarativeError::description() const } /*! - Set the error \a description. + Sets the error \a description. */ void QDeclarativeError::setDescription(const QString &description) { @@ -156,7 +175,7 @@ void QDeclarativeError::setDescription(const QString &description) } /*! - Return the error line number. + Returns the error line number. */ int QDeclarativeError::line() const { @@ -165,7 +184,7 @@ int QDeclarativeError::line() const } /*! - Set the error \a line number. + Sets the error \a line number. */ void QDeclarativeError::setLine(int line) { @@ -174,7 +193,7 @@ void QDeclarativeError::setLine(int line) } /*! - Return the error column number. + Returns the error column number. */ int QDeclarativeError::column() const { @@ -183,7 +202,7 @@ int QDeclarativeError::column() const } /*! - Set the error \a column number. + Sets the error \a column number. */ void QDeclarativeError::setColumn(int column) { @@ -192,7 +211,7 @@ void QDeclarativeError::setColumn(int column) } /*! - Return the error as a human readable string. + Returns the error as a human readable string. */ QString QDeclarativeError::toString() const { @@ -210,7 +229,7 @@ QString QDeclarativeError::toString() const \relates QDeclarativeError \fn QDebug operator<<(QDebug debug, const QDeclarativeError &error) - Output a human readable version of \a error to \a debug. + Outputs a human readable version of \a error to \a debug. */ QDebug operator<<(QDebug debug, const QDeclarativeError &error) diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp index 762c642d..863bfc4 100644 --- a/src/declarative/qml/qdeclarativeextensionplugin.cpp +++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp @@ -59,6 +59,11 @@ QT_BEGIN_NAMESPACE function, and exporting the class using the Q_EXPORT_PLUGIN2() macro. + QML extension plugins can be used to provide either application-specific or + library-like plugins. Library plugins should limit themselves to registering types, + as any manipulation of the engine's root context may cause conflicts + or other issues in the library user's code. + See \l {Extending QML in C++} for details how to write a QML extension plugin. See \l {How to Create Qt Plugins} for general Qt plugin documentation. @@ -85,7 +90,7 @@ QDeclarativeExtensionPlugin::QDeclarativeExtensionPlugin(QObject *parent) } /*! - Destructor. + Destroys the plugin. */ QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin() { @@ -94,7 +99,9 @@ QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin() /*! \fn void QDeclarativeExtensionPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) - Initializes the extension from the \a uri using the \a engine. + Initializes the extension from the \a uri using the \a engine. Here an application + plugin might, for example, expose some data or objects to QML, + as context properties on the engine's root context. */ void QDeclarativeExtensionPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp index b992b9f..4be3472 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/declarative/qml/qdeclarativeimageprovider.cpp @@ -45,31 +45,39 @@ QT_BEGIN_NAMESPACE /*! \class QDeclarativeImageProvider - \brief The QDeclarativeImageProvider class provides an interface for threaded image requests. + \since 4.7 + \brief The QDeclarativeImageProvider class provides an interface for threaded image requests in QML. - Note: the request() method may be called by multiple threads, so ensure the + QDeclarativeImageProvider can be used by a QDeclarativeEngine to provide images to QML asynchronously. + The image request will be run in a low priority thread, allowing potentially costly image + loading to be done in the background, without affecting the performance of the UI. + + See the QDeclarativeEngine::addImageProvider() documentation for an + example of how a custom QDeclarativeImageProvider can be constructed and used. + + \note the request() method may be called by multiple threads, so ensure the implementation of this method is reentrant. \sa QDeclarativeEngine::addImageProvider() */ /*! - The destructor is virtual. + Destroys the image provider. */ QDeclarativeImageProvider::~QDeclarativeImageProvider() { } /*! - \fn QImage QDeclarativeImageProvider::request(const QString &id, QSize *size, const QSize& requested_size) + \fn QImage QDeclarativeImageProvider::request(const QString &id, QSize *size, const QSize& requestedSize) Implement this method to return the image with \a id. - If \a requested_size is a valid size, resize the image to that size before returning. + If \a requestedSize is a valid size, the image returned should be of that size. - In any case, \a size must be set to the (original) size of the image. + In all cases, \a size must be set to the original size of the image. - Note: this method may be called by multiple threads, so ensure the + \note this method may be called by multiple threads, so ensure the implementation of this method is reentrant. */ diff --git a/src/declarative/qml/qdeclarativeimageprovider.h b/src/declarative/qml/qdeclarativeimageprovider.h index 50b73fe..cc9c9af 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.h +++ b/src/declarative/qml/qdeclarativeimageprovider.h @@ -54,7 +54,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeImageProvider { public: virtual ~QDeclarativeImageProvider(); - virtual QImage request(const QString &id, QSize *size, const QSize& requested_size) = 0; + virtual QImage request(const QString &id, QSize *size, const QSize& requestedSize) = 0; }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativelist.cpp b/src/declarative/qml/qdeclarativelist.cpp index 45b8cd7..31ef4c2 100644 --- a/src/declarative/qml/qdeclarativelist.cpp +++ b/src/declarative/qml/qdeclarativelist.cpp @@ -87,9 +87,10 @@ void QDeclarativeListReferencePrivate::release() /*! \class QDeclarativeListReference +\since 4.7 \brief The QDeclarativeListReference class allows the manipulation of QDeclarativeListProperty properties. -QDeclarativeListReference allows programs to read from, and assign values to a QML list property in a +QDeclarativeListReference allows C++ programs to read from, and assign values to a QML list property in a simple and type safe way. A QDeclarativeListReference can be created by passing an object and property name or through a QDeclarativeProperty instance. These two are equivalant: @@ -304,6 +305,7 @@ int QDeclarativeListReference::count() const /*! \class QDeclarativeListProperty +\since 4.7 \brief The QDeclarativeListProperty class allows applications to explose list-like properties to QML. @@ -313,10 +315,10 @@ The use of a list property from QML looks like this: \code FruitBasket { fruit: [ - Apple {}, - Orange{}, - Banana {} - ] + Apple {}, + Orange{}, + Banana{} + ] } \endcode @@ -336,6 +338,9 @@ Q_PROPERTY(QDeclarativeListProperty fruit READ fruit); QML list properties are typesafe - in this case \c {Fruit} is a QObject type that \c {Apple}, \c {Orange} and \c {Banana} all derive from. + +\note QDeclarativeListProperty can only be used for lists of QObject-derived object pointers. + */ /*! diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index afd0d84..3881d0a 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -64,6 +64,7 @@ QT_BEGIN_NAMESPACE /*! \class QDeclarativeProperty +\since 4.7 \brief The QDeclarativeProperty class abstracts accessing properties on objects created from QML. As QML uses Qt's meta-type system all of the existing QMetaObject classes can be used to introspect -- cgit v0.12 From 8620548e1024c44fbff1cb1becaab8d2d9e53cd5 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 29 Mar 2010 16:57:56 +1000 Subject: ResizeMode support for QGraphicsWidgets created with QDeclarativeView Task-number: QTBUG-8814 Reviewed-by: alexis --- src/declarative/util/qdeclarativeview.cpp | 266 +++++++++++++------- src/declarative/util/qdeclarativeview.h | 2 +- tests/auto/declarative/declarative.pro | 1 + .../data/resizemodedeclarativeitem.qml | 5 + .../data/resizemodegraphicswidget.qml | 5 + .../qdeclarativeview/qdeclarativeview.pro | 7 + .../qdeclarativeview/tst_qdeclarativeview.cpp | 272 +++++++++++++++++++++ tools/qml/main.cpp | 9 +- tools/qml/qmlruntime.cpp | 112 +++++---- tools/qml/qmlruntime.h | 4 +- 10 files changed, 551 insertions(+), 132 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml create mode 100644 tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml create mode 100644 tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro create mode 100644 tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index f786898..5cfa0e8 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -59,10 +59,14 @@ #include #include #include -#include +#include +#include +#include #include #include #include +#include +#include QT_BEGIN_NAMESPACE @@ -124,19 +128,23 @@ void FrameBreakAnimation::updateCurrentTime(int msecs) server->frameBreak(); } -class QDeclarativeViewPrivate +class QDeclarativeViewPrivate : public QDeclarativeItemChangeListener { public: QDeclarativeViewPrivate(QDeclarativeView *view) - : q(view), root(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject) {} + : q(view), root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject) {} ~QDeclarativeViewPrivate() { delete root; } - void execute(); + void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry); + void initResize(); + void updateSize(); + inline QSize rootObjectSize(); QDeclarativeView *q; QDeclarativeGuard root; - QDeclarativeGuard qmlRoot; + QDeclarativeGuard declarativeItemRoot; + QDeclarativeGuard graphicsWidgetRoot; QUrl source; @@ -144,7 +152,6 @@ public: QDeclarativeComponent *component; QBasicTimer resizetimer; - mutable QSize initialSize; QDeclarativeView::ResizeMode resizeMode; QTime frameTimer; @@ -155,18 +162,32 @@ public: void QDeclarativeViewPrivate::execute() { - delete root; - delete component; - initialSize = QSize(); - component = new QDeclarativeComponent(&engine, source, q); - - if (!component->isLoading()) { - q->continueExecute(); - } else { - QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), q, SLOT(continueExecute())); + if (root) { + delete root; + root = 0; + } + if (component) { + delete component; + component = 0; + } + if (!source.isEmpty()) { + component = new QDeclarativeComponent(&engine, source, q); + if (!component->isLoading()) { + q->continueExecute(); + } else { + QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), q, SLOT(continueExecute())); + } } } +void QDeclarativeViewPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem, const QRectF &newGeometry, const QRectF &oldGeometry) +{ + if (resizeItem == root && resizeMode == QDeclarativeView::SizeViewToRootObject) { + // wait for both width and height to be changed + resizetimer.start(0,q); + } + QDeclarativeItemChangeListener::itemGeometryChanged(resizeItem, newGeometry, oldGeometry); +} /*! \class QDeclarativeView @@ -332,7 +353,6 @@ QDeclarativeContext* QDeclarativeView::rootContext() /*! \enum QDeclarativeView::Status - Specifies the loading status of the QDeclarativeView. \value Null This QDeclarativeView has no source set. @@ -373,7 +393,6 @@ QList QDeclarativeView::errors() const return QList(); } - /*! \property QDeclarativeView::resizeMode \brief whether the view should resize the canvas contents @@ -394,16 +413,92 @@ void QDeclarativeView::setResizeMode(ResizeMode mode) if (d->resizeMode == mode) return; + if (d->declarativeItemRoot) { + if (d->resizeMode == SizeViewToRootObject) { + QDeclarativeItemPrivate *p = + static_cast(QGraphicsItemPrivate::get(d->declarativeItemRoot)); + p->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry); + } + } else if (d->graphicsWidgetRoot) { + if (d->resizeMode == QDeclarativeView::SizeViewToRootObject) { + d->graphicsWidgetRoot->removeEventFilter(this); + } + } + d->resizeMode = mode; - if (d->qmlRoot) { - if (d->resizeMode == SizeRootObjectToView) { - d->qmlRoot->setWidth(width()); - d->qmlRoot->setHeight(height()); - } else { - d->qmlRoot->setWidth(d->initialSize.width()); - d->qmlRoot->setHeight(d->initialSize.height()); + if (d->root) { + d->initResize(); + } +} + +void QDeclarativeViewPrivate::initResize() +{ + if (declarativeItemRoot) { + if (resizeMode == QDeclarativeView::SizeViewToRootObject) { + QDeclarativeItemPrivate *p = + static_cast(QGraphicsItemPrivate::get(declarativeItemRoot)); + p->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry); + } + } else if (graphicsWidgetRoot) { + if (resizeMode == QDeclarativeView::SizeViewToRootObject) { + graphicsWidgetRoot->installEventFilter(q); + } + } + updateSize(); +} + +void QDeclarativeViewPrivate::updateSize() +{ + if (!root) + return; + if (declarativeItemRoot) { + if (resizeMode == QDeclarativeView::SizeViewToRootObject) { + QSize newSize = QSize(declarativeItemRoot->width(), declarativeItemRoot->height()); + if (newSize.isValid() && newSize != q->size()) { + q->resize(newSize); + } + } else if (resizeMode == QDeclarativeView::SizeRootObjectToView) { + if (!qFuzzyCompare(q->width(), declarativeItemRoot->width())) + declarativeItemRoot->setWidth(q->width()); + if (!qFuzzyCompare(q->height(), declarativeItemRoot->height())) + declarativeItemRoot->setHeight(q->height()); } + } else if (graphicsWidgetRoot) { + if (resizeMode == QDeclarativeView::SizeViewToRootObject) { + QSize newSize = QSize(graphicsWidgetRoot->size().width(), graphicsWidgetRoot->size().height()); + if (newSize.isValid() && newSize != q->size()) { + q->resize(newSize); + } + } else if (resizeMode == QDeclarativeView::SizeRootObjectToView) { + QSizeF newSize = QSize(q->size().width(), q->size().height()); + if (newSize.isValid() && newSize != graphicsWidgetRoot->size()) { + graphicsWidgetRoot->resize(newSize); + } + } + } + q->updateGeometry(); +} + +QSize QDeclarativeViewPrivate::rootObjectSize() +{ + QSize rootObjectSize(0,0); + int widthCandidate = -1; + int heightCandidate = -1; + if (declarativeItemRoot) { + widthCandidate = declarativeItemRoot->width(); + heightCandidate = declarativeItemRoot->height(); + } else if (root) { + QSizeF size = root->boundingRect().size(); + widthCandidate = size.width(); + heightCandidate = size.height(); + } + if (widthCandidate > 0) { + rootObjectSize.setWidth(widthCandidate); } + if (heightCandidate > 0) { + rootObjectSize.setHeight(heightCandidate); + } + return rootObjectSize; } QDeclarativeView::ResizeMode QDeclarativeView::resizeMode() const @@ -449,55 +544,46 @@ void QDeclarativeView::continueExecute() */ void QDeclarativeView::setRootObject(QObject *obj) { - if (QDeclarativeItem *item = qobject_cast(obj)) { - d->scene.addItem(item); - - d->root = item; - d->qmlRoot = item; - connect(item, SIGNAL(widthChanged()), this, SLOT(sizeChanged())); - connect(item, SIGNAL(heightChanged()), this, SLOT(sizeChanged())); - if (d->initialSize.height() <= 0 && d->qmlRoot->width() > 0) - d->initialSize.setWidth(d->qmlRoot->width()); - if (d->initialSize.height() <= 0 && d->qmlRoot->height() > 0) - d->initialSize.setHeight(d->qmlRoot->height()); - resize(d->initialSize); - - if (d->resizeMode == SizeRootObjectToView) { - d->qmlRoot->setWidth(width()); - d->qmlRoot->setHeight(height()); + if (d->root == obj) + return; + if (QDeclarativeItem *declarativeItem = qobject_cast(obj)) { + d->scene.addItem(declarativeItem); + d->root = declarativeItem; + d->declarativeItemRoot = declarativeItem; + } else if (QGraphicsObject *graphicsObject = qobject_cast(obj)) { + d->scene.addItem(graphicsObject); + d->root = graphicsObject; + if (graphicsObject->isWidget()) { + d->graphicsWidgetRoot = static_cast(graphicsObject); } else { - QSize sz(d->qmlRoot->width(),d->qmlRoot->height()); - emit sceneResized(sz); - resize(sz); + qWarning() << "QDeclarativeView::resizeMode is not honored for components of type QGraphicsObject"; } - updateGeometry(); - } else if (QGraphicsObject *item = qobject_cast(obj)) { - d->scene.addItem(item); - qWarning() << "QDeclarativeView::resizeMode is not honored for components of type QGraphicsObject"; - } else if (QWidget *wid = qobject_cast(obj)) { - window()->setAttribute(Qt::WA_OpaquePaintEvent, false); - window()->setAttribute(Qt::WA_NoSystemBackground, false); - if (!layout()) { - setLayout(new QVBoxLayout); - layout()->setContentsMargins(0, 0, 0, 0); - } else if (layout()->count()) { - // Hide the QGraphicsView in GV mode. - QLayoutItem *item = layout()->itemAt(0); - if (item->widget()) - item->widget()->hide(); + } else if (obj) { + qWarning() << "QDeclarativeView only supports loading of root objects that derive from QGraphicsObject"; + if (QWidget* widget = qobject_cast(obj)) { + window()->setAttribute(Qt::WA_OpaquePaintEvent, false); + window()->setAttribute(Qt::WA_NoSystemBackground, false); + if (layout() && layout()->count()) { + // Hide the QGraphicsView in GV mode. + QLayoutItem *item = layout()->itemAt(0); + if (item->widget()) + item->widget()->hide(); + } + widget->setParent(this); + if (isVisible()) { + widget->setVisible(true); + } + resize(widget->size()); } - layout()->addWidget(wid); - emit sceneResized(wid->size()); } -} -/*! - \internal - */ -void QDeclarativeView::sizeChanged() -{ - // delay, so we catch both width and height changing. - d->resizetimer.start(0,this); + if (d->root) { + QSize initialSize = d->rootObjectSize(); + if (initialSize != size()) { + resize(initialSize); + } + d->initResize(); + } } /*! @@ -508,30 +594,36 @@ void QDeclarativeView::sizeChanged() void QDeclarativeView::timerEvent(QTimerEvent* e) { if (!e || e->timerId() == d->resizetimer.timerId()) { - if (d->qmlRoot) { - QSize sz(d->qmlRoot->width(),d->qmlRoot->height()); - emit sceneResized(sz); - //if (!d->resizable) - //resize(sz); - } + d->updateSize(); d->resizetimer.stop(); - updateGeometry(); } } +bool QDeclarativeView::eventFilter(QObject *watched, QEvent *e) +{ + if (watched == d->root && d->resizeMode == SizeViewToRootObject) { + if (d->graphicsWidgetRoot) { + if (e->type() == QEvent::GraphicsSceneResize) { + d->updateSize(); + } + } + } + return QGraphicsView::eventFilter(watched, e); +} + /*! \internal - The size hint is the size of the root item. + Preferred size follows the root object in + resize mode SizeViewToRootObject and + the view in resize mode SizeRootObjectToView. */ QSize QDeclarativeView::sizeHint() const { - if (d->qmlRoot) { - if (d->initialSize.width() <= 0) - d->initialSize.setWidth(d->qmlRoot->width()); - if (d->initialSize.height() <= 0) - d->initialSize.setHeight(d->qmlRoot->height()); + if (d->resizeMode == SizeRootObjectToView) { + return size(); + } else { // d->resizeMode == SizeViewToRootObject + return d->rootObjectSize(); } - return d->initialSize; } /*! @@ -549,17 +641,17 @@ QGraphicsObject *QDeclarativeView::rootObject() const */ void QDeclarativeView::resizeEvent(QResizeEvent *e) { - if (d->resizeMode == SizeRootObjectToView && d->qmlRoot) { - d->qmlRoot->setWidth(width()); - d->qmlRoot->setHeight(height()); + if (d->resizeMode == SizeRootObjectToView) { + d->updateSize(); } - if (d->qmlRoot) { - setSceneRect(QRectF(0, 0, d->qmlRoot->width(), d->qmlRoot->height())); + if (d->declarativeItemRoot) { + setSceneRect(QRectF(0, 0, d->declarativeItemRoot->width(), d->declarativeItemRoot->height())); } else if (d->root) { setSceneRect(d->root->boundingRect()); } else { setSceneRect(rect()); } + emit sceneResized(e->size()); QGraphicsView::resizeEvent(e); } diff --git a/src/declarative/util/qdeclarativeview.h b/src/declarative/util/qdeclarativeview.h index 107f3f9..1807758 100644 --- a/src/declarative/util/qdeclarativeview.h +++ b/src/declarative/util/qdeclarativeview.h @@ -97,13 +97,13 @@ Q_SIGNALS: private Q_SLOTS: void continueExecute(); - void sizeChanged(); protected: virtual void resizeEvent(QResizeEvent *); virtual void paintEvent(QPaintEvent *event); virtual void timerEvent(QTimerEvent*); virtual void setRootObject(QObject *obj); + virtual bool eventFilter(QObject *watched, QEvent *e); friend class QDeclarativeViewPrivate; QDeclarativeViewPrivate *d; diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 7834650..58371c1 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -59,6 +59,7 @@ SUBDIRS += \ qdeclarativerepeater \ # Cover qdeclarativeworkerscript \ # Cover qdeclarativevaluetypes \ # Cover + qdeclarativeview \ # Cover qdeclarativexmlhttprequest \ # Cover qdeclarativeimageprovider \ # Cover qdeclarativestyledtext \ # Cover diff --git a/tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml b/tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml new file mode 100644 index 0000000..27c8454 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeview/data/resizemodedeclarativeitem.qml @@ -0,0 +1,5 @@ +import Qt 4.7 +Item { + width: 200 + height: 200 +} diff --git a/tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml b/tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml new file mode 100644 index 0000000..964810c --- /dev/null +++ b/tests/auto/declarative/qdeclarativeview/data/resizemodegraphicswidget.qml @@ -0,0 +1,5 @@ +import Qt 4.7 +QGraphicsWidget { + width: 200 + height: 200 +} diff --git a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro new file mode 100644 index 0000000..d6be728 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro @@ -0,0 +1,7 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qdeclarativeview.cpp + +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp new file mode 100644 index 0000000..1ed51c1 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp @@ -0,0 +1,272 @@ +/**************************************************************************** +** +** 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 test suite 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 +#include +#include +#include + +class tst_QDeclarativeView : public QObject + +{ + Q_OBJECT +public: + tst_QDeclarativeView(); + +private slots: + void resizemodedeclarativeitem(); + void resizemodegraphicswidget(); + +private: + template + T *findItem(QGraphicsObject *parent, const QString &objectName); +}; + + +tst_QDeclarativeView::tst_QDeclarativeView() +{ +} + +void tst_QDeclarativeView::resizemodedeclarativeitem() +{ + QWidget window; + QDeclarativeView *canvas = new QDeclarativeView(&window); + QVERIFY(canvas); + QSignalSpy sceneResizedSpy(canvas, SIGNAL(sceneResized(QSize))); + canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodedeclarativeitem.qml")); + QDeclarativeItem* declarativeItem = qobject_cast(canvas->rootObject()); + QVERIFY(declarativeItem); + window.show(); + + // initial size from root object + QCOMPARE(declarativeItem->width(), 200.0); + QCOMPARE(declarativeItem->height(), 200.0); + QCOMPARE(canvas->size(), QSize(200, 200)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy.count(), 1); + + // size update from view + canvas->resize(QSize(80,100)); + QCOMPARE(declarativeItem->width(), 80.0); + QCOMPARE(declarativeItem->height(), 100.0); + QCOMPARE(canvas->size(), QSize(80, 100)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy.count(), 2); + + canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject); + + // size update from view disabled + canvas->resize(QSize(60,80)); + QCOMPARE(declarativeItem->width(), 80.0); + QCOMPARE(declarativeItem->height(), 100.0); + QCOMPARE(canvas->size(), QSize(60, 80)); + QCOMPARE(sceneResizedSpy.count(), 3); + + // size update from root object + declarativeItem->setWidth(250); + declarativeItem->setHeight(350); + qApp->processEvents(); + QCOMPARE(declarativeItem->width(), 250.0); + QCOMPARE(declarativeItem->height(), 350.0); + QCOMPARE(canvas->size(), QSize(250, 350)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy.count(), 4); + + // reset canvas + window.hide(); + delete canvas; + canvas = new QDeclarativeView(&window); + QVERIFY(canvas); + QSignalSpy sceneResizedSpy2(canvas, SIGNAL(sceneResized(QSize))); + canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodedeclarativeitem.qml")); + declarativeItem = qobject_cast(canvas->rootObject()); + QVERIFY(declarativeItem); + window.show(); + + // initial size for root object + QCOMPARE(declarativeItem->width(), 200.0); + QCOMPARE(declarativeItem->height(), 200.0); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy2.count(), 1); + + // size update from root object + declarativeItem->setWidth(80); + declarativeItem->setHeight(100); + qApp->processEvents(); + QCOMPARE(declarativeItem->width(), 80.0); + QCOMPARE(declarativeItem->height(), 100.0); + QCOMPARE(canvas->size(), QSize(80, 100)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy2.count(), 2); + + // size update from root object disabled + canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView); + declarativeItem->setWidth(60); + declarativeItem->setHeight(80); + QCOMPARE(canvas->width(), 80); + QCOMPARE(canvas->height(), 100); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy2.count(), 2); + + // size update from view + canvas->resize(QSize(200,300)); + QCOMPARE(declarativeItem->width(), 200.0); + QCOMPARE(declarativeItem->height(), 300.0); + QCOMPARE(canvas->size(), QSize(200, 300)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy2.count(), 3); + + delete canvas; +} + +void tst_QDeclarativeView::resizemodegraphicswidget() +{ + QWidget window; + QDeclarativeView *canvas = new QDeclarativeView(&window); + QVERIFY(canvas); + QSignalSpy sceneResizedSpy(canvas, SIGNAL(sceneResized(QSize))); + canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodegraphicswidget.qml")); + QGraphicsWidget* graphicsWidget = qobject_cast(canvas->rootObject()); + QVERIFY(graphicsWidget); + window.show(); + + // initial size from root object + QCOMPARE(graphicsWidget->size(), QSizeF(200.0, 200.0)); + QCOMPARE(canvas->size(), QSize(200, 200)); + QCOMPARE(canvas->size(), QSize(200, 200)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy.count(), 1); + + // size update from view + canvas->resize(QSize(80,100)); + QCOMPARE(graphicsWidget->size(), QSizeF(80.0,100.0)); + QCOMPARE(canvas->size(), QSize(80,100)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy.count(), 2); + + // size update from view disabled + canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject); + canvas->resize(QSize(60,80)); + QCOMPARE(graphicsWidget->size(), QSizeF(80.0,100.0)); + QCOMPARE(canvas->size(), QSize(60, 80)); + QCOMPARE(sceneResizedSpy.count(), 3); + + // size update from root object + graphicsWidget->resize(QSizeF(250.0, 350.0)); + QCOMPARE(graphicsWidget->size(), QSizeF(250.0,350.0)); + QCOMPARE(canvas->size(), QSize(250, 350)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy.count(), 4); + + // reset canvas + window.hide(); + delete canvas; + canvas = new QDeclarativeView(&window); + QVERIFY(canvas); + QSignalSpy sceneResizedSpy2(canvas, SIGNAL(sceneResized(QSize))); + canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/resizemodegraphicswidget.qml")); + graphicsWidget = qobject_cast(canvas->rootObject()); + QVERIFY(graphicsWidget); + window.show(); + + // initial size from root object + QCOMPARE(graphicsWidget->size(), QSizeF(200.0, 200.0)); + QCOMPARE(canvas->size(), QSize(200, 200)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy2.count(), 1); + + // size update from root object + graphicsWidget->resize(QSizeF(80, 100)); + QCOMPARE(graphicsWidget->size(), QSizeF(80.0, 100.0)); + QCOMPARE(canvas->size(), QSize(80, 100)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy2.count(), 2); + + // size update from root object disabled + canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView); + graphicsWidget->resize(QSizeF(60,80)); + QCOMPARE(canvas->size(), QSize(80,100)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy2.count(), 2); + + // size update from view + canvas->resize(QSize(200,300)); + QCOMPARE(graphicsWidget->size(), QSizeF(200.0, 300.0)); + QCOMPARE(canvas->size(), QSize(200, 300)); + QCOMPARE(canvas->size(), canvas->sizeHint()); + QCOMPARE(sceneResizedSpy2.count(), 3); + + window.show(); + delete canvas; +} + +template +T *tst_QDeclarativeView::findItem(QGraphicsObject *parent, const QString &objectName) +{ + if (!parent) + return 0; + + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->QGraphicsObject::children().count() << "children"; + for (int i = 0; i < parent->childItems().count(); ++i) { + QDeclarativeItem *item = qobject_cast(parent->childItems().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) + return static_cast(item); + item = findItem(item, objectName); + if (item) + return static_cast(item); + } + + return 0; +} + +QTEST_MAIN(tst_QDeclarativeView) + +#include "tst_qdeclarativeview.moc" diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 341908e..5e829a4 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -88,6 +88,8 @@ void usage() qWarning(" -skin ...................... run with a skin window frame"); qWarning(" \"list\" for a list of built-ins"); qWarning(" -resizeview .............................. resize the view, not the skin"); + qWarning(" -sizeviewtorootobject .................... the view resizes to the changes in the content"); + qWarning(" -sizerootobjecttoview .................... the content resizes to the changes in the view"); qWarning(" -qmlbrowser .............................. use a QML-based file browser"); qWarning(" -recordfile ..................... set video recording file"); qWarning(" - ImageMagick 'convert' for GIF)"); @@ -184,6 +186,7 @@ int main(int argc, char ** argv) bool stayOnTop = false; bool maximized = false; bool useNativeFileBrowser = true; + bool sizeToView = true; #if defined(Q_OS_SYMBIAN) maximized = true; @@ -270,6 +273,10 @@ int main(int argc, char ** argv) if (lastArg) usage(); script = QString(argv[++i]); runScript = true; + } else if (arg == "-sizeviewtorootobject") { + sizeToView = false; + } else if (arg == "-sizerootobjecttoview") { + sizeToView = true; } else if (arg[0] != '-') { fileName = arg; } else if (1 || arg == "-help") { @@ -339,6 +346,7 @@ int main(int argc, char ** argv) viewer.setNetworkCacheSize(cache); viewer.setRecordFile(recordfile); + viewer.setSizeToView(sizeToView); if (resizeview) viewer.setScaleView(); if (fps>0) @@ -390,6 +398,5 @@ int main(int argc, char ** argv) } viewer.setUseGL(useGL); viewer.raise(); - return app.exec(); } diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 53409c1..7b4706b 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -496,7 +496,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) canvas = new QDeclarativeView(this); canvas->setAttribute(Qt::WA_OpaquePaintEvent); canvas->setAttribute(Qt::WA_NoSystemBackground); - canvas->setResizeMode((!skin || !scaleSkin) ? QDeclarativeView::SizeRootObjectToView : QDeclarativeView::SizeViewToRootObject); + canvas->setFocus(); QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize))); @@ -519,7 +519,6 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) #else setCentralWidget(canvas); #endif - namFactory = new NetworkAccessManagerFactory; canvas->engine()->setNetworkAccessManagerFactory(namFactory); @@ -753,10 +752,11 @@ void QDeclarativeViewer::setScaleSkin() if (scaleSkin) return; scaleSkin = true; - canvas->setResizeMode((!skin || !scaleSkin) ? QDeclarativeView::SizeRootObjectToView : QDeclarativeView::SizeViewToRootObject); if (skin) { - canvas->setFixedSize(canvas->sizeHint()); - skin->setScreenSize(canvas->sizeHint()); + canvas->resize(initialSize); + canvas->setFixedSize(initialSize); + canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject); + updateSizeHints(); } } @@ -766,11 +766,8 @@ void QDeclarativeViewer::setScaleView() return; scaleSkin = false; if (skin) { - canvas->setResizeMode((!skin || !scaleSkin) ? QDeclarativeView::SizeRootObjectToView : QDeclarativeView::SizeViewToRootObject); - canvas->setMinimumSize(QSize(0,0)); - canvas->setMaximumSize(QSize(16777215,16777215)); - canvas->resize(skin->standardScreenSize()); - skin->setScreenSize(skin->standardScreenSize()); + canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView); + updateSizeHints(); } } @@ -916,19 +913,12 @@ void QDeclarativeViewer::statusChanged() tester->executefailure(); if (canvas->status() == QDeclarativeView::Ready) { - if (!skin) { - canvas->updateGeometry(); - if (mb) - mb->updateGeometry(); - if (!isFullScreen() && !isMaximized()) - resize(sizeHint()); - } else { - if (scaleSkin) - canvas->resize(canvas->sizeHint()); - else { - canvas->setFixedSize(skin->standardScreenSize()); - canvas->resize(skin->standardScreenSize()); - } + initialSize = canvas->sizeHint(); + if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) { + QSize newWindowSize = initialSize; + newWindowSize.setHeight(newWindowSize.height()+menuBar()->height()); + updateSizeHints(); + resize(newWindowSize); } } } @@ -1010,7 +1000,6 @@ bool QDeclarativeViewer::open(const QString& file_or_url) t.start(); canvas->setSource(url); - qWarning() << "Wall startup time:" << t.elapsed(); return true; @@ -1056,41 +1045,43 @@ void QDeclarativeViewer::setSkin(const QString& skinDirOrName) skin->deleteLater(); } - canvas->setResizeMode((!skin || !scaleSkin) ? QDeclarativeView::SizeRootObjectToView : QDeclarativeView::SizeViewToRootObject); - DeviceSkinParameters parameters; if (!skinDirectory.isEmpty() && parameters.read(skinDirectory,DeviceSkinParameters::ReadAll,&err)) { layout()->setEnabled(false); - //setMenuBar(0); if (mb) mb->hide(); if (!err.isEmpty()) qWarning() << err; skin = new PreviewDeviceSkin(parameters,this); - canvas->resize(canvas->sizeHint()); if (scaleSkin) skin->setPreviewAndScale(canvas); else skin->setPreview(canvas); createMenu(0,skin->menu); + if (scaleSkin) { + canvas->setResizeMode(QDeclarativeView::SizeViewToRootObject); + } + updateSizeHints(); skin->show(); - } else { + } else if (skin) { skin = 0; clearMask(); menuBar()->clear(); - canvas->setParent(this, Qt::SubWindow); createMenu(menuBar(),0); - mb->show(); - setMinimumSize(QSize(0,0)); - setMaximumSize(QSize(16777215,16777215)); - canvas->setMinimumSize(QSize(0,0)); - canvas->setMaximumSize(QSize(16777215,16777215)); - QRect g = geometry(); - g.setSize(sizeHint()); + canvas->setParent(this, Qt::SubWindow); setParent(0,windowFlags()); // recreate - canvas->move(0,menuBar()->sizeHint().height()); - setGeometry(g); + mb->show(); + canvas->setResizeMode(QDeclarativeView::SizeRootObjectToView); + updateSizeHints(); + layout()->setEnabled(true); + if (!scaleSkin) { + canvas->resize(initialSize); + canvas->setFixedSize(initialSize); + } + QSize newWindowSize = canvas->size(); + newWindowSize.setHeight(newWindowSize.height()+menuBar()->height()); + resize(newWindowSize); show(); } canvas->show(); @@ -1122,9 +1113,10 @@ void QDeclarativeViewer::setRecordRate(int fps) void QDeclarativeViewer::sceneResized(QSize size) { if (size.width() > 0 && size.height() > 0) { - if (skin && scaleSkin) - skin->setScreenSize(size); - } + if (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject) { + updateSizeHints(); + } + } } void QDeclarativeViewer::keyPressEvent(QKeyEvent *event) @@ -1397,6 +1389,42 @@ void QDeclarativeViewer::setUseNativeFileBrowser(bool use) useQmlFileBrowser = !use; } +void QDeclarativeViewer::setSizeToView(bool sizeToView) +{ + QDeclarativeView::ResizeMode resizeMode = sizeToView ? QDeclarativeView::SizeRootObjectToView : QDeclarativeView::SizeViewToRootObject; + if (resizeMode != canvas->resizeMode()) { + canvas->setResizeMode(resizeMode); + updateSizeHints(); + } +} + +void QDeclarativeViewer::updateSizeHints() +{ + if (canvas->resizeMode() == QDeclarativeView::SizeViewToRootObject) { + QSize newWindowSize = canvas->sizeHint(); + if (!skin) { + newWindowSize.setHeight(newWindowSize.height()+menuBar()->height()); + } + if (!isFullScreen() && !isMaximized()) { + resize(newWindowSize); + setFixedSize(newWindowSize); + if (skin && scaleSkin) { + skin->setScreenSize(newWindowSize); + } + } + } else { // QDeclarativeView::SizeRootObjectToView + canvas->setMinimumSize(QSize(0,0)); + canvas->setMaximumSize(QSize(16777215,16777215)); + setMinimumSize(QSize(0,0)); + setMaximumSize(QSize(16777215,16777215)); + if (skin && !scaleSkin) { + canvas->setFixedSize(skin->standardScreenSize()); + skin->setScreenSize(skin->standardScreenSize()); + } + } + updateGeometry(); +} + void QDeclarativeViewer::registerTypes() { static bool registered = false; diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index 2089dda..a00a703 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -100,7 +100,8 @@ public: void addPluginPath(const QString& plugin); void setUseGL(bool use); void setUseNativeFileBrowser(bool); - + void updateSizeHints(); + void setSizeToView(bool sizeToView); QStringList builtinSkins() const; QMenuBar *menuBar() const; @@ -149,6 +150,7 @@ private: PreviewDeviceSkin *skin; QSize skinscreensize; QDeclarativeView *canvas; + QSize initialSize; QString currentFileOrUrl; QDeclarativeTimer recordTimer; QString frame_fmt; -- cgit v0.12 From b458d672dbec892f00019edc1fe06156190401c7 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Fri, 16 Apr 2010 15:25:23 +1000 Subject: Test not reliable --- tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp index 2621d65..b8e317e 100644 --- a/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp +++ b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp @@ -111,14 +111,6 @@ void tst_QPacketProtocol::setMaximumPacketSize() QPacketProtocol out(m_serverConn); QCOMPARE(out.setMaximumPacketSize(size), expected); - - if (size == expected) { - QPacketProtocol in(m_client); - QByteArray b; - b.fill('a', size + 1); - out.send() << b.constData(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(invalidPacket()))); - } } void tst_QPacketProtocol::setMaximumPacketSize_data() -- cgit v0.12 From 34a1a6b5d6399e7bcad136fdaa9a050a0f8bb2dc Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Fri, 16 Apr 2010 15:33:41 +1000 Subject: Wait for debug clients asynchronously instead of blocking creation of the engine until a debug client has connected. This makes for easier debugging from Qt Creator when debugging C++ and QML together and when debugging an application that has multiple engines. --- .../debugger/qdeclarativedebugservice.cpp | 133 +++++++++------------ .../debugger/qdeclarativedebugservice_p.h | 7 +- src/declarative/qml/qdeclarativeengine.cpp | 2 - .../qdeclarativedebug/tst_qdeclarativedebug.cpp | 91 +++++++------- .../tst_qdeclarativedebugclient.cpp | 42 +++---- .../tst_qdeclarativedebugservice.cpp | 42 +++---- tests/auto/declarative/shared/debugutil.cpp | 81 +------------ tests/auto/declarative/shared/debugutil_p.h | 56 --------- 8 files changed, 143 insertions(+), 311 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp index 9d9d1d0..34e73fd 100644 --- a/src/declarative/debugger/qdeclarativedebugservice.cpp +++ b/src/declarative/debugger/qdeclarativedebugservice.cpp @@ -60,12 +60,12 @@ class QDeclarativeDebugServer : public QObject Q_DISABLE_COPY(QDeclarativeDebugServer) public: static QDeclarativeDebugServer *instance(); - void wait(); - void registerForStartNotification(QObject *object, const char *receiver); + void listen(); + bool hasDebuggingClient() const; private Q_SLOTS: void readyRead(); - void registeredObjectDestroyed(QObject *object); + void newConnection(); private: friend class QDeclarativeDebugService; @@ -78,14 +78,14 @@ class QDeclarativeDebugServerPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QDeclarativeDebugServer) public: QDeclarativeDebugServerPrivate(); - void wait(); int port; QTcpSocket *connection; QPacketProtocol *protocol; QHash plugins; QStringList enabledPlugins; - QList > notifyClients; + QTcpServer *tcpServer; + bool gotHello; }; class QDeclarativeDebugServicePrivate : public QObjectPrivate @@ -99,56 +99,41 @@ public: }; QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() -: connection(0), protocol(0) +: connection(0), protocol(0), gotHello(false) { } -void QDeclarativeDebugServerPrivate::wait() +void QDeclarativeDebugServer::listen() { - Q_Q(QDeclarativeDebugServer); - QTcpServer server; - - if (!server.listen(QHostAddress::Any, port)) { - qWarning("QDeclarativeDebugServer: Unable to listen on port %d", port); - return; - } - - qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", port); - - for (int i=0; itcpServer = new QTcpServer(this); + QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); + if (d->tcpServer->listen(QHostAddress::Any, d->port)) + qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port); + else + qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); +} - connection = server.nextPendingConnection(); - connection->setParent(q); - protocol = new QPacketProtocol(connection, q); +void QDeclarativeDebugServer::newConnection() +{ + Q_D(QDeclarativeDebugServer); - // ### Wait for hello - while (!protocol->packetsAvailable()) { - connection->waitForReadyRead(); - } - QPacket hello = protocol->read(); - QString name; - hello >> name >> enabledPlugins; - if (name != QLatin1String("QDeclarativeDebugServer")) { - qWarning("QDeclarativeDebugServer: Invalid hello message"); - delete protocol; delete connection; connection = 0; protocol = 0; + if (d->connection) { + qWarning("QDeclarativeDebugServer error: another client is already connected"); return; } - QObject::connect(protocol, SIGNAL(readyRead()), q, SLOT(readyRead())); - q->readyRead(); + d->connection = d->tcpServer->nextPendingConnection(); + d->connection->setParent(this); + d->protocol = new QPacketProtocol(d->connection, this); + QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); +} - qWarning("QDeclarativeDebugServer: Connection established"); +bool QDeclarativeDebugServer::hasDebuggingClient() const +{ + Q_D(const QDeclarativeDebugServer); + return d->gotHello; } QDeclarativeDebugServer *QDeclarativeDebugServer::instance() @@ -163,36 +148,15 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() bool ok = false; int port = env.toInt(&ok); - if (ok && port > 1024) + if (ok && port > 1024) { server = new QDeclarativeDebugServer(port); + server->listen(); + } } return server; } -void QDeclarativeDebugServer::wait() -{ - Q_D(QDeclarativeDebugServer); - d->wait(); -} - -void QDeclarativeDebugServer::registerForStartNotification(QObject *object, const char *methodName) -{ - Q_D(QDeclarativeDebugServer); - connect(object, SIGNAL(destroyed(QObject*)), SLOT(registeredObjectDestroyed(QObject*))); - d->notifyClients.append(qMakePair(object, QByteArray(methodName))); -} - -void QDeclarativeDebugServer::registeredObjectDestroyed(QObject *object) -{ - Q_D(QDeclarativeDebugServer); - QMutableListIterator > i(d->notifyClients); - while (i.hasNext()) { - if (i.next().first == object) - i.remove(); - } -} - QDeclarativeDebugServer::QDeclarativeDebugServer(int port) : QObject(*(new QDeclarativeDebugServerPrivate)) { @@ -204,6 +168,23 @@ void QDeclarativeDebugServer::readyRead() { Q_D(QDeclarativeDebugServer); + if (!d->gotHello) { + QPacket hello = d->protocol->read(); + QString name; + hello >> name >> d->enabledPlugins; + if (name != QLatin1String("QDeclarativeDebugServer")) { + qWarning("QDeclarativeDebugServer: Invalid hello message"); + QObject::disconnect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); + d->protocol->deleteLater(); + d->protocol = 0; + d->connection->deleteLater(); + d->connection = 0; + return; + } + d->gotHello = true; + qWarning("QDeclarativeDebugServer: Connection established"); + } + QString debugServer(QLatin1String("QDeclarativeDebugServer")); while (d->protocol->packetsAvailable()) { @@ -375,6 +356,12 @@ bool QDeclarativeDebugService::isDebuggingEnabled() return QDeclarativeDebugServer::instance() != 0; } +bool QDeclarativeDebugService::hasDebuggingClient() +{ + return QDeclarativeDebugServer::instance() != 0 + && QDeclarativeDebugServer::instance()->hasDebuggingClient(); +} + QString QDeclarativeDebugService::objectToString(QObject *obj) { if(!obj) @@ -390,16 +377,6 @@ QString QDeclarativeDebugService::objectToString(QObject *obj) return rv; } -void QDeclarativeDebugService::waitForClients() -{ - QDeclarativeDebugServer::instance()->wait(); -} - -void QDeclarativeDebugService::notifyOnServerStart(QObject *object, const char *receiver) -{ - QDeclarativeDebugServer::instance()->registerForStartNotification(object, receiver); -} - void QDeclarativeDebugService::sendMessage(const QByteArray &message) { Q_D(QDeclarativeDebugService); diff --git a/src/declarative/debugger/qdeclarativedebugservice_p.h b/src/declarative/debugger/qdeclarativedebugservice_p.h index 498edf3..c461ddf 100644 --- a/src/declarative/debugger/qdeclarativedebugservice_p.h +++ b/src/declarative/debugger/qdeclarativedebugservice_p.h @@ -68,19 +68,16 @@ public: static int idForObject(QObject *); static QObject *objectForId(int); - static bool isDebuggingEnabled(); static QString objectToString(QObject *obj); - static void waitForClients(); - - static void notifyOnServerStart(QObject *object, const char *receiver); + static bool isDebuggingEnabled(); + static bool hasDebuggingClient(); protected: virtual void enabledChanged(bool); virtual void messageReceived(const QByteArray &); private: - void registerForStartNotification(QObject *object, const char *methodName); friend class QDeclarativeDebugServer; }; diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index cfdc79e..4dbd199 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -390,8 +390,6 @@ void QDeclarativeEnginePrivate::init() qmlEngineDebugServer(); isDebugging = true; QDeclarativeEngineDebugServer::addEngine(q); - - qmlEngineDebugServer()->waitForClients(); } } diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp index 133dcb8..49d430e 100644 --- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp +++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp @@ -60,6 +60,7 @@ #include #include +#include "../../../shared/util.h" #include "../shared/debugutil_p.h" Q_DECLARE_METATYPE(QDeclarativeDebugWatch::State) @@ -69,14 +70,6 @@ class tst_QDeclarativeDebug : public QObject { Q_OBJECT -public: - tst_QDeclarativeDebug(QDeclarativeDebugTestData *data) - { - m_conn = data->conn; - m_engine = data->engine; - m_rootItem = data->items[0]; - } - private: QDeclarativeDebugObjectReference findRootObject(); QDeclarativeDebugPropertyReference findProperty(const QList &props, const QString &name) const; @@ -93,8 +86,11 @@ private: QDeclarativeEngine *m_engine; QDeclarativeItem *m_rootItem; + QObjectList m_components; + private slots: void initTestCase(); + void cleanupTestCase(); void watch_property(); void watch_object(); @@ -278,9 +274,50 @@ void tst_QDeclarativeDebug::compareProperties(const QDeclarativeDebugPropertyRef void tst_QDeclarativeDebug::initTestCase() { + qRegisterMetaType(); + + qputenv("QML_DEBUG_SERVER_PORT", "3768"); + m_engine = new QDeclarativeEngine(this); + + QList qml; + qml << "import Qt 4.7\n" + "Item {" + "width: 10; height: 20; scale: blueRect.scale;" + "Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }" + "Text { color: blueRect.color; }" + "MouseArea {" + "onEntered: { console.log('hello') }" + "}" + "}"; + // add second component to test multiple root contexts + qml << "import Qt 4.7\n" + "Item {}"; + + for (int i=0; i(component.create()); + } + m_rootItem = qobject_cast(m_components.first()); + + + // add an extra context to test for multiple contexts + QDeclarativeContext *context = new QDeclarativeContext(m_engine->rootContext(), this); + context->setObjectName("tst_QDeclarativeDebug_childContext"); + + m_conn = new QDeclarativeDebugConnection(this); + m_conn->connectToHost("127.0.0.1", 3768); + bool ok = m_conn->waitForConnected(); + Q_ASSERT(ok); + QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient()); + m_dbg = new QDeclarativeEngineDebug(m_conn, this); +} - qRegisterMetaType(); +void tst_QDeclarativeDebug::cleanupTestCase() +{ + qDeleteAll(m_components); } void tst_QDeclarativeDebug::watch_property() @@ -804,40 +841,6 @@ void tst_QDeclarativeDebug::tst_QDeclarativeDebugPropertyReference() compareProperties(r, ref); } - -class tst_QDeclarativeDebug_Factory : public QDeclarativeTestFactory -{ -public: - QObject *createTest(QDeclarativeDebugTestData *data) - { - tst_QDeclarativeDebug *test = new tst_QDeclarativeDebug(data); - QDeclarativeContext *c = new QDeclarativeContext(data->engine->rootContext(), test); - c->setObjectName("tst_QDeclarativeDebug_childContext"); - return test; - } -}; - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QList qml; - qml << "import Qt 4.7\n" - "Item {" - "width: 10; height: 20; scale: blueRect.scale;" - "Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }" - "Text { color: blueRect.color; }" - "MouseArea {" - "onEntered: { console.log('hello') }" - "}" - "}"; - // add second component to test multiple root contexts - qml << "import Qt 4.7\n" - "Item {}"; - tst_QDeclarativeDebug_Factory factory; - return QDeclarativeDebugTest::runTests(&factory, qml); -} - -//QTEST_MAIN(tst_QDeclarativeDebug) +QTEST_MAIN(tst_QDeclarativeDebug) #include "tst_qdeclarativedebug.moc" diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index d3679a7..fb17f90 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -52,21 +52,19 @@ #include #include +#include "../../../shared/util.h" #include "../shared/debugutil_p.h" class tst_QDeclarativeDebugClient : public QObject { Q_OBJECT -public: - tst_QDeclarativeDebugClient(QDeclarativeDebugTestData *data) - { - m_conn = data->conn; - } - +private: QDeclarativeDebugConnection *m_conn; private slots: + void initTestCase(); + void name(); void isEnabled(); void setEnabled(); @@ -74,6 +72,19 @@ private slots: void sendMessage(); }; +void tst_QDeclarativeDebugClient::initTestCase() +{ + qputenv("QML_DEBUG_SERVER_PORT", "3768"); + new QDeclarativeEngine(this); + + m_conn = new QDeclarativeDebugConnection(this); + m_conn->connectToHost("127.0.0.1", 3768); + bool ok = m_conn->waitForConnected(); + Q_ASSERT(ok); + + QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient()); +} + void tst_QDeclarativeDebugClient::name() { QString name = "tst_QDeclarativeDebugClient::name()"; @@ -136,22 +147,7 @@ void tst_QDeclarativeDebugClient::sendMessage() QCOMPARE(resp, msg); } - -class tst_QDeclarativeDebugClient_Factory : public QDeclarativeTestFactory -{ -public: - QObject *createTest(QDeclarativeDebugTestData *data) { return new tst_QDeclarativeDebugClient(data); } -}; - - -// This does not use QTEST_MAIN because the test has to be created and run -// in a separate thread. -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - tst_QDeclarativeDebugClient_Factory factory; - return QDeclarativeDebugTest::runTests(&factory); -} +QTEST_MAIN(tst_QDeclarativeDebugClient) #include "tst_qdeclarativedebugclient.moc" + diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index c8fc001..80d7f76 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -52,21 +52,19 @@ #include #include +#include "../../../shared/util.h" #include "../shared/debugutil_p.h" + class tst_QDeclarativeDebugService : public QObject { Q_OBJECT - -public: - tst_QDeclarativeDebugService(QDeclarativeDebugTestData *data) - { - m_conn = data->conn; - } - +private: QDeclarativeDebugConnection *m_conn; private slots: + void initTestCase(); + void name(); void isEnabled(); void enabledChanged(); @@ -76,6 +74,19 @@ private slots: void objectToString(); }; +void tst_QDeclarativeDebugService::initTestCase() +{ + qputenv("QML_DEBUG_SERVER_PORT", "3768"); + new QDeclarativeEngine(this); + + m_conn = new QDeclarativeDebugConnection(this); + m_conn->connectToHost("127.0.0.1", 3768); + bool ok = m_conn->waitForConnected(); + Q_ASSERT(ok); + + QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient()); +} + void tst_QDeclarativeDebugService::name() { QString name = "tst_QDeclarativeDebugService::name()"; @@ -170,21 +181,6 @@ void tst_QDeclarativeDebugService::objectToString() delete obj; } - -class tst_QDeclarativeDebugService_Factory : public QDeclarativeTestFactory -{ -public: - QObject *createTest(QDeclarativeDebugTestData *data) { return new tst_QDeclarativeDebugService(data); } -}; - -// This does not use QTEST_MAIN because the test has to be created and run -// in a separate thread. -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - tst_QDeclarativeDebugService_Factory factory; - return QDeclarativeDebugTest::runTests(&factory); -} +QTEST_MAIN(tst_QDeclarativeDebugService) #include "tst_qdeclarativedebugservice.moc" diff --git a/tests/auto/declarative/shared/debugutil.cpp b/tests/auto/declarative/shared/debugutil.cpp index 66f04e5..c0c3eca 100644 --- a/tests/auto/declarative/shared/debugutil.cpp +++ b/tests/auto/declarative/shared/debugutil.cpp @@ -47,11 +47,11 @@ #include "debugutil_p.h" -#include bool QDeclarativeDebugTest::waitForSignal(QObject *receiver, const char *member, int timeout) { QEventLoop loop; QTimer timer; + timer.setSingleShot(true); QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); QObject::connect(receiver, member, &loop, SLOT(quit())); timer.start(timeout); @@ -59,25 +59,6 @@ bool QDeclarativeDebugTest::waitForSignal(QObject *receiver, const char *member, return timer.isActive(); } - -QDeclarativeDebugTestData::QDeclarativeDebugTestData(QEventLoop *el) - : exitCode(-1), loop(el) -{ -} - -QDeclarativeDebugTestData::~QDeclarativeDebugTestData() -{ - qDeleteAll(items); -} - -void QDeclarativeDebugTestData::testsFinished(int code) -{ - exitCode = code; - loop->quit(); -} - - - QDeclarativeDebugTestService::QDeclarativeDebugTestService(const QString &s, QObject *parent) : QDeclarativeDebugService(s, parent), enabled(false) { @@ -117,63 +98,3 @@ void QDeclarativeDebugTestClient::messageReceived(const QByteArray &ba) emit serverMessage(ba); } - -tst_QDeclarativeDebug_Thread::tst_QDeclarativeDebug_Thread(QDeclarativeDebugTestData *data, QDeclarativeTestFactory *factory) - : m_data(data), m_factory(factory) -{ -} - -void tst_QDeclarativeDebug_Thread::run() -{ - bool ok = false; - - QDeclarativeDebugConnection conn; - conn.connectToHost("127.0.0.1", 3768); - ok = conn.waitForConnected(); - Q_ASSERT(ok); - - QEventLoop loop; - connect(m_data, SIGNAL(engineCreated()), &loop, SLOT(quit())); - loop.exec(); - - m_data->conn = &conn; - - Q_ASSERT(m_factory); - QObject *test = m_factory->createTest(m_data); - Q_ASSERT(test); - int code = QTest::qExec(test, QCoreApplication::arguments()); - delete test; - emit testsFinished(code); -} - -int QDeclarativeDebugTest::runTests(QDeclarativeTestFactory *factory, const QList &qml) -{ - qputenv("QML_DEBUG_SERVER_PORT", "3768"); - - QEventLoop loop; - QDeclarativeDebugTestData data(&loop); - - tst_QDeclarativeDebug_Thread thread(&data, factory); - QObject::connect(&thread, SIGNAL(testsFinished(int)), &data, SLOT(testsFinished(int))); - - QDeclarativeDebugService::notifyOnServerStart(&thread, "start"); - - QDeclarativeEngine engine; // blocks until client connects - - foreach (const QByteArray &code, qml) { - QDeclarativeComponent c(&engine); - c.setData(code, QUrl::fromLocalFile("")); - Q_ASSERT(c.isReady()); // fails if bad syntax - data.items << qobject_cast(c.create()); - } - - // start the test - data.engine = &engine; - emit data.engineCreated(); - - loop.exec(); - thread.wait(); - - return data.exitCode; -} - diff --git a/tests/auto/declarative/shared/debugutil_p.h b/tests/auto/declarative/shared/debugutil_p.h index c152b5a..e6bb7ad 100644 --- a/tests/auto/declarative/shared/debugutil_p.h +++ b/tests/auto/declarative/shared/debugutil_p.h @@ -51,50 +51,10 @@ #include #include -class QDeclarativeTestFactory; - class QDeclarativeDebugTest { public: static bool waitForSignal(QObject *receiver, const char *member, int timeout = 5000); - - static int runTests(QDeclarativeTestFactory *factory, const QList &qml = QList()); -}; - -class QDeclarativeDebugTestData : public QObject -{ - Q_OBJECT -public: - QDeclarativeDebugTestData(QEventLoop *el); - - ~QDeclarativeDebugTestData(); - - QDeclarativeDebugConnection *conn; - QDeclarativeEngine *engine; - - int exitCode; - QEventLoop *loop; - - QList items; - -signals: - void engineCreated(); - -public slots: - void testsFinished(int code); - -private: - friend class QDeclarativeDebugTest; -}; - - -class QDeclarativeTestFactory -{ -public: - QDeclarativeTestFactory() {} - virtual ~QDeclarativeTestFactory() {} - - virtual QObject *createTest(QDeclarativeDebugTestData *data) = 0; }; class QDeclarativeDebugTestService : public QDeclarativeDebugService @@ -131,20 +91,4 @@ private: QByteArray lastMsg; }; -class tst_QDeclarativeDebug_Thread : public QThread -{ - Q_OBJECT -public: - tst_QDeclarativeDebug_Thread(QDeclarativeDebugTestData *data, QDeclarativeTestFactory *factory); - - void run(); - -signals: - void testsFinished(int); - -private: - QDeclarativeDebugTestData *m_data; - QDeclarativeTestFactory *m_factory; -}; - -- cgit v0.12 From daa12d2d6658924aae22cfbb93cfbc77240f26ba Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 16 Apr 2010 15:39:42 +1000 Subject: Doc: Put "default" property label on same line as property name Task-number: QTBUG-6336 --- doc/src/template/style/style.css | 6 ++++++ tools/qdoc3/htmlgenerator.cpp | 13 +++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 4668c23..94a95a5 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -904,6 +904,12 @@ color: red; } + .qmldefault + { + float: right; + color: red; + } + .qmldoc { } diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 4985f64..a13fc7a 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4412,18 +4412,11 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << ""; out() << ""; if (!qpn->isWritable()) - out() << "read-only"; + out() << "read-only "; + if (qpgn->isDefault()) + out() << "default "; generateQmlItem(qpn, relative, marker, false); out() << ""; - if (qpgn->isDefault()) { - out() << "" - << "" - << "
" - << "
" - << "" - << ""; - } } ++p; } -- cgit v0.12 From ecdc0ebacd97f0d607dcbe884751c203a296a88c Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 16 Apr 2010 15:41:26 +1000 Subject: Doc: in QML use "real" and "enumeration", not "qreal" and "enum" --- doc/src/declarative/elements.qdoc | 7 +------ .../graphicsitems/qdeclarativeborderimage.cpp | 2 +- src/declarative/graphicsitems/qdeclarativeevents.cpp | 2 +- src/declarative/graphicsitems/qdeclarativeimage.cpp | 2 +- src/declarative/graphicsitems/qdeclarativeitem.cpp | 2 +- src/declarative/graphicsitems/qdeclarativeloader.cpp | 4 ++-- src/declarative/util/qdeclarativeanimation.cpp | 4 ++-- src/declarative/util/qdeclarativefontloader.cpp | 2 +- src/declarative/util/qdeclarativesmoothedanimation.cpp | 4 ++-- src/declarative/util/qdeclarativesmoothedfollow.cpp | 4 ++-- src/declarative/util/qdeclarativespringfollow.cpp | 16 ++++++++-------- src/declarative/util/qdeclarativexmllistmodel.cpp | 2 +- 12 files changed, 23 insertions(+), 28 deletions(-) diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index ce3a6e3..355c0f4 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -46,8 +46,6 @@ The following table lists the QML elements provided by the Qt Declarative module. -\bold {Standard Qt Declarative Elements} - \table 80% \header \o \bold {States} @@ -81,6 +79,7 @@ The following table lists the QML elements provided by the Qt Declarative module \o \l PropertyAction \o \l ScriptAction \o \l Transition +\o \l SmoothedFollow \o \l SpringFollow \o \l Behavior \endlist @@ -109,11 +108,7 @@ The following table lists the QML elements provided by the Qt Declarative module \o \l QtObject \o \l WorkerScript \endlist -\endtable -\bold {QML Items} - -\table 80% \header \o \bold {Basic Visual Items} \o \bold {Basic Interaction Items} diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index be9d8bd..7858a7a 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -82,7 +82,7 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage() QDeclarativePixmapCache::cancel(d->sciurl, this); } /*! - \qmlproperty enum BorderImage::status + \qmlproperty enumeration BorderImage::status This property holds the status of image loading. It can be one of: \list diff --git a/src/declarative/graphicsitems/qdeclarativeevents.cpp b/src/declarative/graphicsitems/qdeclarativeevents.cpp index a181071..4425c97 100644 --- a/src/declarative/graphicsitems/qdeclarativeevents.cpp +++ b/src/declarative/graphicsitems/qdeclarativeevents.cpp @@ -145,7 +145,7 @@ Item { */ /*! - \qmlproperty enum MouseEvent::button + \qmlproperty enumeration MouseEvent::button This property holds the button that caused the event. It can be one of: \list diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index ca86637..37b07bf 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -221,7 +221,7 @@ qreal QDeclarativeImage::paintedHeight() const } /*! - \qmlproperty enum Image::status + \qmlproperty enumeration Image::status This property holds the status of image loading. It can be one of: \list diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 0e4e327..843dfdc 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -1415,7 +1415,7 @@ QDeclarativeItem::~QDeclarativeItem() } /*! - \qmlproperty enum Item::transformOrigin + \qmlproperty enumeration Item::transformOrigin This property holds the origin point around which scale and rotation transform. Nine transform origins are available, as shown in the image below. diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index 409c228..8cf8235 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -325,7 +325,7 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded() } /*! - \qmlproperty enum Loader::status + \qmlproperty enumeration Loader::status This property holds the status of QML loading. It can be one of: \list @@ -383,7 +383,7 @@ qreal QDeclarativeLoader::progress() const } /*! - \qmlproperty enum Loader::resizeMode + \qmlproperty enumeration Loader::resizeMode This property determines how the Loader or item are resized: \list diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 7e20428..fd85d91 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1316,7 +1316,7 @@ void QDeclarativeRotationAnimation::setTo(qreal t) } /*! - \qmlproperty enum RotationAnimation::direction + \qmlproperty enumeration RotationAnimation::direction The direction in which to rotate. Possible values are Numerical, Clockwise, Counterclockwise, or Shortest. @@ -1741,7 +1741,7 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t) } /*! - \qmlproperty enum PropertyAnimation::easing.type + \qmlproperty enumeration PropertyAnimation::easing.type \qmlproperty real PropertyAnimation::easing.amplitude \qmlproperty real PropertyAnimation::easing.overshoot \qmlproperty real PropertyAnimation::easing.period diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index b577b81..41740a8 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -181,7 +181,7 @@ void QDeclarativeFontLoader::setName(const QString &name) } /*! - \qmlproperty enum FontLoader::status + \qmlproperty enumeration FontLoader::status This property holds the status of font loading. It can be one of: \list diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp index 48a7583..19a00ee 100644 --- a/src/declarative/util/qdeclarativesmoothedanimation.cpp +++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp @@ -438,7 +438,7 @@ qreal QDeclarativeSmoothedAnimation::velocity() const } /*! - \qmlproperty qreal SmoothedAnimation::velocity + \qmlproperty real SmoothedAnimation::velocity This property holds the average velocity allowed when tracking the 'to' value. @@ -457,7 +457,7 @@ void QDeclarativeSmoothedAnimation::setVelocity(qreal v) } /*! - \qmlproperty qreal SmoothedAnimation::maximumEasingTime + \qmlproperty int SmoothedAnimation::maximumEasingTime This property specifies the maximum time, in msecs, an "eases" during the follow should take. Setting this property causes the velocity to "level out" after at a time. Setting diff --git a/src/declarative/util/qdeclarativesmoothedfollow.cpp b/src/declarative/util/qdeclarativesmoothedfollow.cpp index 9f155fc..3ed9257 100644 --- a/src/declarative/util/qdeclarativesmoothedfollow.cpp +++ b/src/declarative/util/qdeclarativesmoothedfollow.cpp @@ -195,7 +195,7 @@ qreal QDeclarativeSmoothedFollow::velocity() const } /*! - \qmlproperty qreal SmoothedFollow::velocity + \qmlproperty real SmoothedFollow::velocity This property holds the average velocity allowed when tracking the 'to' value. @@ -214,7 +214,7 @@ void QDeclarativeSmoothedFollow::setVelocity(qreal v) } /*! - \qmlproperty qreal SmoothedFollow::maximumEasingTime + \qmlproperty int SmoothedFollow::maximumEasingTime This property specifies the maximum time, in msecs, an "eases" during the follow should take. Setting this property causes the velocity to "level out" after at a time. Setting diff --git a/src/declarative/util/qdeclarativespringfollow.cpp b/src/declarative/util/qdeclarativespringfollow.cpp index 7921735..70077f3 100644 --- a/src/declarative/util/qdeclarativespringfollow.cpp +++ b/src/declarative/util/qdeclarativespringfollow.cpp @@ -267,7 +267,7 @@ qreal QDeclarativeSpringFollow::to() const } /*! - \qmlproperty qreal SpringFollow::to + \qmlproperty real SpringFollow::to This property holds the target value which will be tracked. Bind to a property in order to track its changes. @@ -284,7 +284,7 @@ void QDeclarativeSpringFollow::setTo(qreal value) } /*! - \qmlproperty qreal SpringFollow::velocity + \qmlproperty real SpringFollow::velocity This property holds the maximum velocity allowed when tracking the source. */ @@ -303,7 +303,7 @@ void QDeclarativeSpringFollow::setVelocity(qreal velocity) } /*! - \qmlproperty qreal SpringFollow::spring + \qmlproperty real SpringFollow::spring This property holds the spring constant The spring constant describes how strongly the target is pulled towards the @@ -326,7 +326,7 @@ void QDeclarativeSpringFollow::setSpring(qreal spring) } /*! - \qmlproperty qreal SpringFollow::damping + \qmlproperty real SpringFollow::damping This property holds the spring damping constant The damping constant describes how quickly a sprung follower comes to rest. @@ -349,7 +349,7 @@ void QDeclarativeSpringFollow::setDamping(qreal damping) /*! - \qmlproperty qreal SpringFollow::epsilon + \qmlproperty real SpringFollow::epsilon This property holds the spring epsilon The epsilon is the rate and amount of change in the value which is close enough @@ -371,7 +371,7 @@ void QDeclarativeSpringFollow::setEpsilon(qreal epsilon) } /*! - \qmlproperty qreal SpringFollow::modulus + \qmlproperty real SpringFollow::modulus This property holds the modulus value. Setting a \a modulus forces the target value to "wrap around" at the modulus. @@ -394,7 +394,7 @@ void QDeclarativeSpringFollow::setModulus(qreal modulus) } /*! - \qmlproperty qreal SpringFollow::mass + \qmlproperty real SpringFollow::mass This property holds the "mass" of the property being moved. mass is 1.0 by default. Setting a different mass changes the dynamics of @@ -452,7 +452,7 @@ bool QDeclarativeSpringFollow::inSync() const } /*! - \qmlproperty qreal SpringFollow::value + \qmlproperty real SpringFollow::value The current value. */ qreal QDeclarativeSpringFollow::value() const diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index 7f8b962..55e768e 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -667,7 +667,7 @@ void QDeclarativeXmlListModel::setNamespaceDeclarations(const QString &declarati } /*! - \qmlproperty enum XmlListModel::status + \qmlproperty enumeration XmlListModel::status Specifies the model loading status, which can be one of the following: \list -- cgit v0.12 From 39653e0ff461875b5bbe31c955a7c217abc2931f Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 16 Apr 2010 15:42:55 +1000 Subject: Don't use zoomfactor. It gives better resolution for text positioning, btu many web sites don't work well with it and WebKit. --- demos/declarative/webbrowser/content/FlickableWebView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml index 81904c6..46f45e0 100644 --- a/demos/declarative/webbrowser/content/FlickableWebView.qml +++ b/demos/declarative/webbrowser/content/FlickableWebView.qml @@ -45,7 +45,7 @@ Flickable { smoothCache: true // We do want smooth rendering fillColor: "white" focus: true - zoomFactor: 4 + zoomFactor: 1 onAlert: console.log(message) @@ -73,7 +73,7 @@ Flickable { contentsScale: 1/zoomFactor onContentsSizeChanged: { // zoom out - contentsScale = Math.min(0.25,flickable.width / contentsSize.width) + contentsScale = Math.min(1,flickable.width / contentsSize.width) } onUrlChanged: { // got to topleft -- cgit v0.12 From 9471428742ba59dbb174fc275742052e4bb629ff Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Fri, 16 Apr 2010 16:03:10 +1000 Subject: Fix compile errors in Direct Show media service. The service links against the multimedia library in addition to the mediaservices libarary, and QAbstractVideoSurface is defined in QtMultimedia, no QtMediaServices. --- src/plugins/mediaservices/directshow/directshow.pro | 2 +- .../mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/mediaservices/directshow/directshow.pro b/src/plugins/mediaservices/directshow/directshow.pro index 973c2b1..065e391 100644 --- a/src/plugins/mediaservices/directshow/directshow.pro +++ b/src/plugins/mediaservices/directshow/directshow.pro @@ -1,7 +1,7 @@ TARGET = qdsengine include(../../qpluginbase.pri) -QT += mediaservices +QT += multimedia mediaservices HEADERS += dsserviceplugin.h SOURCES += dsserviceplugin.cpp diff --git a/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h b/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h index 1b3776d..06dc31c 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/mediasamplevideobuffer.h @@ -42,7 +42,7 @@ #ifndef MEDIASAMPLEVIDEOBUFFER_H #define MEDIASAMPLEVIDEOBUFFER_H -#include +#include #include -- cgit v0.12 From a8003df9c7d17a7cdb94161a0aa1b553a30a68e4 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 16 Apr 2010 16:16:52 +1000 Subject: Ensure existing image is gone before next photo selection. Task-number: QTBUG-8084 --- demos/declarative/flickr/mobile/TitleBar.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml index 72b779f..71d9385 100644 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ b/demos/declarative/flickr/mobile/TitleBar.qml @@ -12,6 +12,7 @@ Item { width: (parent.width * 2) - 55 ; height: parent.height function accept() { + imageDetails.closed() titleBar.state = "" background.state = "" rssModel.tags = editor.text -- cgit v0.12 From c01c0c9746fbd54d29683b79de2bf973e5c40cec Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 16 Apr 2010 16:19:35 +1000 Subject: More QML doc consistency. --- src/imports/multimedia/qdeclarativeaudio.cpp | 10 +++++----- src/imports/multimedia/qdeclarativevideo.cpp | 16 ++++++++-------- src/imports/particles/qdeclarativeparticles.cpp | 14 +++++++------- src/multimedia/effects/qsoundeffect.cpp | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp index 82d5d89..849c51d 100644 --- a/src/imports/multimedia/qdeclarativeaudio.cpp +++ b/src/imports/multimedia/qdeclarativeaudio.cpp @@ -195,7 +195,7 @@ void QDeclarativeAudio::stop() */ /*! - \qmlproperty enum Audio::status + \qmlproperty enumeration Audio::status This property holds the status of media loading. It can be one of: @@ -263,7 +263,7 @@ QDeclarativeAudio::Status QDeclarativeAudio::status() const */ /*! - \qmlproperty qreal Audio::volume + \qmlproperty real Audio::volume This property holds the volume of the audio output, from 0.0 (silent) to 1.0 (maximum volume). */ @@ -275,7 +275,7 @@ QDeclarativeAudio::Status QDeclarativeAudio::status() const */ /*! - \qmlproperty qreal Audio::bufferProgress + \qmlproperty real Audio::bufferProgress This property holds how much of the data buffer is currently filled, from 0.0 (empty) to 1.0 (full). @@ -290,13 +290,13 @@ QDeclarativeAudio::Status QDeclarativeAudio::status() const */ /*! - \qmlproperty qreal Audio::playbackRate + \qmlproperty real Audio::playbackRate This property holds the rate at which audio is played at as a multiple of the normal rate. */ /*! - \qmlproperty enum Audio::error + \qmlproperty enumeration Audio::error This property holds the error state of the audio. It can be one of: diff --git a/src/imports/multimedia/qdeclarativevideo.cpp b/src/imports/multimedia/qdeclarativevideo.cpp index c6ae272..d84d304 100644 --- a/src/imports/multimedia/qdeclarativevideo.cpp +++ b/src/imports/multimedia/qdeclarativevideo.cpp @@ -82,11 +82,11 @@ void QDeclarativeVideo::_q_error(int errorCode, const QString &errorString) Video { source: "video/movie.mpg" } \endqml - The video item supports untransformed, stretched, and uniformly scaled video presentation. + The Video item supports untransformed, stretched, and uniformly scaled video presentation. For a description of stretched uniformly scaled presentation, see the \l fillMode property description. - The video item is only visible when the \l hasVideo property is true and the video is playing. + The Video item is only visible when the \l hasVideo property is true and the video is playing. \sa Audio */ @@ -169,7 +169,7 @@ QDeclarativeVideo::~QDeclarativeVideo() */ /*! - \qmlproperty enum Video::status + \qmlproperty enumeration Video::status This property holds the status of media loading. It can be one of: @@ -236,7 +236,7 @@ QDeclarativeVideo::Status QDeclarativeVideo::status() const */ /*! - \qmlproperty qreal Video::volume + \qmlproperty real Video::volume This property holds the volume of the audio output, from 0.0 (silent) to 1.0 (maximum volume). */ @@ -270,7 +270,7 @@ bool QDeclarativeVideo::hasVideo() const } /*! - \qmlproperty qreal Video::bufferProgress + \qmlproperty real Video::bufferProgress This property holds how much of the data buffer is currently filled, from 0.0 (empty) to 1.0 (full). @@ -283,13 +283,13 @@ bool QDeclarativeVideo::hasVideo() const */ /*! - \qmlproperty qreal Video::playbackRate + \qmlproperty real Video::playbackRate This property holds the rate at which video is played at as a multiple of the normal rate. */ /*! - \qmlproperty enum Video::error + \qmlproperty enumeration Video::error This property holds the error state of the video. It can be one of: @@ -325,7 +325,7 @@ QDeclarativeVideo::Error QDeclarativeVideo::error() const */ /*! - \qmlproperty enum Video::fillMode + \qmlproperty enumeration Video::fillMode Set this property to define how the video is scaled to fit the target area. diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp index 264cba2..ecc6604 100644 --- a/src/imports/particles/qdeclarativeparticles.cpp +++ b/src/imports/particles/qdeclarativeparticles.cpp @@ -189,13 +189,13 @@ void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int inte */ /*! - \qmlproperty qreal ParticleMotionGravity::xattractor - \qmlproperty qreal ParticleMotionGravity::yattractor + \qmlproperty real ParticleMotionGravity::xattractor + \qmlproperty real ParticleMotionGravity::yattractor These properties hold the x and y coordinates of the point attracting the particles. */ /*! - \qmlproperty qreal ParticleMotionGravity::acceleration + \qmlproperty real ParticleMotionGravity::acceleration This property holds the acceleration to apply to the particles. */ @@ -303,14 +303,14 @@ Rectangle { */ /*! - \qmlproperty qreal QDeclarativeParticleMotionWander::xvariance - \qmlproperty qreal QDeclarativeParticleMotionWander::yvariance + \qmlproperty real QDeclarativeParticleMotionWander::xvariance + \qmlproperty real QDeclarativeParticleMotionWander::yvariance These properties set the amount to wander in the x and y directions. */ /*! - \qmlproperty qreal QDeclarativeParticleMotionWander::pace + \qmlproperty real QDeclarativeParticleMotionWander::pace This property holds how quickly the paricles will move from side to side. */ @@ -859,7 +859,7 @@ void QDeclarativeParticles::setEmissionRate(int er) } /*! - \qmlproperty qreal Particles::emissionVariance + \qmlproperty real Particles::emissionVariance This property holds how inconsistent the rate of particle emissions are. It is a number between 0 (no variance) and 1 (some variance). diff --git a/src/multimedia/effects/qsoundeffect.cpp b/src/multimedia/effects/qsoundeffect.cpp index d34e532..1992ee5 100644 --- a/src/multimedia/effects/qsoundeffect.cpp +++ b/src/multimedia/effects/qsoundeffect.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE /*! \qmlclass SoundEffect QSoundEffect \since 4.7 - \brief The SoundEffect element provides a way to play sound effects in qml. + \brief The SoundEffect element provides a way to play sound effects in QML. This element is part of the \bold{Qt.multimedia 4.7} module. @@ -81,7 +81,7 @@ QT_BEGIN_NAMESPACE */ /*! - \qmlproperty QUrl SoundEffect::source + \qmlproperty url SoundEffect::source This property provides a way to control the sound to play. */ -- cgit v0.12 From f38c026421febb58686b25d4fb1ca94787f7c4ee Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 16 Apr 2010 16:29:39 +1000 Subject: Documentation typo. --- doc/src/declarative/javascriptblocks.qdoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc index 8ffe58c..e5e61f2 100644 --- a/doc/src/declarative/javascriptblocks.qdoc +++ b/doc/src/declarative/javascriptblocks.qdoc @@ -47,7 +47,7 @@ QML encourages building UIs declaratively, using \l {Property Binding} and the composition of existing \l {QML Elements}. To allow the implementation of more advanced behavior, QML integrates tightly with imperative JavaScript code. -The JavaScript environment provided by QML is stricter than that in a webbrowser. +The JavaScript environment provided by QML is stricter than that in a web browser. In QML you cannot add, or modify, members of the JavaScript global object. It is possible to do this accidentally by using a variable without declaring it. In QML this will throw an exception, so all local variables should be explicitly @@ -104,12 +104,12 @@ Item { } \endcode -Both relative and absolute JavaScript URLs can be imported. In the case of a -relative URL, the location is resolved relative to the location of the -\l {QML Document} that contains the import. If the script file is not accessible, -an error will occur. If the JavaScript needs to be fetched from a network +Both relative and absolute JavaScript URLs can be imported. In the case of a +relative URL, the location is resolved relative to the location of the +\l {QML Document} that contains the import. If the script file is not accessible, +an error will occur. If the JavaScript needs to be fetched from a network resource, the QML document has a "Loading" -\l {QDeclarativeComponent::status()}{status} until the script has been +\l {QDeclarativeComponent::status()}{status} until the script has been downloaded. Imported JavaScript files are always qualified using the "as" keyword. The @@ -160,7 +160,7 @@ parameters. \section1 Running JavaScript at Startup It is occasionally necessary to run some imperative code at application (or -component instance) "startup". While it is tempting to just include the startup +component instance) startup. While it is tempting to just include the startup script as \e {global code} in an external script file, this can have severe limitations as the QML environment may not have been fully established. For example, some objects might not have been created or some \l {Property Binding}s may not have been run. @@ -180,7 +180,7 @@ Rectangle { } \endcode -Any element in a QML file - including nested elements and nested QML component +Any element in a QML file - including nested elements and nested QML component instances - can use this attached property. If there is more than one \c onCompleted() handler to execute at startup, they are run sequentially in an undefined order. -- cgit v0.12 From 731071ed146febd8d93e1897e7f1aba135ac23c4 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 16 Apr 2010 16:27:39 +1000 Subject: Remove unsupported plugin version flags in .pro files of declarative examples Task-number: QTBUG-9191 Reviewed-by: Martin Jones --- examples/declarative/plugins/plugins.pro | 1 - examples/declarative/proxywidgets/proxywidgets.pro | 1 - 2 files changed, 2 deletions(-) diff --git a/examples/declarative/plugins/plugins.pro b/examples/declarative/plugins/plugins.pro index c409d39..b501ae3 100644 --- a/examples/declarative/plugins/plugins.pro +++ b/examples/declarative/plugins/plugins.pro @@ -3,7 +3,6 @@ DESTDIR = com/nokia/TimeExample TARGET = qtimeexampleqmlplugin CONFIG += qt plugin QT += declarative -VERSION = 1.0.0 SOURCES += plugin.cpp diff --git a/examples/declarative/proxywidgets/proxywidgets.pro b/examples/declarative/proxywidgets/proxywidgets.pro index eb85191..cb07d80 100644 --- a/examples/declarative/proxywidgets/proxywidgets.pro +++ b/examples/declarative/proxywidgets/proxywidgets.pro @@ -3,7 +3,6 @@ DESTDIR = ProxyWidgets TARGET = proxywidgetsplugin CONFIG += qt plugin QT += declarative -VERSION = 1.0.0 SOURCES += proxywidgets.cpp -- cgit v0.12 From 269623184ee55bd8126cf3ae5cfb619d3bdda91b Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 16 Apr 2010 18:34:10 +1000 Subject: Doc --- doc/src/declarative/javascriptblocks.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc index e5e61f2..7c0570e 100644 --- a/doc/src/declarative/javascriptblocks.qdoc +++ b/doc/src/declarative/javascriptblocks.qdoc @@ -66,7 +66,7 @@ them. \code Item { function factorial(a) { - a = Integer(a); + a = parseInt(a); if (a <= 0) return 1; else @@ -143,7 +143,7 @@ stateless library through the use of a pragma, as shown in the following example .pragma library function factorial(a) { - a = Integer(a); + a = parseInt(a); if (a <= 0) return 1; else -- cgit v0.12 From 561a7bf35b96ffe70ebafc3876e965ef41b4441d Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 16 Apr 2010 11:15:55 +0200 Subject: Fixed parsing of inner labelled statements. The JS grammar is ambigious and the following statement can be parsed as an object-literal followed by an inserted semicolon or as two labelled statements. outer: { inner: {} } In the old days we used to resolve the conflict by reducing the statement to an expression statement but this was wrong so now we prefer the labelled statement. As nice side effect, we pass two more tests in tests/auto/declarative/parserstress. Task-number: QTBUG-8108 --- src/declarative/qml/parser/qdeclarativejs.g | 2 +- src/declarative/qml/parser/qdeclarativejsgrammar.cpp | 6 +++--- tests/auto/declarative/parserstress/tst_parserstress.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/declarative/qml/parser/qdeclarativejs.g b/src/declarative/qml/parser/qdeclarativejs.g index ba9338e..1b66ba0 100644 --- a/src/declarative/qml/parser/qdeclarativejs.g +++ b/src/declarative/qml/parser/qdeclarativejs.g @@ -1376,7 +1376,7 @@ case $rule_number: { } break; ./ -PropertyName: T_IDENTIFIER %prec REDUCE_HERE ; +PropertyName: T_IDENTIFIER %prec SHIFT_THERE ; /. case $rule_number: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); diff --git a/src/declarative/qml/parser/qdeclarativejsgrammar.cpp b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp index 52e979a..b87d8f4 100644 --- a/src/declarative/qml/parser/qdeclarativejsgrammar.cpp +++ b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ // This file was generated by qlalr - DO NOT EDIT! -#include "private/qdeclarativejsgrammar_p.h" +#include "qdeclarativejsgrammar_p.h" QT_BEGIN_NAMESPACE @@ -346,9 +346,9 @@ const short QDeclarativeJSGrammar::action_index [] = { const short QDeclarativeJSGrammar::action_info [] = { 399, 352, 345, -101, 343, 457, 440, 403, 257, -112, - -125, -131, -123, -98, -120, 348, -128, 389, 453, 391, + -125, -131, -123, 346, -120, 348, -128, 389, 453, 391, 416, 401, 408, 563, -101, -123, 416, -120, 539, -131, - -98, -112, -125, 348, 257, 99, 71, 645, 621, 101, + 346, -112, -125, 348, 257, 99, 71, 645, 621, 101, -128, 440, 141, 621, 164, 431, 539, 430, 453, 573, 457, 444, 440, 424, 71, 424, 101, 446, 559, 420, 424, 448, 539, 440, 570, 539, 466, 527, 312, 346, diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp index 41c0a1b..971496d 100644 --- a/tests/auto/declarative/parserstress/tst_parserstress.cpp +++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp @@ -65,7 +65,7 @@ QStringList tst_parserstress::findJSFiles(const QDir &d) { QStringList rv; - QStringList files = d.entryList(QStringList() << QLatin1String("*.js"), + QStringList files = d.entryList(QStringList() << QLatin1String("*.js"), QDir::Files); foreach (const QString &file, files) { if (file == "browser.js") @@ -73,7 +73,7 @@ QStringList tst_parserstress::findJSFiles(const QDir &d) rv << d.absoluteFilePath(file); } - QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot | + QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); foreach (const QString &dir, dirs) { QDir sub = d; @@ -132,7 +132,7 @@ void tst_parserstress::ecmascript() component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml"))); QSet failingTests; failingTests << "uc-003.js" << "uc-005.js" << "regress-352044-02-n.js" - << "regress-334158.js" << "regress-58274.js" << "dowhile-006.js" << "dowhile-005.js"; + << "regress-334158.js" << "regress-58274.js"; QFileInfo info(file); foreach (const QString &failing, failingTests) { if (info.fileName().endsWith(failing)) { -- cgit v0.12 From 00d9ffa077d48e1d1c5ee40594e609522d055cdf Mon Sep 17 00:00:00 2001 From: mae Date: Thu, 15 Apr 2010 12:00:03 +0200 Subject: Fix doc: remote contents requires qmldir --- doc/src/declarative/network.qdoc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/src/declarative/network.qdoc b/doc/src/declarative/network.qdoc index 0a26c68..d268a13 100644 --- a/doc/src/declarative/network.qdoc +++ b/doc/src/declarative/network.qdoc @@ -69,8 +69,10 @@ Network transparency is supported throughout QML, for example: \endlist Even QML types themselves can be on the network - if the \l {Qt Declarative UI Runtime}{qml} tool is used to load -\tt http://example.com/mystuff/Hello.qml and that content refers to a type "World", this -will load from \tt http://example.com/mystuff/World.qml just as it would for a local file. +\tt http://example.com/mystuff/Hello.qml and that content refers to a type "World", the engine +will load \tt http://example.com/mystuff/qmldir and resolve the type just as it would for a local file. +For example if the qmldir file contains the line "World World.qml", it will load +\tt http://example.com/mystuff/World.qml Any other resources that \tt Hello.qml referred to, usually by a relative URL, would similarly be loaded from the network. -- cgit v0.12 From c8a26b05c342d05e718c118fe6279021c4cadf14 Mon Sep 17 00:00:00 2001 From: mae Date: Fri, 16 Apr 2010 13:58:54 +0200 Subject: Fix doc: QML_DECLARE_TYPE is no longer necessary It's sufficient to register a type with qmlRegisterType() --- doc/src/declarative/extending.qdoc | 21 +++------------------ doc/src/declarative/qtdeclarative.qdoc | 6 +----- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index e1c6469..4d477c6 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -67,12 +67,11 @@ that derive from QObject. The QML engine has no intrinsic knowledge of any class types. Instead the programmer must define the C++ types, and their corresponding QML name. -Custom C++ types are declared QML types using a macro and a template function: +Custom C++ types are registered using a template function: \quotation \code -#define QML_DECLARE_TYPE(T) template int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) \endcode @@ -81,10 +80,6 @@ Calling qmlRegisterType() registers the C++ type \a T with the QML system, and m under the name \a qmlName in library \a uri version \a versionMajor.versionMinor. The \a qmlName can be the same as the C++ type name. -Generally the QML_DECLARE_TYPE() macro should be included immediately following -the type declaration (usually in its header file), and the template function qmlRegisterType() -called by the implementation. - Type \a T must be a concrete type that inherits QObject and has a default constructor. \endquotation @@ -149,21 +144,16 @@ property can be assigned. QML also supports assigning Qt interfaces. To assign to a property whose type is a Qt interface pointer, the interface must also be registered with QML. As they cannot be instantiated directly, registering a Qt interface is different -from registering a new QML type. The following macro and function are used instead: +from registering a new QML type. The following function is used instead: \quotation \code -#define QML_DECLARE_INTERFACE(T) template int qmlRegisterInterface(const char *typeName) \endcode Registers the C++ interface \a T with the QML system as \a typeName. -Generally the QML_DECLARE_INTERFACE() macro should be included immediately -following the interface declaration (usually in its header file), and the -qmlRegisterInterface() template function called by the implementation. - Following registration, QML can coerce objects that implement this interface for assignment to appropriately typed properties. \endquotation @@ -198,11 +188,10 @@ To assign to a property, the property's type must have been registered with QML. Both the qmlRegisterType() and qmlRegisterInterface() template functions already shown can be used to register a type with QML. Additionally, if a type that acts purely as a base class that cannot be instantiated from QML needs to be -registered these macro and function can be used: +registered, the following function can be used: \quotation \code - #define QML_DECLARE_TYPE(T) template int qmlRegisterType() \endcode @@ -212,10 +201,6 @@ function qmlRegisterType() does not define a mapping between the C++ class and a QML element name, so the type is not instantiable from QML, but it is available for type coercion. -Generally the QML_DECLARE_TYPE() macro should be included immediately following -the type declaration (usually in its header file), and the -qmlRegisterType() template function called from the implementation. - Type \a T must inherit QObject, but there are no restrictions on whether it is concrete or the signature of its constructor. \endquotation diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index cbb2146..b4d8a2e 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -70,9 +70,7 @@ \macro QML_DECLARE_TYPE() \relates QDeclarativeEngine - Declares a C++ type to be usable in the QML system. In addition - to this, a type must also be registered with the QML system using - qmlRegisterType(). + Equivalent to Q_DECLARE_METATYPE(TYPE) and Q_DECLARE_METATYPE(QDeclarativeListProperty) */ @@ -83,7 +81,6 @@ This template function registers the C++ type in the QML system with the name \a qmlName. in the library imported from \a uri having the version number composed from \a versionMajor and \a versionMinor. - The type should also haved been declared with the QML_DECLARE_TYPE() macro. Returns the QML type id. @@ -114,7 +111,6 @@ This template function registers the C++ type in the QML system under the name \a typeName. - The type should also haved been declared with the QML_DECLARE_TYPE() macro. Returns the QML type id. -- cgit v0.12 From 86efad03a977763c900aaa0b634f64c109a27e4f Mon Sep 17 00:00:00 2001 From: mae Date: Fri, 16 Apr 2010 14:01:29 +0200 Subject: Fix README The base directory is no longer automatically used as import path. --- examples/declarative/plugins/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/declarative/plugins/README b/examples/declarative/plugins/README index 3ae256d..fe519f8 100644 --- a/examples/declarative/plugins/README +++ b/examples/declarative/plugins/README @@ -5,5 +5,5 @@ by a C++ plugin (providing the "Time" type), and by QML files (providing the To run: make install - qml plugins.qml + qml -I . plugins.qml -- cgit v0.12 From e23a519366587cfc27ad3be88180692cb49e206f Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 16 Apr 2010 15:01:39 +0200 Subject: Recognize identifiers containing unicode escape sequences. Task-number: QTBUG-8108 Reviewed-by: Olivier Goffart --- src/declarative/qml/parser/qdeclarativejslexer.cpp | 42 +++++++++++++++++++++- .../declarative/parserstress/tst_parserstress.cpp | 4 +-- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp index a616146..7c1c30c 100644 --- a/src/declarative/qml/parser/qdeclarativejslexer.cpp +++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp @@ -484,6 +484,8 @@ int Lexer::lex() stackToken = -1; } + bool identifierWithEscapedUnicode = false; + while (!done) { switch (state) { case Start: @@ -523,7 +525,26 @@ int Lexer::lex() state = InString; multiLineString = false; stringType = current; + } else if (current == '\\' && next1 == 'u') { + identifierWithEscapedUnicode = true; + recordStartPos(); + + shift(2); // skip the unicode escape prefix `\u' + + if (isHexDigit(current) && isHexDigit(next1) && + isHexDigit(next2) && isHexDigit(next3)) { + record16(convertUnicode(current, next1, next2, next3)); + shift(3); + state = InIdentifier; + } else { + setDone(Bad); + err = IllegalUnicodeEscapeSequence; + errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence"); + break; + } + } else if (isIdentLetter(current)) { + identifierWithEscapedUnicode = false; recordStartPos(); record16(current); state = InIdentifier; @@ -683,6 +704,21 @@ int Lexer::lex() if (isIdentLetter(current) || isDecimalDigit(current)) { record16(current); break; + } else if (current == '\\' && next1 == 'u') { + identifierWithEscapedUnicode = true; + shift(2); // skip the unicode escape prefix `\u' + + if (isHexDigit(current) && isHexDigit(next1) && + isHexDigit(next2) && isHexDigit(next3)) { + record16(convertUnicode(current, next1, next2, next3)); + shift(3); + break; + } else { + setDone(Bad); + err = IllegalUnicodeEscapeSequence; + errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence"); + break; + } } setDone(Identifier); break; @@ -825,7 +861,11 @@ int Lexer::lex() delimited = true; return token; case Identifier: - if ((token = findReservedWord(buffer16, pos16)) < 0) { + token = -1; + if (! identifierWithEscapedUnicode) + token = findReservedWord(buffer16, pos16); + + if (token < 0) { /* TODO: close leak on parse error. same holds true for String */ if (driver) qsyylval.ustr = driver->intern(buffer16, pos16); diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp index 971496d..f61ca9f 100644 --- a/tests/auto/declarative/parserstress/tst_parserstress.cpp +++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp @@ -131,8 +131,8 @@ void tst_parserstress::ecmascript() QDeclarativeComponent component(&engine); component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml"))); QSet failingTests; - failingTests << "uc-003.js" << "uc-005.js" << "regress-352044-02-n.js" - << "regress-334158.js" << "regress-58274.js"; + failingTests << "regress-352044-02-n.js" + << "regress-334158.js"; QFileInfo info(file); foreach (const QString &failing, failingTests) { if (info.fileName().endsWith(failing)) { -- cgit v0.12 From 095d5b74e571c71e04cc98ba4d372e3c5c2b1f9c Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Fri, 16 Apr 2010 15:51:28 +0200 Subject: Three fixes from Shane after QtMultimedia was split into two dlls. Fix1: QtMultimedia to get .def files from the correct location multimedia was split into 2 subdirectories, which means the general purpose rule in qbase.pri no longer works. Task-number: QTBUG-9983 Reviewed-by: Miikka Heikkinen Fix2: Fix QtMultimedia .def files As a result of the split of multimedia into two DLLs, made the following changes: 1. Revert QtMultimediau.def to v4.6.2 (compatibility baseline) 2. Freeze QtMultimedia and QtMediaServices This is compatible with 4.6.2, but not compatible with any previous 4.7 build. Task-number: QTBUG-9983 Fix3: Add QtMediaServices.dll to Qt.sis The new dll will now be installed by the symbian sis package. Task-number: QTBUG-9983 Reviewed-by: Miikka Heikkinen --- src/multimedia/mediaservices/mediaservices.pro | 7 +- src/multimedia/multimedia/multimedia.pro | 7 +- src/s60installs/bwins/QtMediaServicesu.def | 673 ++++++++++++++++++++++++ src/s60installs/bwins/QtMultimediau.def | 686 +------------------------ src/s60installs/eabi/QtMediaServicesu.def | 674 ++++++++++++++++++++++++ src/s60installs/eabi/QtMultimediau.def | 682 +----------------------- src/s60installs/s60installs.pro | 1 + 7 files changed, 1370 insertions(+), 1360 deletions(-) create mode 100644 src/s60installs/bwins/QtMediaServicesu.def create mode 100644 src/s60installs/eabi/QtMediaServicesu.def diff --git a/src/multimedia/mediaservices/mediaservices.pro b/src/multimedia/mediaservices/mediaservices.pro index ef552e3..d5b0e4c 100644 --- a/src/multimedia/mediaservices/mediaservices.pro +++ b/src/multimedia/mediaservices/mediaservices.pro @@ -12,5 +12,10 @@ include(base/base.pri) include(playback/playback.pri) include(effects/effects.pri) -symbian: TARGET.UID3 = 0x2001E631 +symbian: { + TARGET.UID3 = 0x2001E631 + contains(CONFIG, def_files) { + DEF_FILE=../../s60installs + } +} diff --git a/src/multimedia/multimedia/multimedia.pro b/src/multimedia/multimedia/multimedia.pro index 8d130bd..ee700b6 100644 --- a/src/multimedia/multimedia/multimedia.pro +++ b/src/multimedia/multimedia/multimedia.pro @@ -11,4 +11,9 @@ include(../../qbase.pri) include(audio/audio.pri) include(video/video.pri) -symbian: TARGET.UID3 = 0x2001E627 +symbian: { + TARGET.UID3 = 0x2001E627 + contains(CONFIG, def_files) { + DEF_FILE=../../s60installs + } +} diff --git a/src/s60installs/bwins/QtMediaServicesu.def b/src/s60installs/bwins/QtMediaServicesu.def new file mode 100644 index 0000000..d674d12 --- /dev/null +++ b/src/s60installs/bwins/QtMediaServicesu.def @@ -0,0 +1,673 @@ +EXPORTS + ??0QGraphicsVideoItem@@QAE@PAVQGraphicsItem@@@Z @ 1 NONAME ; QGraphicsVideoItem::QGraphicsVideoItem(class QGraphicsItem *) + ??0QLocalMediaPlaylistProvider@@QAE@PAVQObject@@@Z @ 2 NONAME ; QLocalMediaPlaylistProvider::QLocalMediaPlaylistProvider(class QObject *) + ??0QMediaContent@@QAE@ABV0@@Z @ 3 NONAME ; QMediaContent::QMediaContent(class QMediaContent const &) + ??0QMediaContent@@QAE@ABV?$QList@VQMediaResource@@@@@Z @ 4 NONAME ; QMediaContent::QMediaContent(class QList const &) + ??0QMediaContent@@QAE@ABVQMediaResource@@@Z @ 5 NONAME ; QMediaContent::QMediaContent(class QMediaResource const &) + ??0QMediaContent@@QAE@ABVQNetworkRequest@@@Z @ 6 NONAME ; QMediaContent::QMediaContent(class QNetworkRequest const &) + ??0QMediaContent@@QAE@ABVQUrl@@@Z @ 7 NONAME ; QMediaContent::QMediaContent(class QUrl const &) + ??0QMediaContent@@QAE@XZ @ 8 NONAME ; QMediaContent::QMediaContent(void) + ??0QMediaControl@@IAE@AAVQMediaControlPrivate@@PAVQObject@@@Z @ 9 NONAME ; QMediaControl::QMediaControl(class QMediaControlPrivate &, class QObject *) + ??0QMediaControl@@IAE@PAVQObject@@@Z @ 10 NONAME ; QMediaControl::QMediaControl(class QObject *) + ??0QMediaObject@@IAE@AAVQMediaObjectPrivate@@PAVQObject@@PAVQMediaService@@@Z @ 11 NONAME ; QMediaObject::QMediaObject(class QMediaObjectPrivate &, class QObject *, class QMediaService *) + ??0QMediaObject@@IAE@PAVQObject@@PAVQMediaService@@@Z @ 12 NONAME ; QMediaObject::QMediaObject(class QObject *, class QMediaService *) + ??0QMediaPlayer@@QAE@PAVQObject@@V?$QFlags@W4Flag@QMediaPlayer@@@@PAVQMediaServiceProvider@@@Z @ 13 NONAME ; QMediaPlayer::QMediaPlayer(class QObject *, class QFlags, class QMediaServiceProvider *) + ??0QMediaPlayerControl@@IAE@PAVQObject@@@Z @ 14 NONAME ; QMediaPlayerControl::QMediaPlayerControl(class QObject *) + ??0QMediaPlaylist@@QAE@PAVQObject@@@Z @ 15 NONAME ; QMediaPlaylist::QMediaPlaylist(class QObject *) + ??0QMediaPlaylistControl@@IAE@PAVQObject@@@Z @ 16 NONAME ; QMediaPlaylistControl::QMediaPlaylistControl(class QObject *) + ??0QMediaPlaylistIOPlugin@@QAE@PAVQObject@@@Z @ 17 NONAME ; QMediaPlaylistIOPlugin::QMediaPlaylistIOPlugin(class QObject *) + ??0QMediaPlaylistNavigator@@QAE@PAVQMediaPlaylistProvider@@PAVQObject@@@Z @ 18 NONAME ; QMediaPlaylistNavigator::QMediaPlaylistNavigator(class QMediaPlaylistProvider *, class QObject *) + ??0QMediaPlaylistProvider@@IAE@AAVQMediaPlaylistProviderPrivate@@PAVQObject@@@Z @ 19 NONAME ; QMediaPlaylistProvider::QMediaPlaylistProvider(class QMediaPlaylistProviderPrivate &, class QObject *) + ??0QMediaPlaylistProvider@@QAE@PAVQObject@@@Z @ 20 NONAME ; QMediaPlaylistProvider::QMediaPlaylistProvider(class QObject *) + ??0QMediaResource@@QAE@ABV0@@Z @ 21 NONAME ; QMediaResource::QMediaResource(class QMediaResource const &) + ??0QMediaResource@@QAE@ABVQNetworkRequest@@ABVQString@@@Z @ 22 NONAME ; QMediaResource::QMediaResource(class QNetworkRequest const &, class QString const &) + ??0QMediaResource@@QAE@ABVQUrl@@ABVQString@@@Z @ 23 NONAME ; QMediaResource::QMediaResource(class QUrl const &, class QString const &) + ??0QMediaResource@@QAE@XZ @ 24 NONAME ; QMediaResource::QMediaResource(void) + ??0QMediaService@@IAE@AAVQMediaServicePrivate@@PAVQObject@@@Z @ 25 NONAME ; QMediaService::QMediaService(class QMediaServicePrivate &, class QObject *) + ??0QMediaService@@IAE@PAVQObject@@@Z @ 26 NONAME ; QMediaService::QMediaService(class QObject *) + ??0QMediaServiceProviderHint@@QAE@ABV0@@Z @ 27 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(class QMediaServiceProviderHint const &) + ??0QMediaServiceProviderHint@@QAE@ABVQByteArray@@@Z @ 28 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(class QByteArray const &) + ??0QMediaServiceProviderHint@@QAE@ABVQString@@ABVQStringList@@@Z @ 29 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(class QString const &, class QStringList const &) + ??0QMediaServiceProviderHint@@QAE@V?$QFlags@W4Feature@QMediaServiceProviderHint@@@@@Z @ 30 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(class QFlags) + ??0QMediaServiceProviderHint@@QAE@XZ @ 31 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(void) + ??0QMediaTimeInterval@@QAE@ABV0@@Z @ 32 NONAME ; QMediaTimeInterval::QMediaTimeInterval(class QMediaTimeInterval const &) + ??0QMediaTimeInterval@@QAE@XZ @ 33 NONAME ; QMediaTimeInterval::QMediaTimeInterval(void) + ??0QMediaTimeInterval@@QAE@_J0@Z @ 34 NONAME ; QMediaTimeInterval::QMediaTimeInterval(long long, long long) + ??0QMediaTimeRange@@QAE@ABV0@@Z @ 35 NONAME ; QMediaTimeRange::QMediaTimeRange(class QMediaTimeRange const &) + ??0QMediaTimeRange@@QAE@ABVQMediaTimeInterval@@@Z @ 36 NONAME ; QMediaTimeRange::QMediaTimeRange(class QMediaTimeInterval const &) + ??0QMediaTimeRange@@QAE@XZ @ 37 NONAME ; QMediaTimeRange::QMediaTimeRange(void) + ??0QMediaTimeRange@@QAE@_J0@Z @ 38 NONAME ; QMediaTimeRange::QMediaTimeRange(long long, long long) + ??0QMetaDataControl@@IAE@PAVQObject@@@Z @ 39 NONAME ; QMetaDataControl::QMetaDataControl(class QObject *) + ??0QPainterVideoSurface@@QAE@PAVQObject@@@Z @ 40 NONAME ; QPainterVideoSurface::QPainterVideoSurface(class QObject *) + ??0QSoundEffect@@QAE@PAVQObject@@@Z @ 41 NONAME ; QSoundEffect::QSoundEffect(class QObject *) + ??0QVideoDeviceControl@@IAE@PAVQObject@@@Z @ 42 NONAME ; QVideoDeviceControl::QVideoDeviceControl(class QObject *) + ??0QVideoOutputControl@@IAE@PAVQObject@@@Z @ 43 NONAME ; QVideoOutputControl::QVideoOutputControl(class QObject *) + ??0QVideoRendererControl@@IAE@PAVQObject@@@Z @ 44 NONAME ; QVideoRendererControl::QVideoRendererControl(class QObject *) + ??0QVideoWidget@@QAE@PAVQWidget@@@Z @ 45 NONAME ; QVideoWidget::QVideoWidget(class QWidget *) + ??0QVideoWidgetControl@@IAE@PAVQObject@@@Z @ 46 NONAME ; QVideoWidgetControl::QVideoWidgetControl(class QObject *) + ??0QVideoWindowControl@@IAE@PAVQObject@@@Z @ 47 NONAME ; QVideoWindowControl::QVideoWindowControl(class QObject *) + ??1QGraphicsVideoItem@@UAE@XZ @ 48 NONAME ; QGraphicsVideoItem::~QGraphicsVideoItem(void) + ??1QLocalMediaPlaylistProvider@@UAE@XZ @ 49 NONAME ; QLocalMediaPlaylistProvider::~QLocalMediaPlaylistProvider(void) + ??1QMediaContent@@QAE@XZ @ 50 NONAME ; QMediaContent::~QMediaContent(void) + ??1QMediaControl@@UAE@XZ @ 51 NONAME ; QMediaControl::~QMediaControl(void) + ??1QMediaObject@@UAE@XZ @ 52 NONAME ; QMediaObject::~QMediaObject(void) + ??1QMediaPlayer@@UAE@XZ @ 53 NONAME ; QMediaPlayer::~QMediaPlayer(void) + ??1QMediaPlayerControl@@UAE@XZ @ 54 NONAME ; QMediaPlayerControl::~QMediaPlayerControl(void) + ??1QMediaPlaylist@@UAE@XZ @ 55 NONAME ; QMediaPlaylist::~QMediaPlaylist(void) + ??1QMediaPlaylistControl@@UAE@XZ @ 56 NONAME ; QMediaPlaylistControl::~QMediaPlaylistControl(void) + ??1QMediaPlaylistIOInterface@@UAE@XZ @ 57 NONAME ; QMediaPlaylistIOInterface::~QMediaPlaylistIOInterface(void) + ??1QMediaPlaylistIOPlugin@@UAE@XZ @ 58 NONAME ; QMediaPlaylistIOPlugin::~QMediaPlaylistIOPlugin(void) + ??1QMediaPlaylistNavigator@@UAE@XZ @ 59 NONAME ; QMediaPlaylistNavigator::~QMediaPlaylistNavigator(void) + ??1QMediaPlaylistProvider@@UAE@XZ @ 60 NONAME ; QMediaPlaylistProvider::~QMediaPlaylistProvider(void) + ??1QMediaPlaylistReader@@UAE@XZ @ 61 NONAME ; QMediaPlaylistReader::~QMediaPlaylistReader(void) + ??1QMediaPlaylistWriter@@UAE@XZ @ 62 NONAME ; QMediaPlaylistWriter::~QMediaPlaylistWriter(void) + ??1QMediaResource@@QAE@XZ @ 63 NONAME ; QMediaResource::~QMediaResource(void) + ??1QMediaService@@UAE@XZ @ 64 NONAME ; QMediaService::~QMediaService(void) + ??1QMediaServiceFeaturesInterface@@UAE@XZ @ 65 NONAME ; QMediaServiceFeaturesInterface::~QMediaServiceFeaturesInterface(void) + ??1QMediaServiceProvider@@UAE@XZ @ 66 NONAME ; QMediaServiceProvider::~QMediaServiceProvider(void) + ??1QMediaServiceProviderHint@@QAE@XZ @ 67 NONAME ; QMediaServiceProviderHint::~QMediaServiceProviderHint(void) + ??1QMediaServiceSupportedDevicesInterface@@UAE@XZ @ 68 NONAME ; QMediaServiceSupportedDevicesInterface::~QMediaServiceSupportedDevicesInterface(void) + ??1QMediaServiceSupportedFormatsInterface@@UAE@XZ @ 69 NONAME ; QMediaServiceSupportedFormatsInterface::~QMediaServiceSupportedFormatsInterface(void) + ??1QMediaTimeRange@@QAE@XZ @ 70 NONAME ; QMediaTimeRange::~QMediaTimeRange(void) + ??1QMetaDataControl@@UAE@XZ @ 71 NONAME ; QMetaDataControl::~QMetaDataControl(void) + ??1QPainterVideoSurface@@UAE@XZ @ 72 NONAME ; QPainterVideoSurface::~QPainterVideoSurface(void) + ??1QSoundEffect@@UAE@XZ @ 73 NONAME ; QSoundEffect::~QSoundEffect(void) + ??1QVideoDeviceControl@@UAE@XZ @ 74 NONAME ; QVideoDeviceControl::~QVideoDeviceControl(void) + ??1QVideoOutputControl@@UAE@XZ @ 75 NONAME ; QVideoOutputControl::~QVideoOutputControl(void) + ??1QVideoRendererControl@@UAE@XZ @ 76 NONAME ; QVideoRendererControl::~QVideoRendererControl(void) + ??1QVideoWidget@@UAE@XZ @ 77 NONAME ; QVideoWidget::~QVideoWidget(void) + ??1QVideoWidgetControl@@UAE@XZ @ 78 NONAME ; QVideoWidgetControl::~QVideoWidgetControl(void) + ??1QVideoWindowControl@@UAE@XZ @ 79 NONAME ; QVideoWindowControl::~QVideoWindowControl(void) + ??4QMediaContent@@QAEAAV0@ABV0@@Z @ 80 NONAME ; class QMediaContent & QMediaContent::operator=(class QMediaContent const &) + ??4QMediaResource@@QAEAAV0@ABV0@@Z @ 81 NONAME ; class QMediaResource & QMediaResource::operator=(class QMediaResource const &) + ??4QMediaServiceProviderHint@@QAEAAV0@ABV0@@Z @ 82 NONAME ; class QMediaServiceProviderHint & QMediaServiceProviderHint::operator=(class QMediaServiceProviderHint const &) + ??4QMediaTimeRange@@QAEAAV0@ABV0@@Z @ 83 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator=(class QMediaTimeRange const &) + ??4QMediaTimeRange@@QAEAAV0@ABVQMediaTimeInterval@@@Z @ 84 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator=(class QMediaTimeInterval const &) + ??8@YA_NABVQMediaTimeInterval@@0@Z @ 85 NONAME ; bool operator==(class QMediaTimeInterval const &, class QMediaTimeInterval const &) + ??8@YA_NABVQMediaTimeRange@@0@Z @ 86 NONAME ; bool operator==(class QMediaTimeRange const &, class QMediaTimeRange const &) + ??8QMediaContent@@QBE_NABV0@@Z @ 87 NONAME ; bool QMediaContent::operator==(class QMediaContent const &) const + ??8QMediaResource@@QBE_NABV0@@Z @ 88 NONAME ; bool QMediaResource::operator==(class QMediaResource const &) const + ??8QMediaServiceProviderHint@@QBE_NABV0@@Z @ 89 NONAME ; bool QMediaServiceProviderHint::operator==(class QMediaServiceProviderHint const &) const + ??9@YA_NABVQMediaTimeInterval@@0@Z @ 90 NONAME ; bool operator!=(class QMediaTimeInterval const &, class QMediaTimeInterval const &) + ??9@YA_NABVQMediaTimeRange@@0@Z @ 91 NONAME ; bool operator!=(class QMediaTimeRange const &, class QMediaTimeRange const &) + ??9QMediaContent@@QBE_NABV0@@Z @ 92 NONAME ; bool QMediaContent::operator!=(class QMediaContent const &) const + ??9QMediaResource@@QBE_NABV0@@Z @ 93 NONAME ; bool QMediaResource::operator!=(class QMediaResource const &) const + ??9QMediaServiceProviderHint@@QBE_NABV0@@Z @ 94 NONAME ; bool QMediaServiceProviderHint::operator!=(class QMediaServiceProviderHint const &) const + ??G@YA?AVQMediaTimeRange@@ABV0@0@Z @ 95 NONAME ; class QMediaTimeRange operator-(class QMediaTimeRange const &, class QMediaTimeRange const &) + ??H@YA?AVQMediaTimeRange@@ABV0@0@Z @ 96 NONAME ; class QMediaTimeRange operator+(class QMediaTimeRange const &, class QMediaTimeRange const &) + ??YQMediaTimeRange@@QAEAAV0@ABV0@@Z @ 97 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator+=(class QMediaTimeRange const &) + ??YQMediaTimeRange@@QAEAAV0@ABVQMediaTimeInterval@@@Z @ 98 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator+=(class QMediaTimeInterval const &) + ??ZQMediaTimeRange@@QAEAAV0@ABV0@@Z @ 99 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator-=(class QMediaTimeRange const &) + ??ZQMediaTimeRange@@QAEAAV0@ABVQMediaTimeInterval@@@Z @ 100 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator-=(class QMediaTimeInterval const &) + ??_EQGraphicsVideoItem@@UAE@I@Z @ 101 NONAME ; QGraphicsVideoItem::~QGraphicsVideoItem(unsigned int) + ??_EQLocalMediaPlaylistProvider@@UAE@I@Z @ 102 NONAME ; QLocalMediaPlaylistProvider::~QLocalMediaPlaylistProvider(unsigned int) + ??_EQMediaControl@@UAE@I@Z @ 103 NONAME ; QMediaControl::~QMediaControl(unsigned int) + ??_EQMediaObject@@UAE@I@Z @ 104 NONAME ; QMediaObject::~QMediaObject(unsigned int) + ??_EQMediaPlayer@@UAE@I@Z @ 105 NONAME ; QMediaPlayer::~QMediaPlayer(unsigned int) + ??_EQMediaPlayerControl@@UAE@I@Z @ 106 NONAME ; QMediaPlayerControl::~QMediaPlayerControl(unsigned int) + ??_EQMediaPlaylist@@UAE@I@Z @ 107 NONAME ; QMediaPlaylist::~QMediaPlaylist(unsigned int) + ??_EQMediaPlaylistControl@@UAE@I@Z @ 108 NONAME ; QMediaPlaylistControl::~QMediaPlaylistControl(unsigned int) + ??_EQMediaPlaylistIOInterface@@UAE@I@Z @ 109 NONAME ; QMediaPlaylistIOInterface::~QMediaPlaylistIOInterface(unsigned int) + ??_EQMediaPlaylistIOPlugin@@UAE@I@Z @ 110 NONAME ; QMediaPlaylistIOPlugin::~QMediaPlaylistIOPlugin(unsigned int) + ??_EQMediaPlaylistNavigator@@UAE@I@Z @ 111 NONAME ; QMediaPlaylistNavigator::~QMediaPlaylistNavigator(unsigned int) + ??_EQMediaPlaylistProvider@@UAE@I@Z @ 112 NONAME ; QMediaPlaylistProvider::~QMediaPlaylistProvider(unsigned int) + ??_EQMediaPlaylistReader@@UAE@I@Z @ 113 NONAME ; QMediaPlaylistReader::~QMediaPlaylistReader(unsigned int) + ??_EQMediaPlaylistWriter@@UAE@I@Z @ 114 NONAME ; QMediaPlaylistWriter::~QMediaPlaylistWriter(unsigned int) + ??_EQMediaService@@UAE@I@Z @ 115 NONAME ; QMediaService::~QMediaService(unsigned int) + ??_EQMediaServiceFeaturesInterface@@UAE@I@Z @ 116 NONAME ; QMediaServiceFeaturesInterface::~QMediaServiceFeaturesInterface(unsigned int) + ??_EQMediaServiceProvider@@UAE@I@Z @ 117 NONAME ; QMediaServiceProvider::~QMediaServiceProvider(unsigned int) + ??_EQMediaServiceSupportedDevicesInterface@@UAE@I@Z @ 118 NONAME ; QMediaServiceSupportedDevicesInterface::~QMediaServiceSupportedDevicesInterface(unsigned int) + ??_EQMediaServiceSupportedFormatsInterface@@UAE@I@Z @ 119 NONAME ; QMediaServiceSupportedFormatsInterface::~QMediaServiceSupportedFormatsInterface(unsigned int) + ??_EQMetaDataControl@@UAE@I@Z @ 120 NONAME ; QMetaDataControl::~QMetaDataControl(unsigned int) + ??_EQPainterVideoSurface@@UAE@I@Z @ 121 NONAME ; QPainterVideoSurface::~QPainterVideoSurface(unsigned int) + ??_EQSoundEffect@@UAE@I@Z @ 122 NONAME ; QSoundEffect::~QSoundEffect(unsigned int) + ??_EQVideoDeviceControl@@UAE@I@Z @ 123 NONAME ; QVideoDeviceControl::~QVideoDeviceControl(unsigned int) + ??_EQVideoOutputControl@@UAE@I@Z @ 124 NONAME ; QVideoOutputControl::~QVideoOutputControl(unsigned int) + ??_EQVideoRendererControl@@UAE@I@Z @ 125 NONAME ; QVideoRendererControl::~QVideoRendererControl(unsigned int) + ??_EQVideoWidget@@UAE@I@Z @ 126 NONAME ; QVideoWidget::~QVideoWidget(unsigned int) + ??_EQVideoWidgetControl@@UAE@I@Z @ 127 NONAME ; QVideoWidgetControl::~QVideoWidgetControl(unsigned int) + ??_EQVideoWindowControl@@UAE@I@Z @ 128 NONAME ; QVideoWindowControl::~QVideoWindowControl(unsigned int) + ?activated@QMediaPlaylistNavigator@@IAEXABVQMediaContent@@@Z @ 129 NONAME ; void QMediaPlaylistNavigator::activated(class QMediaContent const &) + ?addInterval@QMediaTimeRange@@QAEXABVQMediaTimeInterval@@@Z @ 130 NONAME ; void QMediaTimeRange::addInterval(class QMediaTimeInterval const &) + ?addInterval@QMediaTimeRange@@QAEX_J0@Z @ 131 NONAME ; void QMediaTimeRange::addInterval(long long, long long) + ?addMedia@QLocalMediaPlaylistProvider@@UAE_NABV?$QList@VQMediaContent@@@@@Z @ 132 NONAME ; bool QLocalMediaPlaylistProvider::addMedia(class QList const &) + ?addMedia@QLocalMediaPlaylistProvider@@UAE_NABVQMediaContent@@@Z @ 133 NONAME ; bool QLocalMediaPlaylistProvider::addMedia(class QMediaContent const &) + ?addMedia@QMediaPlaylist@@QAE_NABV?$QList@VQMediaContent@@@@@Z @ 134 NONAME ; bool QMediaPlaylist::addMedia(class QList const &) + ?addMedia@QMediaPlaylist@@QAE_NABVQMediaContent@@@Z @ 135 NONAME ; bool QMediaPlaylist::addMedia(class QMediaContent const &) + ?addMedia@QMediaPlaylistProvider@@UAE_NABV?$QList@VQMediaContent@@@@@Z @ 136 NONAME ; bool QMediaPlaylistProvider::addMedia(class QList const &) + ?addMedia@QMediaPlaylistProvider@@UAE_NABVQMediaContent@@@Z @ 137 NONAME ; bool QMediaPlaylistProvider::addMedia(class QMediaContent const &) + ?addPropertyWatch@QMediaObject@@IAEXABVQByteArray@@@Z @ 138 NONAME ; void QMediaObject::addPropertyWatch(class QByteArray const &) + ?addTimeRange@QMediaTimeRange@@QAEXABV1@@Z @ 139 NONAME ; void QMediaTimeRange::addTimeRange(class QMediaTimeRange const &) + ?aspectRatioMode@QGraphicsVideoItem@@QBE?AW4AspectRatioMode@Qt@@XZ @ 140 NONAME ; enum Qt::AspectRatioMode QGraphicsVideoItem::aspectRatioMode(void) const + ?aspectRatioMode@QVideoWidget@@QBE?AW4AspectRatioMode@Qt@@XZ @ 141 NONAME ; enum Qt::AspectRatioMode QVideoWidget::aspectRatioMode(void) const + ?audioAvailableChanged@QMediaPlayer@@IAEX_N@Z @ 142 NONAME ; void QMediaPlayer::audioAvailableChanged(bool) + ?audioAvailableChanged@QMediaPlayerControl@@IAEX_N@Z @ 143 NONAME ; void QMediaPlayerControl::audioAvailableChanged(bool) + ?audioBitRate@QMediaResource@@QBEHXZ @ 144 NONAME ; int QMediaResource::audioBitRate(void) const + ?audioCodec@QMediaResource@@QBE?AVQString@@XZ @ 145 NONAME ; class QString QMediaResource::audioCodec(void) const + ?availabilityChanged@QMediaObject@@IAEX_N@Z @ 146 NONAME ; void QMediaObject::availabilityChanged(bool) + ?availabilityError@QMediaObject@@UBE?AW4AvailabilityError@QtMediaServices@@XZ @ 147 NONAME ; enum QtMediaServices::AvailabilityError QMediaObject::availabilityError(void) const + ?availableExtendedMetaData@QMediaObject@@QBE?AVQStringList@@XZ @ 148 NONAME ; class QStringList QMediaObject::availableExtendedMetaData(void) const + ?availableMetaData@QMediaObject@@QBE?AV?$QList@W4MetaData@QtMediaServices@@@@XZ @ 149 NONAME ; class QList QMediaObject::availableMetaData(void) const + ?availableOutputsChanged@QVideoOutputControl@@IAEXABV?$QList@W4Output@QVideoOutputControl@@@@@Z @ 150 NONAME ; void QVideoOutputControl::availableOutputsChanged(class QList const &) + ?availablePlaybackRangesChanged@QMediaPlayerControl@@IAEXABVQMediaTimeRange@@@Z @ 151 NONAME ; void QMediaPlayerControl::availablePlaybackRangesChanged(class QMediaTimeRange const &) + ?bind@QMediaObject@@UAEXPAVQObject@@@Z @ 152 NONAME ; void QMediaObject::bind(class QObject *) + ?bind@QMediaPlayer@@UAEXPAVQObject@@@Z @ 153 NONAME ; void QMediaPlayer::bind(class QObject *) + ?boundingRect@QGraphicsVideoItem@@UBE?AVQRectF@@XZ @ 154 NONAME ; class QRectF QGraphicsVideoItem::boundingRect(void) const + ?brightness@QPainterVideoSurface@@QBEHXZ @ 155 NONAME ; int QPainterVideoSurface::brightness(void) const + ?brightness@QVideoWidget@@QBEHXZ @ 156 NONAME ; int QVideoWidget::brightness(void) const + ?brightnessChanged@QVideoWidget@@IAEXH@Z @ 157 NONAME ; void QVideoWidget::brightnessChanged(int) + ?brightnessChanged@QVideoWidgetControl@@IAEXH@Z @ 158 NONAME ; void QVideoWidgetControl::brightnessChanged(int) + ?brightnessChanged@QVideoWindowControl@@IAEXH@Z @ 159 NONAME ; void QVideoWindowControl::brightnessChanged(int) + ?bufferStatus@QMediaPlayer@@QBEHXZ @ 160 NONAME ; int QMediaPlayer::bufferStatus(void) const + ?bufferStatusChanged@QMediaPlayer@@IAEXH@Z @ 161 NONAME ; void QMediaPlayer::bufferStatusChanged(int) + ?bufferStatusChanged@QMediaPlayerControl@@IAEXH@Z @ 162 NONAME ; void QMediaPlayerControl::bufferStatusChanged(int) + ?canonicalRequest@QMediaContent@@QBE?AVQNetworkRequest@@XZ @ 163 NONAME ; class QNetworkRequest QMediaContent::canonicalRequest(void) const + ?canonicalResource@QMediaContent@@QBE?AVQMediaResource@@XZ @ 164 NONAME ; class QMediaResource QMediaContent::canonicalResource(void) const + ?canonicalUrl@QMediaContent@@QBE?AVQUrl@@XZ @ 165 NONAME ; class QUrl QMediaContent::canonicalUrl(void) const + ?channelCount@QMediaResource@@QBEHXZ @ 166 NONAME ; int QMediaResource::channelCount(void) const + ?clear@QLocalMediaPlaylistProvider@@UAE_NXZ @ 167 NONAME ; bool QLocalMediaPlaylistProvider::clear(void) + ?clear@QMediaPlaylist@@QAE_NXZ @ 168 NONAME ; bool QMediaPlaylist::clear(void) + ?clear@QMediaPlaylistProvider@@UAE_NXZ @ 169 NONAME ; bool QMediaPlaylistProvider::clear(void) + ?clear@QMediaTimeRange@@QAEXXZ @ 170 NONAME ; void QMediaTimeRange::clear(void) + ?codecs@QMediaServiceProviderHint@@QBE?AVQStringList@@XZ @ 171 NONAME ; class QStringList QMediaServiceProviderHint::codecs(void) const + ?contains@QMediaTimeInterval@@QBE_N_J@Z @ 172 NONAME ; bool QMediaTimeInterval::contains(long long) const + ?contains@QMediaTimeRange@@QBE_N_J@Z @ 173 NONAME ; bool QMediaTimeRange::contains(long long) const + ?contrast@QPainterVideoSurface@@QBEHXZ @ 174 NONAME ; int QPainterVideoSurface::contrast(void) const + ?contrast@QVideoWidget@@QBEHXZ @ 175 NONAME ; int QVideoWidget::contrast(void) const + ?contrastChanged@QVideoWidget@@IAEXH@Z @ 176 NONAME ; void QVideoWidget::contrastChanged(int) + ?contrastChanged@QVideoWidgetControl@@IAEXH@Z @ 177 NONAME ; void QVideoWidgetControl::contrastChanged(int) + ?contrastChanged@QVideoWindowControl@@IAEXH@Z @ 178 NONAME ; void QVideoWindowControl::contrastChanged(int) + ?createPainter@QPainterVideoSurface@@AAEXXZ @ 179 NONAME ; void QPainterVideoSurface::createPainter(void) + ?currentIndex@QMediaPlaylist@@QBEHXZ @ 180 NONAME ; int QMediaPlaylist::currentIndex(void) const + ?currentIndex@QMediaPlaylistNavigator@@QBEHXZ @ 181 NONAME ; int QMediaPlaylistNavigator::currentIndex(void) const + ?currentIndexChanged@QMediaPlaylist@@IAEXH@Z @ 182 NONAME ; void QMediaPlaylist::currentIndexChanged(int) + ?currentIndexChanged@QMediaPlaylistControl@@IAEXH@Z @ 183 NONAME ; void QMediaPlaylistControl::currentIndexChanged(int) + ?currentIndexChanged@QMediaPlaylistNavigator@@IAEXH@Z @ 184 NONAME ; void QMediaPlaylistNavigator::currentIndexChanged(int) + ?currentItem@QMediaPlaylistNavigator@@QBE?AVQMediaContent@@XZ @ 185 NONAME ; class QMediaContent QMediaPlaylistNavigator::currentItem(void) const + ?currentMedia@QMediaPlaylist@@QBE?AVQMediaContent@@XZ @ 186 NONAME ; class QMediaContent QMediaPlaylist::currentMedia(void) const + ?currentMediaChanged@QMediaPlaylist@@IAEXABVQMediaContent@@@Z @ 187 NONAME ; void QMediaPlaylist::currentMediaChanged(class QMediaContent const &) + ?currentMediaChanged@QMediaPlaylistControl@@IAEXABVQMediaContent@@@Z @ 188 NONAME ; void QMediaPlaylistControl::currentMediaChanged(class QMediaContent const &) + ?d_func@QGraphicsVideoItem@@AAEPAVQGraphicsVideoItemPrivate@@XZ @ 189 NONAME ; class QGraphicsVideoItemPrivate * QGraphicsVideoItem::d_func(void) + ?d_func@QGraphicsVideoItem@@ABEPBVQGraphicsVideoItemPrivate@@XZ @ 190 NONAME ; class QGraphicsVideoItemPrivate const * QGraphicsVideoItem::d_func(void) const + ?d_func@QLocalMediaPlaylistProvider@@AAEPAVQLocalMediaPlaylistProviderPrivate@@XZ @ 191 NONAME ; class QLocalMediaPlaylistProviderPrivate * QLocalMediaPlaylistProvider::d_func(void) + ?d_func@QLocalMediaPlaylistProvider@@ABEPBVQLocalMediaPlaylistProviderPrivate@@XZ @ 192 NONAME ; class QLocalMediaPlaylistProviderPrivate const * QLocalMediaPlaylistProvider::d_func(void) const + ?d_func@QMediaControl@@AAEPAVQMediaControlPrivate@@XZ @ 193 NONAME ; class QMediaControlPrivate * QMediaControl::d_func(void) + ?d_func@QMediaControl@@ABEPBVQMediaControlPrivate@@XZ @ 194 NONAME ; class QMediaControlPrivate const * QMediaControl::d_func(void) const + ?d_func@QMediaObject@@AAEPAVQMediaObjectPrivate@@XZ @ 195 NONAME ; class QMediaObjectPrivate * QMediaObject::d_func(void) + ?d_func@QMediaObject@@ABEPBVQMediaObjectPrivate@@XZ @ 196 NONAME ; class QMediaObjectPrivate const * QMediaObject::d_func(void) const + ?d_func@QMediaPlayer@@AAEPAVQMediaPlayerPrivate@@XZ @ 197 NONAME ; class QMediaPlayerPrivate * QMediaPlayer::d_func(void) + ?d_func@QMediaPlayer@@ABEPBVQMediaPlayerPrivate@@XZ @ 198 NONAME ; class QMediaPlayerPrivate const * QMediaPlayer::d_func(void) const + ?d_func@QMediaPlaylist@@AAEPAVQMediaPlaylistPrivate@@XZ @ 199 NONAME ; class QMediaPlaylistPrivate * QMediaPlaylist::d_func(void) + ?d_func@QMediaPlaylist@@ABEPBVQMediaPlaylistPrivate@@XZ @ 200 NONAME ; class QMediaPlaylistPrivate const * QMediaPlaylist::d_func(void) const + ?d_func@QMediaPlaylistNavigator@@AAEPAVQMediaPlaylistNavigatorPrivate@@XZ @ 201 NONAME ; class QMediaPlaylistNavigatorPrivate * QMediaPlaylistNavigator::d_func(void) + ?d_func@QMediaPlaylistNavigator@@ABEPBVQMediaPlaylistNavigatorPrivate@@XZ @ 202 NONAME ; class QMediaPlaylistNavigatorPrivate const * QMediaPlaylistNavigator::d_func(void) const + ?d_func@QMediaPlaylistProvider@@AAEPAVQMediaPlaylistProviderPrivate@@XZ @ 203 NONAME ; class QMediaPlaylistProviderPrivate * QMediaPlaylistProvider::d_func(void) + ?d_func@QMediaPlaylistProvider@@ABEPBVQMediaPlaylistProviderPrivate@@XZ @ 204 NONAME ; class QMediaPlaylistProviderPrivate const * QMediaPlaylistProvider::d_func(void) const + ?d_func@QMediaService@@AAEPAVQMediaServicePrivate@@XZ @ 205 NONAME ; class QMediaServicePrivate * QMediaService::d_func(void) + ?d_func@QMediaService@@ABEPBVQMediaServicePrivate@@XZ @ 206 NONAME ; class QMediaServicePrivate const * QMediaService::d_func(void) const + ?d_func@QVideoWidget@@AAEPAVQVideoWidgetPrivate@@XZ @ 207 NONAME ; class QVideoWidgetPrivate * QVideoWidget::d_func(void) + ?d_func@QVideoWidget@@ABEPBVQVideoWidgetPrivate@@XZ @ 208 NONAME ; class QVideoWidgetPrivate const * QVideoWidget::d_func(void) const + ?dataSize@QMediaResource@@QBE_JXZ @ 209 NONAME ; long long QMediaResource::dataSize(void) const + ?defaultServiceProvider@QMediaServiceProvider@@SAPAV1@XZ @ 210 NONAME ; class QMediaServiceProvider * QMediaServiceProvider::defaultServiceProvider(void) + ?device@QMediaServiceProviderHint@@QBE?AVQByteArray@@XZ @ 211 NONAME ; class QByteArray QMediaServiceProviderHint::device(void) const + ?deviceDescription@QMediaServiceProvider@@UAE?AVQString@@ABVQByteArray@@0@Z @ 212 NONAME ; class QString QMediaServiceProvider::deviceDescription(class QByteArray const &, class QByteArray const &) + ?devices@QMediaServiceProvider@@UBE?AV?$QList@VQByteArray@@@@ABVQByteArray@@@Z @ 213 NONAME ; class QList QMediaServiceProvider::devices(class QByteArray const &) const + ?devicesChanged@QVideoDeviceControl@@IAEXXZ @ 214 NONAME ; void QVideoDeviceControl::devicesChanged(void) + ?duration@QMediaPlayer@@QBE_JXZ @ 215 NONAME ; long long QMediaPlayer::duration(void) const + ?durationChanged@QMediaPlayer@@IAEX_J@Z @ 216 NONAME ; void QMediaPlayer::durationChanged(long long) + ?durationChanged@QMediaPlayerControl@@IAEX_J@Z @ 217 NONAME ; void QMediaPlayerControl::durationChanged(long long) + ?earliestTime@QMediaTimeRange@@QBE_JXZ @ 218 NONAME ; long long QMediaTimeRange::earliestTime(void) const + ?end@QMediaTimeInterval@@QBE_JXZ @ 219 NONAME ; long long QMediaTimeInterval::end(void) const + ?error@QMediaPlayer@@IAEXW4Error@1@@Z @ 220 NONAME ; void QMediaPlayer::error(enum QMediaPlayer::Error) + ?error@QMediaPlayer@@QBE?AW4Error@1@XZ @ 221 NONAME ; enum QMediaPlayer::Error QMediaPlayer::error(void) const + ?error@QMediaPlayerControl@@IAEXHABVQString@@@Z @ 222 NONAME ; void QMediaPlayerControl::error(int, class QString const &) + ?error@QMediaPlaylist@@QBE?AW4Error@1@XZ @ 223 NONAME ; enum QMediaPlaylist::Error QMediaPlaylist::error(void) const + ?errorString@QMediaPlayer@@QBE?AVQString@@XZ @ 224 NONAME ; class QString QMediaPlayer::errorString(void) const + ?errorString@QMediaPlaylist@@QBE?AVQString@@XZ @ 225 NONAME ; class QString QMediaPlaylist::errorString(void) const + ?event@QGraphicsVideoItem@@MAE_NPAVQEvent@@@Z @ 226 NONAME ; bool QGraphicsVideoItem::event(class QEvent *) + ?event@QVideoWidget@@MAE_NPAVQEvent@@@Z @ 227 NONAME ; bool QVideoWidget::event(class QEvent *) + ?extendedMetaData@QMediaObject@@QBE?AVQVariant@@ABVQString@@@Z @ 228 NONAME ; class QVariant QMediaObject::extendedMetaData(class QString const &) const + ?features@QMediaServiceProviderHint@@QBE?AV?$QFlags@W4Feature@QMediaServiceProviderHint@@@@XZ @ 229 NONAME ; class QFlags QMediaServiceProviderHint::features(void) const + ?frameChanged@QPainterVideoSurface@@IAEXXZ @ 230 NONAME ; void QPainterVideoSurface::frameChanged(void) + ?fullScreenChanged@QVideoWidget@@IAEX_N@Z @ 231 NONAME ; void QVideoWidget::fullScreenChanged(bool) + ?fullScreenChanged@QVideoWidgetControl@@IAEX_N@Z @ 232 NONAME ; void QVideoWidgetControl::fullScreenChanged(bool) + ?fullScreenChanged@QVideoWindowControl@@IAEX_N@Z @ 233 NONAME ; void QVideoWindowControl::fullScreenChanged(bool) + ?getStaticMetaObject@QGraphicsVideoItem@@SAABUQMetaObject@@XZ @ 234 NONAME ; struct QMetaObject const & QGraphicsVideoItem::getStaticMetaObject(void) + ?getStaticMetaObject@QLocalMediaPlaylistProvider@@SAABUQMetaObject@@XZ @ 235 NONAME ; struct QMetaObject const & QLocalMediaPlaylistProvider::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaControl@@SAABUQMetaObject@@XZ @ 236 NONAME ; struct QMetaObject const & QMediaControl::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaObject@@SAABUQMetaObject@@XZ @ 237 NONAME ; struct QMetaObject const & QMediaObject::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaPlayer@@SAABUQMetaObject@@XZ @ 238 NONAME ; struct QMetaObject const & QMediaPlayer::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaPlayerControl@@SAABUQMetaObject@@XZ @ 239 NONAME ; struct QMetaObject const & QMediaPlayerControl::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaPlaylist@@SAABUQMetaObject@@XZ @ 240 NONAME ; struct QMetaObject const & QMediaPlaylist::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaPlaylistControl@@SAABUQMetaObject@@XZ @ 241 NONAME ; struct QMetaObject const & QMediaPlaylistControl::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaPlaylistIOPlugin@@SAABUQMetaObject@@XZ @ 242 NONAME ; struct QMetaObject const & QMediaPlaylistIOPlugin::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaPlaylistNavigator@@SAABUQMetaObject@@XZ @ 243 NONAME ; struct QMetaObject const & QMediaPlaylistNavigator::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaPlaylistProvider@@SAABUQMetaObject@@XZ @ 244 NONAME ; struct QMetaObject const & QMediaPlaylistProvider::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaService@@SAABUQMetaObject@@XZ @ 245 NONAME ; struct QMetaObject const & QMediaService::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaServiceProvider@@SAABUQMetaObject@@XZ @ 246 NONAME ; struct QMetaObject const & QMediaServiceProvider::getStaticMetaObject(void) + ?getStaticMetaObject@QMediaServiceProviderPlugin@@SAABUQMetaObject@@XZ @ 247 NONAME ; struct QMetaObject const & QMediaServiceProviderPlugin::getStaticMetaObject(void) + ?getStaticMetaObject@QMetaDataControl@@SAABUQMetaObject@@XZ @ 248 NONAME ; struct QMetaObject const & QMetaDataControl::getStaticMetaObject(void) + ?getStaticMetaObject@QPainterVideoSurface@@SAABUQMetaObject@@XZ @ 249 NONAME ; struct QMetaObject const & QPainterVideoSurface::getStaticMetaObject(void) + ?getStaticMetaObject@QSoundEffect@@SAABUQMetaObject@@XZ @ 250 NONAME ; struct QMetaObject const & QSoundEffect::getStaticMetaObject(void) + ?getStaticMetaObject@QVideoDeviceControl@@SAABUQMetaObject@@XZ @ 251 NONAME ; struct QMetaObject const & QVideoDeviceControl::getStaticMetaObject(void) + ?getStaticMetaObject@QVideoOutputControl@@SAABUQMetaObject@@XZ @ 252 NONAME ; struct QMetaObject const & QVideoOutputControl::getStaticMetaObject(void) + ?getStaticMetaObject@QVideoRendererControl@@SAABUQMetaObject@@XZ @ 253 NONAME ; struct QMetaObject const & QVideoRendererControl::getStaticMetaObject(void) + ?getStaticMetaObject@QVideoWidget@@SAABUQMetaObject@@XZ @ 254 NONAME ; struct QMetaObject const & QVideoWidget::getStaticMetaObject(void) + ?getStaticMetaObject@QVideoWidgetControl@@SAABUQMetaObject@@XZ @ 255 NONAME ; struct QMetaObject const & QVideoWidgetControl::getStaticMetaObject(void) + ?getStaticMetaObject@QVideoWindowControl@@SAABUQMetaObject@@XZ @ 256 NONAME ; struct QMetaObject const & QVideoWindowControl::getStaticMetaObject(void) + ?hasSupport@QMediaPlayer@@SA?AW4SupportEstimate@QtMediaServices@@ABVQString@@ABVQStringList@@V?$QFlags@W4Flag@QMediaPlayer@@@@@Z @ 257 NONAME ; enum QtMediaServices::SupportEstimate QMediaPlayer::hasSupport(class QString const &, class QStringList const &, class QFlags) + ?hasSupport@QMediaServiceProvider@@UBE?AW4SupportEstimate@QtMediaServices@@ABVQByteArray@@ABVQString@@ABVQStringList@@H@Z @ 258 NONAME ; enum QtMediaServices::SupportEstimate QMediaServiceProvider::hasSupport(class QByteArray const &, class QString const &, class QStringList const &, int) const + ?hideEvent@QVideoWidget@@MAEXPAVQHideEvent@@@Z @ 259 NONAME ; void QVideoWidget::hideEvent(class QHideEvent *) + ?hue@QPainterVideoSurface@@QBEHXZ @ 260 NONAME ; int QPainterVideoSurface::hue(void) const + ?hue@QVideoWidget@@QBEHXZ @ 261 NONAME ; int QVideoWidget::hue(void) const + ?hueChanged@QVideoWidget@@IAEXH@Z @ 262 NONAME ; void QVideoWidget::hueChanged(int) + ?hueChanged@QVideoWidgetControl@@IAEXH@Z @ 263 NONAME ; void QVideoWidgetControl::hueChanged(int) + ?hueChanged@QVideoWindowControl@@IAEXH@Z @ 264 NONAME ; void QVideoWindowControl::hueChanged(int) + ?insertMedia@QLocalMediaPlaylistProvider@@UAE_NHABV?$QList@VQMediaContent@@@@@Z @ 265 NONAME ; bool QLocalMediaPlaylistProvider::insertMedia(int, class QList const &) + ?insertMedia@QLocalMediaPlaylistProvider@@UAE_NHABVQMediaContent@@@Z @ 266 NONAME ; bool QLocalMediaPlaylistProvider::insertMedia(int, class QMediaContent const &) + ?insertMedia@QMediaPlaylist@@QAE_NHABV?$QList@VQMediaContent@@@@@Z @ 267 NONAME ; bool QMediaPlaylist::insertMedia(int, class QList const &) + ?insertMedia@QMediaPlaylist@@QAE_NHABVQMediaContent@@@Z @ 268 NONAME ; bool QMediaPlaylist::insertMedia(int, class QMediaContent const &) + ?insertMedia@QMediaPlaylistProvider@@UAE_NHABV?$QList@VQMediaContent@@@@@Z @ 269 NONAME ; bool QMediaPlaylistProvider::insertMedia(int, class QList const &) + ?insertMedia@QMediaPlaylistProvider@@UAE_NHABVQMediaContent@@@Z @ 270 NONAME ; bool QMediaPlaylistProvider::insertMedia(int, class QMediaContent const &) + ?intervals@QMediaTimeRange@@QBE?AV?$QList@VQMediaTimeInterval@@@@XZ @ 271 NONAME ; class QList QMediaTimeRange::intervals(void) const + ?isAudioAvailable@QMediaPlayer@@QBE_NXZ @ 272 NONAME ; bool QMediaPlayer::isAudioAvailable(void) const + ?isAvailable@QMediaObject@@UBE_NXZ @ 273 NONAME ; bool QMediaObject::isAvailable(void) const + ?isContinuous@QMediaTimeRange@@QBE_NXZ @ 274 NONAME ; bool QMediaTimeRange::isContinuous(void) const + ?isEmpty@QMediaPlaylist@@QBE_NXZ @ 275 NONAME ; bool QMediaPlaylist::isEmpty(void) const + ?isEmpty@QMediaTimeRange@@QBE_NXZ @ 276 NONAME ; bool QMediaTimeRange::isEmpty(void) const + ?isFormatSupported@QPainterVideoSurface@@QBE_NABVQVideoSurfaceFormat@@PAV2@@Z @ 277 NONAME ; bool QPainterVideoSurface::isFormatSupported(class QVideoSurfaceFormat const &, class QVideoSurfaceFormat *) const + ?isMetaDataAvailable@QMediaObject@@QBE_NXZ @ 278 NONAME ; bool QMediaObject::isMetaDataAvailable(void) const + ?isMetaDataWritable@QMediaObject@@QBE_NXZ @ 279 NONAME ; bool QMediaObject::isMetaDataWritable(void) const + ?isMuted@QMediaPlayer@@QBE_NXZ @ 280 NONAME ; bool QMediaPlayer::isMuted(void) const + ?isMuted@QSoundEffect@@QBE_NXZ @ 281 NONAME ; bool QSoundEffect::isMuted(void) const + ?isNormal@QMediaTimeInterval@@QBE_NXZ @ 282 NONAME ; bool QMediaTimeInterval::isNormal(void) const + ?isNull@QMediaContent@@QBE_NXZ @ 283 NONAME ; bool QMediaContent::isNull(void) const + ?isNull@QMediaResource@@QBE_NXZ @ 284 NONAME ; bool QMediaResource::isNull(void) const + ?isNull@QMediaServiceProviderHint@@QBE_NXZ @ 285 NONAME ; bool QMediaServiceProviderHint::isNull(void) const + ?isReadOnly@QLocalMediaPlaylistProvider@@UBE_NXZ @ 286 NONAME ; bool QLocalMediaPlaylistProvider::isReadOnly(void) const + ?isReadOnly@QMediaPlaylist@@QBE_NXZ @ 287 NONAME ; bool QMediaPlaylist::isReadOnly(void) const + ?isReadOnly@QMediaPlaylistProvider@@UBE_NXZ @ 288 NONAME ; bool QMediaPlaylistProvider::isReadOnly(void) const + ?isReady@QPainterVideoSurface@@QBE_NXZ @ 289 NONAME ; bool QPainterVideoSurface::isReady(void) const + ?isSeekable@QMediaPlayer@@QBE_NXZ @ 290 NONAME ; bool QMediaPlayer::isSeekable(void) const + ?isVideoAvailable@QMediaPlayer@@QBE_NXZ @ 291 NONAME ; bool QMediaPlayer::isVideoAvailable(void) const + ?itemAt@QMediaPlaylistNavigator@@QBE?AVQMediaContent@@H@Z @ 292 NONAME ; class QMediaContent QMediaPlaylistNavigator::itemAt(int) const + ?itemChange@QGraphicsVideoItem@@MAE?AVQVariant@@W4GraphicsItemChange@QGraphicsItem@@ABV2@@Z @ 293 NONAME ; class QVariant QGraphicsVideoItem::itemChange(enum QGraphicsItem::GraphicsItemChange, class QVariant const &) + ?jump@QMediaPlaylistNavigator@@QAEXH@Z @ 294 NONAME ; void QMediaPlaylistNavigator::jump(int) + ?language@QMediaResource@@QBE?AVQString@@XZ @ 295 NONAME ; class QString QMediaResource::language(void) const + ?latestTime@QMediaTimeRange@@QBE_JXZ @ 296 NONAME ; long long QMediaTimeRange::latestTime(void) const + ?load@QMediaPlaylist@@QAEXABVQUrl@@PBD@Z @ 297 NONAME ; void QMediaPlaylist::load(class QUrl const &, char const *) + ?load@QMediaPlaylist@@QAEXPAVQIODevice@@PBD@Z @ 298 NONAME ; void QMediaPlaylist::load(class QIODevice *, char const *) + ?load@QMediaPlaylistProvider@@UAE_NABVQUrl@@PBD@Z @ 299 NONAME ; bool QMediaPlaylistProvider::load(class QUrl const &, char const *) + ?load@QMediaPlaylistProvider@@UAE_NPAVQIODevice@@PBD@Z @ 300 NONAME ; bool QMediaPlaylistProvider::load(class QIODevice *, char const *) + ?loadFailed@QMediaPlaylist@@IAEXXZ @ 301 NONAME ; void QMediaPlaylist::loadFailed(void) + ?loadFailed@QMediaPlaylistProvider@@IAEXW4Error@QMediaPlaylist@@ABVQString@@@Z @ 302 NONAME ; void QMediaPlaylistProvider::loadFailed(enum QMediaPlaylist::Error, class QString const &) + ?loaded@QMediaPlaylist@@IAEXXZ @ 303 NONAME ; void QMediaPlaylist::loaded(void) + ?loaded@QMediaPlaylistProvider@@IAEXXZ @ 304 NONAME ; void QMediaPlaylistProvider::loaded(void) + ?loops@QSoundEffect@@QBEHXZ @ 305 NONAME ; int QSoundEffect::loops(void) const + ?loopsChanged@QSoundEffect@@IAEXXZ @ 306 NONAME ; void QSoundEffect::loopsChanged(void) + ?media@QLocalMediaPlaylistProvider@@UBE?AVQMediaContent@@H@Z @ 307 NONAME ; class QMediaContent QLocalMediaPlaylistProvider::media(int) const + ?media@QMediaPlayer@@QBE?AVQMediaContent@@XZ @ 308 NONAME ; class QMediaContent QMediaPlayer::media(void) const + ?media@QMediaPlaylist@@QBE?AVQMediaContent@@H@Z @ 309 NONAME ; class QMediaContent QMediaPlaylist::media(int) const + ?mediaAboutToBeInserted@QMediaPlaylist@@IAEXHH@Z @ 310 NONAME ; void QMediaPlaylist::mediaAboutToBeInserted(int, int) + ?mediaAboutToBeInserted@QMediaPlaylistProvider@@IAEXHH@Z @ 311 NONAME ; void QMediaPlaylistProvider::mediaAboutToBeInserted(int, int) + ?mediaAboutToBeRemoved@QMediaPlaylist@@IAEXHH@Z @ 312 NONAME ; void QMediaPlaylist::mediaAboutToBeRemoved(int, int) + ?mediaAboutToBeRemoved@QMediaPlaylistProvider@@IAEXHH@Z @ 313 NONAME ; void QMediaPlaylistProvider::mediaAboutToBeRemoved(int, int) + ?mediaChanged@QMediaPlayer@@IAEXABVQMediaContent@@@Z @ 314 NONAME ; void QMediaPlayer::mediaChanged(class QMediaContent const &) + ?mediaChanged@QMediaPlayerControl@@IAEXABVQMediaContent@@@Z @ 315 NONAME ; void QMediaPlayerControl::mediaChanged(class QMediaContent const &) + ?mediaChanged@QMediaPlaylist@@IAEXHH@Z @ 316 NONAME ; void QMediaPlaylist::mediaChanged(int, int) + ?mediaChanged@QMediaPlaylistProvider@@IAEXHH@Z @ 317 NONAME ; void QMediaPlaylistProvider::mediaChanged(int, int) + ?mediaCount@QLocalMediaPlaylistProvider@@UBEHXZ @ 318 NONAME ; int QLocalMediaPlaylistProvider::mediaCount(void) const + ?mediaCount@QMediaPlaylist@@QBEHXZ @ 319 NONAME ; int QMediaPlaylist::mediaCount(void) const + ?mediaInserted@QMediaPlaylist@@IAEXHH@Z @ 320 NONAME ; void QMediaPlaylist::mediaInserted(int, int) + ?mediaInserted@QMediaPlaylistProvider@@IAEXHH@Z @ 321 NONAME ; void QMediaPlaylistProvider::mediaInserted(int, int) + ?mediaObject@QGraphicsVideoItem@@QBEPAVQMediaObject@@XZ @ 322 NONAME ; class QMediaObject * QGraphicsVideoItem::mediaObject(void) const + ?mediaObject@QMediaPlaylist@@QBEPAVQMediaObject@@XZ @ 323 NONAME ; class QMediaObject * QMediaPlaylist::mediaObject(void) const + ?mediaObject@QVideoWidget@@QBEPAVQMediaObject@@XZ @ 324 NONAME ; class QMediaObject * QVideoWidget::mediaObject(void) const + ?mediaRemoved@QMediaPlaylist@@IAEXHH@Z @ 325 NONAME ; void QMediaPlaylist::mediaRemoved(int, int) + ?mediaRemoved@QMediaPlaylistProvider@@IAEXHH@Z @ 326 NONAME ; void QMediaPlaylistProvider::mediaRemoved(int, int) + ?mediaStatus@QMediaPlayer@@QBE?AW4MediaStatus@1@XZ @ 327 NONAME ; enum QMediaPlayer::MediaStatus QMediaPlayer::mediaStatus(void) const + ?mediaStatusChanged@QMediaPlayer@@IAEXW4MediaStatus@1@@Z @ 328 NONAME ; void QMediaPlayer::mediaStatusChanged(enum QMediaPlayer::MediaStatus) + ?mediaStatusChanged@QMediaPlayerControl@@IAEXW4MediaStatus@QMediaPlayer@@@Z @ 329 NONAME ; void QMediaPlayerControl::mediaStatusChanged(enum QMediaPlayer::MediaStatus) + ?mediaStream@QMediaPlayer@@QBEPBVQIODevice@@XZ @ 330 NONAME ; class QIODevice const * QMediaPlayer::mediaStream(void) const + ?metaData@QMediaObject@@QBE?AVQVariant@@W4MetaData@QtMediaServices@@@Z @ 331 NONAME ; class QVariant QMediaObject::metaData(enum QtMediaServices::MetaData) const + ?metaDataAvailableChanged@QMediaObject@@IAEX_N@Z @ 332 NONAME ; void QMediaObject::metaDataAvailableChanged(bool) + ?metaDataAvailableChanged@QMetaDataControl@@IAEX_N@Z @ 333 NONAME ; void QMetaDataControl::metaDataAvailableChanged(bool) + ?metaDataChanged@QMediaObject@@IAEXXZ @ 334 NONAME ; void QMediaObject::metaDataChanged(void) + ?metaDataChanged@QMetaDataControl@@IAEXXZ @ 335 NONAME ; void QMetaDataControl::metaDataChanged(void) + ?metaDataWritableChanged@QMediaObject@@IAEX_N@Z @ 336 NONAME ; void QMediaObject::metaDataWritableChanged(bool) + ?metaObject@QGraphicsVideoItem@@UBEPBUQMetaObject@@XZ @ 337 NONAME ; struct QMetaObject const * QGraphicsVideoItem::metaObject(void) const + ?metaObject@QLocalMediaPlaylistProvider@@UBEPBUQMetaObject@@XZ @ 338 NONAME ; struct QMetaObject const * QLocalMediaPlaylistProvider::metaObject(void) const + ?metaObject@QMediaControl@@UBEPBUQMetaObject@@XZ @ 339 NONAME ; struct QMetaObject const * QMediaControl::metaObject(void) const + ?metaObject@QMediaObject@@UBEPBUQMetaObject@@XZ @ 340 NONAME ; struct QMetaObject const * QMediaObject::metaObject(void) const + ?metaObject@QMediaPlayer@@UBEPBUQMetaObject@@XZ @ 341 NONAME ; struct QMetaObject const * QMediaPlayer::metaObject(void) const + ?metaObject@QMediaPlayerControl@@UBEPBUQMetaObject@@XZ @ 342 NONAME ; struct QMetaObject const * QMediaPlayerControl::metaObject(void) const + ?metaObject@QMediaPlaylist@@UBEPBUQMetaObject@@XZ @ 343 NONAME ; struct QMetaObject const * QMediaPlaylist::metaObject(void) const + ?metaObject@QMediaPlaylistControl@@UBEPBUQMetaObject@@XZ @ 344 NONAME ; struct QMetaObject const * QMediaPlaylistControl::metaObject(void) const + ?metaObject@QMediaPlaylistIOPlugin@@UBEPBUQMetaObject@@XZ @ 345 NONAME ; struct QMetaObject const * QMediaPlaylistIOPlugin::metaObject(void) const + ?metaObject@QMediaPlaylistNavigator@@UBEPBUQMetaObject@@XZ @ 346 NONAME ; struct QMetaObject const * QMediaPlaylistNavigator::metaObject(void) const + ?metaObject@QMediaPlaylistProvider@@UBEPBUQMetaObject@@XZ @ 347 NONAME ; struct QMetaObject const * QMediaPlaylistProvider::metaObject(void) const + ?metaObject@QMediaService@@UBEPBUQMetaObject@@XZ @ 348 NONAME ; struct QMetaObject const * QMediaService::metaObject(void) const + ?metaObject@QMediaServiceProvider@@UBEPBUQMetaObject@@XZ @ 349 NONAME ; struct QMetaObject const * QMediaServiceProvider::metaObject(void) const + ?metaObject@QMediaServiceProviderPlugin@@UBEPBUQMetaObject@@XZ @ 350 NONAME ; struct QMetaObject const * QMediaServiceProviderPlugin::metaObject(void) const + ?metaObject@QMetaDataControl@@UBEPBUQMetaObject@@XZ @ 351 NONAME ; struct QMetaObject const * QMetaDataControl::metaObject(void) const + ?metaObject@QPainterVideoSurface@@UBEPBUQMetaObject@@XZ @ 352 NONAME ; struct QMetaObject const * QPainterVideoSurface::metaObject(void) const + ?metaObject@QSoundEffect@@UBEPBUQMetaObject@@XZ @ 353 NONAME ; struct QMetaObject const * QSoundEffect::metaObject(void) const + ?metaObject@QVideoDeviceControl@@UBEPBUQMetaObject@@XZ @ 354 NONAME ; struct QMetaObject const * QVideoDeviceControl::metaObject(void) const + ?metaObject@QVideoOutputControl@@UBEPBUQMetaObject@@XZ @ 355 NONAME ; struct QMetaObject const * QVideoOutputControl::metaObject(void) const + ?metaObject@QVideoRendererControl@@UBEPBUQMetaObject@@XZ @ 356 NONAME ; struct QMetaObject const * QVideoRendererControl::metaObject(void) const + ?metaObject@QVideoWidget@@UBEPBUQMetaObject@@XZ @ 357 NONAME ; struct QMetaObject const * QVideoWidget::metaObject(void) const + ?metaObject@QVideoWidgetControl@@UBEPBUQMetaObject@@XZ @ 358 NONAME ; struct QMetaObject const * QVideoWidgetControl::metaObject(void) const + ?metaObject@QVideoWindowControl@@UBEPBUQMetaObject@@XZ @ 359 NONAME ; struct QMetaObject const * QVideoWindowControl::metaObject(void) const + ?mimeType@QMediaResource@@QBE?AVQString@@XZ @ 360 NONAME ; class QString QMediaResource::mimeType(void) const + ?mimeType@QMediaServiceProviderHint@@QBE?AVQString@@XZ @ 361 NONAME ; class QString QMediaServiceProviderHint::mimeType(void) const + ?moveEvent@QVideoWidget@@MAEXPAVQMoveEvent@@@Z @ 362 NONAME ; void QVideoWidget::moveEvent(class QMoveEvent *) + ?mutedChanged@QMediaPlayer@@IAEX_N@Z @ 363 NONAME ; void QMediaPlayer::mutedChanged(bool) + ?mutedChanged@QMediaPlayerControl@@IAEX_N@Z @ 364 NONAME ; void QMediaPlayerControl::mutedChanged(bool) + ?mutedChanged@QSoundEffect@@IAEXXZ @ 365 NONAME ; void QSoundEffect::mutedChanged(void) + ?nativeSize@QGraphicsVideoItem@@QBE?AVQSizeF@@XZ @ 366 NONAME ; class QSizeF QGraphicsVideoItem::nativeSize(void) const + ?nativeSizeChanged@QGraphicsVideoItem@@IAEXABVQSizeF@@@Z @ 367 NONAME ; void QGraphicsVideoItem::nativeSizeChanged(class QSizeF const &) + ?nativeSizeChanged@QVideoWindowControl@@IAEXXZ @ 368 NONAME ; void QVideoWindowControl::nativeSizeChanged(void) + ?next@QMediaPlaylist@@QAEXXZ @ 369 NONAME ; void QMediaPlaylist::next(void) + ?next@QMediaPlaylistNavigator@@QAEXXZ @ 370 NONAME ; void QMediaPlaylistNavigator::next(void) + ?nextIndex@QMediaPlaylist@@QBEHH@Z @ 371 NONAME ; int QMediaPlaylist::nextIndex(int) const + ?nextIndex@QMediaPlaylistNavigator@@QBEHH@Z @ 372 NONAME ; int QMediaPlaylistNavigator::nextIndex(int) const + ?nextItem@QMediaPlaylistNavigator@@QBE?AVQMediaContent@@H@Z @ 373 NONAME ; class QMediaContent QMediaPlaylistNavigator::nextItem(int) const + ?normalized@QMediaTimeInterval@@QBE?AV1@XZ @ 374 NONAME ; class QMediaTimeInterval QMediaTimeInterval::normalized(void) const + ?notifyInterval@QMediaObject@@QBEHXZ @ 375 NONAME ; int QMediaObject::notifyInterval(void) const + ?notifyIntervalChanged@QMediaObject@@IAEXH@Z @ 376 NONAME ; void QMediaObject::notifyIntervalChanged(int) + ?offset@QGraphicsVideoItem@@QBE?AVQPointF@@XZ @ 377 NONAME ; class QPointF QGraphicsVideoItem::offset(void) const + ?paint@QGraphicsVideoItem@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 378 NONAME ; void QGraphicsVideoItem::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *) + ?paint@QPainterVideoSurface@@QAEXPAVQPainter@@ABVQRectF@@1@Z @ 379 NONAME ; void QPainterVideoSurface::paint(class QPainter *, class QRectF const &, class QRectF const &) + ?paintEvent@QVideoWidget@@MAEXPAVQPaintEvent@@@Z @ 380 NONAME ; void QVideoWidget::paintEvent(class QPaintEvent *) + ?pause@QMediaPlayer@@QAEXXZ @ 381 NONAME ; void QMediaPlayer::pause(void) + ?play@QMediaPlayer@@QAEXXZ @ 382 NONAME ; void QMediaPlayer::play(void) + ?play@QSoundEffect@@QAEXXZ @ 383 NONAME ; void QSoundEffect::play(void) + ?playbackMode@QMediaPlaylist@@QBE?AW4PlaybackMode@1@XZ @ 384 NONAME ; enum QMediaPlaylist::PlaybackMode QMediaPlaylist::playbackMode(void) const + ?playbackMode@QMediaPlaylistNavigator@@QBE?AW4PlaybackMode@QMediaPlaylist@@XZ @ 385 NONAME ; enum QMediaPlaylist::PlaybackMode QMediaPlaylistNavigator::playbackMode(void) const + ?playbackModeChanged@QMediaPlaylist@@IAEXW4PlaybackMode@1@@Z @ 386 NONAME ; void QMediaPlaylist::playbackModeChanged(enum QMediaPlaylist::PlaybackMode) + ?playbackModeChanged@QMediaPlaylistControl@@IAEXW4PlaybackMode@QMediaPlaylist@@@Z @ 387 NONAME ; void QMediaPlaylistControl::playbackModeChanged(enum QMediaPlaylist::PlaybackMode) + ?playbackModeChanged@QMediaPlaylistNavigator@@IAEXW4PlaybackMode@QMediaPlaylist@@@Z @ 388 NONAME ; void QMediaPlaylistNavigator::playbackModeChanged(enum QMediaPlaylist::PlaybackMode) + ?playbackRate@QMediaPlayer@@QBEMXZ @ 389 NONAME ; float QMediaPlayer::playbackRate(void) const + ?playbackRateChanged@QMediaPlayer@@IAEXM@Z @ 390 NONAME ; void QMediaPlayer::playbackRateChanged(float) + ?playbackRateChanged@QMediaPlayerControl@@IAEXM@Z @ 391 NONAME ; void QMediaPlayerControl::playbackRateChanged(float) + ?playlist@QMediaPlaylistNavigator@@QBEPAVQMediaPlaylistProvider@@XZ @ 392 NONAME ; class QMediaPlaylistProvider * QMediaPlaylistNavigator::playlist(void) const + ?playlistProviderChanged@QMediaPlaylistControl@@IAEXXZ @ 393 NONAME ; void QMediaPlaylistControl::playlistProviderChanged(void) + ?position@QMediaPlayer@@QBE_JXZ @ 394 NONAME ; long long QMediaPlayer::position(void) const + ?positionChanged@QMediaPlayer@@IAEX_J@Z @ 395 NONAME ; void QMediaPlayer::positionChanged(long long) + ?positionChanged@QMediaPlayerControl@@IAEX_J@Z @ 396 NONAME ; void QMediaPlayerControl::positionChanged(long long) + ?present@QPainterVideoSurface@@UAE_NABVQVideoFrame@@@Z @ 397 NONAME ; bool QPainterVideoSurface::present(class QVideoFrame const &) + ?previous@QMediaPlaylist@@QAEXXZ @ 398 NONAME ; void QMediaPlaylist::previous(void) + ?previous@QMediaPlaylistNavigator@@QAEXXZ @ 399 NONAME ; void QMediaPlaylistNavigator::previous(void) + ?previousIndex@QMediaPlaylist@@QBEHH@Z @ 400 NONAME ; int QMediaPlaylist::previousIndex(int) const + ?previousIndex@QMediaPlaylistNavigator@@QBEHH@Z @ 401 NONAME ; int QMediaPlaylistNavigator::previousIndex(int) const + ?previousItem@QMediaPlaylistNavigator@@QBE?AVQMediaContent@@H@Z @ 402 NONAME ; class QMediaContent QMediaPlaylistNavigator::previousItem(int) const + ?qt_metacall@QGraphicsVideoItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 403 NONAME ; int QGraphicsVideoItem::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QLocalMediaPlaylistProvider@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 404 NONAME ; int QLocalMediaPlaylistProvider::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 405 NONAME ; int QMediaControl::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaObject@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 406 NONAME ; int QMediaObject::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaPlayer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 407 NONAME ; int QMediaPlayer::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaPlayerControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 408 NONAME ; int QMediaPlayerControl::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaPlaylist@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 409 NONAME ; int QMediaPlaylist::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaPlaylistControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 410 NONAME ; int QMediaPlaylistControl::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaPlaylistIOPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 411 NONAME ; int QMediaPlaylistIOPlugin::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaPlaylistNavigator@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 412 NONAME ; int QMediaPlaylistNavigator::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaPlaylistProvider@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 413 NONAME ; int QMediaPlaylistProvider::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 414 NONAME ; int QMediaService::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaServiceProvider@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 415 NONAME ; int QMediaServiceProvider::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMediaServiceProviderPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 416 NONAME ; int QMediaServiceProviderPlugin::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QMetaDataControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 417 NONAME ; int QMetaDataControl::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QPainterVideoSurface@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 418 NONAME ; int QPainterVideoSurface::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QSoundEffect@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 419 NONAME ; int QSoundEffect::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QVideoDeviceControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 420 NONAME ; int QVideoDeviceControl::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QVideoOutputControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 421 NONAME ; int QVideoOutputControl::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QVideoRendererControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 422 NONAME ; int QVideoRendererControl::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QVideoWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 423 NONAME ; int QVideoWidget::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QVideoWidgetControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 424 NONAME ; int QVideoWidgetControl::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QVideoWindowControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 425 NONAME ; int QVideoWindowControl::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacast@QGraphicsVideoItem@@UAEPAXPBD@Z @ 426 NONAME ; void * QGraphicsVideoItem::qt_metacast(char const *) + ?qt_metacast@QLocalMediaPlaylistProvider@@UAEPAXPBD@Z @ 427 NONAME ; void * QLocalMediaPlaylistProvider::qt_metacast(char const *) + ?qt_metacast@QMediaControl@@UAEPAXPBD@Z @ 428 NONAME ; void * QMediaControl::qt_metacast(char const *) + ?qt_metacast@QMediaObject@@UAEPAXPBD@Z @ 429 NONAME ; void * QMediaObject::qt_metacast(char const *) + ?qt_metacast@QMediaPlayer@@UAEPAXPBD@Z @ 430 NONAME ; void * QMediaPlayer::qt_metacast(char const *) + ?qt_metacast@QMediaPlayerControl@@UAEPAXPBD@Z @ 431 NONAME ; void * QMediaPlayerControl::qt_metacast(char const *) + ?qt_metacast@QMediaPlaylist@@UAEPAXPBD@Z @ 432 NONAME ; void * QMediaPlaylist::qt_metacast(char const *) + ?qt_metacast@QMediaPlaylistControl@@UAEPAXPBD@Z @ 433 NONAME ; void * QMediaPlaylistControl::qt_metacast(char const *) + ?qt_metacast@QMediaPlaylistIOPlugin@@UAEPAXPBD@Z @ 434 NONAME ; void * QMediaPlaylistIOPlugin::qt_metacast(char const *) + ?qt_metacast@QMediaPlaylistNavigator@@UAEPAXPBD@Z @ 435 NONAME ; void * QMediaPlaylistNavigator::qt_metacast(char const *) + ?qt_metacast@QMediaPlaylistProvider@@UAEPAXPBD@Z @ 436 NONAME ; void * QMediaPlaylistProvider::qt_metacast(char const *) + ?qt_metacast@QMediaService@@UAEPAXPBD@Z @ 437 NONAME ; void * QMediaService::qt_metacast(char const *) + ?qt_metacast@QMediaServiceProvider@@UAEPAXPBD@Z @ 438 NONAME ; void * QMediaServiceProvider::qt_metacast(char const *) + ?qt_metacast@QMediaServiceProviderPlugin@@UAEPAXPBD@Z @ 439 NONAME ; void * QMediaServiceProviderPlugin::qt_metacast(char const *) + ?qt_metacast@QMetaDataControl@@UAEPAXPBD@Z @ 440 NONAME ; void * QMetaDataControl::qt_metacast(char const *) + ?qt_metacast@QPainterVideoSurface@@UAEPAXPBD@Z @ 441 NONAME ; void * QPainterVideoSurface::qt_metacast(char const *) + ?qt_metacast@QSoundEffect@@UAEPAXPBD@Z @ 442 NONAME ; void * QSoundEffect::qt_metacast(char const *) + ?qt_metacast@QVideoDeviceControl@@UAEPAXPBD@Z @ 443 NONAME ; void * QVideoDeviceControl::qt_metacast(char const *) + ?qt_metacast@QVideoOutputControl@@UAEPAXPBD@Z @ 444 NONAME ; void * QVideoOutputControl::qt_metacast(char const *) + ?qt_metacast@QVideoRendererControl@@UAEPAXPBD@Z @ 445 NONAME ; void * QVideoRendererControl::qt_metacast(char const *) + ?qt_metacast@QVideoWidget@@UAEPAXPBD@Z @ 446 NONAME ; void * QVideoWidget::qt_metacast(char const *) + ?qt_metacast@QVideoWidgetControl@@UAEPAXPBD@Z @ 447 NONAME ; void * QVideoWidgetControl::qt_metacast(char const *) + ?qt_metacast@QVideoWindowControl@@UAEPAXPBD@Z @ 448 NONAME ; void * QVideoWindowControl::qt_metacast(char const *) + ?removeInterval@QMediaTimeRange@@QAEXABVQMediaTimeInterval@@@Z @ 449 NONAME ; void QMediaTimeRange::removeInterval(class QMediaTimeInterval const &) + ?removeInterval@QMediaTimeRange@@QAEX_J0@Z @ 450 NONAME ; void QMediaTimeRange::removeInterval(long long, long long) + ?removeMedia@QLocalMediaPlaylistProvider@@UAE_NH@Z @ 451 NONAME ; bool QLocalMediaPlaylistProvider::removeMedia(int) + ?removeMedia@QLocalMediaPlaylistProvider@@UAE_NHH@Z @ 452 NONAME ; bool QLocalMediaPlaylistProvider::removeMedia(int, int) + ?removeMedia@QMediaPlaylist@@QAE_NH@Z @ 453 NONAME ; bool QMediaPlaylist::removeMedia(int) + ?removeMedia@QMediaPlaylist@@QAE_NHH@Z @ 454 NONAME ; bool QMediaPlaylist::removeMedia(int, int) + ?removeMedia@QMediaPlaylistProvider@@UAE_NH@Z @ 455 NONAME ; bool QMediaPlaylistProvider::removeMedia(int) + ?removeMedia@QMediaPlaylistProvider@@UAE_NHH@Z @ 456 NONAME ; bool QMediaPlaylistProvider::removeMedia(int, int) + ?removePropertyWatch@QMediaObject@@IAEXABVQByteArray@@@Z @ 457 NONAME ; void QMediaObject::removePropertyWatch(class QByteArray const &) + ?removeTimeRange@QMediaTimeRange@@QAEXABV1@@Z @ 458 NONAME ; void QMediaTimeRange::removeTimeRange(class QMediaTimeRange const &) + ?request@QMediaResource@@QBE?AVQNetworkRequest@@XZ @ 459 NONAME ; class QNetworkRequest QMediaResource::request(void) const + ?resizeEvent@QVideoWidget@@MAEXPAVQResizeEvent@@@Z @ 460 NONAME ; void QVideoWidget::resizeEvent(class QResizeEvent *) + ?resolution@QMediaResource@@QBE?AVQSize@@XZ @ 461 NONAME ; class QSize QMediaResource::resolution(void) const + ?resources@QMediaContent@@QBE?AV?$QList@VQMediaResource@@@@XZ @ 462 NONAME ; class QList QMediaContent::resources(void) const + ?sampleRate@QMediaResource@@QBEHXZ @ 463 NONAME ; int QMediaResource::sampleRate(void) const + ?saturation@QPainterVideoSurface@@QBEHXZ @ 464 NONAME ; int QPainterVideoSurface::saturation(void) const + ?saturation@QVideoWidget@@QBEHXZ @ 465 NONAME ; int QVideoWidget::saturation(void) const + ?saturationChanged@QVideoWidget@@IAEXH@Z @ 466 NONAME ; void QVideoWidget::saturationChanged(int) + ?saturationChanged@QVideoWidgetControl@@IAEXH@Z @ 467 NONAME ; void QVideoWidgetControl::saturationChanged(int) + ?saturationChanged@QVideoWindowControl@@IAEXH@Z @ 468 NONAME ; void QVideoWindowControl::saturationChanged(int) + ?save@QMediaPlaylist@@QAE_NABVQUrl@@PBD@Z @ 469 NONAME ; bool QMediaPlaylist::save(class QUrl const &, char const *) + ?save@QMediaPlaylist@@QAE_NPAVQIODevice@@PBD@Z @ 470 NONAME ; bool QMediaPlaylist::save(class QIODevice *, char const *) + ?save@QMediaPlaylistProvider@@UAE_NABVQUrl@@PBD@Z @ 471 NONAME ; bool QMediaPlaylistProvider::save(class QUrl const &, char const *) + ?save@QMediaPlaylistProvider@@UAE_NPAVQIODevice@@PBD@Z @ 472 NONAME ; bool QMediaPlaylistProvider::save(class QIODevice *, char const *) + ?sceneEvent@QGraphicsVideoItem@@MAE_NPAVQEvent@@@Z @ 473 NONAME ; bool QGraphicsVideoItem::sceneEvent(class QEvent *) + ?seekableChanged@QMediaPlayer@@IAEX_N@Z @ 474 NONAME ; void QMediaPlayer::seekableChanged(bool) + ?seekableChanged@QMediaPlayerControl@@IAEX_N@Z @ 475 NONAME ; void QMediaPlayerControl::seekableChanged(bool) + ?selectedDeviceChanged@QVideoDeviceControl@@IAEXABVQString@@@Z @ 476 NONAME ; void QVideoDeviceControl::selectedDeviceChanged(class QString const &) + ?selectedDeviceChanged@QVideoDeviceControl@@IAEXH@Z @ 477 NONAME ; void QVideoDeviceControl::selectedDeviceChanged(int) + ?service@QMediaObject@@UBEPAVQMediaService@@XZ @ 478 NONAME ; class QMediaService * QMediaObject::service(void) const + ?setAspectRatioMode@QGraphicsVideoItem@@QAEXW4AspectRatioMode@Qt@@@Z @ 479 NONAME ; void QGraphicsVideoItem::setAspectRatioMode(enum Qt::AspectRatioMode) + ?setAspectRatioMode@QVideoWidget@@QAEXW4AspectRatioMode@Qt@@@Z @ 480 NONAME ; void QVideoWidget::setAspectRatioMode(enum Qt::AspectRatioMode) + ?setAudioBitRate@QMediaResource@@QAEXH@Z @ 481 NONAME ; void QMediaResource::setAudioBitRate(int) + ?setAudioCodec@QMediaResource@@QAEXABVQString@@@Z @ 482 NONAME ; void QMediaResource::setAudioCodec(class QString const &) + ?setBrightness@QPainterVideoSurface@@QAEXH@Z @ 483 NONAME ; void QPainterVideoSurface::setBrightness(int) + ?setBrightness@QVideoWidget@@QAEXH@Z @ 484 NONAME ; void QVideoWidget::setBrightness(int) + ?setChannelCount@QMediaResource@@QAEXH@Z @ 485 NONAME ; void QMediaResource::setChannelCount(int) + ?setContrast@QPainterVideoSurface@@QAEXH@Z @ 486 NONAME ; void QPainterVideoSurface::setContrast(int) + ?setContrast@QVideoWidget@@QAEXH@Z @ 487 NONAME ; void QVideoWidget::setContrast(int) + ?setCurrentIndex@QMediaPlaylist@@QAEXH@Z @ 488 NONAME ; void QMediaPlaylist::setCurrentIndex(int) + ?setDataSize@QMediaResource@@QAEX_J@Z @ 489 NONAME ; void QMediaResource::setDataSize(long long) + ?setExtendedMetaData@QMediaObject@@QAEXABVQString@@ABVQVariant@@@Z @ 490 NONAME ; void QMediaObject::setExtendedMetaData(class QString const &, class QVariant const &) + ?setFullScreen@QVideoWidget@@QAEX_N@Z @ 491 NONAME ; void QVideoWidget::setFullScreen(bool) + ?setHue@QPainterVideoSurface@@QAEXH@Z @ 492 NONAME ; void QPainterVideoSurface::setHue(int) + ?setHue@QVideoWidget@@QAEXH@Z @ 493 NONAME ; void QVideoWidget::setHue(int) + ?setLanguage@QMediaResource@@QAEXABVQString@@@Z @ 494 NONAME ; void QMediaResource::setLanguage(class QString const &) + ?setLoops@QSoundEffect@@QAEXH@Z @ 495 NONAME ; void QSoundEffect::setLoops(int) + ?setMedia@QMediaPlayer@@QAEXABVQMediaContent@@PAVQIODevice@@@Z @ 496 NONAME ; void QMediaPlayer::setMedia(class QMediaContent const &, class QIODevice *) + ?setMediaObject@QGraphicsVideoItem@@QAEXPAVQMediaObject@@@Z @ 497 NONAME ; void QGraphicsVideoItem::setMediaObject(class QMediaObject *) + ?setMediaObject@QMediaPlaylist@@QAEXPAVQMediaObject@@@Z @ 498 NONAME ; void QMediaPlaylist::setMediaObject(class QMediaObject *) + ?setMediaObject@QVideoWidget@@QAEXPAVQMediaObject@@@Z @ 499 NONAME ; void QVideoWidget::setMediaObject(class QMediaObject *) + ?setMetaData@QMediaObject@@QAEXW4MetaData@QtMediaServices@@ABVQVariant@@@Z @ 500 NONAME ; void QMediaObject::setMetaData(enum QtMediaServices::MetaData, class QVariant const &) + ?setMuted@QMediaPlayer@@QAEX_N@Z @ 501 NONAME ; void QMediaPlayer::setMuted(bool) + ?setMuted@QSoundEffect@@QAEX_N@Z @ 502 NONAME ; void QSoundEffect::setMuted(bool) + ?setNotifyInterval@QMediaObject@@QAEXH@Z @ 503 NONAME ; void QMediaObject::setNotifyInterval(int) + ?setOffset@QGraphicsVideoItem@@QAEXABVQPointF@@@Z @ 504 NONAME ; void QGraphicsVideoItem::setOffset(class QPointF const &) + ?setPlaybackMode@QMediaPlaylist@@QAEXW4PlaybackMode@1@@Z @ 505 NONAME ; void QMediaPlaylist::setPlaybackMode(enum QMediaPlaylist::PlaybackMode) + ?setPlaybackMode@QMediaPlaylistNavigator@@QAEXW4PlaybackMode@QMediaPlaylist@@@Z @ 506 NONAME ; void QMediaPlaylistNavigator::setPlaybackMode(enum QMediaPlaylist::PlaybackMode) + ?setPlaybackRate@QMediaPlayer@@QAEXM@Z @ 507 NONAME ; void QMediaPlayer::setPlaybackRate(float) + ?setPlaylist@QMediaPlaylistNavigator@@QAEXPAVQMediaPlaylistProvider@@@Z @ 508 NONAME ; void QMediaPlaylistNavigator::setPlaylist(class QMediaPlaylistProvider *) + ?setPosition@QMediaPlayer@@QAEX_J@Z @ 509 NONAME ; void QMediaPlayer::setPosition(long long) + ?setReady@QPainterVideoSurface@@QAEX_N@Z @ 510 NONAME ; void QPainterVideoSurface::setReady(bool) + ?setResolution@QMediaResource@@QAEXABVQSize@@@Z @ 511 NONAME ; void QMediaResource::setResolution(class QSize const &) + ?setResolution@QMediaResource@@QAEXHH@Z @ 512 NONAME ; void QMediaResource::setResolution(int, int) + ?setSampleRate@QMediaResource@@QAEXH@Z @ 513 NONAME ; void QMediaResource::setSampleRate(int) + ?setSaturation@QPainterVideoSurface@@QAEXH@Z @ 514 NONAME ; void QPainterVideoSurface::setSaturation(int) + ?setSaturation@QVideoWidget@@QAEXH@Z @ 515 NONAME ; void QVideoWidget::setSaturation(int) + ?setSize@QGraphicsVideoItem@@QAEXABVQSizeF@@@Z @ 516 NONAME ; void QGraphicsVideoItem::setSize(class QSizeF const &) + ?setSource@QSoundEffect@@QAEXABVQUrl@@@Z @ 517 NONAME ; void QSoundEffect::setSource(class QUrl const &) + ?setVideoBitRate@QMediaResource@@QAEXH@Z @ 518 NONAME ; void QMediaResource::setVideoBitRate(int) + ?setVideoCodec@QMediaResource@@QAEXABVQString@@@Z @ 519 NONAME ; void QMediaResource::setVideoCodec(class QString const &) + ?setVolume@QMediaPlayer@@QAEXH@Z @ 520 NONAME ; void QMediaPlayer::setVolume(int) + ?setVolume@QSoundEffect@@QAEXH@Z @ 521 NONAME ; void QSoundEffect::setVolume(int) + ?setupMetaData@QMediaObject@@AAEXXZ @ 522 NONAME ; void QMediaObject::setupMetaData(void) + ?showEvent@QVideoWidget@@MAEXPAVQShowEvent@@@Z @ 523 NONAME ; void QVideoWidget::showEvent(class QShowEvent *) + ?shuffle@QLocalMediaPlaylistProvider@@UAEXXZ @ 524 NONAME ; void QLocalMediaPlaylistProvider::shuffle(void) + ?shuffle@QMediaPlaylist@@QAEXXZ @ 525 NONAME ; void QMediaPlaylist::shuffle(void) + ?shuffle@QMediaPlaylistProvider@@UAEXXZ @ 526 NONAME ; void QMediaPlaylistProvider::shuffle(void) + ?size@QGraphicsVideoItem@@QBE?AVQSizeF@@XZ @ 527 NONAME ; class QSizeF QGraphicsVideoItem::size(void) const + ?sizeHint@QVideoWidget@@UBE?AVQSize@@XZ @ 528 NONAME ; class QSize QVideoWidget::sizeHint(void) const + ?source@QSoundEffect@@QBE?AVQUrl@@XZ @ 529 NONAME ; class QUrl QSoundEffect::source(void) const + ?sourceChanged@QSoundEffect@@IAEXXZ @ 530 NONAME ; void QSoundEffect::sourceChanged(void) + ?start@QMediaTimeInterval@@QBE_JXZ @ 531 NONAME ; long long QMediaTimeInterval::start(void) const + ?start@QPainterVideoSurface@@UAE_NABVQVideoSurfaceFormat@@@Z @ 532 NONAME ; bool QPainterVideoSurface::start(class QVideoSurfaceFormat const &) + ?state@QMediaPlayer@@QBE?AW4State@1@XZ @ 533 NONAME ; enum QMediaPlayer::State QMediaPlayer::state(void) const + ?stateChanged@QMediaPlayer@@IAEXW4State@1@@Z @ 534 NONAME ; void QMediaPlayer::stateChanged(enum QMediaPlayer::State) + ?stateChanged@QMediaPlayerControl@@IAEXW4State@QMediaPlayer@@@Z @ 535 NONAME ; void QMediaPlayerControl::stateChanged(enum QMediaPlayer::State) + ?stop@QMediaPlayer@@QAEXXZ @ 536 NONAME ; void QMediaPlayer::stop(void) + ?stop@QPainterVideoSurface@@UAEXXZ @ 537 NONAME ; void QPainterVideoSurface::stop(void) + ?supportedMimeTypes@QMediaPlayer@@SA?AVQStringList@@V?$QFlags@W4Flag@QMediaPlayer@@@@@Z @ 538 NONAME ; class QStringList QMediaPlayer::supportedMimeTypes(class QFlags) + ?supportedMimeTypes@QMediaServiceProvider@@UBE?AVQStringList@@ABVQByteArray@@H@Z @ 539 NONAME ; class QStringList QMediaServiceProvider::supportedMimeTypes(class QByteArray const &, int) const + ?supportedPixelFormats@QPainterVideoSurface@@UBE?AV?$QList@W4PixelFormat@QVideoFrame@@@@W4HandleType@QAbstractVideoBuffer@@@Z @ 540 NONAME ; class QList QPainterVideoSurface::supportedPixelFormats(enum QAbstractVideoBuffer::HandleType) const + ?surroundingItemsChanged@QMediaPlaylistNavigator@@IAEXXZ @ 541 NONAME ; void QMediaPlaylistNavigator::surroundingItemsChanged(void) + ?tr@QGraphicsVideoItem@@SA?AVQString@@PBD0@Z @ 542 NONAME ; class QString QGraphicsVideoItem::tr(char const *, char const *) + ?tr@QGraphicsVideoItem@@SA?AVQString@@PBD0H@Z @ 543 NONAME ; class QString QGraphicsVideoItem::tr(char const *, char const *, int) + ?tr@QLocalMediaPlaylistProvider@@SA?AVQString@@PBD0@Z @ 544 NONAME ; class QString QLocalMediaPlaylistProvider::tr(char const *, char const *) + ?tr@QLocalMediaPlaylistProvider@@SA?AVQString@@PBD0H@Z @ 545 NONAME ; class QString QLocalMediaPlaylistProvider::tr(char const *, char const *, int) + ?tr@QMediaControl@@SA?AVQString@@PBD0@Z @ 546 NONAME ; class QString QMediaControl::tr(char const *, char const *) + ?tr@QMediaControl@@SA?AVQString@@PBD0H@Z @ 547 NONAME ; class QString QMediaControl::tr(char const *, char const *, int) + ?tr@QMediaObject@@SA?AVQString@@PBD0@Z @ 548 NONAME ; class QString QMediaObject::tr(char const *, char const *) + ?tr@QMediaObject@@SA?AVQString@@PBD0H@Z @ 549 NONAME ; class QString QMediaObject::tr(char const *, char const *, int) + ?tr@QMediaPlayer@@SA?AVQString@@PBD0@Z @ 550 NONAME ; class QString QMediaPlayer::tr(char const *, char const *) + ?tr@QMediaPlayer@@SA?AVQString@@PBD0H@Z @ 551 NONAME ; class QString QMediaPlayer::tr(char const *, char const *, int) + ?tr@QMediaPlayerControl@@SA?AVQString@@PBD0@Z @ 552 NONAME ; class QString QMediaPlayerControl::tr(char const *, char const *) + ?tr@QMediaPlayerControl@@SA?AVQString@@PBD0H@Z @ 553 NONAME ; class QString QMediaPlayerControl::tr(char const *, char const *, int) + ?tr@QMediaPlaylist@@SA?AVQString@@PBD0@Z @ 554 NONAME ; class QString QMediaPlaylist::tr(char const *, char const *) + ?tr@QMediaPlaylist@@SA?AVQString@@PBD0H@Z @ 555 NONAME ; class QString QMediaPlaylist::tr(char const *, char const *, int) + ?tr@QMediaPlaylistControl@@SA?AVQString@@PBD0@Z @ 556 NONAME ; class QString QMediaPlaylistControl::tr(char const *, char const *) + ?tr@QMediaPlaylistControl@@SA?AVQString@@PBD0H@Z @ 557 NONAME ; class QString QMediaPlaylistControl::tr(char const *, char const *, int) + ?tr@QMediaPlaylistIOPlugin@@SA?AVQString@@PBD0@Z @ 558 NONAME ; class QString QMediaPlaylistIOPlugin::tr(char const *, char const *) + ?tr@QMediaPlaylistIOPlugin@@SA?AVQString@@PBD0H@Z @ 559 NONAME ; class QString QMediaPlaylistIOPlugin::tr(char const *, char const *, int) + ?tr@QMediaPlaylistNavigator@@SA?AVQString@@PBD0@Z @ 560 NONAME ; class QString QMediaPlaylistNavigator::tr(char const *, char const *) + ?tr@QMediaPlaylistNavigator@@SA?AVQString@@PBD0H@Z @ 561 NONAME ; class QString QMediaPlaylistNavigator::tr(char const *, char const *, int) + ?tr@QMediaPlaylistProvider@@SA?AVQString@@PBD0@Z @ 562 NONAME ; class QString QMediaPlaylistProvider::tr(char const *, char const *) + ?tr@QMediaPlaylistProvider@@SA?AVQString@@PBD0H@Z @ 563 NONAME ; class QString QMediaPlaylistProvider::tr(char const *, char const *, int) + ?tr@QMediaService@@SA?AVQString@@PBD0@Z @ 564 NONAME ; class QString QMediaService::tr(char const *, char const *) + ?tr@QMediaService@@SA?AVQString@@PBD0H@Z @ 565 NONAME ; class QString QMediaService::tr(char const *, char const *, int) + ?tr@QMediaServiceProvider@@SA?AVQString@@PBD0@Z @ 566 NONAME ; class QString QMediaServiceProvider::tr(char const *, char const *) + ?tr@QMediaServiceProvider@@SA?AVQString@@PBD0H@Z @ 567 NONAME ; class QString QMediaServiceProvider::tr(char const *, char const *, int) + ?tr@QMediaServiceProviderPlugin@@SA?AVQString@@PBD0@Z @ 568 NONAME ; class QString QMediaServiceProviderPlugin::tr(char const *, char const *) + ?tr@QMediaServiceProviderPlugin@@SA?AVQString@@PBD0H@Z @ 569 NONAME ; class QString QMediaServiceProviderPlugin::tr(char const *, char const *, int) + ?tr@QMetaDataControl@@SA?AVQString@@PBD0@Z @ 570 NONAME ; class QString QMetaDataControl::tr(char const *, char const *) + ?tr@QMetaDataControl@@SA?AVQString@@PBD0H@Z @ 571 NONAME ; class QString QMetaDataControl::tr(char const *, char const *, int) + ?tr@QPainterVideoSurface@@SA?AVQString@@PBD0@Z @ 572 NONAME ; class QString QPainterVideoSurface::tr(char const *, char const *) + ?tr@QPainterVideoSurface@@SA?AVQString@@PBD0H@Z @ 573 NONAME ; class QString QPainterVideoSurface::tr(char const *, char const *, int) + ?tr@QSoundEffect@@SA?AVQString@@PBD0@Z @ 574 NONAME ; class QString QSoundEffect::tr(char const *, char const *) + ?tr@QSoundEffect@@SA?AVQString@@PBD0H@Z @ 575 NONAME ; class QString QSoundEffect::tr(char const *, char const *, int) + ?tr@QVideoDeviceControl@@SA?AVQString@@PBD0@Z @ 576 NONAME ; class QString QVideoDeviceControl::tr(char const *, char const *) + ?tr@QVideoDeviceControl@@SA?AVQString@@PBD0H@Z @ 577 NONAME ; class QString QVideoDeviceControl::tr(char const *, char const *, int) + ?tr@QVideoOutputControl@@SA?AVQString@@PBD0@Z @ 578 NONAME ; class QString QVideoOutputControl::tr(char const *, char const *) + ?tr@QVideoOutputControl@@SA?AVQString@@PBD0H@Z @ 579 NONAME ; class QString QVideoOutputControl::tr(char const *, char const *, int) + ?tr@QVideoRendererControl@@SA?AVQString@@PBD0@Z @ 580 NONAME ; class QString QVideoRendererControl::tr(char const *, char const *) + ?tr@QVideoRendererControl@@SA?AVQString@@PBD0H@Z @ 581 NONAME ; class QString QVideoRendererControl::tr(char const *, char const *, int) + ?tr@QVideoWidget@@SA?AVQString@@PBD0@Z @ 582 NONAME ; class QString QVideoWidget::tr(char const *, char const *) + ?tr@QVideoWidget@@SA?AVQString@@PBD0H@Z @ 583 NONAME ; class QString QVideoWidget::tr(char const *, char const *, int) + ?tr@QVideoWidgetControl@@SA?AVQString@@PBD0@Z @ 584 NONAME ; class QString QVideoWidgetControl::tr(char const *, char const *) + ?tr@QVideoWidgetControl@@SA?AVQString@@PBD0H@Z @ 585 NONAME ; class QString QVideoWidgetControl::tr(char const *, char const *, int) + ?tr@QVideoWindowControl@@SA?AVQString@@PBD0@Z @ 586 NONAME ; class QString QVideoWindowControl::tr(char const *, char const *) + ?tr@QVideoWindowControl@@SA?AVQString@@PBD0H@Z @ 587 NONAME ; class QString QVideoWindowControl::tr(char const *, char const *, int) + ?trUtf8@QGraphicsVideoItem@@SA?AVQString@@PBD0@Z @ 588 NONAME ; class QString QGraphicsVideoItem::trUtf8(char const *, char const *) + ?trUtf8@QGraphicsVideoItem@@SA?AVQString@@PBD0H@Z @ 589 NONAME ; class QString QGraphicsVideoItem::trUtf8(char const *, char const *, int) + ?trUtf8@QLocalMediaPlaylistProvider@@SA?AVQString@@PBD0@Z @ 590 NONAME ; class QString QLocalMediaPlaylistProvider::trUtf8(char const *, char const *) + ?trUtf8@QLocalMediaPlaylistProvider@@SA?AVQString@@PBD0H@Z @ 591 NONAME ; class QString QLocalMediaPlaylistProvider::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaControl@@SA?AVQString@@PBD0@Z @ 592 NONAME ; class QString QMediaControl::trUtf8(char const *, char const *) + ?trUtf8@QMediaControl@@SA?AVQString@@PBD0H@Z @ 593 NONAME ; class QString QMediaControl::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaObject@@SA?AVQString@@PBD0@Z @ 594 NONAME ; class QString QMediaObject::trUtf8(char const *, char const *) + ?trUtf8@QMediaObject@@SA?AVQString@@PBD0H@Z @ 595 NONAME ; class QString QMediaObject::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaPlayer@@SA?AVQString@@PBD0@Z @ 596 NONAME ; class QString QMediaPlayer::trUtf8(char const *, char const *) + ?trUtf8@QMediaPlayer@@SA?AVQString@@PBD0H@Z @ 597 NONAME ; class QString QMediaPlayer::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaPlayerControl@@SA?AVQString@@PBD0@Z @ 598 NONAME ; class QString QMediaPlayerControl::trUtf8(char const *, char const *) + ?trUtf8@QMediaPlayerControl@@SA?AVQString@@PBD0H@Z @ 599 NONAME ; class QString QMediaPlayerControl::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaPlaylist@@SA?AVQString@@PBD0@Z @ 600 NONAME ; class QString QMediaPlaylist::trUtf8(char const *, char const *) + ?trUtf8@QMediaPlaylist@@SA?AVQString@@PBD0H@Z @ 601 NONAME ; class QString QMediaPlaylist::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaPlaylistControl@@SA?AVQString@@PBD0@Z @ 602 NONAME ; class QString QMediaPlaylistControl::trUtf8(char const *, char const *) + ?trUtf8@QMediaPlaylistControl@@SA?AVQString@@PBD0H@Z @ 603 NONAME ; class QString QMediaPlaylistControl::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaPlaylistIOPlugin@@SA?AVQString@@PBD0@Z @ 604 NONAME ; class QString QMediaPlaylistIOPlugin::trUtf8(char const *, char const *) + ?trUtf8@QMediaPlaylistIOPlugin@@SA?AVQString@@PBD0H@Z @ 605 NONAME ; class QString QMediaPlaylistIOPlugin::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaPlaylistNavigator@@SA?AVQString@@PBD0@Z @ 606 NONAME ; class QString QMediaPlaylistNavigator::trUtf8(char const *, char const *) + ?trUtf8@QMediaPlaylistNavigator@@SA?AVQString@@PBD0H@Z @ 607 NONAME ; class QString QMediaPlaylistNavigator::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaPlaylistProvider@@SA?AVQString@@PBD0@Z @ 608 NONAME ; class QString QMediaPlaylistProvider::trUtf8(char const *, char const *) + ?trUtf8@QMediaPlaylistProvider@@SA?AVQString@@PBD0H@Z @ 609 NONAME ; class QString QMediaPlaylistProvider::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaService@@SA?AVQString@@PBD0@Z @ 610 NONAME ; class QString QMediaService::trUtf8(char const *, char const *) + ?trUtf8@QMediaService@@SA?AVQString@@PBD0H@Z @ 611 NONAME ; class QString QMediaService::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaServiceProvider@@SA?AVQString@@PBD0@Z @ 612 NONAME ; class QString QMediaServiceProvider::trUtf8(char const *, char const *) + ?trUtf8@QMediaServiceProvider@@SA?AVQString@@PBD0H@Z @ 613 NONAME ; class QString QMediaServiceProvider::trUtf8(char const *, char const *, int) + ?trUtf8@QMediaServiceProviderPlugin@@SA?AVQString@@PBD0@Z @ 614 NONAME ; class QString QMediaServiceProviderPlugin::trUtf8(char const *, char const *) + ?trUtf8@QMediaServiceProviderPlugin@@SA?AVQString@@PBD0H@Z @ 615 NONAME ; class QString QMediaServiceProviderPlugin::trUtf8(char const *, char const *, int) + ?trUtf8@QMetaDataControl@@SA?AVQString@@PBD0@Z @ 616 NONAME ; class QString QMetaDataControl::trUtf8(char const *, char const *) + ?trUtf8@QMetaDataControl@@SA?AVQString@@PBD0H@Z @ 617 NONAME ; class QString QMetaDataControl::trUtf8(char const *, char const *, int) + ?trUtf8@QPainterVideoSurface@@SA?AVQString@@PBD0@Z @ 618 NONAME ; class QString QPainterVideoSurface::trUtf8(char const *, char const *) + ?trUtf8@QPainterVideoSurface@@SA?AVQString@@PBD0H@Z @ 619 NONAME ; class QString QPainterVideoSurface::trUtf8(char const *, char const *, int) + ?trUtf8@QSoundEffect@@SA?AVQString@@PBD0@Z @ 620 NONAME ; class QString QSoundEffect::trUtf8(char const *, char const *) + ?trUtf8@QSoundEffect@@SA?AVQString@@PBD0H@Z @ 621 NONAME ; class QString QSoundEffect::trUtf8(char const *, char const *, int) + ?trUtf8@QVideoDeviceControl@@SA?AVQString@@PBD0@Z @ 622 NONAME ; class QString QVideoDeviceControl::trUtf8(char const *, char const *) + ?trUtf8@QVideoDeviceControl@@SA?AVQString@@PBD0H@Z @ 623 NONAME ; class QString QVideoDeviceControl::trUtf8(char const *, char const *, int) + ?trUtf8@QVideoOutputControl@@SA?AVQString@@PBD0@Z @ 624 NONAME ; class QString QVideoOutputControl::trUtf8(char const *, char const *) + ?trUtf8@QVideoOutputControl@@SA?AVQString@@PBD0H@Z @ 625 NONAME ; class QString QVideoOutputControl::trUtf8(char const *, char const *, int) + ?trUtf8@QVideoRendererControl@@SA?AVQString@@PBD0@Z @ 626 NONAME ; class QString QVideoRendererControl::trUtf8(char const *, char const *) + ?trUtf8@QVideoRendererControl@@SA?AVQString@@PBD0H@Z @ 627 NONAME ; class QString QVideoRendererControl::trUtf8(char const *, char const *, int) + ?trUtf8@QVideoWidget@@SA?AVQString@@PBD0@Z @ 628 NONAME ; class QString QVideoWidget::trUtf8(char const *, char const *) + ?trUtf8@QVideoWidget@@SA?AVQString@@PBD0H@Z @ 629 NONAME ; class QString QVideoWidget::trUtf8(char const *, char const *, int) + ?trUtf8@QVideoWidgetControl@@SA?AVQString@@PBD0@Z @ 630 NONAME ; class QString QVideoWidgetControl::trUtf8(char const *, char const *) + ?trUtf8@QVideoWidgetControl@@SA?AVQString@@PBD0H@Z @ 631 NONAME ; class QString QVideoWidgetControl::trUtf8(char const *, char const *, int) + ?trUtf8@QVideoWindowControl@@SA?AVQString@@PBD0@Z @ 632 NONAME ; class QString QVideoWindowControl::trUtf8(char const *, char const *) + ?trUtf8@QVideoWindowControl@@SA?AVQString@@PBD0H@Z @ 633 NONAME ; class QString QVideoWindowControl::trUtf8(char const *, char const *, int) + ?translated@QMediaTimeInterval@@QBE?AV1@_J@Z @ 634 NONAME ; class QMediaTimeInterval QMediaTimeInterval::translated(long long) const + ?type@QMediaServiceProviderHint@@QBE?AW4Type@1@XZ @ 635 NONAME ; enum QMediaServiceProviderHint::Type QMediaServiceProviderHint::type(void) const + ?unbind@QMediaObject@@UAEXPAVQObject@@@Z @ 636 NONAME ; void QMediaObject::unbind(class QObject *) + ?unbind@QMediaPlayer@@UAEXPAVQObject@@@Z @ 637 NONAME ; void QMediaPlayer::unbind(class QObject *) + ?url@QMediaResource@@QBE?AVQUrl@@XZ @ 638 NONAME ; class QUrl QMediaResource::url(void) const + ?videoAvailableChanged@QMediaPlayer@@IAEX_N@Z @ 639 NONAME ; void QMediaPlayer::videoAvailableChanged(bool) + ?videoAvailableChanged@QMediaPlayerControl@@IAEX_N@Z @ 640 NONAME ; void QMediaPlayerControl::videoAvailableChanged(bool) + ?videoBitRate@QMediaResource@@QBEHXZ @ 641 NONAME ; int QMediaResource::videoBitRate(void) const + ?videoCodec@QMediaResource@@QBE?AVQString@@XZ @ 642 NONAME ; class QString QMediaResource::videoCodec(void) const + ?volume@QMediaPlayer@@QBEHXZ @ 643 NONAME ; int QMediaPlayer::volume(void) const + ?volume@QSoundEffect@@QBEHXZ @ 644 NONAME ; int QSoundEffect::volume(void) const + ?volumeChanged@QMediaPlayer@@IAEXH@Z @ 645 NONAME ; void QMediaPlayer::volumeChanged(int) + ?volumeChanged@QMediaPlayerControl@@IAEXH@Z @ 646 NONAME ; void QMediaPlayerControl::volumeChanged(int) + ?volumeChanged@QSoundEffect@@IAEXXZ @ 647 NONAME ; void QSoundEffect::volumeChanged(void) + ?writableChanged@QMetaDataControl@@IAEX_N@Z @ 648 NONAME ; void QMetaDataControl::writableChanged(bool) + ?staticMetaObject@QMediaPlaylistProvider@@2UQMetaObject@@B @ 649 NONAME ; struct QMetaObject const QMediaPlaylistProvider::staticMetaObject + ?staticMetaObject@QSoundEffect@@2UQMetaObject@@B @ 650 NONAME ; struct QMetaObject const QSoundEffect::staticMetaObject + ?staticMetaObject@QVideoWidget@@2UQMetaObject@@B @ 651 NONAME ; struct QMetaObject const QVideoWidget::staticMetaObject + ?staticMetaObject@QMediaPlaylistControl@@2UQMetaObject@@B @ 652 NONAME ; struct QMetaObject const QMediaPlaylistControl::staticMetaObject + ?staticMetaObject@QMediaControl@@2UQMetaObject@@B @ 653 NONAME ; struct QMetaObject const QMediaControl::staticMetaObject + ?staticMetaObject@QLocalMediaPlaylistProvider@@2UQMetaObject@@B @ 654 NONAME ; struct QMetaObject const QLocalMediaPlaylistProvider::staticMetaObject + ?staticMetaObject@QMediaServiceProviderPlugin@@2UQMetaObject@@B @ 655 NONAME ; struct QMetaObject const QMediaServiceProviderPlugin::staticMetaObject + ?staticMetaObject@QVideoOutputControl@@2UQMetaObject@@B @ 656 NONAME ; struct QMetaObject const QVideoOutputControl::staticMetaObject + ?staticMetaObject@QMetaDataControl@@2UQMetaObject@@B @ 657 NONAME ; struct QMetaObject const QMetaDataControl::staticMetaObject + ?staticMetaObject@QMediaPlayer@@2UQMetaObject@@B @ 658 NONAME ; struct QMetaObject const QMediaPlayer::staticMetaObject + ?staticMetaObject@QMediaService@@2UQMetaObject@@B @ 659 NONAME ; struct QMetaObject const QMediaService::staticMetaObject + ?staticMetaObject@QMediaObject@@2UQMetaObject@@B @ 660 NONAME ; struct QMetaObject const QMediaObject::staticMetaObject + ?staticMetaObject@QMediaPlaylist@@2UQMetaObject@@B @ 661 NONAME ; struct QMetaObject const QMediaPlaylist::staticMetaObject + ?staticMetaObject@QMediaServiceProvider@@2UQMetaObject@@B @ 662 NONAME ; struct QMetaObject const QMediaServiceProvider::staticMetaObject + ?staticMetaObject@QMediaPlayerControl@@2UQMetaObject@@B @ 663 NONAME ; struct QMetaObject const QMediaPlayerControl::staticMetaObject + ?staticMetaObject@QMediaPlaylistNavigator@@2UQMetaObject@@B @ 664 NONAME ; struct QMetaObject const QMediaPlaylistNavigator::staticMetaObject + ?staticMetaObject@QVideoWidgetControl@@2UQMetaObject@@B @ 665 NONAME ; struct QMetaObject const QVideoWidgetControl::staticMetaObject + ?staticMetaObject@QVideoWindowControl@@2UQMetaObject@@B @ 666 NONAME ; struct QMetaObject const QVideoWindowControl::staticMetaObject + ?staticMetaObject@QVideoDeviceControl@@2UQMetaObject@@B @ 667 NONAME ; struct QMetaObject const QVideoDeviceControl::staticMetaObject + ?staticMetaObject@QVideoRendererControl@@2UQMetaObject@@B @ 668 NONAME ; struct QMetaObject const QVideoRendererControl::staticMetaObject + ?staticMetaObject@QPainterVideoSurface@@2UQMetaObject@@B @ 669 NONAME ; struct QMetaObject const QPainterVideoSurface::staticMetaObject + ?staticMetaObject@QMediaPlaylistIOPlugin@@2UQMetaObject@@B @ 670 NONAME ; struct QMetaObject const QMediaPlaylistIOPlugin::staticMetaObject + ?staticMetaObject@QGraphicsVideoItem@@2UQMetaObject@@B @ 671 NONAME ; struct QMetaObject const QGraphicsVideoItem::staticMetaObject + diff --git a/src/s60installs/bwins/QtMultimediau.def b/src/s60installs/bwins/QtMultimediau.def index ad33993..b0e6368 100644 --- a/src/s60installs/bwins/QtMultimediau.def +++ b/src/s60installs/bwins/QtMultimediau.def @@ -268,684 +268,10 @@ EXPORTS ?staticMetaObject@QAbstractAudioOutput@@2UQMetaObject@@B @ 267 NONAME ; struct QMetaObject const QAbstractAudioOutput::staticMetaObject ?staticMetaObject@QAudioOutput@@2UQMetaObject@@B @ 268 NONAME ; struct QMetaObject const QAudioOutput::staticMetaObject ?staticMetaObject@QAbstractAudioInput@@2UQMetaObject@@B @ 269 NONAME ; struct QMetaObject const QAbstractAudioInput::staticMetaObject - ??0QGraphicsVideoItem@@QAE@PAVQGraphicsItem@@@Z @ 270 NONAME ; QGraphicsVideoItem::QGraphicsVideoItem(class QGraphicsItem *) - ??0QLocalMediaPlaylistProvider@@QAE@PAVQObject@@@Z @ 271 NONAME ; QLocalMediaPlaylistProvider::QLocalMediaPlaylistProvider(class QObject *) - ??0QMediaContent@@QAE@ABV0@@Z @ 272 NONAME ; QMediaContent::QMediaContent(class QMediaContent const &) - ??0QMediaContent@@QAE@ABV?$QList@VQMediaResource@@@@@Z @ 273 NONAME ; QMediaContent::QMediaContent(class QList const &) - ??0QMediaContent@@QAE@ABVQMediaResource@@@Z @ 274 NONAME ; QMediaContent::QMediaContent(class QMediaResource const &) - ??0QMediaContent@@QAE@ABVQNetworkRequest@@@Z @ 275 NONAME ; QMediaContent::QMediaContent(class QNetworkRequest const &) - ??0QMediaContent@@QAE@ABVQUrl@@@Z @ 276 NONAME ; QMediaContent::QMediaContent(class QUrl const &) - ??0QMediaContent@@QAE@XZ @ 277 NONAME ; QMediaContent::QMediaContent(void) - ??0QMediaControl@@IAE@AAVQMediaControlPrivate@@PAVQObject@@@Z @ 278 NONAME ; QMediaControl::QMediaControl(class QMediaControlPrivate &, class QObject *) - ??0QMediaControl@@IAE@PAVQObject@@@Z @ 279 NONAME ; QMediaControl::QMediaControl(class QObject *) - ??0QMediaObject@@IAE@AAVQMediaObjectPrivate@@PAVQObject@@PAVQMediaService@@@Z @ 280 NONAME ; QMediaObject::QMediaObject(class QMediaObjectPrivate &, class QObject *, class QMediaService *) - ??0QMediaObject@@IAE@PAVQObject@@PAVQMediaService@@@Z @ 281 NONAME ; QMediaObject::QMediaObject(class QObject *, class QMediaService *) - ??0QMediaPlayer@@QAE@PAVQObject@@V?$QFlags@W4Flag@QMediaPlayer@@@@PAVQMediaServiceProvider@@@Z @ 282 NONAME ; QMediaPlayer::QMediaPlayer(class QObject *, class QFlags, class QMediaServiceProvider *) - ??0QMediaPlayerControl@@IAE@PAVQObject@@@Z @ 283 NONAME ; QMediaPlayerControl::QMediaPlayerControl(class QObject *) - ??0QMediaPlaylist@@QAE@PAVQObject@@@Z @ 284 NONAME ; QMediaPlaylist::QMediaPlaylist(class QObject *) - ??0QMediaPlaylistControl@@IAE@PAVQObject@@@Z @ 285 NONAME ; QMediaPlaylistControl::QMediaPlaylistControl(class QObject *) - ??0QMediaPlaylistIOPlugin@@QAE@PAVQObject@@@Z @ 286 NONAME ; QMediaPlaylistIOPlugin::QMediaPlaylistIOPlugin(class QObject *) - ??0QMediaPlaylistNavigator@@QAE@PAVQMediaPlaylistProvider@@PAVQObject@@@Z @ 287 NONAME ; QMediaPlaylistNavigator::QMediaPlaylistNavigator(class QMediaPlaylistProvider *, class QObject *) - ??0QMediaPlaylistProvider@@IAE@AAVQMediaPlaylistProviderPrivate@@PAVQObject@@@Z @ 288 NONAME ; QMediaPlaylistProvider::QMediaPlaylistProvider(class QMediaPlaylistProviderPrivate &, class QObject *) - ??0QMediaPlaylistProvider@@QAE@PAVQObject@@@Z @ 289 NONAME ; QMediaPlaylistProvider::QMediaPlaylistProvider(class QObject *) - ??0QMediaResource@@QAE@ABV0@@Z @ 290 NONAME ; QMediaResource::QMediaResource(class QMediaResource const &) - ??0QMediaResource@@QAE@ABVQNetworkRequest@@ABVQString@@@Z @ 291 NONAME ; QMediaResource::QMediaResource(class QNetworkRequest const &, class QString const &) - ??0QMediaResource@@QAE@ABVQUrl@@ABVQString@@@Z @ 292 NONAME ; QMediaResource::QMediaResource(class QUrl const &, class QString const &) - ??0QMediaResource@@QAE@XZ @ 293 NONAME ; QMediaResource::QMediaResource(void) - ??0QMediaService@@IAE@AAVQMediaServicePrivate@@PAVQObject@@@Z @ 294 NONAME ; QMediaService::QMediaService(class QMediaServicePrivate &, class QObject *) - ??0QMediaService@@IAE@PAVQObject@@@Z @ 295 NONAME ; QMediaService::QMediaService(class QObject *) - ??0QMediaServiceProviderHint@@QAE@ABV0@@Z @ 296 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(class QMediaServiceProviderHint const &) - ??0QMediaServiceProviderHint@@QAE@ABVQByteArray@@@Z @ 297 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(class QByteArray const &) - ??0QMediaServiceProviderHint@@QAE@ABVQString@@ABVQStringList@@@Z @ 298 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(class QString const &, class QStringList const &) - ??0QMediaServiceProviderHint@@QAE@V?$QFlags@W4Feature@QMediaServiceProviderHint@@@@@Z @ 299 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(class QFlags) - ??0QMediaServiceProviderHint@@QAE@XZ @ 300 NONAME ; QMediaServiceProviderHint::QMediaServiceProviderHint(void) - ??0QMediaTimeInterval@@QAE@ABV0@@Z @ 301 NONAME ; QMediaTimeInterval::QMediaTimeInterval(class QMediaTimeInterval const &) - ??0QMediaTimeInterval@@QAE@XZ @ 302 NONAME ; QMediaTimeInterval::QMediaTimeInterval(void) - ??0QMediaTimeInterval@@QAE@_J0@Z @ 303 NONAME ; QMediaTimeInterval::QMediaTimeInterval(long long, long long) - ??0QMediaTimeRange@@QAE@ABV0@@Z @ 304 NONAME ; QMediaTimeRange::QMediaTimeRange(class QMediaTimeRange const &) - ??0QMediaTimeRange@@QAE@ABVQMediaTimeInterval@@@Z @ 305 NONAME ; QMediaTimeRange::QMediaTimeRange(class QMediaTimeInterval const &) - ??0QMediaTimeRange@@QAE@XZ @ 306 NONAME ; QMediaTimeRange::QMediaTimeRange(void) - ??0QMediaTimeRange@@QAE@_J0@Z @ 307 NONAME ; QMediaTimeRange::QMediaTimeRange(long long, long long) - ??0QMetaDataControl@@IAE@PAVQObject@@@Z @ 308 NONAME ; QMetaDataControl::QMetaDataControl(class QObject *) - ??0QPainterVideoSurface@@QAE@PAVQObject@@@Z @ 309 NONAME ; QPainterVideoSurface::QPainterVideoSurface(class QObject *) - ??0QVideoDeviceControl@@IAE@PAVQObject@@@Z @ 310 NONAME ; QVideoDeviceControl::QVideoDeviceControl(class QObject *) - ??0QVideoOutputControl@@IAE@PAVQObject@@@Z @ 311 NONAME ; QVideoOutputControl::QVideoOutputControl(class QObject *) - ??0QVideoRendererControl@@IAE@PAVQObject@@@Z @ 312 NONAME ; QVideoRendererControl::QVideoRendererControl(class QObject *) - ??0QVideoWidget@@QAE@PAVQWidget@@@Z @ 313 NONAME ; QVideoWidget::QVideoWidget(class QWidget *) - ??0QVideoWidgetControl@@IAE@PAVQObject@@@Z @ 314 NONAME ; QVideoWidgetControl::QVideoWidgetControl(class QObject *) - ??0QVideoWindowControl@@IAE@PAVQObject@@@Z @ 315 NONAME ; QVideoWindowControl::QVideoWindowControl(class QObject *) - ??1QGraphicsVideoItem@@UAE@XZ @ 316 NONAME ; QGraphicsVideoItem::~QGraphicsVideoItem(void) - ??1QLocalMediaPlaylistProvider@@UAE@XZ @ 317 NONAME ; QLocalMediaPlaylistProvider::~QLocalMediaPlaylistProvider(void) - ??1QMediaContent@@QAE@XZ @ 318 NONAME ; QMediaContent::~QMediaContent(void) - ??1QMediaControl@@UAE@XZ @ 319 NONAME ; QMediaControl::~QMediaControl(void) - ??1QMediaObject@@UAE@XZ @ 320 NONAME ; QMediaObject::~QMediaObject(void) - ??1QMediaPlayer@@UAE@XZ @ 321 NONAME ; QMediaPlayer::~QMediaPlayer(void) - ??1QMediaPlayerControl@@UAE@XZ @ 322 NONAME ; QMediaPlayerControl::~QMediaPlayerControl(void) - ??1QMediaPlaylist@@UAE@XZ @ 323 NONAME ; QMediaPlaylist::~QMediaPlaylist(void) - ??1QMediaPlaylistControl@@UAE@XZ @ 324 NONAME ; QMediaPlaylistControl::~QMediaPlaylistControl(void) - ??1QMediaPlaylistIOInterface@@UAE@XZ @ 325 NONAME ; QMediaPlaylistIOInterface::~QMediaPlaylistIOInterface(void) - ??1QMediaPlaylistIOPlugin@@UAE@XZ @ 326 NONAME ; QMediaPlaylistIOPlugin::~QMediaPlaylistIOPlugin(void) - ??1QMediaPlaylistNavigator@@UAE@XZ @ 327 NONAME ; QMediaPlaylistNavigator::~QMediaPlaylistNavigator(void) - ??1QMediaPlaylistProvider@@UAE@XZ @ 328 NONAME ; QMediaPlaylistProvider::~QMediaPlaylistProvider(void) - ??1QMediaPlaylistReader@@UAE@XZ @ 329 NONAME ; QMediaPlaylistReader::~QMediaPlaylistReader(void) - ??1QMediaPlaylistWriter@@UAE@XZ @ 330 NONAME ; QMediaPlaylistWriter::~QMediaPlaylistWriter(void) - ??1QMediaResource@@QAE@XZ @ 331 NONAME ; QMediaResource::~QMediaResource(void) - ??1QMediaService@@UAE@XZ @ 332 NONAME ; QMediaService::~QMediaService(void) - ??1QMediaServiceFeaturesInterface@@UAE@XZ @ 333 NONAME ; QMediaServiceFeaturesInterface::~QMediaServiceFeaturesInterface(void) - ??1QMediaServiceProvider@@UAE@XZ @ 334 NONAME ; QMediaServiceProvider::~QMediaServiceProvider(void) - ??1QMediaServiceProviderHint@@QAE@XZ @ 335 NONAME ; QMediaServiceProviderHint::~QMediaServiceProviderHint(void) - ??1QMediaServiceSupportedDevicesInterface@@UAE@XZ @ 336 NONAME ; QMediaServiceSupportedDevicesInterface::~QMediaServiceSupportedDevicesInterface(void) - ??1QMediaServiceSupportedFormatsInterface@@UAE@XZ @ 337 NONAME ; QMediaServiceSupportedFormatsInterface::~QMediaServiceSupportedFormatsInterface(void) - ??1QMediaTimeRange@@QAE@XZ @ 338 NONAME ; QMediaTimeRange::~QMediaTimeRange(void) - ??1QMetaDataControl@@UAE@XZ @ 339 NONAME ; QMetaDataControl::~QMetaDataControl(void) - ??1QPainterVideoSurface@@UAE@XZ @ 340 NONAME ; QPainterVideoSurface::~QPainterVideoSurface(void) - ??1QVideoDeviceControl@@UAE@XZ @ 341 NONAME ; QVideoDeviceControl::~QVideoDeviceControl(void) - ??1QVideoOutputControl@@UAE@XZ @ 342 NONAME ; QVideoOutputControl::~QVideoOutputControl(void) - ??1QVideoRendererControl@@UAE@XZ @ 343 NONAME ; QVideoRendererControl::~QVideoRendererControl(void) - ??1QVideoWidget@@UAE@XZ @ 344 NONAME ; QVideoWidget::~QVideoWidget(void) - ??1QVideoWidgetControl@@UAE@XZ @ 345 NONAME ; QVideoWidgetControl::~QVideoWidgetControl(void) - ??1QVideoWindowControl@@UAE@XZ @ 346 NONAME ; QVideoWindowControl::~QVideoWindowControl(void) - ??4QMediaContent@@QAEAAV0@ABV0@@Z @ 347 NONAME ; class QMediaContent & QMediaContent::operator=(class QMediaContent const &) - ??4QMediaResource@@QAEAAV0@ABV0@@Z @ 348 NONAME ; class QMediaResource & QMediaResource::operator=(class QMediaResource const &) - ??4QMediaServiceProviderHint@@QAEAAV0@ABV0@@Z @ 349 NONAME ; class QMediaServiceProviderHint & QMediaServiceProviderHint::operator=(class QMediaServiceProviderHint const &) - ??4QMediaTimeRange@@QAEAAV0@ABV0@@Z @ 350 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator=(class QMediaTimeRange const &) - ??4QMediaTimeRange@@QAEAAV0@ABVQMediaTimeInterval@@@Z @ 351 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator=(class QMediaTimeInterval const &) - ??8@YA_NABVQMediaTimeInterval@@0@Z @ 352 NONAME ; bool operator==(class QMediaTimeInterval const &, class QMediaTimeInterval const &) - ??8@YA_NABVQMediaTimeRange@@0@Z @ 353 NONAME ; bool operator==(class QMediaTimeRange const &, class QMediaTimeRange const &) - ??8QMediaContent@@QBE_NABV0@@Z @ 354 NONAME ; bool QMediaContent::operator==(class QMediaContent const &) const - ??8QMediaResource@@QBE_NABV0@@Z @ 355 NONAME ; bool QMediaResource::operator==(class QMediaResource const &) const - ??8QMediaServiceProviderHint@@QBE_NABV0@@Z @ 356 NONAME ; bool QMediaServiceProviderHint::operator==(class QMediaServiceProviderHint const &) const - ??9@YA_NABVQMediaTimeInterval@@0@Z @ 357 NONAME ; bool operator!=(class QMediaTimeInterval const &, class QMediaTimeInterval const &) - ??9@YA_NABVQMediaTimeRange@@0@Z @ 358 NONAME ; bool operator!=(class QMediaTimeRange const &, class QMediaTimeRange const &) - ??9QMediaContent@@QBE_NABV0@@Z @ 359 NONAME ; bool QMediaContent::operator!=(class QMediaContent const &) const - ??9QMediaResource@@QBE_NABV0@@Z @ 360 NONAME ; bool QMediaResource::operator!=(class QMediaResource const &) const - ??9QMediaServiceProviderHint@@QBE_NABV0@@Z @ 361 NONAME ; bool QMediaServiceProviderHint::operator!=(class QMediaServiceProviderHint const &) const - ??G@YA?AVQMediaTimeRange@@ABV0@0@Z @ 362 NONAME ; class QMediaTimeRange operator-(class QMediaTimeRange const &, class QMediaTimeRange const &) - ??H@YA?AVQMediaTimeRange@@ABV0@0@Z @ 363 NONAME ; class QMediaTimeRange operator+(class QMediaTimeRange const &, class QMediaTimeRange const &) - ??YQMediaTimeRange@@QAEAAV0@ABV0@@Z @ 364 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator+=(class QMediaTimeRange const &) - ??YQMediaTimeRange@@QAEAAV0@ABVQMediaTimeInterval@@@Z @ 365 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator+=(class QMediaTimeInterval const &) - ??ZQMediaTimeRange@@QAEAAV0@ABV0@@Z @ 366 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator-=(class QMediaTimeRange const &) - ??ZQMediaTimeRange@@QAEAAV0@ABVQMediaTimeInterval@@@Z @ 367 NONAME ; class QMediaTimeRange & QMediaTimeRange::operator-=(class QMediaTimeInterval const &) - ??_EQGraphicsVideoItem@@UAE@I@Z @ 368 NONAME ; QGraphicsVideoItem::~QGraphicsVideoItem(unsigned int) - ??_EQLocalMediaPlaylistProvider@@UAE@I@Z @ 369 NONAME ; QLocalMediaPlaylistProvider::~QLocalMediaPlaylistProvider(unsigned int) - ??_EQMediaControl@@UAE@I@Z @ 370 NONAME ; QMediaControl::~QMediaControl(unsigned int) - ??_EQMediaObject@@UAE@I@Z @ 371 NONAME ; QMediaObject::~QMediaObject(unsigned int) - ??_EQMediaPlayer@@UAE@I@Z @ 372 NONAME ; QMediaPlayer::~QMediaPlayer(unsigned int) - ??_EQMediaPlayerControl@@UAE@I@Z @ 373 NONAME ; QMediaPlayerControl::~QMediaPlayerControl(unsigned int) - ??_EQMediaPlaylist@@UAE@I@Z @ 374 NONAME ; QMediaPlaylist::~QMediaPlaylist(unsigned int) - ??_EQMediaPlaylistControl@@UAE@I@Z @ 375 NONAME ; QMediaPlaylistControl::~QMediaPlaylistControl(unsigned int) - ??_EQMediaPlaylistIOInterface@@UAE@I@Z @ 376 NONAME ; QMediaPlaylistIOInterface::~QMediaPlaylistIOInterface(unsigned int) - ??_EQMediaPlaylistIOPlugin@@UAE@I@Z @ 377 NONAME ; QMediaPlaylistIOPlugin::~QMediaPlaylistIOPlugin(unsigned int) - ??_EQMediaPlaylistNavigator@@UAE@I@Z @ 378 NONAME ; QMediaPlaylistNavigator::~QMediaPlaylistNavigator(unsigned int) - ??_EQMediaPlaylistProvider@@UAE@I@Z @ 379 NONAME ; QMediaPlaylistProvider::~QMediaPlaylistProvider(unsigned int) - ??_EQMediaPlaylistReader@@UAE@I@Z @ 380 NONAME ; QMediaPlaylistReader::~QMediaPlaylistReader(unsigned int) - ??_EQMediaPlaylistWriter@@UAE@I@Z @ 381 NONAME ; QMediaPlaylistWriter::~QMediaPlaylistWriter(unsigned int) - ??_EQMediaService@@UAE@I@Z @ 382 NONAME ; QMediaService::~QMediaService(unsigned int) - ??_EQMediaServiceFeaturesInterface@@UAE@I@Z @ 383 NONAME ; QMediaServiceFeaturesInterface::~QMediaServiceFeaturesInterface(unsigned int) - ??_EQMediaServiceProvider@@UAE@I@Z @ 384 NONAME ; QMediaServiceProvider::~QMediaServiceProvider(unsigned int) - ??_EQMediaServiceSupportedDevicesInterface@@UAE@I@Z @ 385 NONAME ; QMediaServiceSupportedDevicesInterface::~QMediaServiceSupportedDevicesInterface(unsigned int) - ??_EQMediaServiceSupportedFormatsInterface@@UAE@I@Z @ 386 NONAME ; QMediaServiceSupportedFormatsInterface::~QMediaServiceSupportedFormatsInterface(unsigned int) - ??_EQMetaDataControl@@UAE@I@Z @ 387 NONAME ; QMetaDataControl::~QMetaDataControl(unsigned int) - ??_EQPainterVideoSurface@@UAE@I@Z @ 388 NONAME ; QPainterVideoSurface::~QPainterVideoSurface(unsigned int) - ??_EQVideoDeviceControl@@UAE@I@Z @ 389 NONAME ; QVideoDeviceControl::~QVideoDeviceControl(unsigned int) - ??_EQVideoOutputControl@@UAE@I@Z @ 390 NONAME ; QVideoOutputControl::~QVideoOutputControl(unsigned int) - ??_EQVideoRendererControl@@UAE@I@Z @ 391 NONAME ; QVideoRendererControl::~QVideoRendererControl(unsigned int) - ??_EQVideoWidget@@UAE@I@Z @ 392 NONAME ; QVideoWidget::~QVideoWidget(unsigned int) - ??_EQVideoWidgetControl@@UAE@I@Z @ 393 NONAME ; QVideoWidgetControl::~QVideoWidgetControl(unsigned int) - ??_EQVideoWindowControl@@UAE@I@Z @ 394 NONAME ; QVideoWindowControl::~QVideoWindowControl(unsigned int) - ?activated@QMediaPlaylistNavigator@@IAEXABVQMediaContent@@@Z @ 395 NONAME ; void QMediaPlaylistNavigator::activated(class QMediaContent const &) - ?addInterval@QMediaTimeRange@@QAEXABVQMediaTimeInterval@@@Z @ 396 NONAME ; void QMediaTimeRange::addInterval(class QMediaTimeInterval const &) - ?addInterval@QMediaTimeRange@@QAEX_J0@Z @ 397 NONAME ; void QMediaTimeRange::addInterval(long long, long long) - ?addMedia@QLocalMediaPlaylistProvider@@UAE_NABV?$QList@VQMediaContent@@@@@Z @ 398 NONAME ; bool QLocalMediaPlaylistProvider::addMedia(class QList const &) - ?addMedia@QLocalMediaPlaylistProvider@@UAE_NABVQMediaContent@@@Z @ 399 NONAME ; bool QLocalMediaPlaylistProvider::addMedia(class QMediaContent const &) - ?addMedia@QMediaPlaylist@@QAE_NABV?$QList@VQMediaContent@@@@@Z @ 400 NONAME ; bool QMediaPlaylist::addMedia(class QList const &) - ?addMedia@QMediaPlaylist@@QAE_NABVQMediaContent@@@Z @ 401 NONAME ; bool QMediaPlaylist::addMedia(class QMediaContent const &) - ?addMedia@QMediaPlaylistProvider@@UAE_NABV?$QList@VQMediaContent@@@@@Z @ 402 NONAME ; bool QMediaPlaylistProvider::addMedia(class QList const &) - ?addMedia@QMediaPlaylistProvider@@UAE_NABVQMediaContent@@@Z @ 403 NONAME ; bool QMediaPlaylistProvider::addMedia(class QMediaContent const &) - ?addPropertyWatch@QMediaObject@@IAEXABVQByteArray@@@Z @ 404 NONAME ; void QMediaObject::addPropertyWatch(class QByteArray const &) - ?addTimeRange@QMediaTimeRange@@QAEXABV1@@Z @ 405 NONAME ; void QMediaTimeRange::addTimeRange(class QMediaTimeRange const &) - ?aspectRatioMode@QGraphicsVideoItem@@QBE?AW4AspectRatioMode@Qt@@XZ @ 406 NONAME ; enum Qt::AspectRatioMode QGraphicsVideoItem::aspectRatioMode(void) const - ?aspectRatioMode@QVideoWidget@@QBE?AW4AspectRatioMode@1@XZ @ 407 NONAME ABSENT ; enum QVideoWidget::AspectRatioMode QVideoWidget::aspectRatioMode(void) const - ?audioAvailableChanged@QMediaPlayer@@IAEX_N@Z @ 408 NONAME ; void QMediaPlayer::audioAvailableChanged(bool) - ?audioAvailableChanged@QMediaPlayerControl@@IAEX_N@Z @ 409 NONAME ; void QMediaPlayerControl::audioAvailableChanged(bool) - ?audioBitRate@QMediaResource@@QBEHXZ @ 410 NONAME ; int QMediaResource::audioBitRate(void) const - ?audioCodec@QMediaResource@@QBE?AVQString@@XZ @ 411 NONAME ; class QString QMediaResource::audioCodec(void) const - ?availabilityChanged@QMediaObject@@IAEX_N@Z @ 412 NONAME ; void QMediaObject::availabilityChanged(bool) - ?availabilityError@QMediaObject@@UBE?AW4AvailabilityError@QtMultimedia@@XZ @ 413 NONAME ; enum QtMultimedia::AvailabilityError QMediaObject::availabilityError(void) const - ?availableExtendedMetaData@QMediaObject@@QBE?AVQStringList@@XZ @ 414 NONAME ; class QStringList QMediaObject::availableExtendedMetaData(void) const - ?availableMetaData@QMediaObject@@QBE?AV?$QList@W4MetaData@QtMultimedia@@@@XZ @ 415 NONAME ; class QList QMediaObject::availableMetaData(void) const - ?availableOutputsChanged@QVideoOutputControl@@IAEXABV?$QList@W4Output@QVideoOutputControl@@@@@Z @ 416 NONAME ; void QVideoOutputControl::availableOutputsChanged(class QList const &) - ?availablePlaybackRangesChanged@QMediaPlayerControl@@IAEXABVQMediaTimeRange@@@Z @ 417 NONAME ; void QMediaPlayerControl::availablePlaybackRangesChanged(class QMediaTimeRange const &) - ?bind@QMediaObject@@UAEXPAVQObject@@@Z @ 418 NONAME ; void QMediaObject::bind(class QObject *) - ?bind@QMediaPlayer@@UAEXPAVQObject@@@Z @ 419 NONAME ; void QMediaPlayer::bind(class QObject *) - ?boundingRect@QGraphicsVideoItem@@UBE?AVQRectF@@XZ @ 420 NONAME ; class QRectF QGraphicsVideoItem::boundingRect(void) const - ?brightness@QPainterVideoSurface@@QBEHXZ @ 421 NONAME ; int QPainterVideoSurface::brightness(void) const - ?brightness@QVideoWidget@@QBEHXZ @ 422 NONAME ; int QVideoWidget::brightness(void) const - ?brightnessChanged@QVideoWidget@@IAEXH@Z @ 423 NONAME ; void QVideoWidget::brightnessChanged(int) - ?brightnessChanged@QVideoWidgetControl@@IAEXH@Z @ 424 NONAME ; void QVideoWidgetControl::brightnessChanged(int) - ?brightnessChanged@QVideoWindowControl@@IAEXH@Z @ 425 NONAME ; void QVideoWindowControl::brightnessChanged(int) - ?bufferStatus@QMediaPlayer@@QBEHXZ @ 426 NONAME ; int QMediaPlayer::bufferStatus(void) const - ?bufferStatusChanged@QMediaPlayer@@IAEXH@Z @ 427 NONAME ; void QMediaPlayer::bufferStatusChanged(int) - ?bufferStatusChanged@QMediaPlayerControl@@IAEXH@Z @ 428 NONAME ; void QMediaPlayerControl::bufferStatusChanged(int) - ?canonicalRequest@QMediaContent@@QBE?AVQNetworkRequest@@XZ @ 429 NONAME ; class QNetworkRequest QMediaContent::canonicalRequest(void) const - ?canonicalResource@QMediaContent@@QBE?AVQMediaResource@@XZ @ 430 NONAME ; class QMediaResource QMediaContent::canonicalResource(void) const - ?canonicalUrl@QMediaContent@@QBE?AVQUrl@@XZ @ 431 NONAME ; class QUrl QMediaContent::canonicalUrl(void) const - ?channelCount@QAudioFormat@@QBEHXZ @ 432 NONAME ; int QAudioFormat::channelCount(void) const - ?channelCount@QMediaResource@@QBEHXZ @ 433 NONAME ; int QMediaResource::channelCount(void) const - ?clear@QLocalMediaPlaylistProvider@@UAE_NXZ @ 434 NONAME ; bool QLocalMediaPlaylistProvider::clear(void) - ?clear@QMediaPlaylist@@QAE_NXZ @ 435 NONAME ; bool QMediaPlaylist::clear(void) - ?clear@QMediaPlaylistProvider@@UAE_NXZ @ 436 NONAME ; bool QMediaPlaylistProvider::clear(void) - ?clear@QMediaTimeRange@@QAEXXZ @ 437 NONAME ; void QMediaTimeRange::clear(void) - ?codecs@QMediaServiceProviderHint@@QBE?AVQStringList@@XZ @ 438 NONAME ; class QStringList QMediaServiceProviderHint::codecs(void) const - ?contains@QMediaTimeInterval@@QBE_N_J@Z @ 439 NONAME ; bool QMediaTimeInterval::contains(long long) const - ?contains@QMediaTimeRange@@QBE_N_J@Z @ 440 NONAME ; bool QMediaTimeRange::contains(long long) const - ?contrast@QPainterVideoSurface@@QBEHXZ @ 441 NONAME ; int QPainterVideoSurface::contrast(void) const - ?contrast@QVideoWidget@@QBEHXZ @ 442 NONAME ; int QVideoWidget::contrast(void) const - ?contrastChanged@QVideoWidget@@IAEXH@Z @ 443 NONAME ; void QVideoWidget::contrastChanged(int) - ?contrastChanged@QVideoWidgetControl@@IAEXH@Z @ 444 NONAME ; void QVideoWidgetControl::contrastChanged(int) - ?contrastChanged@QVideoWindowControl@@IAEXH@Z @ 445 NONAME ; void QVideoWindowControl::contrastChanged(int) - ?createPainter@QPainterVideoSurface@@AAEXXZ @ 446 NONAME ; void QPainterVideoSurface::createPainter(void) - ?currentIndex@QMediaPlaylist@@QBEHXZ @ 447 NONAME ; int QMediaPlaylist::currentIndex(void) const - ?currentIndex@QMediaPlaylistNavigator@@QBEHXZ @ 448 NONAME ; int QMediaPlaylistNavigator::currentIndex(void) const - ?currentIndexChanged@QMediaPlaylist@@IAEXH@Z @ 449 NONAME ; void QMediaPlaylist::currentIndexChanged(int) - ?currentIndexChanged@QMediaPlaylistControl@@IAEXH@Z @ 450 NONAME ; void QMediaPlaylistControl::currentIndexChanged(int) - ?currentIndexChanged@QMediaPlaylistNavigator@@IAEXH@Z @ 451 NONAME ; void QMediaPlaylistNavigator::currentIndexChanged(int) - ?currentItem@QMediaPlaylistNavigator@@QBE?AVQMediaContent@@XZ @ 452 NONAME ; class QMediaContent QMediaPlaylistNavigator::currentItem(void) const - ?currentMedia@QMediaPlaylist@@QBE?AVQMediaContent@@XZ @ 453 NONAME ; class QMediaContent QMediaPlaylist::currentMedia(void) const - ?currentMediaChanged@QMediaPlaylist@@IAEXABVQMediaContent@@@Z @ 454 NONAME ; void QMediaPlaylist::currentMediaChanged(class QMediaContent const &) - ?currentMediaChanged@QMediaPlaylistControl@@IAEXABVQMediaContent@@@Z @ 455 NONAME ; void QMediaPlaylistControl::currentMediaChanged(class QMediaContent const &) - ?d_func@QGraphicsVideoItem@@AAEPAVQGraphicsVideoItemPrivate@@XZ @ 456 NONAME ; class QGraphicsVideoItemPrivate * QGraphicsVideoItem::d_func(void) - ?d_func@QGraphicsVideoItem@@ABEPBVQGraphicsVideoItemPrivate@@XZ @ 457 NONAME ; class QGraphicsVideoItemPrivate const * QGraphicsVideoItem::d_func(void) const - ?d_func@QLocalMediaPlaylistProvider@@AAEPAVQLocalMediaPlaylistProviderPrivate@@XZ @ 458 NONAME ; class QLocalMediaPlaylistProviderPrivate * QLocalMediaPlaylistProvider::d_func(void) - ?d_func@QLocalMediaPlaylistProvider@@ABEPBVQLocalMediaPlaylistProviderPrivate@@XZ @ 459 NONAME ; class QLocalMediaPlaylistProviderPrivate const * QLocalMediaPlaylistProvider::d_func(void) const - ?d_func@QMediaControl@@AAEPAVQMediaControlPrivate@@XZ @ 460 NONAME ; class QMediaControlPrivate * QMediaControl::d_func(void) - ?d_func@QMediaControl@@ABEPBVQMediaControlPrivate@@XZ @ 461 NONAME ; class QMediaControlPrivate const * QMediaControl::d_func(void) const - ?d_func@QMediaObject@@AAEPAVQMediaObjectPrivate@@XZ @ 462 NONAME ; class QMediaObjectPrivate * QMediaObject::d_func(void) - ?d_func@QMediaObject@@ABEPBVQMediaObjectPrivate@@XZ @ 463 NONAME ; class QMediaObjectPrivate const * QMediaObject::d_func(void) const - ?d_func@QMediaPlayer@@AAEPAVQMediaPlayerPrivate@@XZ @ 464 NONAME ; class QMediaPlayerPrivate * QMediaPlayer::d_func(void) - ?d_func@QMediaPlayer@@ABEPBVQMediaPlayerPrivate@@XZ @ 465 NONAME ; class QMediaPlayerPrivate const * QMediaPlayer::d_func(void) const - ?d_func@QMediaPlaylist@@AAEPAVQMediaPlaylistPrivate@@XZ @ 466 NONAME ; class QMediaPlaylistPrivate * QMediaPlaylist::d_func(void) - ?d_func@QMediaPlaylist@@ABEPBVQMediaPlaylistPrivate@@XZ @ 467 NONAME ; class QMediaPlaylistPrivate const * QMediaPlaylist::d_func(void) const - ?d_func@QMediaPlaylistNavigator@@AAEPAVQMediaPlaylistNavigatorPrivate@@XZ @ 468 NONAME ; class QMediaPlaylistNavigatorPrivate * QMediaPlaylistNavigator::d_func(void) - ?d_func@QMediaPlaylistNavigator@@ABEPBVQMediaPlaylistNavigatorPrivate@@XZ @ 469 NONAME ; class QMediaPlaylistNavigatorPrivate const * QMediaPlaylistNavigator::d_func(void) const - ?d_func@QMediaPlaylistProvider@@AAEPAVQMediaPlaylistProviderPrivate@@XZ @ 470 NONAME ; class QMediaPlaylistProviderPrivate * QMediaPlaylistProvider::d_func(void) - ?d_func@QMediaPlaylistProvider@@ABEPBVQMediaPlaylistProviderPrivate@@XZ @ 471 NONAME ; class QMediaPlaylistProviderPrivate const * QMediaPlaylistProvider::d_func(void) const - ?d_func@QMediaService@@AAEPAVQMediaServicePrivate@@XZ @ 472 NONAME ; class QMediaServicePrivate * QMediaService::d_func(void) - ?d_func@QMediaService@@ABEPBVQMediaServicePrivate@@XZ @ 473 NONAME ; class QMediaServicePrivate const * QMediaService::d_func(void) const - ?d_func@QVideoWidget@@AAEPAVQVideoWidgetPrivate@@XZ @ 474 NONAME ; class QVideoWidgetPrivate * QVideoWidget::d_func(void) - ?d_func@QVideoWidget@@ABEPBVQVideoWidgetPrivate@@XZ @ 475 NONAME ; class QVideoWidgetPrivate const * QVideoWidget::d_func(void) const - ?dataSize@QMediaResource@@QBE_JXZ @ 476 NONAME ; long long QMediaResource::dataSize(void) const - ?defaultServiceProvider@QMediaServiceProvider@@SAPAV1@XZ @ 477 NONAME ; class QMediaServiceProvider * QMediaServiceProvider::defaultServiceProvider(void) - ?device@QMediaServiceProviderHint@@QBE?AVQByteArray@@XZ @ 478 NONAME ; class QByteArray QMediaServiceProviderHint::device(void) const - ?deviceDescription@QMediaServiceProvider@@UAE?AVQString@@ABVQByteArray@@0@Z @ 479 NONAME ; class QString QMediaServiceProvider::deviceDescription(class QByteArray const &, class QByteArray const &) - ?devices@QMediaServiceProvider@@UBE?AV?$QList@VQByteArray@@@@ABVQByteArray@@@Z @ 480 NONAME ; class QList QMediaServiceProvider::devices(class QByteArray const &) const - ?devicesChanged@QVideoDeviceControl@@IAEXXZ @ 481 NONAME ; void QVideoDeviceControl::devicesChanged(void) - ?duration@QMediaPlayer@@QBE_JXZ @ 482 NONAME ; long long QMediaPlayer::duration(void) const - ?durationChanged@QMediaPlayer@@IAEX_J@Z @ 483 NONAME ; void QMediaPlayer::durationChanged(long long) - ?durationChanged@QMediaPlayerControl@@IAEX_J@Z @ 484 NONAME ; void QMediaPlayerControl::durationChanged(long long) - ?earliestTime@QMediaTimeRange@@QBE_JXZ @ 485 NONAME ; long long QMediaTimeRange::earliestTime(void) const - ?end@QMediaTimeInterval@@QBE_JXZ @ 486 NONAME ; long long QMediaTimeInterval::end(void) const - ?error@QMediaPlayer@@IAEXW4Error@1@@Z @ 487 NONAME ; void QMediaPlayer::error(enum QMediaPlayer::Error) - ?error@QMediaPlayer@@QBE?AW4Error@1@XZ @ 488 NONAME ; enum QMediaPlayer::Error QMediaPlayer::error(void) const - ?error@QMediaPlayerControl@@IAEXHABVQString@@@Z @ 489 NONAME ; void QMediaPlayerControl::error(int, class QString const &) - ?error@QMediaPlaylist@@QBE?AW4Error@1@XZ @ 490 NONAME ; enum QMediaPlaylist::Error QMediaPlaylist::error(void) const - ?errorString@QMediaPlayer@@QBE?AVQString@@XZ @ 491 NONAME ; class QString QMediaPlayer::errorString(void) const - ?errorString@QMediaPlaylist@@QBE?AVQString@@XZ @ 492 NONAME ; class QString QMediaPlaylist::errorString(void) const - ?event@QVideoWidget@@MAE_NPAVQEvent@@@Z @ 493 NONAME ; bool QVideoWidget::event(class QEvent *) - ?extendedMetaData@QMediaObject@@QBE?AVQVariant@@ABVQString@@@Z @ 494 NONAME ; class QVariant QMediaObject::extendedMetaData(class QString const &) const - ?features@QMediaServiceProviderHint@@QBE?AV?$QFlags@W4Feature@QMediaServiceProviderHint@@@@XZ @ 495 NONAME ; class QFlags QMediaServiceProviderHint::features(void) const - ?frameChanged@QPainterVideoSurface@@IAEXXZ @ 496 NONAME ; void QPainterVideoSurface::frameChanged(void) - ?fullScreenChanged@QVideoWidget@@IAEX_N@Z @ 497 NONAME ; void QVideoWidget::fullScreenChanged(bool) - ?fullScreenChanged@QVideoWidgetControl@@IAEX_N@Z @ 498 NONAME ; void QVideoWidgetControl::fullScreenChanged(bool) - ?fullScreenChanged@QVideoWindowControl@@IAEX_N@Z @ 499 NONAME ; void QVideoWindowControl::fullScreenChanged(bool) - ?getStaticMetaObject@QGraphicsVideoItem@@SAABUQMetaObject@@XZ @ 500 NONAME ; struct QMetaObject const & QGraphicsVideoItem::getStaticMetaObject(void) - ?getStaticMetaObject@QLocalMediaPlaylistProvider@@SAABUQMetaObject@@XZ @ 501 NONAME ; struct QMetaObject const & QLocalMediaPlaylistProvider::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaControl@@SAABUQMetaObject@@XZ @ 502 NONAME ; struct QMetaObject const & QMediaControl::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaObject@@SAABUQMetaObject@@XZ @ 503 NONAME ; struct QMetaObject const & QMediaObject::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaPlayer@@SAABUQMetaObject@@XZ @ 504 NONAME ; struct QMetaObject const & QMediaPlayer::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaPlayerControl@@SAABUQMetaObject@@XZ @ 505 NONAME ; struct QMetaObject const & QMediaPlayerControl::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaPlaylist@@SAABUQMetaObject@@XZ @ 506 NONAME ; struct QMetaObject const & QMediaPlaylist::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaPlaylistControl@@SAABUQMetaObject@@XZ @ 507 NONAME ; struct QMetaObject const & QMediaPlaylistControl::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaPlaylistIOPlugin@@SAABUQMetaObject@@XZ @ 508 NONAME ; struct QMetaObject const & QMediaPlaylistIOPlugin::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaPlaylistNavigator@@SAABUQMetaObject@@XZ @ 509 NONAME ; struct QMetaObject const & QMediaPlaylistNavigator::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaPlaylistProvider@@SAABUQMetaObject@@XZ @ 510 NONAME ; struct QMetaObject const & QMediaPlaylistProvider::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaService@@SAABUQMetaObject@@XZ @ 511 NONAME ; struct QMetaObject const & QMediaService::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaServiceProvider@@SAABUQMetaObject@@XZ @ 512 NONAME ; struct QMetaObject const & QMediaServiceProvider::getStaticMetaObject(void) - ?getStaticMetaObject@QMediaServiceProviderPlugin@@SAABUQMetaObject@@XZ @ 513 NONAME ; struct QMetaObject const & QMediaServiceProviderPlugin::getStaticMetaObject(void) - ?getStaticMetaObject@QMetaDataControl@@SAABUQMetaObject@@XZ @ 514 NONAME ; struct QMetaObject const & QMetaDataControl::getStaticMetaObject(void) - ?getStaticMetaObject@QPainterVideoSurface@@SAABUQMetaObject@@XZ @ 515 NONAME ; struct QMetaObject const & QPainterVideoSurface::getStaticMetaObject(void) - ?getStaticMetaObject@QVideoDeviceControl@@SAABUQMetaObject@@XZ @ 516 NONAME ; struct QMetaObject const & QVideoDeviceControl::getStaticMetaObject(void) - ?getStaticMetaObject@QVideoOutputControl@@SAABUQMetaObject@@XZ @ 517 NONAME ; struct QMetaObject const & QVideoOutputControl::getStaticMetaObject(void) - ?getStaticMetaObject@QVideoRendererControl@@SAABUQMetaObject@@XZ @ 518 NONAME ; struct QMetaObject const & QVideoRendererControl::getStaticMetaObject(void) - ?getStaticMetaObject@QVideoWidget@@SAABUQMetaObject@@XZ @ 519 NONAME ; struct QMetaObject const & QVideoWidget::getStaticMetaObject(void) - ?getStaticMetaObject@QVideoWidgetControl@@SAABUQMetaObject@@XZ @ 520 NONAME ; struct QMetaObject const & QVideoWidgetControl::getStaticMetaObject(void) - ?getStaticMetaObject@QVideoWindowControl@@SAABUQMetaObject@@XZ @ 521 NONAME ; struct QMetaObject const & QVideoWindowControl::getStaticMetaObject(void) - ?hasSupport@QMediaPlayer@@SA?AW4SupportEstimate@QtMultimedia@@ABVQString@@ABVQStringList@@V?$QFlags@W4Flag@QMediaPlayer@@@@@Z @ 522 NONAME ; enum QtMultimedia::SupportEstimate QMediaPlayer::hasSupport(class QString const &, class QStringList const &, class QFlags) - ?hasSupport@QMediaServiceProvider@@UBE?AW4SupportEstimate@QtMultimedia@@ABVQByteArray@@ABVQString@@ABVQStringList@@H@Z @ 523 NONAME ; enum QtMultimedia::SupportEstimate QMediaServiceProvider::hasSupport(class QByteArray const &, class QString const &, class QStringList const &, int) const - ?hideEvent@QVideoWidget@@MAEXPAVQHideEvent@@@Z @ 524 NONAME ; void QVideoWidget::hideEvent(class QHideEvent *) - ?hue@QPainterVideoSurface@@QBEHXZ @ 525 NONAME ; int QPainterVideoSurface::hue(void) const - ?hue@QVideoWidget@@QBEHXZ @ 526 NONAME ; int QVideoWidget::hue(void) const - ?hueChanged@QVideoWidget@@IAEXH@Z @ 527 NONAME ; void QVideoWidget::hueChanged(int) - ?hueChanged@QVideoWidgetControl@@IAEXH@Z @ 528 NONAME ; void QVideoWidgetControl::hueChanged(int) - ?hueChanged@QVideoWindowControl@@IAEXH@Z @ 529 NONAME ; void QVideoWindowControl::hueChanged(int) - ?insertMedia@QLocalMediaPlaylistProvider@@UAE_NHABV?$QList@VQMediaContent@@@@@Z @ 530 NONAME ; bool QLocalMediaPlaylistProvider::insertMedia(int, class QList const &) - ?insertMedia@QLocalMediaPlaylistProvider@@UAE_NHABVQMediaContent@@@Z @ 531 NONAME ; bool QLocalMediaPlaylistProvider::insertMedia(int, class QMediaContent const &) - ?insertMedia@QMediaPlaylist@@QAE_NHABV?$QList@VQMediaContent@@@@@Z @ 532 NONAME ; bool QMediaPlaylist::insertMedia(int, class QList const &) - ?insertMedia@QMediaPlaylist@@QAE_NHABVQMediaContent@@@Z @ 533 NONAME ; bool QMediaPlaylist::insertMedia(int, class QMediaContent const &) - ?insertMedia@QMediaPlaylistProvider@@UAE_NHABV?$QList@VQMediaContent@@@@@Z @ 534 NONAME ; bool QMediaPlaylistProvider::insertMedia(int, class QList const &) - ?insertMedia@QMediaPlaylistProvider@@UAE_NHABVQMediaContent@@@Z @ 535 NONAME ; bool QMediaPlaylistProvider::insertMedia(int, class QMediaContent const &) - ?intervals@QMediaTimeRange@@QBE?AV?$QList@VQMediaTimeInterval@@@@XZ @ 536 NONAME ; class QList QMediaTimeRange::intervals(void) const - ?isAudioAvailable@QMediaPlayer@@QBE_NXZ @ 537 NONAME ; bool QMediaPlayer::isAudioAvailable(void) const - ?isAvailable@QMediaObject@@UBE_NXZ @ 538 NONAME ; bool QMediaObject::isAvailable(void) const - ?isContinuous@QMediaTimeRange@@QBE_NXZ @ 539 NONAME ; bool QMediaTimeRange::isContinuous(void) const - ?isEmpty@QMediaPlaylist@@QBE_NXZ @ 540 NONAME ; bool QMediaPlaylist::isEmpty(void) const - ?isEmpty@QMediaTimeRange@@QBE_NXZ @ 541 NONAME ; bool QMediaTimeRange::isEmpty(void) const - ?isFormatSupported@QPainterVideoSurface@@QBE_NABVQVideoSurfaceFormat@@PAV2@@Z @ 542 NONAME ; bool QPainterVideoSurface::isFormatSupported(class QVideoSurfaceFormat const &, class QVideoSurfaceFormat *) const - ?isMetaDataAvailable@QMediaObject@@QBE_NXZ @ 543 NONAME ; bool QMediaObject::isMetaDataAvailable(void) const - ?isMetaDataWritable@QMediaObject@@QBE_NXZ @ 544 NONAME ; bool QMediaObject::isMetaDataWritable(void) const - ?isMuted@QMediaPlayer@@QBE_NXZ @ 545 NONAME ; bool QMediaPlayer::isMuted(void) const - ?isNormal@QMediaTimeInterval@@QBE_NXZ @ 546 NONAME ; bool QMediaTimeInterval::isNormal(void) const - ?isNull@QMediaContent@@QBE_NXZ @ 547 NONAME ; bool QMediaContent::isNull(void) const - ?isNull@QMediaResource@@QBE_NXZ @ 548 NONAME ; bool QMediaResource::isNull(void) const - ?isNull@QMediaServiceProviderHint@@QBE_NXZ @ 549 NONAME ; bool QMediaServiceProviderHint::isNull(void) const - ?isReadOnly@QLocalMediaPlaylistProvider@@UBE_NXZ @ 550 NONAME ; bool QLocalMediaPlaylistProvider::isReadOnly(void) const - ?isReadOnly@QMediaPlaylist@@QBE_NXZ @ 551 NONAME ; bool QMediaPlaylist::isReadOnly(void) const - ?isReadOnly@QMediaPlaylistProvider@@UBE_NXZ @ 552 NONAME ; bool QMediaPlaylistProvider::isReadOnly(void) const - ?isReady@QPainterVideoSurface@@QBE_NXZ @ 553 NONAME ; bool QPainterVideoSurface::isReady(void) const - ?isSeekable@QMediaPlayer@@QBE_NXZ @ 554 NONAME ; bool QMediaPlayer::isSeekable(void) const - ?isVideoAvailable@QMediaPlayer@@QBE_NXZ @ 555 NONAME ; bool QMediaPlayer::isVideoAvailable(void) const - ?itemAt@QMediaPlaylistNavigator@@QBE?AVQMediaContent@@H@Z @ 556 NONAME ; class QMediaContent QMediaPlaylistNavigator::itemAt(int) const - ?itemChange@QGraphicsVideoItem@@MAE?AVQVariant@@W4GraphicsItemChange@QGraphicsItem@@ABV2@@Z @ 557 NONAME ; class QVariant QGraphicsVideoItem::itemChange(enum QGraphicsItem::GraphicsItemChange, class QVariant const &) - ?jump@QMediaPlaylistNavigator@@QAEXH@Z @ 558 NONAME ; void QMediaPlaylistNavigator::jump(int) - ?language@QMediaResource@@QBE?AVQString@@XZ @ 559 NONAME ; class QString QMediaResource::language(void) const - ?latestTime@QMediaTimeRange@@QBE_JXZ @ 560 NONAME ; long long QMediaTimeRange::latestTime(void) const - ?load@QMediaPlaylist@@QAEXABVQUrl@@PBD@Z @ 561 NONAME ; void QMediaPlaylist::load(class QUrl const &, char const *) - ?load@QMediaPlaylist@@QAEXPAVQIODevice@@PBD@Z @ 562 NONAME ; void QMediaPlaylist::load(class QIODevice *, char const *) - ?load@QMediaPlaylistProvider@@UAE_NABVQUrl@@PBD@Z @ 563 NONAME ; bool QMediaPlaylistProvider::load(class QUrl const &, char const *) - ?load@QMediaPlaylistProvider@@UAE_NPAVQIODevice@@PBD@Z @ 564 NONAME ; bool QMediaPlaylistProvider::load(class QIODevice *, char const *) - ?loadFailed@QMediaPlaylist@@IAEXXZ @ 565 NONAME ; void QMediaPlaylist::loadFailed(void) - ?loadFailed@QMediaPlaylistProvider@@IAEXW4Error@QMediaPlaylist@@ABVQString@@@Z @ 566 NONAME ; void QMediaPlaylistProvider::loadFailed(enum QMediaPlaylist::Error, class QString const &) - ?loaded@QMediaPlaylist@@IAEXXZ @ 567 NONAME ; void QMediaPlaylist::loaded(void) - ?loaded@QMediaPlaylistProvider@@IAEXXZ @ 568 NONAME ; void QMediaPlaylistProvider::loaded(void) - ?media@QLocalMediaPlaylistProvider@@UBE?AVQMediaContent@@H@Z @ 569 NONAME ; class QMediaContent QLocalMediaPlaylistProvider::media(int) const - ?media@QMediaPlayer@@QBE?AVQMediaContent@@XZ @ 570 NONAME ; class QMediaContent QMediaPlayer::media(void) const - ?media@QMediaPlaylist@@QBE?AVQMediaContent@@H@Z @ 571 NONAME ; class QMediaContent QMediaPlaylist::media(int) const - ?mediaAboutToBeInserted@QMediaPlaylist@@IAEXHH@Z @ 572 NONAME ; void QMediaPlaylist::mediaAboutToBeInserted(int, int) - ?mediaAboutToBeInserted@QMediaPlaylistProvider@@IAEXHH@Z @ 573 NONAME ; void QMediaPlaylistProvider::mediaAboutToBeInserted(int, int) - ?mediaAboutToBeRemoved@QMediaPlaylist@@IAEXHH@Z @ 574 NONAME ; void QMediaPlaylist::mediaAboutToBeRemoved(int, int) - ?mediaAboutToBeRemoved@QMediaPlaylistProvider@@IAEXHH@Z @ 575 NONAME ; void QMediaPlaylistProvider::mediaAboutToBeRemoved(int, int) - ?mediaChanged@QMediaPlayer@@IAEXABVQMediaContent@@@Z @ 576 NONAME ; void QMediaPlayer::mediaChanged(class QMediaContent const &) - ?mediaChanged@QMediaPlayerControl@@IAEXABVQMediaContent@@@Z @ 577 NONAME ; void QMediaPlayerControl::mediaChanged(class QMediaContent const &) - ?mediaChanged@QMediaPlaylist@@IAEXHH@Z @ 578 NONAME ; void QMediaPlaylist::mediaChanged(int, int) - ?mediaChanged@QMediaPlaylistProvider@@IAEXHH@Z @ 579 NONAME ; void QMediaPlaylistProvider::mediaChanged(int, int) - ?mediaCount@QLocalMediaPlaylistProvider@@UBEHXZ @ 580 NONAME ; int QLocalMediaPlaylistProvider::mediaCount(void) const - ?mediaCount@QMediaPlaylist@@QBEHXZ @ 581 NONAME ; int QMediaPlaylist::mediaCount(void) const - ?mediaInserted@QMediaPlaylist@@IAEXHH@Z @ 582 NONAME ; void QMediaPlaylist::mediaInserted(int, int) - ?mediaInserted@QMediaPlaylistProvider@@IAEXHH@Z @ 583 NONAME ; void QMediaPlaylistProvider::mediaInserted(int, int) - ?mediaObject@QGraphicsVideoItem@@QBEPAVQMediaObject@@XZ @ 584 NONAME ; class QMediaObject * QGraphicsVideoItem::mediaObject(void) const - ?mediaObject@QMediaPlaylist@@QBEPAVQMediaObject@@XZ @ 585 NONAME ; class QMediaObject * QMediaPlaylist::mediaObject(void) const - ?mediaObject@QVideoWidget@@QBEPAVQMediaObject@@XZ @ 586 NONAME ; class QMediaObject * QVideoWidget::mediaObject(void) const - ?mediaRemoved@QMediaPlaylist@@IAEXHH@Z @ 587 NONAME ; void QMediaPlaylist::mediaRemoved(int, int) - ?mediaRemoved@QMediaPlaylistProvider@@IAEXHH@Z @ 588 NONAME ; void QMediaPlaylistProvider::mediaRemoved(int, int) - ?mediaStatus@QMediaPlayer@@QBE?AW4MediaStatus@1@XZ @ 589 NONAME ; enum QMediaPlayer::MediaStatus QMediaPlayer::mediaStatus(void) const - ?mediaStatusChanged@QMediaPlayer@@IAEXW4MediaStatus@1@@Z @ 590 NONAME ; void QMediaPlayer::mediaStatusChanged(enum QMediaPlayer::MediaStatus) - ?mediaStatusChanged@QMediaPlayerControl@@IAEXW4MediaStatus@QMediaPlayer@@@Z @ 591 NONAME ; void QMediaPlayerControl::mediaStatusChanged(enum QMediaPlayer::MediaStatus) - ?mediaStream@QMediaPlayer@@QBEPBVQIODevice@@XZ @ 592 NONAME ; class QIODevice const * QMediaPlayer::mediaStream(void) const - ?metaData@QMediaObject@@QBE?AVQVariant@@W4MetaData@QtMultimedia@@@Z @ 593 NONAME ; class QVariant QMediaObject::metaData(enum QtMultimedia::MetaData) const - ?metaDataAvailableChanged@QMediaObject@@IAEX_N@Z @ 594 NONAME ; void QMediaObject::metaDataAvailableChanged(bool) - ?metaDataAvailableChanged@QMetaDataControl@@IAEX_N@Z @ 595 NONAME ; void QMetaDataControl::metaDataAvailableChanged(bool) - ?metaDataChanged@QMediaObject@@IAEXXZ @ 596 NONAME ; void QMediaObject::metaDataChanged(void) - ?metaDataChanged@QMetaDataControl@@IAEXXZ @ 597 NONAME ; void QMetaDataControl::metaDataChanged(void) - ?metaDataWritableChanged@QMediaObject@@IAEX_N@Z @ 598 NONAME ; void QMediaObject::metaDataWritableChanged(bool) - ?metaObject@QGraphicsVideoItem@@UBEPBUQMetaObject@@XZ @ 599 NONAME ; struct QMetaObject const * QGraphicsVideoItem::metaObject(void) const - ?metaObject@QLocalMediaPlaylistProvider@@UBEPBUQMetaObject@@XZ @ 600 NONAME ; struct QMetaObject const * QLocalMediaPlaylistProvider::metaObject(void) const - ?metaObject@QMediaControl@@UBEPBUQMetaObject@@XZ @ 601 NONAME ; struct QMetaObject const * QMediaControl::metaObject(void) const - ?metaObject@QMediaObject@@UBEPBUQMetaObject@@XZ @ 602 NONAME ; struct QMetaObject const * QMediaObject::metaObject(void) const - ?metaObject@QMediaPlayer@@UBEPBUQMetaObject@@XZ @ 603 NONAME ; struct QMetaObject const * QMediaPlayer::metaObject(void) const - ?metaObject@QMediaPlayerControl@@UBEPBUQMetaObject@@XZ @ 604 NONAME ; struct QMetaObject const * QMediaPlayerControl::metaObject(void) const - ?metaObject@QMediaPlaylist@@UBEPBUQMetaObject@@XZ @ 605 NONAME ; struct QMetaObject const * QMediaPlaylist::metaObject(void) const - ?metaObject@QMediaPlaylistControl@@UBEPBUQMetaObject@@XZ @ 606 NONAME ; struct QMetaObject const * QMediaPlaylistControl::metaObject(void) const - ?metaObject@QMediaPlaylistIOPlugin@@UBEPBUQMetaObject@@XZ @ 607 NONAME ; struct QMetaObject const * QMediaPlaylistIOPlugin::metaObject(void) const - ?metaObject@QMediaPlaylistNavigator@@UBEPBUQMetaObject@@XZ @ 608 NONAME ; struct QMetaObject const * QMediaPlaylistNavigator::metaObject(void) const - ?metaObject@QMediaPlaylistProvider@@UBEPBUQMetaObject@@XZ @ 609 NONAME ; struct QMetaObject const * QMediaPlaylistProvider::metaObject(void) const - ?metaObject@QMediaService@@UBEPBUQMetaObject@@XZ @ 610 NONAME ; struct QMetaObject const * QMediaService::metaObject(void) const - ?metaObject@QMediaServiceProvider@@UBEPBUQMetaObject@@XZ @ 611 NONAME ; struct QMetaObject const * QMediaServiceProvider::metaObject(void) const - ?metaObject@QMediaServiceProviderPlugin@@UBEPBUQMetaObject@@XZ @ 612 NONAME ; struct QMetaObject const * QMediaServiceProviderPlugin::metaObject(void) const - ?metaObject@QMetaDataControl@@UBEPBUQMetaObject@@XZ @ 613 NONAME ; struct QMetaObject const * QMetaDataControl::metaObject(void) const - ?metaObject@QPainterVideoSurface@@UBEPBUQMetaObject@@XZ @ 614 NONAME ; struct QMetaObject const * QPainterVideoSurface::metaObject(void) const - ?metaObject@QVideoDeviceControl@@UBEPBUQMetaObject@@XZ @ 615 NONAME ; struct QMetaObject const * QVideoDeviceControl::metaObject(void) const - ?metaObject@QVideoOutputControl@@UBEPBUQMetaObject@@XZ @ 616 NONAME ; struct QMetaObject const * QVideoOutputControl::metaObject(void) const - ?metaObject@QVideoRendererControl@@UBEPBUQMetaObject@@XZ @ 617 NONAME ; struct QMetaObject const * QVideoRendererControl::metaObject(void) const - ?metaObject@QVideoWidget@@UBEPBUQMetaObject@@XZ @ 618 NONAME ; struct QMetaObject const * QVideoWidget::metaObject(void) const - ?metaObject@QVideoWidgetControl@@UBEPBUQMetaObject@@XZ @ 619 NONAME ; struct QMetaObject const * QVideoWidgetControl::metaObject(void) const - ?metaObject@QVideoWindowControl@@UBEPBUQMetaObject@@XZ @ 620 NONAME ; struct QMetaObject const * QVideoWindowControl::metaObject(void) const - ?mimeType@QMediaResource@@QBE?AVQString@@XZ @ 621 NONAME ; class QString QMediaResource::mimeType(void) const - ?mimeType@QMediaServiceProviderHint@@QBE?AVQString@@XZ @ 622 NONAME ; class QString QMediaServiceProviderHint::mimeType(void) const - ?moveEvent@QVideoWidget@@MAEXPAVQMoveEvent@@@Z @ 623 NONAME ; void QVideoWidget::moveEvent(class QMoveEvent *) - ?mutedChanged@QMediaPlayer@@IAEX_N@Z @ 624 NONAME ; void QMediaPlayer::mutedChanged(bool) - ?mutedChanged@QMediaPlayerControl@@IAEX_N@Z @ 625 NONAME ; void QMediaPlayerControl::mutedChanged(bool) - ?nativeSize@QGraphicsVideoItem@@QBE?AVQSizeF@@XZ @ 626 NONAME ; class QSizeF QGraphicsVideoItem::nativeSize(void) const - ?nativeSizeChanged@QGraphicsVideoItem@@IAEXABVQSizeF@@@Z @ 627 NONAME ; void QGraphicsVideoItem::nativeSizeChanged(class QSizeF const &) - ?nativeSizeChanged@QVideoWindowControl@@IAEXXZ @ 628 NONAME ; void QVideoWindowControl::nativeSizeChanged(void) - ?next@QMediaPlaylist@@QAEXXZ @ 629 NONAME ; void QMediaPlaylist::next(void) - ?next@QMediaPlaylistNavigator@@QAEXXZ @ 630 NONAME ; void QMediaPlaylistNavigator::next(void) - ?nextIndex@QMediaPlaylist@@QBEHH@Z @ 631 NONAME ; int QMediaPlaylist::nextIndex(int) const - ?nextIndex@QMediaPlaylistNavigator@@QBEHH@Z @ 632 NONAME ; int QMediaPlaylistNavigator::nextIndex(int) const - ?nextItem@QMediaPlaylistNavigator@@QBE?AVQMediaContent@@H@Z @ 633 NONAME ; class QMediaContent QMediaPlaylistNavigator::nextItem(int) const - ?normalized@QMediaTimeInterval@@QBE?AV1@XZ @ 634 NONAME ; class QMediaTimeInterval QMediaTimeInterval::normalized(void) const - ?notifyInterval@QMediaObject@@QBEHXZ @ 635 NONAME ; int QMediaObject::notifyInterval(void) const - ?notifyIntervalChanged@QMediaObject@@IAEXH@Z @ 636 NONAME ; void QMediaObject::notifyIntervalChanged(int) - ?offset@QGraphicsVideoItem@@QBE?AVQPointF@@XZ @ 637 NONAME ; class QPointF QGraphicsVideoItem::offset(void) const - ?paint@QGraphicsVideoItem@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 638 NONAME ; void QGraphicsVideoItem::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *) - ?paint@QPainterVideoSurface@@QAEXPAVQPainter@@ABVQRectF@@1@Z @ 639 NONAME ; void QPainterVideoSurface::paint(class QPainter *, class QRectF const &, class QRectF const &) - ?paintEvent@QVideoWidget@@MAEXPAVQPaintEvent@@@Z @ 640 NONAME ; void QVideoWidget::paintEvent(class QPaintEvent *) - ?pause@QMediaPlayer@@QAEXXZ @ 641 NONAME ; void QMediaPlayer::pause(void) - ?play@QMediaPlayer@@QAEXXZ @ 642 NONAME ; void QMediaPlayer::play(void) - ?playbackMode@QMediaPlaylist@@QBE?AW4PlaybackMode@1@XZ @ 643 NONAME ; enum QMediaPlaylist::PlaybackMode QMediaPlaylist::playbackMode(void) const - ?playbackMode@QMediaPlaylistNavigator@@QBE?AW4PlaybackMode@QMediaPlaylist@@XZ @ 644 NONAME ; enum QMediaPlaylist::PlaybackMode QMediaPlaylistNavigator::playbackMode(void) const - ?playbackModeChanged@QMediaPlaylist@@IAEXW4PlaybackMode@1@@Z @ 645 NONAME ; void QMediaPlaylist::playbackModeChanged(enum QMediaPlaylist::PlaybackMode) - ?playbackModeChanged@QMediaPlaylistControl@@IAEXW4PlaybackMode@QMediaPlaylist@@@Z @ 646 NONAME ; void QMediaPlaylistControl::playbackModeChanged(enum QMediaPlaylist::PlaybackMode) - ?playbackModeChanged@QMediaPlaylistNavigator@@IAEXW4PlaybackMode@QMediaPlaylist@@@Z @ 647 NONAME ; void QMediaPlaylistNavigator::playbackModeChanged(enum QMediaPlaylist::PlaybackMode) - ?playbackRate@QMediaPlayer@@QBEMXZ @ 648 NONAME ; float QMediaPlayer::playbackRate(void) const - ?playbackRateChanged@QMediaPlayer@@IAEXM@Z @ 649 NONAME ; void QMediaPlayer::playbackRateChanged(float) - ?playbackRateChanged@QMediaPlayerControl@@IAEXM@Z @ 650 NONAME ; void QMediaPlayerControl::playbackRateChanged(float) - ?playlist@QMediaPlaylistNavigator@@QBEPAVQMediaPlaylistProvider@@XZ @ 651 NONAME ; class QMediaPlaylistProvider * QMediaPlaylistNavigator::playlist(void) const - ?playlistProviderChanged@QMediaPlaylistControl@@IAEXXZ @ 652 NONAME ; void QMediaPlaylistControl::playlistProviderChanged(void) - ?position@QMediaPlayer@@QBE_JXZ @ 653 NONAME ; long long QMediaPlayer::position(void) const - ?positionChanged@QMediaPlayer@@IAEX_J@Z @ 654 NONAME ; void QMediaPlayer::positionChanged(long long) - ?positionChanged@QMediaPlayerControl@@IAEX_J@Z @ 655 NONAME ; void QMediaPlayerControl::positionChanged(long long) - ?present@QPainterVideoSurface@@UAE_NABVQVideoFrame@@@Z @ 656 NONAME ; bool QPainterVideoSurface::present(class QVideoFrame const &) - ?previous@QMediaPlaylist@@QAEXXZ @ 657 NONAME ; void QMediaPlaylist::previous(void) - ?previous@QMediaPlaylistNavigator@@QAEXXZ @ 658 NONAME ; void QMediaPlaylistNavigator::previous(void) - ?previousIndex@QMediaPlaylist@@QBEHH@Z @ 659 NONAME ; int QMediaPlaylist::previousIndex(int) const - ?previousIndex@QMediaPlaylistNavigator@@QBEHH@Z @ 660 NONAME ; int QMediaPlaylistNavigator::previousIndex(int) const - ?previousItem@QMediaPlaylistNavigator@@QBE?AVQMediaContent@@H@Z @ 661 NONAME ; class QMediaContent QMediaPlaylistNavigator::previousItem(int) const - ?qRegisterDeclarativeElements@QtMultimedia@@YAXPBD@Z @ 662 NONAME ABSENT ; void QtMultimedia::qRegisterDeclarativeElements(char const *) - ?qt_metacall@QGraphicsVideoItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 663 NONAME ; int QGraphicsVideoItem::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QLocalMediaPlaylistProvider@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 664 NONAME ; int QLocalMediaPlaylistProvider::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 665 NONAME ; int QMediaControl::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaObject@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 666 NONAME ; int QMediaObject::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaPlayer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 667 NONAME ; int QMediaPlayer::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaPlayerControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 668 NONAME ; int QMediaPlayerControl::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaPlaylist@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 669 NONAME ; int QMediaPlaylist::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaPlaylistControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 670 NONAME ; int QMediaPlaylistControl::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaPlaylistIOPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 671 NONAME ; int QMediaPlaylistIOPlugin::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaPlaylistNavigator@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 672 NONAME ; int QMediaPlaylistNavigator::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaPlaylistProvider@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 673 NONAME ; int QMediaPlaylistProvider::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaService@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 674 NONAME ; int QMediaService::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaServiceProvider@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 675 NONAME ; int QMediaServiceProvider::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMediaServiceProviderPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 676 NONAME ; int QMediaServiceProviderPlugin::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QMetaDataControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 677 NONAME ; int QMetaDataControl::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QPainterVideoSurface@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 678 NONAME ; int QPainterVideoSurface::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QVideoDeviceControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 679 NONAME ; int QVideoDeviceControl::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QVideoOutputControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 680 NONAME ; int QVideoOutputControl::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QVideoRendererControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 681 NONAME ; int QVideoRendererControl::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QVideoWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 682 NONAME ; int QVideoWidget::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QVideoWidgetControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 683 NONAME ; int QVideoWidgetControl::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QVideoWindowControl@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 684 NONAME ; int QVideoWindowControl::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacast@QGraphicsVideoItem@@UAEPAXPBD@Z @ 685 NONAME ; void * QGraphicsVideoItem::qt_metacast(char const *) - ?qt_metacast@QLocalMediaPlaylistProvider@@UAEPAXPBD@Z @ 686 NONAME ; void * QLocalMediaPlaylistProvider::qt_metacast(char const *) - ?qt_metacast@QMediaControl@@UAEPAXPBD@Z @ 687 NONAME ; void * QMediaControl::qt_metacast(char const *) - ?qt_metacast@QMediaObject@@UAEPAXPBD@Z @ 688 NONAME ; void * QMediaObject::qt_metacast(char const *) - ?qt_metacast@QMediaPlayer@@UAEPAXPBD@Z @ 689 NONAME ; void * QMediaPlayer::qt_metacast(char const *) - ?qt_metacast@QMediaPlayerControl@@UAEPAXPBD@Z @ 690 NONAME ; void * QMediaPlayerControl::qt_metacast(char const *) - ?qt_metacast@QMediaPlaylist@@UAEPAXPBD@Z @ 691 NONAME ; void * QMediaPlaylist::qt_metacast(char const *) - ?qt_metacast@QMediaPlaylistControl@@UAEPAXPBD@Z @ 692 NONAME ; void * QMediaPlaylistControl::qt_metacast(char const *) - ?qt_metacast@QMediaPlaylistIOPlugin@@UAEPAXPBD@Z @ 693 NONAME ; void * QMediaPlaylistIOPlugin::qt_metacast(char const *) - ?qt_metacast@QMediaPlaylistNavigator@@UAEPAXPBD@Z @ 694 NONAME ; void * QMediaPlaylistNavigator::qt_metacast(char const *) - ?qt_metacast@QMediaPlaylistProvider@@UAEPAXPBD@Z @ 695 NONAME ; void * QMediaPlaylistProvider::qt_metacast(char const *) - ?qt_metacast@QMediaService@@UAEPAXPBD@Z @ 696 NONAME ; void * QMediaService::qt_metacast(char const *) - ?qt_metacast@QMediaServiceProvider@@UAEPAXPBD@Z @ 697 NONAME ; void * QMediaServiceProvider::qt_metacast(char const *) - ?qt_metacast@QMediaServiceProviderPlugin@@UAEPAXPBD@Z @ 698 NONAME ; void * QMediaServiceProviderPlugin::qt_metacast(char const *) - ?qt_metacast@QMetaDataControl@@UAEPAXPBD@Z @ 699 NONAME ; void * QMetaDataControl::qt_metacast(char const *) - ?qt_metacast@QPainterVideoSurface@@UAEPAXPBD@Z @ 700 NONAME ; void * QPainterVideoSurface::qt_metacast(char const *) - ?qt_metacast@QVideoDeviceControl@@UAEPAXPBD@Z @ 701 NONAME ; void * QVideoDeviceControl::qt_metacast(char const *) - ?qt_metacast@QVideoOutputControl@@UAEPAXPBD@Z @ 702 NONAME ; void * QVideoOutputControl::qt_metacast(char const *) - ?qt_metacast@QVideoRendererControl@@UAEPAXPBD@Z @ 703 NONAME ; void * QVideoRendererControl::qt_metacast(char const *) - ?qt_metacast@QVideoWidget@@UAEPAXPBD@Z @ 704 NONAME ; void * QVideoWidget::qt_metacast(char const *) - ?qt_metacast@QVideoWidgetControl@@UAEPAXPBD@Z @ 705 NONAME ; void * QVideoWidgetControl::qt_metacast(char const *) - ?qt_metacast@QVideoWindowControl@@UAEPAXPBD@Z @ 706 NONAME ; void * QVideoWindowControl::qt_metacast(char const *) - ?removeInterval@QMediaTimeRange@@QAEXABVQMediaTimeInterval@@@Z @ 707 NONAME ; void QMediaTimeRange::removeInterval(class QMediaTimeInterval const &) - ?removeInterval@QMediaTimeRange@@QAEX_J0@Z @ 708 NONAME ; void QMediaTimeRange::removeInterval(long long, long long) - ?removeMedia@QLocalMediaPlaylistProvider@@UAE_NH@Z @ 709 NONAME ; bool QLocalMediaPlaylistProvider::removeMedia(int) - ?removeMedia@QLocalMediaPlaylistProvider@@UAE_NHH@Z @ 710 NONAME ; bool QLocalMediaPlaylistProvider::removeMedia(int, int) - ?removeMedia@QMediaPlaylist@@QAE_NH@Z @ 711 NONAME ; bool QMediaPlaylist::removeMedia(int) - ?removeMedia@QMediaPlaylist@@QAE_NHH@Z @ 712 NONAME ; bool QMediaPlaylist::removeMedia(int, int) - ?removeMedia@QMediaPlaylistProvider@@UAE_NH@Z @ 713 NONAME ; bool QMediaPlaylistProvider::removeMedia(int) - ?removeMedia@QMediaPlaylistProvider@@UAE_NHH@Z @ 714 NONAME ; bool QMediaPlaylistProvider::removeMedia(int, int) - ?removePropertyWatch@QMediaObject@@IAEXABVQByteArray@@@Z @ 715 NONAME ; void QMediaObject::removePropertyWatch(class QByteArray const &) - ?removeTimeRange@QMediaTimeRange@@QAEXABV1@@Z @ 716 NONAME ; void QMediaTimeRange::removeTimeRange(class QMediaTimeRange const &) - ?request@QMediaResource@@QBE?AVQNetworkRequest@@XZ @ 717 NONAME ; class QNetworkRequest QMediaResource::request(void) const - ?resizeEvent@QVideoWidget@@MAEXPAVQResizeEvent@@@Z @ 718 NONAME ; void QVideoWidget::resizeEvent(class QResizeEvent *) - ?resolution@QMediaResource@@QBE?AVQSize@@XZ @ 719 NONAME ; class QSize QMediaResource::resolution(void) const - ?resources@QMediaContent@@QBE?AV?$QList@VQMediaResource@@@@XZ @ 720 NONAME ; class QList QMediaContent::resources(void) const - ?sampleRate@QAudioFormat@@QBEHXZ @ 721 NONAME ; int QAudioFormat::sampleRate(void) const - ?sampleRate@QMediaResource@@QBEHXZ @ 722 NONAME ; int QMediaResource::sampleRate(void) const - ?saturation@QPainterVideoSurface@@QBEHXZ @ 723 NONAME ; int QPainterVideoSurface::saturation(void) const - ?saturation@QVideoWidget@@QBEHXZ @ 724 NONAME ; int QVideoWidget::saturation(void) const - ?saturationChanged@QVideoWidget@@IAEXH@Z @ 725 NONAME ; void QVideoWidget::saturationChanged(int) - ?saturationChanged@QVideoWidgetControl@@IAEXH@Z @ 726 NONAME ; void QVideoWidgetControl::saturationChanged(int) - ?saturationChanged@QVideoWindowControl@@IAEXH@Z @ 727 NONAME ; void QVideoWindowControl::saturationChanged(int) - ?save@QMediaPlaylist@@QAE_NABVQUrl@@PBD@Z @ 728 NONAME ; bool QMediaPlaylist::save(class QUrl const &, char const *) - ?save@QMediaPlaylist@@QAE_NPAVQIODevice@@PBD@Z @ 729 NONAME ; bool QMediaPlaylist::save(class QIODevice *, char const *) - ?save@QMediaPlaylistProvider@@UAE_NABVQUrl@@PBD@Z @ 730 NONAME ; bool QMediaPlaylistProvider::save(class QUrl const &, char const *) - ?save@QMediaPlaylistProvider@@UAE_NPAVQIODevice@@PBD@Z @ 731 NONAME ; bool QMediaPlaylistProvider::save(class QIODevice *, char const *) - ?seekableChanged@QMediaPlayer@@IAEX_N@Z @ 732 NONAME ; void QMediaPlayer::seekableChanged(bool) - ?seekableChanged@QMediaPlayerControl@@IAEX_N@Z @ 733 NONAME ; void QMediaPlayerControl::seekableChanged(bool) - ?selectedDeviceChanged@QVideoDeviceControl@@IAEXABVQString@@@Z @ 734 NONAME ; void QVideoDeviceControl::selectedDeviceChanged(class QString const &) - ?selectedDeviceChanged@QVideoDeviceControl@@IAEXH@Z @ 735 NONAME ; void QVideoDeviceControl::selectedDeviceChanged(int) - ?service@QMediaObject@@UBEPAVQMediaService@@XZ @ 736 NONAME ; class QMediaService * QMediaObject::service(void) const - ?setAspectRatioMode@QGraphicsVideoItem@@QAEXW4AspectRatioMode@Qt@@@Z @ 737 NONAME ; void QGraphicsVideoItem::setAspectRatioMode(enum Qt::AspectRatioMode) - ?setAspectRatioMode@QVideoWidget@@QAEXW4AspectRatioMode@1@@Z @ 738 NONAME ABSENT ; void QVideoWidget::setAspectRatioMode(enum QVideoWidget::AspectRatioMode) - ?setAudioBitRate@QMediaResource@@QAEXH@Z @ 739 NONAME ; void QMediaResource::setAudioBitRate(int) - ?setAudioCodec@QMediaResource@@QAEXABVQString@@@Z @ 740 NONAME ; void QMediaResource::setAudioCodec(class QString const &) - ?setBrightness@QPainterVideoSurface@@QAEXH@Z @ 741 NONAME ; void QPainterVideoSurface::setBrightness(int) - ?setBrightness@QVideoWidget@@QAEXH@Z @ 742 NONAME ; void QVideoWidget::setBrightness(int) - ?setChannelCount@QAudioFormat@@QAEXH@Z @ 743 NONAME ; void QAudioFormat::setChannelCount(int) - ?setChannelCount@QMediaResource@@QAEXH@Z @ 744 NONAME ; void QMediaResource::setChannelCount(int) - ?setContrast@QPainterVideoSurface@@QAEXH@Z @ 745 NONAME ; void QPainterVideoSurface::setContrast(int) - ?setContrast@QVideoWidget@@QAEXH@Z @ 746 NONAME ; void QVideoWidget::setContrast(int) - ?setCurrentIndex@QMediaPlaylist@@QAEXH@Z @ 747 NONAME ; void QMediaPlaylist::setCurrentIndex(int) - ?setDataSize@QMediaResource@@QAEX_J@Z @ 748 NONAME ; void QMediaResource::setDataSize(long long) - ?setExtendedMetaData@QMediaObject@@QAEXABVQString@@ABVQVariant@@@Z @ 749 NONAME ; void QMediaObject::setExtendedMetaData(class QString const &, class QVariant const &) - ?setFullScreen@QVideoWidget@@QAEX_N@Z @ 750 NONAME ; void QVideoWidget::setFullScreen(bool) - ?setHue@QPainterVideoSurface@@QAEXH@Z @ 751 NONAME ; void QPainterVideoSurface::setHue(int) - ?setHue@QVideoWidget@@QAEXH@Z @ 752 NONAME ; void QVideoWidget::setHue(int) - ?setLanguage@QMediaResource@@QAEXABVQString@@@Z @ 753 NONAME ; void QMediaResource::setLanguage(class QString const &) - ?setMedia@QMediaPlayer@@QAEXABVQMediaContent@@PAVQIODevice@@@Z @ 754 NONAME ; void QMediaPlayer::setMedia(class QMediaContent const &, class QIODevice *) - ?setMediaObject@QGraphicsVideoItem@@QAEXPAVQMediaObject@@@Z @ 755 NONAME ; void QGraphicsVideoItem::setMediaObject(class QMediaObject *) - ?setMediaObject@QMediaPlaylist@@QAEXPAVQMediaObject@@@Z @ 756 NONAME ; void QMediaPlaylist::setMediaObject(class QMediaObject *) - ?setMediaObject@QVideoWidget@@QAEXPAVQMediaObject@@@Z @ 757 NONAME ; void QVideoWidget::setMediaObject(class QMediaObject *) - ?setMetaData@QMediaObject@@QAEXW4MetaData@QtMultimedia@@ABVQVariant@@@Z @ 758 NONAME ; void QMediaObject::setMetaData(enum QtMultimedia::MetaData, class QVariant const &) - ?setMuted@QMediaPlayer@@QAEX_N@Z @ 759 NONAME ; void QMediaPlayer::setMuted(bool) - ?setNotifyInterval@QMediaObject@@QAEXH@Z @ 760 NONAME ; void QMediaObject::setNotifyInterval(int) - ?setOffset@QGraphicsVideoItem@@QAEXABVQPointF@@@Z @ 761 NONAME ; void QGraphicsVideoItem::setOffset(class QPointF const &) - ?setPlaybackMode@QMediaPlaylist@@QAEXW4PlaybackMode@1@@Z @ 762 NONAME ; void QMediaPlaylist::setPlaybackMode(enum QMediaPlaylist::PlaybackMode) - ?setPlaybackMode@QMediaPlaylistNavigator@@QAEXW4PlaybackMode@QMediaPlaylist@@@Z @ 763 NONAME ; void QMediaPlaylistNavigator::setPlaybackMode(enum QMediaPlaylist::PlaybackMode) - ?setPlaybackRate@QMediaPlayer@@QAEXM@Z @ 764 NONAME ; void QMediaPlayer::setPlaybackRate(float) - ?setPlaylist@QMediaPlaylistNavigator@@QAEXPAVQMediaPlaylistProvider@@@Z @ 765 NONAME ; void QMediaPlaylistNavigator::setPlaylist(class QMediaPlaylistProvider *) - ?setPosition@QMediaPlayer@@QAEX_J@Z @ 766 NONAME ; void QMediaPlayer::setPosition(long long) - ?setReady@QPainterVideoSurface@@QAEX_N@Z @ 767 NONAME ; void QPainterVideoSurface::setReady(bool) - ?setResolution@QMediaResource@@QAEXABVQSize@@@Z @ 768 NONAME ; void QMediaResource::setResolution(class QSize const &) - ?setResolution@QMediaResource@@QAEXHH@Z @ 769 NONAME ; void QMediaResource::setResolution(int, int) - ?setSampleRate@QAudioFormat@@QAEXH@Z @ 770 NONAME ; void QAudioFormat::setSampleRate(int) - ?setSampleRate@QMediaResource@@QAEXH@Z @ 771 NONAME ; void QMediaResource::setSampleRate(int) - ?setSaturation@QPainterVideoSurface@@QAEXH@Z @ 772 NONAME ; void QPainterVideoSurface::setSaturation(int) - ?setSaturation@QVideoWidget@@QAEXH@Z @ 773 NONAME ; void QVideoWidget::setSaturation(int) - ?setSize@QGraphicsVideoItem@@QAEXABVQSizeF@@@Z @ 774 NONAME ; void QGraphicsVideoItem::setSize(class QSizeF const &) - ?setVideoBitRate@QMediaResource@@QAEXH@Z @ 775 NONAME ; void QMediaResource::setVideoBitRate(int) - ?setVideoCodec@QMediaResource@@QAEXABVQString@@@Z @ 776 NONAME ; void QMediaResource::setVideoCodec(class QString const &) - ?setVolume@QMediaPlayer@@QAEXH@Z @ 777 NONAME ; void QMediaPlayer::setVolume(int) - ?setupMetaData@QMediaObject@@AAEXXZ @ 778 NONAME ; void QMediaObject::setupMetaData(void) - ?showEvent@QVideoWidget@@MAEXPAVQShowEvent@@@Z @ 779 NONAME ; void QVideoWidget::showEvent(class QShowEvent *) - ?shuffle@QLocalMediaPlaylistProvider@@UAEXXZ @ 780 NONAME ; void QLocalMediaPlaylistProvider::shuffle(void) - ?shuffle@QMediaPlaylist@@QAEXXZ @ 781 NONAME ; void QMediaPlaylist::shuffle(void) - ?shuffle@QMediaPlaylistProvider@@UAEXXZ @ 782 NONAME ; void QMediaPlaylistProvider::shuffle(void) - ?size@QGraphicsVideoItem@@QBE?AVQSizeF@@XZ @ 783 NONAME ; class QSizeF QGraphicsVideoItem::size(void) const - ?sizeHint@QVideoWidget@@UBE?AVQSize@@XZ @ 784 NONAME ; class QSize QVideoWidget::sizeHint(void) const - ?start@QMediaTimeInterval@@QBE_JXZ @ 785 NONAME ; long long QMediaTimeInterval::start(void) const - ?start@QPainterVideoSurface@@UAE_NABVQVideoSurfaceFormat@@@Z @ 786 NONAME ; bool QPainterVideoSurface::start(class QVideoSurfaceFormat const &) - ?state@QMediaPlayer@@QBE?AW4State@1@XZ @ 787 NONAME ; enum QMediaPlayer::State QMediaPlayer::state(void) const - ?stateChanged@QMediaPlayer@@IAEXW4State@1@@Z @ 788 NONAME ; void QMediaPlayer::stateChanged(enum QMediaPlayer::State) - ?stateChanged@QMediaPlayerControl@@IAEXW4State@QMediaPlayer@@@Z @ 789 NONAME ; void QMediaPlayerControl::stateChanged(enum QMediaPlayer::State) - ?stop@QMediaPlayer@@QAEXXZ @ 790 NONAME ; void QMediaPlayer::stop(void) - ?stop@QPainterVideoSurface@@UAEXXZ @ 791 NONAME ; void QPainterVideoSurface::stop(void) - ?supportedChannelCounts@QAudioDeviceInfo@@QBE?AV?$QList@H@@XZ @ 792 NONAME ; class QList QAudioDeviceInfo::supportedChannelCounts(void) const - ?supportedMimeTypes@QMediaPlayer@@SA?AVQStringList@@V?$QFlags@W4Flag@QMediaPlayer@@@@@Z @ 793 NONAME ; class QStringList QMediaPlayer::supportedMimeTypes(class QFlags) - ?supportedMimeTypes@QMediaServiceProvider@@UBE?AVQStringList@@ABVQByteArray@@H@Z @ 794 NONAME ; class QStringList QMediaServiceProvider::supportedMimeTypes(class QByteArray const &, int) const - ?supportedPixelFormats@QPainterVideoSurface@@UBE?AV?$QList@W4PixelFormat@QVideoFrame@@@@W4HandleType@QAbstractVideoBuffer@@@Z @ 795 NONAME ; class QList QPainterVideoSurface::supportedPixelFormats(enum QAbstractVideoBuffer::HandleType) const - ?supportedSampleRates@QAudioDeviceInfo@@QBE?AV?$QList@H@@XZ @ 796 NONAME ; class QList QAudioDeviceInfo::supportedSampleRates(void) const - ?surroundingItemsChanged@QMediaPlaylistNavigator@@IAEXXZ @ 797 NONAME ; void QMediaPlaylistNavigator::surroundingItemsChanged(void) - ?tr@QGraphicsVideoItem@@SA?AVQString@@PBD0@Z @ 798 NONAME ; class QString QGraphicsVideoItem::tr(char const *, char const *) - ?tr@QGraphicsVideoItem@@SA?AVQString@@PBD0H@Z @ 799 NONAME ; class QString QGraphicsVideoItem::tr(char const *, char const *, int) - ?tr@QLocalMediaPlaylistProvider@@SA?AVQString@@PBD0@Z @ 800 NONAME ; class QString QLocalMediaPlaylistProvider::tr(char const *, char const *) - ?tr@QLocalMediaPlaylistProvider@@SA?AVQString@@PBD0H@Z @ 801 NONAME ; class QString QLocalMediaPlaylistProvider::tr(char const *, char const *, int) - ?tr@QMediaControl@@SA?AVQString@@PBD0@Z @ 802 NONAME ; class QString QMediaControl::tr(char const *, char const *) - ?tr@QMediaControl@@SA?AVQString@@PBD0H@Z @ 803 NONAME ; class QString QMediaControl::tr(char const *, char const *, int) - ?tr@QMediaObject@@SA?AVQString@@PBD0@Z @ 804 NONAME ; class QString QMediaObject::tr(char const *, char const *) - ?tr@QMediaObject@@SA?AVQString@@PBD0H@Z @ 805 NONAME ; class QString QMediaObject::tr(char const *, char const *, int) - ?tr@QMediaPlayer@@SA?AVQString@@PBD0@Z @ 806 NONAME ; class QString QMediaPlayer::tr(char const *, char const *) - ?tr@QMediaPlayer@@SA?AVQString@@PBD0H@Z @ 807 NONAME ; class QString QMediaPlayer::tr(char const *, char const *, int) - ?tr@QMediaPlayerControl@@SA?AVQString@@PBD0@Z @ 808 NONAME ; class QString QMediaPlayerControl::tr(char const *, char const *) - ?tr@QMediaPlayerControl@@SA?AVQString@@PBD0H@Z @ 809 NONAME ; class QString QMediaPlayerControl::tr(char const *, char const *, int) - ?tr@QMediaPlaylist@@SA?AVQString@@PBD0@Z @ 810 NONAME ; class QString QMediaPlaylist::tr(char const *, char const *) - ?tr@QMediaPlaylist@@SA?AVQString@@PBD0H@Z @ 811 NONAME ; class QString QMediaPlaylist::tr(char const *, char const *, int) - ?tr@QMediaPlaylistControl@@SA?AVQString@@PBD0@Z @ 812 NONAME ; class QString QMediaPlaylistControl::tr(char const *, char const *) - ?tr@QMediaPlaylistControl@@SA?AVQString@@PBD0H@Z @ 813 NONAME ; class QString QMediaPlaylistControl::tr(char const *, char const *, int) - ?tr@QMediaPlaylistIOPlugin@@SA?AVQString@@PBD0@Z @ 814 NONAME ; class QString QMediaPlaylistIOPlugin::tr(char const *, char const *) - ?tr@QMediaPlaylistIOPlugin@@SA?AVQString@@PBD0H@Z @ 815 NONAME ; class QString QMediaPlaylistIOPlugin::tr(char const *, char const *, int) - ?tr@QMediaPlaylistNavigator@@SA?AVQString@@PBD0@Z @ 816 NONAME ; class QString QMediaPlaylistNavigator::tr(char const *, char const *) - ?tr@QMediaPlaylistNavigator@@SA?AVQString@@PBD0H@Z @ 817 NONAME ; class QString QMediaPlaylistNavigator::tr(char const *, char const *, int) - ?tr@QMediaPlaylistProvider@@SA?AVQString@@PBD0@Z @ 818 NONAME ; class QString QMediaPlaylistProvider::tr(char const *, char const *) - ?tr@QMediaPlaylistProvider@@SA?AVQString@@PBD0H@Z @ 819 NONAME ; class QString QMediaPlaylistProvider::tr(char const *, char const *, int) - ?tr@QMediaService@@SA?AVQString@@PBD0@Z @ 820 NONAME ; class QString QMediaService::tr(char const *, char const *) - ?tr@QMediaService@@SA?AVQString@@PBD0H@Z @ 821 NONAME ; class QString QMediaService::tr(char const *, char const *, int) - ?tr@QMediaServiceProvider@@SA?AVQString@@PBD0@Z @ 822 NONAME ; class QString QMediaServiceProvider::tr(char const *, char const *) - ?tr@QMediaServiceProvider@@SA?AVQString@@PBD0H@Z @ 823 NONAME ; class QString QMediaServiceProvider::tr(char const *, char const *, int) - ?tr@QMediaServiceProviderPlugin@@SA?AVQString@@PBD0@Z @ 824 NONAME ; class QString QMediaServiceProviderPlugin::tr(char const *, char const *) - ?tr@QMediaServiceProviderPlugin@@SA?AVQString@@PBD0H@Z @ 825 NONAME ; class QString QMediaServiceProviderPlugin::tr(char const *, char const *, int) - ?tr@QMetaDataControl@@SA?AVQString@@PBD0@Z @ 826 NONAME ; class QString QMetaDataControl::tr(char const *, char const *) - ?tr@QMetaDataControl@@SA?AVQString@@PBD0H@Z @ 827 NONAME ; class QString QMetaDataControl::tr(char const *, char const *, int) - ?tr@QPainterVideoSurface@@SA?AVQString@@PBD0@Z @ 828 NONAME ; class QString QPainterVideoSurface::tr(char const *, char const *) - ?tr@QPainterVideoSurface@@SA?AVQString@@PBD0H@Z @ 829 NONAME ; class QString QPainterVideoSurface::tr(char const *, char const *, int) - ?tr@QVideoDeviceControl@@SA?AVQString@@PBD0@Z @ 830 NONAME ; class QString QVideoDeviceControl::tr(char const *, char const *) - ?tr@QVideoDeviceControl@@SA?AVQString@@PBD0H@Z @ 831 NONAME ; class QString QVideoDeviceControl::tr(char const *, char const *, int) - ?tr@QVideoOutputControl@@SA?AVQString@@PBD0@Z @ 832 NONAME ; class QString QVideoOutputControl::tr(char const *, char const *) - ?tr@QVideoOutputControl@@SA?AVQString@@PBD0H@Z @ 833 NONAME ; class QString QVideoOutputControl::tr(char const *, char const *, int) - ?tr@QVideoRendererControl@@SA?AVQString@@PBD0@Z @ 834 NONAME ; class QString QVideoRendererControl::tr(char const *, char const *) - ?tr@QVideoRendererControl@@SA?AVQString@@PBD0H@Z @ 835 NONAME ; class QString QVideoRendererControl::tr(char const *, char const *, int) - ?tr@QVideoWidget@@SA?AVQString@@PBD0@Z @ 836 NONAME ; class QString QVideoWidget::tr(char const *, char const *) - ?tr@QVideoWidget@@SA?AVQString@@PBD0H@Z @ 837 NONAME ; class QString QVideoWidget::tr(char const *, char const *, int) - ?tr@QVideoWidgetControl@@SA?AVQString@@PBD0@Z @ 838 NONAME ; class QString QVideoWidgetControl::tr(char const *, char const *) - ?tr@QVideoWidgetControl@@SA?AVQString@@PBD0H@Z @ 839 NONAME ; class QString QVideoWidgetControl::tr(char const *, char const *, int) - ?tr@QVideoWindowControl@@SA?AVQString@@PBD0@Z @ 840 NONAME ; class QString QVideoWindowControl::tr(char const *, char const *) - ?tr@QVideoWindowControl@@SA?AVQString@@PBD0H@Z @ 841 NONAME ; class QString QVideoWindowControl::tr(char const *, char const *, int) - ?trUtf8@QGraphicsVideoItem@@SA?AVQString@@PBD0@Z @ 842 NONAME ; class QString QGraphicsVideoItem::trUtf8(char const *, char const *) - ?trUtf8@QGraphicsVideoItem@@SA?AVQString@@PBD0H@Z @ 843 NONAME ; class QString QGraphicsVideoItem::trUtf8(char const *, char const *, int) - ?trUtf8@QLocalMediaPlaylistProvider@@SA?AVQString@@PBD0@Z @ 844 NONAME ; class QString QLocalMediaPlaylistProvider::trUtf8(char const *, char const *) - ?trUtf8@QLocalMediaPlaylistProvider@@SA?AVQString@@PBD0H@Z @ 845 NONAME ; class QString QLocalMediaPlaylistProvider::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaControl@@SA?AVQString@@PBD0@Z @ 846 NONAME ; class QString QMediaControl::trUtf8(char const *, char const *) - ?trUtf8@QMediaControl@@SA?AVQString@@PBD0H@Z @ 847 NONAME ; class QString QMediaControl::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaObject@@SA?AVQString@@PBD0@Z @ 848 NONAME ; class QString QMediaObject::trUtf8(char const *, char const *) - ?trUtf8@QMediaObject@@SA?AVQString@@PBD0H@Z @ 849 NONAME ; class QString QMediaObject::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaPlayer@@SA?AVQString@@PBD0@Z @ 850 NONAME ; class QString QMediaPlayer::trUtf8(char const *, char const *) - ?trUtf8@QMediaPlayer@@SA?AVQString@@PBD0H@Z @ 851 NONAME ; class QString QMediaPlayer::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaPlayerControl@@SA?AVQString@@PBD0@Z @ 852 NONAME ; class QString QMediaPlayerControl::trUtf8(char const *, char const *) - ?trUtf8@QMediaPlayerControl@@SA?AVQString@@PBD0H@Z @ 853 NONAME ; class QString QMediaPlayerControl::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaPlaylist@@SA?AVQString@@PBD0@Z @ 854 NONAME ; class QString QMediaPlaylist::trUtf8(char const *, char const *) - ?trUtf8@QMediaPlaylist@@SA?AVQString@@PBD0H@Z @ 855 NONAME ; class QString QMediaPlaylist::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaPlaylistControl@@SA?AVQString@@PBD0@Z @ 856 NONAME ; class QString QMediaPlaylistControl::trUtf8(char const *, char const *) - ?trUtf8@QMediaPlaylistControl@@SA?AVQString@@PBD0H@Z @ 857 NONAME ; class QString QMediaPlaylistControl::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaPlaylistIOPlugin@@SA?AVQString@@PBD0@Z @ 858 NONAME ; class QString QMediaPlaylistIOPlugin::trUtf8(char const *, char const *) - ?trUtf8@QMediaPlaylistIOPlugin@@SA?AVQString@@PBD0H@Z @ 859 NONAME ; class QString QMediaPlaylistIOPlugin::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaPlaylistNavigator@@SA?AVQString@@PBD0@Z @ 860 NONAME ; class QString QMediaPlaylistNavigator::trUtf8(char const *, char const *) - ?trUtf8@QMediaPlaylistNavigator@@SA?AVQString@@PBD0H@Z @ 861 NONAME ; class QString QMediaPlaylistNavigator::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaPlaylistProvider@@SA?AVQString@@PBD0@Z @ 862 NONAME ; class QString QMediaPlaylistProvider::trUtf8(char const *, char const *) - ?trUtf8@QMediaPlaylistProvider@@SA?AVQString@@PBD0H@Z @ 863 NONAME ; class QString QMediaPlaylistProvider::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaService@@SA?AVQString@@PBD0@Z @ 864 NONAME ; class QString QMediaService::trUtf8(char const *, char const *) - ?trUtf8@QMediaService@@SA?AVQString@@PBD0H@Z @ 865 NONAME ; class QString QMediaService::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaServiceProvider@@SA?AVQString@@PBD0@Z @ 866 NONAME ; class QString QMediaServiceProvider::trUtf8(char const *, char const *) - ?trUtf8@QMediaServiceProvider@@SA?AVQString@@PBD0H@Z @ 867 NONAME ; class QString QMediaServiceProvider::trUtf8(char const *, char const *, int) - ?trUtf8@QMediaServiceProviderPlugin@@SA?AVQString@@PBD0@Z @ 868 NONAME ; class QString QMediaServiceProviderPlugin::trUtf8(char const *, char const *) - ?trUtf8@QMediaServiceProviderPlugin@@SA?AVQString@@PBD0H@Z @ 869 NONAME ; class QString QMediaServiceProviderPlugin::trUtf8(char const *, char const *, int) - ?trUtf8@QMetaDataControl@@SA?AVQString@@PBD0@Z @ 870 NONAME ; class QString QMetaDataControl::trUtf8(char const *, char const *) - ?trUtf8@QMetaDataControl@@SA?AVQString@@PBD0H@Z @ 871 NONAME ; class QString QMetaDataControl::trUtf8(char const *, char const *, int) - ?trUtf8@QPainterVideoSurface@@SA?AVQString@@PBD0@Z @ 872 NONAME ; class QString QPainterVideoSurface::trUtf8(char const *, char const *) - ?trUtf8@QPainterVideoSurface@@SA?AVQString@@PBD0H@Z @ 873 NONAME ; class QString QPainterVideoSurface::trUtf8(char const *, char const *, int) - ?trUtf8@QVideoDeviceControl@@SA?AVQString@@PBD0@Z @ 874 NONAME ; class QString QVideoDeviceControl::trUtf8(char const *, char const *) - ?trUtf8@QVideoDeviceControl@@SA?AVQString@@PBD0H@Z @ 875 NONAME ; class QString QVideoDeviceControl::trUtf8(char const *, char const *, int) - ?trUtf8@QVideoOutputControl@@SA?AVQString@@PBD0@Z @ 876 NONAME ; class QString QVideoOutputControl::trUtf8(char const *, char const *) - ?trUtf8@QVideoOutputControl@@SA?AVQString@@PBD0H@Z @ 877 NONAME ; class QString QVideoOutputControl::trUtf8(char const *, char const *, int) - ?trUtf8@QVideoRendererControl@@SA?AVQString@@PBD0@Z @ 878 NONAME ; class QString QVideoRendererControl::trUtf8(char const *, char const *) - ?trUtf8@QVideoRendererControl@@SA?AVQString@@PBD0H@Z @ 879 NONAME ; class QString QVideoRendererControl::trUtf8(char const *, char const *, int) - ?trUtf8@QVideoWidget@@SA?AVQString@@PBD0@Z @ 880 NONAME ; class QString QVideoWidget::trUtf8(char const *, char const *) - ?trUtf8@QVideoWidget@@SA?AVQString@@PBD0H@Z @ 881 NONAME ; class QString QVideoWidget::trUtf8(char const *, char const *, int) - ?trUtf8@QVideoWidgetControl@@SA?AVQString@@PBD0@Z @ 882 NONAME ; class QString QVideoWidgetControl::trUtf8(char const *, char const *) - ?trUtf8@QVideoWidgetControl@@SA?AVQString@@PBD0H@Z @ 883 NONAME ; class QString QVideoWidgetControl::trUtf8(char const *, char const *, int) - ?trUtf8@QVideoWindowControl@@SA?AVQString@@PBD0@Z @ 884 NONAME ; class QString QVideoWindowControl::trUtf8(char const *, char const *) - ?trUtf8@QVideoWindowControl@@SA?AVQString@@PBD0H@Z @ 885 NONAME ; class QString QVideoWindowControl::trUtf8(char const *, char const *, int) - ?translated@QMediaTimeInterval@@QBE?AV1@_J@Z @ 886 NONAME ; class QMediaTimeInterval QMediaTimeInterval::translated(long long) const - ?type@QMediaServiceProviderHint@@QBE?AW4Type@1@XZ @ 887 NONAME ; enum QMediaServiceProviderHint::Type QMediaServiceProviderHint::type(void) const - ?unbind@QMediaObject@@UAEXPAVQObject@@@Z @ 888 NONAME ; void QMediaObject::unbind(class QObject *) - ?unbind@QMediaPlayer@@UAEXPAVQObject@@@Z @ 889 NONAME ; void QMediaPlayer::unbind(class QObject *) - ?url@QMediaResource@@QBE?AVQUrl@@XZ @ 890 NONAME ; class QUrl QMediaResource::url(void) const - ?videoAvailableChanged@QMediaPlayer@@IAEX_N@Z @ 891 NONAME ; void QMediaPlayer::videoAvailableChanged(bool) - ?videoAvailableChanged@QMediaPlayerControl@@IAEX_N@Z @ 892 NONAME ; void QMediaPlayerControl::videoAvailableChanged(bool) - ?videoBitRate@QMediaResource@@QBEHXZ @ 893 NONAME ; int QMediaResource::videoBitRate(void) const - ?videoCodec@QMediaResource@@QBE?AVQString@@XZ @ 894 NONAME ; class QString QMediaResource::videoCodec(void) const - ?volume@QMediaPlayer@@QBEHXZ @ 895 NONAME ; int QMediaPlayer::volume(void) const - ?volumeChanged@QMediaPlayer@@IAEXH@Z @ 896 NONAME ; void QMediaPlayer::volumeChanged(int) - ?volumeChanged@QMediaPlayerControl@@IAEXH@Z @ 897 NONAME ; void QMediaPlayerControl::volumeChanged(int) - ?writableChanged@QMetaDataControl@@IAEX_N@Z @ 898 NONAME ; void QMetaDataControl::writableChanged(bool) - ?staticMetaObject@QMediaPlaylistProvider@@2UQMetaObject@@B @ 899 NONAME ; struct QMetaObject const QMediaPlaylistProvider::staticMetaObject - ?staticMetaObject@QVideoWidget@@2UQMetaObject@@B @ 900 NONAME ; struct QMetaObject const QVideoWidget::staticMetaObject - ?staticMetaObject@QMediaPlaylistControl@@2UQMetaObject@@B @ 901 NONAME ; struct QMetaObject const QMediaPlaylistControl::staticMetaObject - ?staticMetaObject@QMediaControl@@2UQMetaObject@@B @ 902 NONAME ; struct QMetaObject const QMediaControl::staticMetaObject - ?staticMetaObject@QLocalMediaPlaylistProvider@@2UQMetaObject@@B @ 903 NONAME ; struct QMetaObject const QLocalMediaPlaylistProvider::staticMetaObject - ?staticMetaObject@QMediaServiceProviderPlugin@@2UQMetaObject@@B @ 904 NONAME ; struct QMetaObject const QMediaServiceProviderPlugin::staticMetaObject - ?staticMetaObject@QVideoOutputControl@@2UQMetaObject@@B @ 905 NONAME ; struct QMetaObject const QVideoOutputControl::staticMetaObject - ?staticMetaObject@QMetaDataControl@@2UQMetaObject@@B @ 906 NONAME ; struct QMetaObject const QMetaDataControl::staticMetaObject - ?staticMetaObject@QMediaPlayer@@2UQMetaObject@@B @ 907 NONAME ; struct QMetaObject const QMediaPlayer::staticMetaObject - ?staticMetaObject@QMediaService@@2UQMetaObject@@B @ 908 NONAME ; struct QMetaObject const QMediaService::staticMetaObject - ?staticMetaObject@QMediaObject@@2UQMetaObject@@B @ 909 NONAME ; struct QMetaObject const QMediaObject::staticMetaObject - ?staticMetaObject@QMediaPlaylist@@2UQMetaObject@@B @ 910 NONAME ; struct QMetaObject const QMediaPlaylist::staticMetaObject - ?staticMetaObject@QMediaServiceProvider@@2UQMetaObject@@B @ 911 NONAME ; struct QMetaObject const QMediaServiceProvider::staticMetaObject - ?staticMetaObject@QMediaPlayerControl@@2UQMetaObject@@B @ 912 NONAME ; struct QMetaObject const QMediaPlayerControl::staticMetaObject - ?staticMetaObject@QMediaPlaylistNavigator@@2UQMetaObject@@B @ 913 NONAME ; struct QMetaObject const QMediaPlaylistNavigator::staticMetaObject - ?staticMetaObject@QVideoWidgetControl@@2UQMetaObject@@B @ 914 NONAME ; struct QMetaObject const QVideoWidgetControl::staticMetaObject - ?staticMetaObject@QVideoWindowControl@@2UQMetaObject@@B @ 915 NONAME ; struct QMetaObject const QVideoWindowControl::staticMetaObject - ?staticMetaObject@QVideoDeviceControl@@2UQMetaObject@@B @ 916 NONAME ; struct QMetaObject const QVideoDeviceControl::staticMetaObject - ?staticMetaObject@QVideoRendererControl@@2UQMetaObject@@B @ 917 NONAME ; struct QMetaObject const QVideoRendererControl::staticMetaObject - ?staticMetaObject@QPainterVideoSurface@@2UQMetaObject@@B @ 918 NONAME ; struct QMetaObject const QPainterVideoSurface::staticMetaObject - ?staticMetaObject@QMediaPlaylistIOPlugin@@2UQMetaObject@@B @ 919 NONAME ; struct QMetaObject const QMediaPlaylistIOPlugin::staticMetaObject - ?staticMetaObject@QGraphicsVideoItem@@2UQMetaObject@@B @ 920 NONAME ; struct QMetaObject const QGraphicsVideoItem::staticMetaObject - ??0QSoundEffect@@QAE@PAVQObject@@@Z @ 921 NONAME ; QSoundEffect::QSoundEffect(class QObject *) - ??1QSoundEffect@@UAE@XZ @ 922 NONAME ; QSoundEffect::~QSoundEffect(void) - ??_EQSoundEffect@@UAE@I@Z @ 923 NONAME ; QSoundEffect::~QSoundEffect(unsigned int) - ?aspectRatioMode@QVideoWidget@@QBE?AW4AspectRatioMode@Qt@@XZ @ 924 NONAME ; enum Qt::AspectRatioMode QVideoWidget::aspectRatioMode(void) const - ?getStaticMetaObject@QSoundEffect@@SAABUQMetaObject@@XZ @ 925 NONAME ; struct QMetaObject const & QSoundEffect::getStaticMetaObject(void) - ?isMuted@QSoundEffect@@QBE_NXZ @ 926 NONAME ; bool QSoundEffect::isMuted(void) const - ?loops@QSoundEffect@@QBEHXZ @ 927 NONAME ; int QSoundEffect::loops(void) const - ?loopsChanged@QSoundEffect@@IAEXXZ @ 928 NONAME ; void QSoundEffect::loopsChanged(void) - ?metaObject@QSoundEffect@@UBEPBUQMetaObject@@XZ @ 929 NONAME ; struct QMetaObject const * QSoundEffect::metaObject(void) const - ?mutedChanged@QSoundEffect@@IAEXXZ @ 930 NONAME ; void QSoundEffect::mutedChanged(void) - ?play@QSoundEffect@@QAEXXZ @ 931 NONAME ; void QSoundEffect::play(void) - ?qt_metacall@QSoundEffect@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 932 NONAME ; int QSoundEffect::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacast@QSoundEffect@@UAEPAXPBD@Z @ 933 NONAME ; void * QSoundEffect::qt_metacast(char const *) - ?setAspectRatioMode@QVideoWidget@@QAEXW4AspectRatioMode@Qt@@@Z @ 934 NONAME ; void QVideoWidget::setAspectRatioMode(enum Qt::AspectRatioMode) - ?setLoops@QSoundEffect@@QAEXH@Z @ 935 NONAME ; void QSoundEffect::setLoops(int) - ?setMuted@QSoundEffect@@QAEX_N@Z @ 936 NONAME ; void QSoundEffect::setMuted(bool) - ?setSource@QSoundEffect@@QAEXABVQUrl@@@Z @ 937 NONAME ; void QSoundEffect::setSource(class QUrl const &) - ?setVolume@QSoundEffect@@QAEXH@Z @ 938 NONAME ; void QSoundEffect::setVolume(int) - ?source@QSoundEffect@@QBE?AVQUrl@@XZ @ 939 NONAME ; class QUrl QSoundEffect::source(void) const - ?sourceChanged@QSoundEffect@@IAEXXZ @ 940 NONAME ; void QSoundEffect::sourceChanged(void) - ?tr@QSoundEffect@@SA?AVQString@@PBD0@Z @ 941 NONAME ; class QString QSoundEffect::tr(char const *, char const *) - ?tr@QSoundEffect@@SA?AVQString@@PBD0H@Z @ 942 NONAME ; class QString QSoundEffect::tr(char const *, char const *, int) - ?trUtf8@QSoundEffect@@SA?AVQString@@PBD0@Z @ 943 NONAME ; class QString QSoundEffect::trUtf8(char const *, char const *) - ?trUtf8@QSoundEffect@@SA?AVQString@@PBD0H@Z @ 944 NONAME ; class QString QSoundEffect::trUtf8(char const *, char const *, int) - ?volume@QSoundEffect@@QBEHXZ @ 945 NONAME ; int QSoundEffect::volume(void) const - ?volumeChanged@QSoundEffect@@IAEXXZ @ 946 NONAME ; void QSoundEffect::volumeChanged(void) - ?staticMetaObject@QSoundEffect@@2UQMetaObject@@B @ 947 NONAME ; struct QMetaObject const QSoundEffect::staticMetaObject - ?event@QGraphicsVideoItem@@MAE_NPAVQEvent@@@Z @ 948 NONAME ; bool QGraphicsVideoItem::event(class QEvent *) - ?sceneEvent@QGraphicsVideoItem@@MAE_NPAVQEvent@@@Z @ 949 NONAME ; bool QGraphicsVideoItem::sceneEvent(class QEvent *) + ?channelCount@QAudioFormat@@QBEHXZ @ 270 NONAME ; int QAudioFormat::channelCount(void) const + ?sampleRate@QAudioFormat@@QBEHXZ @ 271 NONAME ; int QAudioFormat::sampleRate(void) const + ?setChannelCount@QAudioFormat@@QAEXH@Z @ 272 NONAME ; void QAudioFormat::setChannelCount(int) + ?setSampleRate@QAudioFormat@@QAEXH@Z @ 273 NONAME ; void QAudioFormat::setSampleRate(int) + ?supportedChannelCounts@QAudioDeviceInfo@@QBE?AV?$QList@H@@XZ @ 274 NONAME ; class QList QAudioDeviceInfo::supportedChannelCounts(void) const + ?supportedSampleRates@QAudioDeviceInfo@@QBE?AV?$QList@H@@XZ @ 275 NONAME ; class QList QAudioDeviceInfo::supportedSampleRates(void) const diff --git a/src/s60installs/eabi/QtMediaServicesu.def b/src/s60installs/eabi/QtMediaServicesu.def new file mode 100644 index 0000000..0b4083d --- /dev/null +++ b/src/s60installs/eabi/QtMediaServicesu.def @@ -0,0 +1,674 @@ +EXPORTS + _ZN12QMediaObject11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME + _ZN12QMediaObject11qt_metacastEPKc @ 2 NONAME + _ZN12QMediaObject11setMetaDataEN15QtMediaServices8MetaDataERK8QVariant @ 3 NONAME + _ZN12QMediaObject13setupMetaDataEv @ 4 NONAME + _ZN12QMediaObject15metaDataChangedEv @ 5 NONAME + _ZN12QMediaObject16addPropertyWatchERK10QByteArray @ 6 NONAME + _ZN12QMediaObject16staticMetaObjectE @ 7 NONAME DATA 16 + _ZN12QMediaObject17setNotifyIntervalEi @ 8 NONAME + _ZN12QMediaObject19availabilityChangedEb @ 9 NONAME + _ZN12QMediaObject19getStaticMetaObjectEv @ 10 NONAME + _ZN12QMediaObject19removePropertyWatchERK10QByteArray @ 11 NONAME + _ZN12QMediaObject19setExtendedMetaDataERK7QStringRK8QVariant @ 12 NONAME + _ZN12QMediaObject21notifyIntervalChangedEi @ 13 NONAME + _ZN12QMediaObject23metaDataWritableChangedEb @ 14 NONAME + _ZN12QMediaObject24metaDataAvailableChangedEb @ 15 NONAME + _ZN12QMediaObject4bindEP7QObject @ 16 NONAME + _ZN12QMediaObject6unbindEP7QObject @ 17 NONAME + _ZN12QMediaObjectC1EP7QObjectP13QMediaService @ 18 NONAME + _ZN12QMediaObjectC1ER19QMediaObjectPrivateP7QObjectP13QMediaService @ 19 NONAME + _ZN12QMediaObjectC2EP7QObjectP13QMediaService @ 20 NONAME + _ZN12QMediaObjectC2ER19QMediaObjectPrivateP7QObjectP13QMediaService @ 21 NONAME + _ZN12QMediaObjectD0Ev @ 22 NONAME + _ZN12QMediaObjectD1Ev @ 23 NONAME + _ZN12QMediaObjectD2Ev @ 24 NONAME + _ZN12QMediaPlayer10hasSupportERK7QStringRK11QStringList6QFlagsINS_4FlagEE @ 25 NONAME + _ZN12QMediaPlayer11qt_metacallEN11QMetaObject4CallEiPPv @ 26 NONAME + _ZN12QMediaPlayer11qt_metacastEPKc @ 27 NONAME + _ZN12QMediaPlayer11setPositionEx @ 28 NONAME + _ZN12QMediaPlayer12mediaChangedERK13QMediaContent @ 29 NONAME + _ZN12QMediaPlayer12mutedChangedEb @ 30 NONAME + _ZN12QMediaPlayer12stateChangedENS_5StateE @ 31 NONAME + _ZN12QMediaPlayer13volumeChangedEi @ 32 NONAME + _ZN12QMediaPlayer15durationChangedEx @ 33 NONAME + _ZN12QMediaPlayer15positionChangedEx @ 34 NONAME + _ZN12QMediaPlayer15seekableChangedEb @ 35 NONAME + _ZN12QMediaPlayer15setPlaybackRateEf @ 36 NONAME + _ZN12QMediaPlayer16staticMetaObjectE @ 37 NONAME DATA 16 + _ZN12QMediaPlayer18mediaStatusChangedENS_11MediaStatusE @ 38 NONAME + _ZN12QMediaPlayer18supportedMimeTypesE6QFlagsINS_4FlagEE @ 39 NONAME + _ZN12QMediaPlayer19bufferStatusChangedEi @ 40 NONAME + _ZN12QMediaPlayer19getStaticMetaObjectEv @ 41 NONAME + _ZN12QMediaPlayer19playbackRateChangedEf @ 42 NONAME + _ZN12QMediaPlayer21audioAvailableChangedEb @ 43 NONAME + _ZN12QMediaPlayer21videoAvailableChangedEb @ 44 NONAME + _ZN12QMediaPlayer4bindEP7QObject @ 45 NONAME + _ZN12QMediaPlayer4playEv @ 46 NONAME + _ZN12QMediaPlayer4stopEv @ 47 NONAME + _ZN12QMediaPlayer5errorENS_5ErrorE @ 48 NONAME + _ZN12QMediaPlayer5pauseEv @ 49 NONAME + _ZN12QMediaPlayer6unbindEP7QObject @ 50 NONAME + _ZN12QMediaPlayer8setMediaERK13QMediaContentP9QIODevice @ 51 NONAME + _ZN12QMediaPlayer8setMutedEb @ 52 NONAME + _ZN12QMediaPlayer9setVolumeEi @ 53 NONAME + _ZN12QMediaPlayerC1EP7QObject6QFlagsINS_4FlagEEP21QMediaServiceProvider @ 54 NONAME + _ZN12QMediaPlayerC2EP7QObject6QFlagsINS_4FlagEEP21QMediaServiceProvider @ 55 NONAME + _ZN12QMediaPlayerD0Ev @ 56 NONAME + _ZN12QMediaPlayerD1Ev @ 57 NONAME + _ZN12QMediaPlayerD2Ev @ 58 NONAME + _ZN12QSoundEffect11qt_metacallEN11QMetaObject4CallEiPPv @ 59 NONAME + _ZN12QSoundEffect11qt_metacastEPKc @ 60 NONAME + _ZN12QSoundEffect12loopsChangedEv @ 61 NONAME + _ZN12QSoundEffect12mutedChangedEv @ 62 NONAME + _ZN12QSoundEffect13sourceChangedEv @ 63 NONAME + _ZN12QSoundEffect13volumeChangedEv @ 64 NONAME + _ZN12QSoundEffect16staticMetaObjectE @ 65 NONAME DATA 16 + _ZN12QSoundEffect19getStaticMetaObjectEv @ 66 NONAME + _ZN12QSoundEffect4playEv @ 67 NONAME + _ZN12QSoundEffect8setLoopsEi @ 68 NONAME + _ZN12QSoundEffect8setMutedEb @ 69 NONAME + _ZN12QSoundEffect9setSourceERK4QUrl @ 70 NONAME + _ZN12QSoundEffect9setVolumeEi @ 71 NONAME + _ZN12QSoundEffectC1EP7QObject @ 72 NONAME + _ZN12QSoundEffectC2EP7QObject @ 73 NONAME + _ZN12QSoundEffectD0Ev @ 74 NONAME + _ZN12QSoundEffectD1Ev @ 75 NONAME + _ZN12QSoundEffectD2Ev @ 76 NONAME + _ZN12QVideoWidget10hueChangedEi @ 77 NONAME + _ZN12QVideoWidget10paintEventEP11QPaintEvent @ 78 NONAME + _ZN12QVideoWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 79 NONAME + _ZN12QVideoWidget11qt_metacastEPKc @ 80 NONAME + _ZN12QVideoWidget11resizeEventEP12QResizeEvent @ 81 NONAME + _ZN12QVideoWidget11setContrastEi @ 82 NONAME + _ZN12QVideoWidget13setBrightnessEi @ 83 NONAME + _ZN12QVideoWidget13setFullScreenEb @ 84 NONAME + _ZN12QVideoWidget13setSaturationEi @ 85 NONAME + _ZN12QVideoWidget14setMediaObjectEP12QMediaObject @ 86 NONAME + _ZN12QVideoWidget15contrastChangedEi @ 87 NONAME + _ZN12QVideoWidget16staticMetaObjectE @ 88 NONAME DATA 16 + _ZN12QVideoWidget17brightnessChangedEi @ 89 NONAME + _ZN12QVideoWidget17fullScreenChangedEb @ 90 NONAME + _ZN12QVideoWidget17saturationChangedEi @ 91 NONAME + _ZN12QVideoWidget18setAspectRatioModeEN2Qt15AspectRatioModeE @ 92 NONAME + _ZN12QVideoWidget19getStaticMetaObjectEv @ 93 NONAME + _ZN12QVideoWidget5eventEP6QEvent @ 94 NONAME + _ZN12QVideoWidget6setHueEi @ 95 NONAME + _ZN12QVideoWidget9hideEventEP10QHideEvent @ 96 NONAME + _ZN12QVideoWidget9moveEventEP10QMoveEvent @ 97 NONAME + _ZN12QVideoWidget9showEventEP10QShowEvent @ 98 NONAME + _ZN12QVideoWidgetC1EP7QWidget @ 99 NONAME + _ZN12QVideoWidgetC2EP7QWidget @ 100 NONAME + _ZN12QVideoWidgetD0Ev @ 101 NONAME + _ZN12QVideoWidgetD1Ev @ 102 NONAME + _ZN12QVideoWidgetD2Ev @ 103 NONAME + _ZN13QMediaContentC1ERK14QMediaResource @ 104 NONAME + _ZN13QMediaContentC1ERK15QNetworkRequest @ 105 NONAME + _ZN13QMediaContentC1ERK4QUrl @ 106 NONAME + _ZN13QMediaContentC1ERK5QListI14QMediaResourceE @ 107 NONAME + _ZN13QMediaContentC1ERKS_ @ 108 NONAME + _ZN13QMediaContentC1Ev @ 109 NONAME + _ZN13QMediaContentC2ERK14QMediaResource @ 110 NONAME + _ZN13QMediaContentC2ERK15QNetworkRequest @ 111 NONAME + _ZN13QMediaContentC2ERK4QUrl @ 112 NONAME + _ZN13QMediaContentC2ERK5QListI14QMediaResourceE @ 113 NONAME + _ZN13QMediaContentC2ERKS_ @ 114 NONAME + _ZN13QMediaContentC2Ev @ 115 NONAME + _ZN13QMediaContentD1Ev @ 116 NONAME + _ZN13QMediaContentD2Ev @ 117 NONAME + _ZN13QMediaContentaSERKS_ @ 118 NONAME + _ZN13QMediaControl11qt_metacallEN11QMetaObject4CallEiPPv @ 119 NONAME + _ZN13QMediaControl11qt_metacastEPKc @ 120 NONAME + _ZN13QMediaControl16staticMetaObjectE @ 121 NONAME DATA 16 + _ZN13QMediaControl19getStaticMetaObjectEv @ 122 NONAME + _ZN13QMediaControlC1EP7QObject @ 123 NONAME + _ZN13QMediaControlC1ER20QMediaControlPrivateP7QObject @ 124 NONAME + _ZN13QMediaControlC2EP7QObject @ 125 NONAME + _ZN13QMediaControlC2ER20QMediaControlPrivateP7QObject @ 126 NONAME + _ZN13QMediaControlD0Ev @ 127 NONAME + _ZN13QMediaControlD1Ev @ 128 NONAME + _ZN13QMediaControlD2Ev @ 129 NONAME + _ZN13QMediaService11qt_metacallEN11QMetaObject4CallEiPPv @ 130 NONAME + _ZN13QMediaService11qt_metacastEPKc @ 131 NONAME + _ZN13QMediaService16staticMetaObjectE @ 132 NONAME DATA 16 + _ZN13QMediaService19getStaticMetaObjectEv @ 133 NONAME + _ZN13QMediaServiceC2EP7QObject @ 134 NONAME + _ZN13QMediaServiceC2ER20QMediaServicePrivateP7QObject @ 135 NONAME + _ZN13QMediaServiceD0Ev @ 136 NONAME + _ZN13QMediaServiceD1Ev @ 137 NONAME + _ZN13QMediaServiceD2Ev @ 138 NONAME + _ZN14QMediaPlaylist10loadFailedEv @ 139 NONAME + _ZN14QMediaPlaylist11insertMediaEiRK13QMediaContent @ 140 NONAME + _ZN14QMediaPlaylist11insertMediaEiRK5QListI13QMediaContentE @ 141 NONAME + _ZN14QMediaPlaylist11qt_metacallEN11QMetaObject4CallEiPPv @ 142 NONAME + _ZN14QMediaPlaylist11qt_metacastEPKc @ 143 NONAME + _ZN14QMediaPlaylist11removeMediaEi @ 144 NONAME + _ZN14QMediaPlaylist11removeMediaEii @ 145 NONAME + _ZN14QMediaPlaylist12mediaChangedEii @ 146 NONAME + _ZN14QMediaPlaylist12mediaRemovedEii @ 147 NONAME + _ZN14QMediaPlaylist13mediaInsertedEii @ 148 NONAME + _ZN14QMediaPlaylist14setMediaObjectEP12QMediaObject @ 149 NONAME + _ZN14QMediaPlaylist15setCurrentIndexEi @ 150 NONAME + _ZN14QMediaPlaylist15setPlaybackModeENS_12PlaybackModeE @ 151 NONAME + _ZN14QMediaPlaylist16staticMetaObjectE @ 152 NONAME DATA 16 + _ZN14QMediaPlaylist19currentIndexChangedEi @ 153 NONAME + _ZN14QMediaPlaylist19currentMediaChangedERK13QMediaContent @ 154 NONAME + _ZN14QMediaPlaylist19getStaticMetaObjectEv @ 155 NONAME + _ZN14QMediaPlaylist19playbackModeChangedENS_12PlaybackModeE @ 156 NONAME + _ZN14QMediaPlaylist21mediaAboutToBeRemovedEii @ 157 NONAME + _ZN14QMediaPlaylist22mediaAboutToBeInsertedEii @ 158 NONAME + _ZN14QMediaPlaylist4loadEP9QIODevicePKc @ 159 NONAME + _ZN14QMediaPlaylist4loadERK4QUrlPKc @ 160 NONAME + _ZN14QMediaPlaylist4nextEv @ 161 NONAME + _ZN14QMediaPlaylist4saveEP9QIODevicePKc @ 162 NONAME + _ZN14QMediaPlaylist4saveERK4QUrlPKc @ 163 NONAME + _ZN14QMediaPlaylist5clearEv @ 164 NONAME + _ZN14QMediaPlaylist6loadedEv @ 165 NONAME + _ZN14QMediaPlaylist7shuffleEv @ 166 NONAME + _ZN14QMediaPlaylist8addMediaERK13QMediaContent @ 167 NONAME + _ZN14QMediaPlaylist8addMediaERK5QListI13QMediaContentE @ 168 NONAME + _ZN14QMediaPlaylist8previousEv @ 169 NONAME + _ZN14QMediaPlaylistC1EP7QObject @ 170 NONAME + _ZN14QMediaPlaylistC2EP7QObject @ 171 NONAME + _ZN14QMediaPlaylistD0Ev @ 172 NONAME + _ZN14QMediaPlaylistD1Ev @ 173 NONAME + _ZN14QMediaPlaylistD2Ev @ 174 NONAME + _ZN14QMediaResource11setDataSizeEx @ 175 NONAME + _ZN14QMediaResource11setLanguageERK7QString @ 176 NONAME + _ZN14QMediaResource13setAudioCodecERK7QString @ 177 NONAME + _ZN14QMediaResource13setResolutionERK5QSize @ 178 NONAME + _ZN14QMediaResource13setResolutionEii @ 179 NONAME + _ZN14QMediaResource13setSampleRateEi @ 180 NONAME + _ZN14QMediaResource13setVideoCodecERK7QString @ 181 NONAME + _ZN14QMediaResource15setAudioBitRateEi @ 182 NONAME + _ZN14QMediaResource15setChannelCountEi @ 183 NONAME + _ZN14QMediaResource15setVideoBitRateEi @ 184 NONAME + _ZN14QMediaResourceC1ERK15QNetworkRequestRK7QString @ 185 NONAME + _ZN14QMediaResourceC1ERK4QUrlRK7QString @ 186 NONAME + _ZN14QMediaResourceC1ERKS_ @ 187 NONAME + _ZN14QMediaResourceC1Ev @ 188 NONAME + _ZN14QMediaResourceC2ERK15QNetworkRequestRK7QString @ 189 NONAME + _ZN14QMediaResourceC2ERK4QUrlRK7QString @ 190 NONAME + _ZN14QMediaResourceC2ERKS_ @ 191 NONAME + _ZN14QMediaResourceC2Ev @ 192 NONAME + _ZN14QMediaResourceD1Ev @ 193 NONAME + _ZN14QMediaResourceD2Ev @ 194 NONAME + _ZN14QMediaResourceaSERKS_ @ 195 NONAME + _ZN15QMediaTimeRange11addIntervalERK18QMediaTimeInterval @ 196 NONAME + _ZN15QMediaTimeRange11addIntervalExx @ 197 NONAME + _ZN15QMediaTimeRange12addTimeRangeERKS_ @ 198 NONAME + _ZN15QMediaTimeRange14removeIntervalERK18QMediaTimeInterval @ 199 NONAME + _ZN15QMediaTimeRange14removeIntervalExx @ 200 NONAME + _ZN15QMediaTimeRange15removeTimeRangeERKS_ @ 201 NONAME + _ZN15QMediaTimeRange5clearEv @ 202 NONAME + _ZN15QMediaTimeRangeC1ERK18QMediaTimeInterval @ 203 NONAME + _ZN15QMediaTimeRangeC1ERKS_ @ 204 NONAME + _ZN15QMediaTimeRangeC1Ev @ 205 NONAME + _ZN15QMediaTimeRangeC1Exx @ 206 NONAME + _ZN15QMediaTimeRangeC2ERK18QMediaTimeInterval @ 207 NONAME + _ZN15QMediaTimeRangeC2ERKS_ @ 208 NONAME + _ZN15QMediaTimeRangeC2Ev @ 209 NONAME + _ZN15QMediaTimeRangeC2Exx @ 210 NONAME + _ZN15QMediaTimeRangeD1Ev @ 211 NONAME + _ZN15QMediaTimeRangeD2Ev @ 212 NONAME + _ZN15QMediaTimeRangeaSERK18QMediaTimeInterval @ 213 NONAME + _ZN15QMediaTimeRangeaSERKS_ @ 214 NONAME + _ZN15QMediaTimeRangemIERK18QMediaTimeInterval @ 215 NONAME + _ZN15QMediaTimeRangemIERKS_ @ 216 NONAME + _ZN15QMediaTimeRangepLERK18QMediaTimeInterval @ 217 NONAME + _ZN15QMediaTimeRangepLERKS_ @ 218 NONAME + _ZN16QMetaDataControl11qt_metacallEN11QMetaObject4CallEiPPv @ 219 NONAME + _ZN16QMetaDataControl11qt_metacastEPKc @ 220 NONAME + _ZN16QMetaDataControl15metaDataChangedEv @ 221 NONAME + _ZN16QMetaDataControl15writableChangedEb @ 222 NONAME + _ZN16QMetaDataControl16staticMetaObjectE @ 223 NONAME DATA 16 + _ZN16QMetaDataControl19getStaticMetaObjectEv @ 224 NONAME + _ZN16QMetaDataControl24metaDataAvailableChangedEb @ 225 NONAME + _ZN16QMetaDataControlC2EP7QObject @ 226 NONAME + _ZN16QMetaDataControlD0Ev @ 227 NONAME + _ZN16QMetaDataControlD1Ev @ 228 NONAME + _ZN16QMetaDataControlD2Ev @ 229 NONAME + _ZN18QGraphicsVideoItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 230 NONAME + _ZN18QGraphicsVideoItem10sceneEventEP6QEvent @ 231 NONAME + _ZN18QGraphicsVideoItem11qt_metacallEN11QMetaObject4CallEiPPv @ 232 NONAME + _ZN18QGraphicsVideoItem11qt_metacastEPKc @ 233 NONAME + _ZN18QGraphicsVideoItem14setMediaObjectEP12QMediaObject @ 234 NONAME + _ZN18QGraphicsVideoItem16staticMetaObjectE @ 235 NONAME DATA 16 + _ZN18QGraphicsVideoItem17nativeSizeChangedERK6QSizeF @ 236 NONAME + _ZN18QGraphicsVideoItem18setAspectRatioModeEN2Qt15AspectRatioModeE @ 237 NONAME + _ZN18QGraphicsVideoItem19getStaticMetaObjectEv @ 238 NONAME + _ZN18QGraphicsVideoItem5eventEP6QEvent @ 239 NONAME + _ZN18QGraphicsVideoItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 240 NONAME + _ZN18QGraphicsVideoItem7setSizeERK6QSizeF @ 241 NONAME + _ZN18QGraphicsVideoItem9setOffsetERK7QPointF @ 242 NONAME + _ZN18QGraphicsVideoItemC1EP13QGraphicsItem @ 243 NONAME + _ZN18QGraphicsVideoItemC2EP13QGraphicsItem @ 244 NONAME + _ZN18QGraphicsVideoItemD0Ev @ 245 NONAME + _ZN18QGraphicsVideoItemD1Ev @ 246 NONAME + _ZN18QGraphicsVideoItemD2Ev @ 247 NONAME + _ZN18QMediaTimeIntervalC1ERKS_ @ 248 NONAME + _ZN18QMediaTimeIntervalC1Ev @ 249 NONAME + _ZN18QMediaTimeIntervalC1Exx @ 250 NONAME + _ZN18QMediaTimeIntervalC2ERKS_ @ 251 NONAME + _ZN18QMediaTimeIntervalC2Ev @ 252 NONAME + _ZN18QMediaTimeIntervalC2Exx @ 253 NONAME + _ZN19QMediaPlayerControl11qt_metacallEN11QMetaObject4CallEiPPv @ 254 NONAME + _ZN19QMediaPlayerControl11qt_metacastEPKc @ 255 NONAME + _ZN19QMediaPlayerControl12mediaChangedERK13QMediaContent @ 256 NONAME + _ZN19QMediaPlayerControl12mutedChangedEb @ 257 NONAME + _ZN19QMediaPlayerControl12stateChangedEN12QMediaPlayer5StateE @ 258 NONAME + _ZN19QMediaPlayerControl13volumeChangedEi @ 259 NONAME + _ZN19QMediaPlayerControl15durationChangedEx @ 260 NONAME + _ZN19QMediaPlayerControl15positionChangedEx @ 261 NONAME + _ZN19QMediaPlayerControl15seekableChangedEb @ 262 NONAME + _ZN19QMediaPlayerControl16staticMetaObjectE @ 263 NONAME DATA 16 + _ZN19QMediaPlayerControl18mediaStatusChangedEN12QMediaPlayer11MediaStatusE @ 264 NONAME + _ZN19QMediaPlayerControl19bufferStatusChangedEi @ 265 NONAME + _ZN19QMediaPlayerControl19getStaticMetaObjectEv @ 266 NONAME + _ZN19QMediaPlayerControl19playbackRateChangedEf @ 267 NONAME + _ZN19QMediaPlayerControl21audioAvailableChangedEb @ 268 NONAME + _ZN19QMediaPlayerControl21videoAvailableChangedEb @ 269 NONAME + _ZN19QMediaPlayerControl30availablePlaybackRangesChangedERK15QMediaTimeRange @ 270 NONAME + _ZN19QMediaPlayerControl5errorEiRK7QString @ 271 NONAME + _ZN19QMediaPlayerControlC2EP7QObject @ 272 NONAME + _ZN19QMediaPlayerControlD0Ev @ 273 NONAME + _ZN19QMediaPlayerControlD1Ev @ 274 NONAME + _ZN19QMediaPlayerControlD2Ev @ 275 NONAME + _ZN19QVideoDeviceControl11qt_metacallEN11QMetaObject4CallEiPPv @ 276 NONAME + _ZN19QVideoDeviceControl11qt_metacastEPKc @ 277 NONAME + _ZN19QVideoDeviceControl14devicesChangedEv @ 278 NONAME + _ZN19QVideoDeviceControl16staticMetaObjectE @ 279 NONAME DATA 16 + _ZN19QVideoDeviceControl19getStaticMetaObjectEv @ 280 NONAME + _ZN19QVideoDeviceControl21selectedDeviceChangedERK7QString @ 281 NONAME + _ZN19QVideoDeviceControl21selectedDeviceChangedEi @ 282 NONAME + _ZN19QVideoDeviceControlC2EP7QObject @ 283 NONAME + _ZN19QVideoDeviceControlD0Ev @ 284 NONAME + _ZN19QVideoDeviceControlD1Ev @ 285 NONAME + _ZN19QVideoDeviceControlD2Ev @ 286 NONAME + _ZN19QVideoOutputControl11qt_metacallEN11QMetaObject4CallEiPPv @ 287 NONAME + _ZN19QVideoOutputControl11qt_metacastEPKc @ 288 NONAME + _ZN19QVideoOutputControl16staticMetaObjectE @ 289 NONAME DATA 16 + _ZN19QVideoOutputControl19getStaticMetaObjectEv @ 290 NONAME + _ZN19QVideoOutputControl23availableOutputsChangedERK5QListINS_6OutputEE @ 291 NONAME + _ZN19QVideoOutputControlC2EP7QObject @ 292 NONAME + _ZN19QVideoOutputControlD0Ev @ 293 NONAME + _ZN19QVideoOutputControlD1Ev @ 294 NONAME + _ZN19QVideoOutputControlD2Ev @ 295 NONAME + _ZN19QVideoWidgetControl10hueChangedEi @ 296 NONAME + _ZN19QVideoWidgetControl11qt_metacallEN11QMetaObject4CallEiPPv @ 297 NONAME + _ZN19QVideoWidgetControl11qt_metacastEPKc @ 298 NONAME + _ZN19QVideoWidgetControl15contrastChangedEi @ 299 NONAME + _ZN19QVideoWidgetControl16staticMetaObjectE @ 300 NONAME DATA 16 + _ZN19QVideoWidgetControl17brightnessChangedEi @ 301 NONAME + _ZN19QVideoWidgetControl17fullScreenChangedEb @ 302 NONAME + _ZN19QVideoWidgetControl17saturationChangedEi @ 303 NONAME + _ZN19QVideoWidgetControl19getStaticMetaObjectEv @ 304 NONAME + _ZN19QVideoWidgetControlC2EP7QObject @ 305 NONAME + _ZN19QVideoWidgetControlD0Ev @ 306 NONAME + _ZN19QVideoWidgetControlD1Ev @ 307 NONAME + _ZN19QVideoWidgetControlD2Ev @ 308 NONAME + _ZN19QVideoWindowControl10hueChangedEi @ 309 NONAME + _ZN19QVideoWindowControl11qt_metacallEN11QMetaObject4CallEiPPv @ 310 NONAME + _ZN19QVideoWindowControl11qt_metacastEPKc @ 311 NONAME + _ZN19QVideoWindowControl15contrastChangedEi @ 312 NONAME + _ZN19QVideoWindowControl16staticMetaObjectE @ 313 NONAME DATA 16 + _ZN19QVideoWindowControl17brightnessChangedEi @ 314 NONAME + _ZN19QVideoWindowControl17fullScreenChangedEb @ 315 NONAME + _ZN19QVideoWindowControl17nativeSizeChangedEv @ 316 NONAME + _ZN19QVideoWindowControl17saturationChangedEi @ 317 NONAME + _ZN19QVideoWindowControl19getStaticMetaObjectEv @ 318 NONAME + _ZN19QVideoWindowControlC2EP7QObject @ 319 NONAME + _ZN19QVideoWindowControlD0Ev @ 320 NONAME + _ZN19QVideoWindowControlD1Ev @ 321 NONAME + _ZN19QVideoWindowControlD2Ev @ 322 NONAME + _ZN20QMediaPlaylistReaderD0Ev @ 323 NONAME + _ZN20QMediaPlaylistReaderD1Ev @ 324 NONAME + _ZN20QMediaPlaylistReaderD2Ev @ 325 NONAME + _ZN20QMediaPlaylistWriterD0Ev @ 326 NONAME + _ZN20QMediaPlaylistWriterD1Ev @ 327 NONAME + _ZN20QMediaPlaylistWriterD2Ev @ 328 NONAME + _ZN20QPainterVideoSurface11qt_metacallEN11QMetaObject4CallEiPPv @ 329 NONAME + _ZN20QPainterVideoSurface11qt_metacastEPKc @ 330 NONAME + _ZN20QPainterVideoSurface11setContrastEi @ 331 NONAME + _ZN20QPainterVideoSurface12frameChangedEv @ 332 NONAME + _ZN20QPainterVideoSurface13createPainterEv @ 333 NONAME + _ZN20QPainterVideoSurface13setBrightnessEi @ 334 NONAME + _ZN20QPainterVideoSurface13setSaturationEi @ 335 NONAME + _ZN20QPainterVideoSurface16staticMetaObjectE @ 336 NONAME DATA 16 + _ZN20QPainterVideoSurface19getStaticMetaObjectEv @ 337 NONAME + _ZN20QPainterVideoSurface4stopEv @ 338 NONAME + _ZN20QPainterVideoSurface5paintEP8QPainterRK6QRectFS4_ @ 339 NONAME + _ZN20QPainterVideoSurface5startERK19QVideoSurfaceFormat @ 340 NONAME + _ZN20QPainterVideoSurface6setHueEi @ 341 NONAME + _ZN20QPainterVideoSurface7presentERK11QVideoFrame @ 342 NONAME + _ZN20QPainterVideoSurface8setReadyEb @ 343 NONAME + _ZN20QPainterVideoSurfaceC1EP7QObject @ 344 NONAME + _ZN20QPainterVideoSurfaceC2EP7QObject @ 345 NONAME + _ZN20QPainterVideoSurfaceD0Ev @ 346 NONAME + _ZN20QPainterVideoSurfaceD1Ev @ 347 NONAME + _ZN20QPainterVideoSurfaceD2Ev @ 348 NONAME + _ZN21QMediaPlaylistControl11qt_metacallEN11QMetaObject4CallEiPPv @ 349 NONAME + _ZN21QMediaPlaylistControl11qt_metacastEPKc @ 350 NONAME + _ZN21QMediaPlaylistControl16staticMetaObjectE @ 351 NONAME DATA 16 + _ZN21QMediaPlaylistControl19currentIndexChangedEi @ 352 NONAME + _ZN21QMediaPlaylistControl19currentMediaChangedERK13QMediaContent @ 353 NONAME + _ZN21QMediaPlaylistControl19getStaticMetaObjectEv @ 354 NONAME + _ZN21QMediaPlaylistControl19playbackModeChangedEN14QMediaPlaylist12PlaybackModeE @ 355 NONAME + _ZN21QMediaPlaylistControl23playlistProviderChangedEv @ 356 NONAME + _ZN21QMediaPlaylistControlC2EP7QObject @ 357 NONAME + _ZN21QMediaPlaylistControlD0Ev @ 358 NONAME + _ZN21QMediaPlaylistControlD1Ev @ 359 NONAME + _ZN21QMediaPlaylistControlD2Ev @ 360 NONAME + _ZN21QMediaServiceProvider11qt_metacallEN11QMetaObject4CallEiPPv @ 361 NONAME + _ZN21QMediaServiceProvider11qt_metacastEPKc @ 362 NONAME + _ZN21QMediaServiceProvider16staticMetaObjectE @ 363 NONAME DATA 16 + _ZN21QMediaServiceProvider17deviceDescriptionERK10QByteArrayS2_ @ 364 NONAME + _ZN21QMediaServiceProvider19getStaticMetaObjectEv @ 365 NONAME + _ZN21QMediaServiceProvider22defaultServiceProviderEv @ 366 NONAME + _ZN21QVideoRendererControl11qt_metacallEN11QMetaObject4CallEiPPv @ 367 NONAME + _ZN21QVideoRendererControl11qt_metacastEPKc @ 368 NONAME + _ZN21QVideoRendererControl16staticMetaObjectE @ 369 NONAME DATA 16 + _ZN21QVideoRendererControl19getStaticMetaObjectEv @ 370 NONAME + _ZN21QVideoRendererControlC2EP7QObject @ 371 NONAME + _ZN21QVideoRendererControlD0Ev @ 372 NONAME + _ZN21QVideoRendererControlD1Ev @ 373 NONAME + _ZN21QVideoRendererControlD2Ev @ 374 NONAME + _ZN22QMediaPlaylistIOPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 375 NONAME + _ZN22QMediaPlaylistIOPlugin11qt_metacastEPKc @ 376 NONAME + _ZN22QMediaPlaylistIOPlugin16staticMetaObjectE @ 377 NONAME DATA 16 + _ZN22QMediaPlaylistIOPlugin19getStaticMetaObjectEv @ 378 NONAME + _ZN22QMediaPlaylistIOPluginC2EP7QObject @ 379 NONAME + _ZN22QMediaPlaylistIOPluginD0Ev @ 380 NONAME + _ZN22QMediaPlaylistIOPluginD1Ev @ 381 NONAME + _ZN22QMediaPlaylistIOPluginD2Ev @ 382 NONAME + _ZN22QMediaPlaylistProvider10loadFailedEN14QMediaPlaylist5ErrorERK7QString @ 383 NONAME + _ZN22QMediaPlaylistProvider11insertMediaEiRK13QMediaContent @ 384 NONAME + _ZN22QMediaPlaylistProvider11insertMediaEiRK5QListI13QMediaContentE @ 385 NONAME + _ZN22QMediaPlaylistProvider11qt_metacallEN11QMetaObject4CallEiPPv @ 386 NONAME + _ZN22QMediaPlaylistProvider11qt_metacastEPKc @ 387 NONAME + _ZN22QMediaPlaylistProvider11removeMediaEi @ 388 NONAME + _ZN22QMediaPlaylistProvider11removeMediaEii @ 389 NONAME + _ZN22QMediaPlaylistProvider12mediaChangedEii @ 390 NONAME + _ZN22QMediaPlaylistProvider12mediaRemovedEii @ 391 NONAME + _ZN22QMediaPlaylistProvider13mediaInsertedEii @ 392 NONAME + _ZN22QMediaPlaylistProvider16staticMetaObjectE @ 393 NONAME DATA 16 + _ZN22QMediaPlaylistProvider19getStaticMetaObjectEv @ 394 NONAME + _ZN22QMediaPlaylistProvider21mediaAboutToBeRemovedEii @ 395 NONAME + _ZN22QMediaPlaylistProvider22mediaAboutToBeInsertedEii @ 396 NONAME + _ZN22QMediaPlaylistProvider4loadEP9QIODevicePKc @ 397 NONAME + _ZN22QMediaPlaylistProvider4loadERK4QUrlPKc @ 398 NONAME + _ZN22QMediaPlaylistProvider4saveEP9QIODevicePKc @ 399 NONAME + _ZN22QMediaPlaylistProvider4saveERK4QUrlPKc @ 400 NONAME + _ZN22QMediaPlaylistProvider5clearEv @ 401 NONAME + _ZN22QMediaPlaylistProvider6loadedEv @ 402 NONAME + _ZN22QMediaPlaylistProvider7shuffleEv @ 403 NONAME + _ZN22QMediaPlaylistProvider8addMediaERK13QMediaContent @ 404 NONAME + _ZN22QMediaPlaylistProvider8addMediaERK5QListI13QMediaContentE @ 405 NONAME + _ZN22QMediaPlaylistProviderC2EP7QObject @ 406 NONAME + _ZN22QMediaPlaylistProviderC2ER29QMediaPlaylistProviderPrivateP7QObject @ 407 NONAME + _ZN22QMediaPlaylistProviderD0Ev @ 408 NONAME + _ZN22QMediaPlaylistProviderD1Ev @ 409 NONAME + _ZN22QMediaPlaylistProviderD2Ev @ 410 NONAME + _ZN23QMediaPlaylistNavigator11qt_metacallEN11QMetaObject4CallEiPPv @ 411 NONAME + _ZN23QMediaPlaylistNavigator11qt_metacastEPKc @ 412 NONAME + _ZN23QMediaPlaylistNavigator11setPlaylistEP22QMediaPlaylistProvider @ 413 NONAME + _ZN23QMediaPlaylistNavigator15setPlaybackModeEN14QMediaPlaylist12PlaybackModeE @ 414 NONAME + _ZN23QMediaPlaylistNavigator16staticMetaObjectE @ 415 NONAME DATA 16 + _ZN23QMediaPlaylistNavigator19currentIndexChangedEi @ 416 NONAME + _ZN23QMediaPlaylistNavigator19getStaticMetaObjectEv @ 417 NONAME + _ZN23QMediaPlaylistNavigator19playbackModeChangedEN14QMediaPlaylist12PlaybackModeE @ 418 NONAME + _ZN23QMediaPlaylistNavigator23surroundingItemsChangedEv @ 419 NONAME + _ZN23QMediaPlaylistNavigator4jumpEi @ 420 NONAME + _ZN23QMediaPlaylistNavigator4nextEv @ 421 NONAME + _ZN23QMediaPlaylistNavigator8previousEv @ 422 NONAME + _ZN23QMediaPlaylistNavigator9activatedERK13QMediaContent @ 423 NONAME + _ZN23QMediaPlaylistNavigatorC1EP22QMediaPlaylistProviderP7QObject @ 424 NONAME + _ZN23QMediaPlaylistNavigatorC2EP22QMediaPlaylistProviderP7QObject @ 425 NONAME + _ZN23QMediaPlaylistNavigatorD0Ev @ 426 NONAME + _ZN23QMediaPlaylistNavigatorD1Ev @ 427 NONAME + _ZN23QMediaPlaylistNavigatorD2Ev @ 428 NONAME + _ZN25QMediaServiceProviderHintC1E6QFlagsINS_7FeatureEE @ 429 NONAME + _ZN25QMediaServiceProviderHintC1ERK10QByteArray @ 430 NONAME + _ZN25QMediaServiceProviderHintC1ERK7QStringRK11QStringList @ 431 NONAME + _ZN25QMediaServiceProviderHintC1ERKS_ @ 432 NONAME + _ZN25QMediaServiceProviderHintC1Ev @ 433 NONAME + _ZN25QMediaServiceProviderHintC2E6QFlagsINS_7FeatureEE @ 434 NONAME + _ZN25QMediaServiceProviderHintC2ERK10QByteArray @ 435 NONAME + _ZN25QMediaServiceProviderHintC2ERK7QStringRK11QStringList @ 436 NONAME + _ZN25QMediaServiceProviderHintC2ERKS_ @ 437 NONAME + _ZN25QMediaServiceProviderHintC2Ev @ 438 NONAME + _ZN25QMediaServiceProviderHintD1Ev @ 439 NONAME + _ZN25QMediaServiceProviderHintD2Ev @ 440 NONAME + _ZN25QMediaServiceProviderHintaSERKS_ @ 441 NONAME + _ZN27QLocalMediaPlaylistProvider11insertMediaEiRK13QMediaContent @ 442 NONAME + _ZN27QLocalMediaPlaylistProvider11insertMediaEiRK5QListI13QMediaContentE @ 443 NONAME + _ZN27QLocalMediaPlaylistProvider11qt_metacallEN11QMetaObject4CallEiPPv @ 444 NONAME + _ZN27QLocalMediaPlaylistProvider11qt_metacastEPKc @ 445 NONAME + _ZN27QLocalMediaPlaylistProvider11removeMediaEi @ 446 NONAME + _ZN27QLocalMediaPlaylistProvider11removeMediaEii @ 447 NONAME + _ZN27QLocalMediaPlaylistProvider16staticMetaObjectE @ 448 NONAME DATA 16 + _ZN27QLocalMediaPlaylistProvider19getStaticMetaObjectEv @ 449 NONAME + _ZN27QLocalMediaPlaylistProvider5clearEv @ 450 NONAME + _ZN27QLocalMediaPlaylistProvider7shuffleEv @ 451 NONAME + _ZN27QLocalMediaPlaylistProvider8addMediaERK13QMediaContent @ 452 NONAME + _ZN27QLocalMediaPlaylistProvider8addMediaERK5QListI13QMediaContentE @ 453 NONAME + _ZN27QLocalMediaPlaylistProviderC1EP7QObject @ 454 NONAME + _ZN27QLocalMediaPlaylistProviderC2EP7QObject @ 455 NONAME + _ZN27QLocalMediaPlaylistProviderD0Ev @ 456 NONAME + _ZN27QLocalMediaPlaylistProviderD1Ev @ 457 NONAME + _ZN27QLocalMediaPlaylistProviderD2Ev @ 458 NONAME + _ZN27QMediaServiceProviderPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 459 NONAME + _ZN27QMediaServiceProviderPlugin11qt_metacastEPKc @ 460 NONAME + _ZN27QMediaServiceProviderPlugin16staticMetaObjectE @ 461 NONAME DATA 16 + _ZN27QMediaServiceProviderPlugin19getStaticMetaObjectEv @ 462 NONAME + _ZNK12QMediaObject10metaObjectEv @ 463 NONAME + _ZNK12QMediaObject11isAvailableEv @ 464 NONAME + _ZNK12QMediaObject14notifyIntervalEv @ 465 NONAME + _ZNK12QMediaObject16extendedMetaDataERK7QString @ 466 NONAME + _ZNK12QMediaObject17availabilityErrorEv @ 467 NONAME + _ZNK12QMediaObject17availableMetaDataEv @ 468 NONAME + _ZNK12QMediaObject18isMetaDataWritableEv @ 469 NONAME + _ZNK12QMediaObject19isMetaDataAvailableEv @ 470 NONAME + _ZNK12QMediaObject25availableExtendedMetaDataEv @ 471 NONAME + _ZNK12QMediaObject7serviceEv @ 472 NONAME + _ZNK12QMediaObject8metaDataEN15QtMediaServices8MetaDataE @ 473 NONAME + _ZNK12QMediaPlayer10isSeekableEv @ 474 NONAME + _ZNK12QMediaPlayer10metaObjectEv @ 475 NONAME + _ZNK12QMediaPlayer11errorStringEv @ 476 NONAME + _ZNK12QMediaPlayer11mediaStatusEv @ 477 NONAME + _ZNK12QMediaPlayer11mediaStreamEv @ 478 NONAME + _ZNK12QMediaPlayer12bufferStatusEv @ 479 NONAME + _ZNK12QMediaPlayer12playbackRateEv @ 480 NONAME + _ZNK12QMediaPlayer16isAudioAvailableEv @ 481 NONAME + _ZNK12QMediaPlayer16isVideoAvailableEv @ 482 NONAME + _ZNK12QMediaPlayer5errorEv @ 483 NONAME + _ZNK12QMediaPlayer5mediaEv @ 484 NONAME + _ZNK12QMediaPlayer5stateEv @ 485 NONAME + _ZNK12QMediaPlayer6volumeEv @ 486 NONAME + _ZNK12QMediaPlayer7isMutedEv @ 487 NONAME + _ZNK12QMediaPlayer8durationEv @ 488 NONAME + _ZNK12QMediaPlayer8positionEv @ 489 NONAME + _ZNK12QSoundEffect10metaObjectEv @ 490 NONAME + _ZNK12QSoundEffect5loopsEv @ 491 NONAME + _ZNK12QSoundEffect6sourceEv @ 492 NONAME + _ZNK12QSoundEffect6volumeEv @ 493 NONAME + _ZNK12QSoundEffect7isMutedEv @ 494 NONAME + _ZNK12QVideoWidget10brightnessEv @ 495 NONAME + _ZNK12QVideoWidget10metaObjectEv @ 496 NONAME + _ZNK12QVideoWidget10saturationEv @ 497 NONAME + _ZNK12QVideoWidget11mediaObjectEv @ 498 NONAME + _ZNK12QVideoWidget15aspectRatioModeEv @ 499 NONAME + _ZNK12QVideoWidget3hueEv @ 500 NONAME + _ZNK12QVideoWidget8contrastEv @ 501 NONAME + _ZNK12QVideoWidget8sizeHintEv @ 502 NONAME + _ZNK13QMediaContent12canonicalUrlEv @ 503 NONAME + _ZNK13QMediaContent16canonicalRequestEv @ 504 NONAME + _ZNK13QMediaContent17canonicalResourceEv @ 505 NONAME + _ZNK13QMediaContent6isNullEv @ 506 NONAME + _ZNK13QMediaContent9resourcesEv @ 507 NONAME + _ZNK13QMediaContenteqERKS_ @ 508 NONAME + _ZNK13QMediaContentneERKS_ @ 509 NONAME + _ZNK13QMediaControl10metaObjectEv @ 510 NONAME + _ZNK13QMediaService10metaObjectEv @ 511 NONAME + _ZNK14QMediaPlaylist10isReadOnlyEv @ 512 NONAME + _ZNK14QMediaPlaylist10mediaCountEv @ 513 NONAME + _ZNK14QMediaPlaylist10metaObjectEv @ 514 NONAME + _ZNK14QMediaPlaylist11errorStringEv @ 515 NONAME + _ZNK14QMediaPlaylist11mediaObjectEv @ 516 NONAME + _ZNK14QMediaPlaylist12currentIndexEv @ 517 NONAME + _ZNK14QMediaPlaylist12currentMediaEv @ 518 NONAME + _ZNK14QMediaPlaylist12playbackModeEv @ 519 NONAME + _ZNK14QMediaPlaylist13previousIndexEi @ 520 NONAME + _ZNK14QMediaPlaylist5errorEv @ 521 NONAME + _ZNK14QMediaPlaylist5mediaEi @ 522 NONAME + _ZNK14QMediaPlaylist7isEmptyEv @ 523 NONAME + _ZNK14QMediaPlaylist9nextIndexEi @ 524 NONAME + _ZNK14QMediaResource10audioCodecEv @ 525 NONAME + _ZNK14QMediaResource10resolutionEv @ 526 NONAME + _ZNK14QMediaResource10sampleRateEv @ 527 NONAME + _ZNK14QMediaResource10videoCodecEv @ 528 NONAME + _ZNK14QMediaResource12audioBitRateEv @ 529 NONAME + _ZNK14QMediaResource12channelCountEv @ 530 NONAME + _ZNK14QMediaResource12videoBitRateEv @ 531 NONAME + _ZNK14QMediaResource3urlEv @ 532 NONAME + _ZNK14QMediaResource6isNullEv @ 533 NONAME + _ZNK14QMediaResource7requestEv @ 534 NONAME + _ZNK14QMediaResource8dataSizeEv @ 535 NONAME + _ZNK14QMediaResource8languageEv @ 536 NONAME + _ZNK14QMediaResource8mimeTypeEv @ 537 NONAME + _ZNK14QMediaResourceeqERKS_ @ 538 NONAME + _ZNK14QMediaResourceneERKS_ @ 539 NONAME + _ZNK15QMediaTimeRange10latestTimeEv @ 540 NONAME + _ZNK15QMediaTimeRange12earliestTimeEv @ 541 NONAME + _ZNK15QMediaTimeRange12isContinuousEv @ 542 NONAME + _ZNK15QMediaTimeRange7isEmptyEv @ 543 NONAME + _ZNK15QMediaTimeRange8containsEx @ 544 NONAME + _ZNK15QMediaTimeRange9intervalsEv @ 545 NONAME + _ZNK16QMetaDataControl10metaObjectEv @ 546 NONAME + _ZNK18QGraphicsVideoItem10metaObjectEv @ 547 NONAME + _ZNK18QGraphicsVideoItem10nativeSizeEv @ 548 NONAME + _ZNK18QGraphicsVideoItem11mediaObjectEv @ 549 NONAME + _ZNK18QGraphicsVideoItem12boundingRectEv @ 550 NONAME + _ZNK18QGraphicsVideoItem15aspectRatioModeEv @ 551 NONAME + _ZNK18QGraphicsVideoItem4sizeEv @ 552 NONAME + _ZNK18QGraphicsVideoItem6offsetEv @ 553 NONAME + _ZNK18QMediaTimeInterval10normalizedEv @ 554 NONAME + _ZNK18QMediaTimeInterval10translatedEx @ 555 NONAME + _ZNK18QMediaTimeInterval3endEv @ 556 NONAME + _ZNK18QMediaTimeInterval5startEv @ 557 NONAME + _ZNK18QMediaTimeInterval8containsEx @ 558 NONAME + _ZNK18QMediaTimeInterval8isNormalEv @ 559 NONAME + _ZNK19QMediaPlayerControl10metaObjectEv @ 560 NONAME + _ZNK19QVideoDeviceControl10metaObjectEv @ 561 NONAME + _ZNK19QVideoOutputControl10metaObjectEv @ 562 NONAME + _ZNK19QVideoWidgetControl10metaObjectEv @ 563 NONAME + _ZNK19QVideoWindowControl10metaObjectEv @ 564 NONAME + _ZNK20QPainterVideoSurface10brightnessEv @ 565 NONAME + _ZNK20QPainterVideoSurface10metaObjectEv @ 566 NONAME + _ZNK20QPainterVideoSurface10saturationEv @ 567 NONAME + _ZNK20QPainterVideoSurface17isFormatSupportedERK19QVideoSurfaceFormatPS0_ @ 568 NONAME + _ZNK20QPainterVideoSurface21supportedPixelFormatsEN20QAbstractVideoBuffer10HandleTypeE @ 569 NONAME + _ZNK20QPainterVideoSurface3hueEv @ 570 NONAME + _ZNK20QPainterVideoSurface7isReadyEv @ 571 NONAME + _ZNK20QPainterVideoSurface8contrastEv @ 572 NONAME + _ZNK21QMediaPlaylistControl10metaObjectEv @ 573 NONAME + _ZNK21QMediaServiceProvider10hasSupportERK10QByteArrayRK7QStringRK11QStringListi @ 574 NONAME + _ZNK21QMediaServiceProvider10metaObjectEv @ 575 NONAME + _ZNK21QMediaServiceProvider18supportedMimeTypesERK10QByteArrayi @ 576 NONAME + _ZNK21QMediaServiceProvider7devicesERK10QByteArray @ 577 NONAME + _ZNK21QVideoRendererControl10metaObjectEv @ 578 NONAME + _ZNK22QMediaPlaylistIOPlugin10metaObjectEv @ 579 NONAME + _ZNK22QMediaPlaylistProvider10isReadOnlyEv @ 580 NONAME + _ZNK22QMediaPlaylistProvider10metaObjectEv @ 581 NONAME + _ZNK23QMediaPlaylistNavigator10metaObjectEv @ 582 NONAME + _ZNK23QMediaPlaylistNavigator11currentItemEv @ 583 NONAME + _ZNK23QMediaPlaylistNavigator12currentIndexEv @ 584 NONAME + _ZNK23QMediaPlaylistNavigator12playbackModeEv @ 585 NONAME + _ZNK23QMediaPlaylistNavigator12previousItemEi @ 586 NONAME + _ZNK23QMediaPlaylistNavigator13previousIndexEi @ 587 NONAME + _ZNK23QMediaPlaylistNavigator6itemAtEi @ 588 NONAME + _ZNK23QMediaPlaylistNavigator8nextItemEi @ 589 NONAME + _ZNK23QMediaPlaylistNavigator8playlistEv @ 590 NONAME + _ZNK23QMediaPlaylistNavigator9nextIndexEi @ 591 NONAME + _ZNK25QMediaServiceProviderHint4typeEv @ 592 NONAME + _ZNK25QMediaServiceProviderHint6codecsEv @ 593 NONAME + _ZNK25QMediaServiceProviderHint6deviceEv @ 594 NONAME + _ZNK25QMediaServiceProviderHint6isNullEv @ 595 NONAME + _ZNK25QMediaServiceProviderHint8featuresEv @ 596 NONAME + _ZNK25QMediaServiceProviderHint8mimeTypeEv @ 597 NONAME + _ZNK25QMediaServiceProviderHinteqERKS_ @ 598 NONAME + _ZNK25QMediaServiceProviderHintneERKS_ @ 599 NONAME + _ZNK27QLocalMediaPlaylistProvider10isReadOnlyEv @ 600 NONAME + _ZNK27QLocalMediaPlaylistProvider10mediaCountEv @ 601 NONAME + _ZNK27QLocalMediaPlaylistProvider10metaObjectEv @ 602 NONAME + _ZNK27QLocalMediaPlaylistProvider5mediaEi @ 603 NONAME + _ZNK27QMediaServiceProviderPlugin10metaObjectEv @ 604 NONAME + _ZTI12QMediaObject @ 605 NONAME + _ZTI12QMediaPlayer @ 606 NONAME + _ZTI12QSoundEffect @ 607 NONAME + _ZTI12QVideoWidget @ 608 NONAME + _ZTI13QMediaControl @ 609 NONAME + _ZTI13QMediaService @ 610 NONAME + _ZTI14QMediaPlaylist @ 611 NONAME + _ZTI16QMetaDataControl @ 612 NONAME + _ZTI18QGraphicsVideoItem @ 613 NONAME + _ZTI19QMediaPlayerControl @ 614 NONAME + _ZTI19QVideoDeviceControl @ 615 NONAME + _ZTI19QVideoOutputControl @ 616 NONAME + _ZTI19QVideoWidgetControl @ 617 NONAME + _ZTI19QVideoWindowControl @ 618 NONAME + _ZTI20QMediaPlaylistReader @ 619 NONAME + _ZTI20QMediaPlaylistWriter @ 620 NONAME + _ZTI20QPainterVideoSurface @ 621 NONAME + _ZTI21QMediaPlaylistControl @ 622 NONAME + _ZTI21QMediaServiceProvider @ 623 NONAME + _ZTI21QVideoRendererControl @ 624 NONAME + _ZTI22QMediaPlaylistIOPlugin @ 625 NONAME + _ZTI22QMediaPlaylistProvider @ 626 NONAME + _ZTI23QMediaPlaylistNavigator @ 627 NONAME + _ZTI25QMediaPlaylistIOInterface @ 628 NONAME + _ZTI27QLocalMediaPlaylistProvider @ 629 NONAME + _ZTI27QMediaServiceProviderPlugin @ 630 NONAME + _ZTI37QMediaServiceProviderFactoryInterface @ 631 NONAME + _ZTV12QMediaObject @ 632 NONAME + _ZTV12QMediaPlayer @ 633 NONAME + _ZTV12QSoundEffect @ 634 NONAME + _ZTV12QVideoWidget @ 635 NONAME + _ZTV13QMediaControl @ 636 NONAME + _ZTV13QMediaService @ 637 NONAME + _ZTV14QMediaPlaylist @ 638 NONAME + _ZTV16QMetaDataControl @ 639 NONAME + _ZTV18QGraphicsVideoItem @ 640 NONAME + _ZTV19QMediaPlayerControl @ 641 NONAME + _ZTV19QVideoDeviceControl @ 642 NONAME + _ZTV19QVideoOutputControl @ 643 NONAME + _ZTV19QVideoWidgetControl @ 644 NONAME + _ZTV19QVideoWindowControl @ 645 NONAME + _ZTV20QMediaPlaylistReader @ 646 NONAME + _ZTV20QMediaPlaylistWriter @ 647 NONAME + _ZTV20QPainterVideoSurface @ 648 NONAME + _ZTV21QMediaPlaylistControl @ 649 NONAME + _ZTV21QMediaServiceProvider @ 650 NONAME + _ZTV21QVideoRendererControl @ 651 NONAME + _ZTV22QMediaPlaylistIOPlugin @ 652 NONAME + _ZTV22QMediaPlaylistProvider @ 653 NONAME + _ZTV23QMediaPlaylistNavigator @ 654 NONAME + _ZTV27QLocalMediaPlaylistProvider @ 655 NONAME + _ZTV27QMediaServiceProviderPlugin @ 656 NONAME + _ZThn8_N12QVideoWidgetD0Ev @ 657 NONAME + _ZThn8_N12QVideoWidgetD1Ev @ 658 NONAME + _ZThn8_N18QGraphicsVideoItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 659 NONAME + _ZThn8_N18QGraphicsVideoItem10sceneEventEP6QEvent @ 660 NONAME + _ZThn8_N18QGraphicsVideoItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 661 NONAME + _ZThn8_N18QGraphicsVideoItemD0Ev @ 662 NONAME + _ZThn8_N18QGraphicsVideoItemD1Ev @ 663 NONAME + _ZThn8_N22QMediaPlaylistIOPluginD0Ev @ 664 NONAME + _ZThn8_N22QMediaPlaylistIOPluginD1Ev @ 665 NONAME + _ZThn8_NK18QGraphicsVideoItem12boundingRectEv @ 666 NONAME + _ZeqRK15QMediaTimeRangeS1_ @ 667 NONAME + _ZeqRK18QMediaTimeIntervalS1_ @ 668 NONAME + _ZmiRK15QMediaTimeRangeS1_ @ 669 NONAME + _ZneRK15QMediaTimeRangeS1_ @ 670 NONAME + _ZneRK18QMediaTimeIntervalS1_ @ 671 NONAME + _ZplRK15QMediaTimeRangeS1_ @ 672 NONAME + diff --git a/src/s60installs/eabi/QtMultimediau.def b/src/s60installs/eabi/QtMultimediau.def index 64a6dc6..f332885 100644 --- a/src/s60installs/eabi/QtMultimediau.def +++ b/src/s60installs/eabi/QtMultimediau.def @@ -297,682 +297,8 @@ EXPORTS _ZNK21QAbstractVideoSurface8isActiveEv @ 296 NONAME _ZN12QAudioFormat13setSampleRateEi @ 297 NONAME _ZN12QAudioFormat15setChannelCountEi @ 298 NONAME - _ZN12QMediaObject11qt_metacallEN11QMetaObject4CallEiPPv @ 299 NONAME - _ZN12QMediaObject11qt_metacastEPKc @ 300 NONAME - _ZN12QMediaObject11setMetaDataEN12QtMultimedia8MetaDataERK8QVariant @ 301 NONAME - _ZN12QMediaObject13setupMetaDataEv @ 302 NONAME - _ZN12QMediaObject15metaDataChangedEv @ 303 NONAME - _ZN12QMediaObject16addPropertyWatchERK10QByteArray @ 304 NONAME - _ZN12QMediaObject16staticMetaObjectE @ 305 NONAME DATA 16 - _ZN12QMediaObject17setNotifyIntervalEi @ 306 NONAME - _ZN12QMediaObject19availabilityChangedEb @ 307 NONAME - _ZN12QMediaObject19getStaticMetaObjectEv @ 308 NONAME - _ZN12QMediaObject19removePropertyWatchERK10QByteArray @ 309 NONAME - _ZN12QMediaObject19setExtendedMetaDataERK7QStringRK8QVariant @ 310 NONAME - _ZN12QMediaObject21notifyIntervalChangedEi @ 311 NONAME - _ZN12QMediaObject23metaDataWritableChangedEb @ 312 NONAME - _ZN12QMediaObject24metaDataAvailableChangedEb @ 313 NONAME - _ZN12QMediaObject4bindEP7QObject @ 314 NONAME - _ZN12QMediaObject6unbindEP7QObject @ 315 NONAME - _ZN12QMediaObjectC1EP7QObjectP13QMediaService @ 316 NONAME - _ZN12QMediaObjectC1ER19QMediaObjectPrivateP7QObjectP13QMediaService @ 317 NONAME - _ZN12QMediaObjectC2EP7QObjectP13QMediaService @ 318 NONAME - _ZN12QMediaObjectC2ER19QMediaObjectPrivateP7QObjectP13QMediaService @ 319 NONAME - _ZN12QMediaObjectD0Ev @ 320 NONAME - _ZN12QMediaObjectD1Ev @ 321 NONAME - _ZN12QMediaObjectD2Ev @ 322 NONAME - _ZN12QMediaPlayer10hasSupportERK7QStringRK11QStringList6QFlagsINS_4FlagEE @ 323 NONAME - _ZN12QMediaPlayer11qt_metacallEN11QMetaObject4CallEiPPv @ 324 NONAME - _ZN12QMediaPlayer11qt_metacastEPKc @ 325 NONAME - _ZN12QMediaPlayer11setPositionEx @ 326 NONAME - _ZN12QMediaPlayer12mediaChangedERK13QMediaContent @ 327 NONAME - _ZN12QMediaPlayer12mutedChangedEb @ 328 NONAME - _ZN12QMediaPlayer12stateChangedENS_5StateE @ 329 NONAME - _ZN12QMediaPlayer13volumeChangedEi @ 330 NONAME - _ZN12QMediaPlayer15durationChangedEx @ 331 NONAME - _ZN12QMediaPlayer15positionChangedEx @ 332 NONAME - _ZN12QMediaPlayer15seekableChangedEb @ 333 NONAME - _ZN12QMediaPlayer15setPlaybackRateEf @ 334 NONAME - _ZN12QMediaPlayer16staticMetaObjectE @ 335 NONAME DATA 16 - _ZN12QMediaPlayer18mediaStatusChangedENS_11MediaStatusE @ 336 NONAME - _ZN12QMediaPlayer18supportedMimeTypesE6QFlagsINS_4FlagEE @ 337 NONAME - _ZN12QMediaPlayer19bufferStatusChangedEi @ 338 NONAME - _ZN12QMediaPlayer19getStaticMetaObjectEv @ 339 NONAME - _ZN12QMediaPlayer19playbackRateChangedEf @ 340 NONAME - _ZN12QMediaPlayer21audioAvailableChangedEb @ 341 NONAME - _ZN12QMediaPlayer21videoAvailableChangedEb @ 342 NONAME - _ZN12QMediaPlayer4bindEP7QObject @ 343 NONAME - _ZN12QMediaPlayer4playEv @ 344 NONAME - _ZN12QMediaPlayer4stopEv @ 345 NONAME - _ZN12QMediaPlayer5errorENS_5ErrorE @ 346 NONAME - _ZN12QMediaPlayer5pauseEv @ 347 NONAME - _ZN12QMediaPlayer6unbindEP7QObject @ 348 NONAME - _ZN12QMediaPlayer8setMediaERK13QMediaContentP9QIODevice @ 349 NONAME - _ZN12QMediaPlayer8setMutedEb @ 350 NONAME - _ZN12QMediaPlayer9setVolumeEi @ 351 NONAME - _ZN12QMediaPlayerC1EP7QObject6QFlagsINS_4FlagEEP21QMediaServiceProvider @ 352 NONAME - _ZN12QMediaPlayerC2EP7QObject6QFlagsINS_4FlagEEP21QMediaServiceProvider @ 353 NONAME - _ZN12QMediaPlayerD0Ev @ 354 NONAME - _ZN12QMediaPlayerD1Ev @ 355 NONAME - _ZN12QMediaPlayerD2Ev @ 356 NONAME - _ZN12QVideoWidget10hueChangedEi @ 357 NONAME - _ZN12QVideoWidget10paintEventEP11QPaintEvent @ 358 NONAME - _ZN12QVideoWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 359 NONAME - _ZN12QVideoWidget11qt_metacastEPKc @ 360 NONAME - _ZN12QVideoWidget11resizeEventEP12QResizeEvent @ 361 NONAME - _ZN12QVideoWidget11setContrastEi @ 362 NONAME - _ZN12QVideoWidget13setBrightnessEi @ 363 NONAME - _ZN12QVideoWidget13setFullScreenEb @ 364 NONAME - _ZN12QVideoWidget13setSaturationEi @ 365 NONAME - _ZN12QVideoWidget14setMediaObjectEP12QMediaObject @ 366 NONAME - _ZN12QVideoWidget15contrastChangedEi @ 367 NONAME - _ZN12QVideoWidget16staticMetaObjectE @ 368 NONAME DATA 16 - _ZN12QVideoWidget17brightnessChangedEi @ 369 NONAME - _ZN12QVideoWidget17fullScreenChangedEb @ 370 NONAME - _ZN12QVideoWidget17saturationChangedEi @ 371 NONAME - _ZN12QVideoWidget18setAspectRatioModeENS_15AspectRatioModeE @ 372 NONAME ABSENT - _ZN12QVideoWidget19getStaticMetaObjectEv @ 373 NONAME - _ZN12QVideoWidget5eventEP6QEvent @ 374 NONAME - _ZN12QVideoWidget6setHueEi @ 375 NONAME - _ZN12QVideoWidget9hideEventEP10QHideEvent @ 376 NONAME - _ZN12QVideoWidget9moveEventEP10QMoveEvent @ 377 NONAME - _ZN12QVideoWidget9showEventEP10QShowEvent @ 378 NONAME - _ZN12QVideoWidgetC1EP7QWidget @ 379 NONAME - _ZN12QVideoWidgetC2EP7QWidget @ 380 NONAME - _ZN12QVideoWidgetD0Ev @ 381 NONAME - _ZN12QVideoWidgetD1Ev @ 382 NONAME - _ZN12QVideoWidgetD2Ev @ 383 NONAME - _ZN12QtMultimedia28qRegisterDeclarativeElementsEPKc @ 384 NONAME ABSENT - _ZN13QMediaContentC1ERK14QMediaResource @ 385 NONAME - _ZN13QMediaContentC1ERK15QNetworkRequest @ 386 NONAME - _ZN13QMediaContentC1ERK4QUrl @ 387 NONAME - _ZN13QMediaContentC1ERK5QListI14QMediaResourceE @ 388 NONAME - _ZN13QMediaContentC1ERKS_ @ 389 NONAME - _ZN13QMediaContentC1Ev @ 390 NONAME - _ZN13QMediaContentC2ERK14QMediaResource @ 391 NONAME - _ZN13QMediaContentC2ERK15QNetworkRequest @ 392 NONAME - _ZN13QMediaContentC2ERK4QUrl @ 393 NONAME - _ZN13QMediaContentC2ERK5QListI14QMediaResourceE @ 394 NONAME - _ZN13QMediaContentC2ERKS_ @ 395 NONAME - _ZN13QMediaContentC2Ev @ 396 NONAME - _ZN13QMediaContentD1Ev @ 397 NONAME - _ZN13QMediaContentD2Ev @ 398 NONAME - _ZN13QMediaContentaSERKS_ @ 399 NONAME - _ZN13QMediaControl11qt_metacallEN11QMetaObject4CallEiPPv @ 400 NONAME - _ZN13QMediaControl11qt_metacastEPKc @ 401 NONAME - _ZN13QMediaControl16staticMetaObjectE @ 402 NONAME DATA 16 - _ZN13QMediaControl19getStaticMetaObjectEv @ 403 NONAME - _ZN13QMediaControlC1EP7QObject @ 404 NONAME - _ZN13QMediaControlC1ER20QMediaControlPrivateP7QObject @ 405 NONAME - _ZN13QMediaControlC2EP7QObject @ 406 NONAME - _ZN13QMediaControlC2ER20QMediaControlPrivateP7QObject @ 407 NONAME - _ZN13QMediaControlD0Ev @ 408 NONAME - _ZN13QMediaControlD1Ev @ 409 NONAME - _ZN13QMediaControlD2Ev @ 410 NONAME - _ZN13QMediaService11qt_metacallEN11QMetaObject4CallEiPPv @ 411 NONAME - _ZN13QMediaService11qt_metacastEPKc @ 412 NONAME - _ZN13QMediaService16staticMetaObjectE @ 413 NONAME DATA 16 - _ZN13QMediaService19getStaticMetaObjectEv @ 414 NONAME - _ZN13QMediaServiceC2EP7QObject @ 415 NONAME - _ZN13QMediaServiceC2ER20QMediaServicePrivateP7QObject @ 416 NONAME - _ZN13QMediaServiceD0Ev @ 417 NONAME - _ZN13QMediaServiceD1Ev @ 418 NONAME - _ZN13QMediaServiceD2Ev @ 419 NONAME - _ZN14QMediaPlaylist10loadFailedEv @ 420 NONAME - _ZN14QMediaPlaylist11insertMediaEiRK13QMediaContent @ 421 NONAME - _ZN14QMediaPlaylist11insertMediaEiRK5QListI13QMediaContentE @ 422 NONAME - _ZN14QMediaPlaylist11qt_metacallEN11QMetaObject4CallEiPPv @ 423 NONAME - _ZN14QMediaPlaylist11qt_metacastEPKc @ 424 NONAME - _ZN14QMediaPlaylist11removeMediaEi @ 425 NONAME - _ZN14QMediaPlaylist11removeMediaEii @ 426 NONAME - _ZN14QMediaPlaylist12mediaChangedEii @ 427 NONAME - _ZN14QMediaPlaylist12mediaRemovedEii @ 428 NONAME - _ZN14QMediaPlaylist13mediaInsertedEii @ 429 NONAME - _ZN14QMediaPlaylist14setMediaObjectEP12QMediaObject @ 430 NONAME - _ZN14QMediaPlaylist15setCurrentIndexEi @ 431 NONAME - _ZN14QMediaPlaylist15setPlaybackModeENS_12PlaybackModeE @ 432 NONAME - _ZN14QMediaPlaylist16staticMetaObjectE @ 433 NONAME DATA 16 - _ZN14QMediaPlaylist19currentIndexChangedEi @ 434 NONAME - _ZN14QMediaPlaylist19currentMediaChangedERK13QMediaContent @ 435 NONAME - _ZN14QMediaPlaylist19getStaticMetaObjectEv @ 436 NONAME - _ZN14QMediaPlaylist19playbackModeChangedENS_12PlaybackModeE @ 437 NONAME - _ZN14QMediaPlaylist21mediaAboutToBeRemovedEii @ 438 NONAME - _ZN14QMediaPlaylist22mediaAboutToBeInsertedEii @ 439 NONAME - _ZN14QMediaPlaylist4loadEP9QIODevicePKc @ 440 NONAME - _ZN14QMediaPlaylist4loadERK4QUrlPKc @ 441 NONAME - _ZN14QMediaPlaylist4nextEv @ 442 NONAME - _ZN14QMediaPlaylist4saveEP9QIODevicePKc @ 443 NONAME - _ZN14QMediaPlaylist4saveERK4QUrlPKc @ 444 NONAME - _ZN14QMediaPlaylist5clearEv @ 445 NONAME - _ZN14QMediaPlaylist6loadedEv @ 446 NONAME - _ZN14QMediaPlaylist7shuffleEv @ 447 NONAME - _ZN14QMediaPlaylist8addMediaERK13QMediaContent @ 448 NONAME - _ZN14QMediaPlaylist8addMediaERK5QListI13QMediaContentE @ 449 NONAME - _ZN14QMediaPlaylist8previousEv @ 450 NONAME - _ZN14QMediaPlaylistC1EP7QObject @ 451 NONAME - _ZN14QMediaPlaylistC2EP7QObject @ 452 NONAME - _ZN14QMediaPlaylistD0Ev @ 453 NONAME - _ZN14QMediaPlaylistD1Ev @ 454 NONAME - _ZN14QMediaPlaylistD2Ev @ 455 NONAME - _ZN14QMediaResource11setDataSizeEx @ 456 NONAME - _ZN14QMediaResource11setLanguageERK7QString @ 457 NONAME - _ZN14QMediaResource13setAudioCodecERK7QString @ 458 NONAME - _ZN14QMediaResource13setResolutionERK5QSize @ 459 NONAME - _ZN14QMediaResource13setResolutionEii @ 460 NONAME - _ZN14QMediaResource13setSampleRateEi @ 461 NONAME - _ZN14QMediaResource13setVideoCodecERK7QString @ 462 NONAME - _ZN14QMediaResource15setAudioBitRateEi @ 463 NONAME - _ZN14QMediaResource15setChannelCountEi @ 464 NONAME - _ZN14QMediaResource15setVideoBitRateEi @ 465 NONAME - _ZN14QMediaResourceC1ERK15QNetworkRequestRK7QString @ 466 NONAME - _ZN14QMediaResourceC1ERK4QUrlRK7QString @ 467 NONAME - _ZN14QMediaResourceC1ERKS_ @ 468 NONAME - _ZN14QMediaResourceC1Ev @ 469 NONAME - _ZN14QMediaResourceC2ERK15QNetworkRequestRK7QString @ 470 NONAME - _ZN14QMediaResourceC2ERK4QUrlRK7QString @ 471 NONAME - _ZN14QMediaResourceC2ERKS_ @ 472 NONAME - _ZN14QMediaResourceC2Ev @ 473 NONAME - _ZN14QMediaResourceD1Ev @ 474 NONAME - _ZN14QMediaResourceD2Ev @ 475 NONAME - _ZN14QMediaResourceaSERKS_ @ 476 NONAME - _ZN15QMediaTimeRange11addIntervalERK18QMediaTimeInterval @ 477 NONAME - _ZN15QMediaTimeRange11addIntervalExx @ 478 NONAME - _ZN15QMediaTimeRange12addTimeRangeERKS_ @ 479 NONAME - _ZN15QMediaTimeRange14removeIntervalERK18QMediaTimeInterval @ 480 NONAME - _ZN15QMediaTimeRange14removeIntervalExx @ 481 NONAME - _ZN15QMediaTimeRange15removeTimeRangeERKS_ @ 482 NONAME - _ZN15QMediaTimeRange5clearEv @ 483 NONAME - _ZN15QMediaTimeRangeC1ERK18QMediaTimeInterval @ 484 NONAME - _ZN15QMediaTimeRangeC1ERKS_ @ 485 NONAME - _ZN15QMediaTimeRangeC1Ev @ 486 NONAME - _ZN15QMediaTimeRangeC1Exx @ 487 NONAME - _ZN15QMediaTimeRangeC2ERK18QMediaTimeInterval @ 488 NONAME - _ZN15QMediaTimeRangeC2ERKS_ @ 489 NONAME - _ZN15QMediaTimeRangeC2Ev @ 490 NONAME - _ZN15QMediaTimeRangeC2Exx @ 491 NONAME - _ZN15QMediaTimeRangeD1Ev @ 492 NONAME - _ZN15QMediaTimeRangeD2Ev @ 493 NONAME - _ZN15QMediaTimeRangeaSERK18QMediaTimeInterval @ 494 NONAME - _ZN15QMediaTimeRangeaSERKS_ @ 495 NONAME - _ZN15QMediaTimeRangemIERK18QMediaTimeInterval @ 496 NONAME - _ZN15QMediaTimeRangemIERKS_ @ 497 NONAME - _ZN15QMediaTimeRangepLERK18QMediaTimeInterval @ 498 NONAME - _ZN15QMediaTimeRangepLERKS_ @ 499 NONAME - _ZN16QMetaDataControl11qt_metacallEN11QMetaObject4CallEiPPv @ 500 NONAME - _ZN16QMetaDataControl11qt_metacastEPKc @ 501 NONAME - _ZN16QMetaDataControl15metaDataChangedEv @ 502 NONAME - _ZN16QMetaDataControl15writableChangedEb @ 503 NONAME - _ZN16QMetaDataControl16staticMetaObjectE @ 504 NONAME DATA 16 - _ZN16QMetaDataControl19getStaticMetaObjectEv @ 505 NONAME - _ZN16QMetaDataControl24metaDataAvailableChangedEb @ 506 NONAME - _ZN16QMetaDataControlC2EP7QObject @ 507 NONAME - _ZN16QMetaDataControlD0Ev @ 508 NONAME - _ZN16QMetaDataControlD1Ev @ 509 NONAME - _ZN16QMetaDataControlD2Ev @ 510 NONAME - _ZN18QGraphicsVideoItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 511 NONAME - _ZN18QGraphicsVideoItem11qt_metacallEN11QMetaObject4CallEiPPv @ 512 NONAME - _ZN18QGraphicsVideoItem11qt_metacastEPKc @ 513 NONAME - _ZN18QGraphicsVideoItem14setMediaObjectEP12QMediaObject @ 514 NONAME - _ZN18QGraphicsVideoItem16staticMetaObjectE @ 515 NONAME DATA 16 - _ZN18QGraphicsVideoItem17nativeSizeChangedERK6QSizeF @ 516 NONAME - _ZN18QGraphicsVideoItem18setAspectRatioModeEN2Qt15AspectRatioModeE @ 517 NONAME - _ZN18QGraphicsVideoItem19getStaticMetaObjectEv @ 518 NONAME - _ZN18QGraphicsVideoItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 519 NONAME - _ZN18QGraphicsVideoItem7setSizeERK6QSizeF @ 520 NONAME - _ZN18QGraphicsVideoItem9setOffsetERK7QPointF @ 521 NONAME - _ZN18QGraphicsVideoItemC1EP13QGraphicsItem @ 522 NONAME - _ZN18QGraphicsVideoItemC2EP13QGraphicsItem @ 523 NONAME - _ZN18QGraphicsVideoItemD0Ev @ 524 NONAME - _ZN18QGraphicsVideoItemD1Ev @ 525 NONAME - _ZN18QGraphicsVideoItemD2Ev @ 526 NONAME - _ZN18QMediaTimeIntervalC1ERKS_ @ 527 NONAME - _ZN18QMediaTimeIntervalC1Ev @ 528 NONAME - _ZN18QMediaTimeIntervalC1Exx @ 529 NONAME - _ZN18QMediaTimeIntervalC2ERKS_ @ 530 NONAME - _ZN18QMediaTimeIntervalC2Ev @ 531 NONAME - _ZN18QMediaTimeIntervalC2Exx @ 532 NONAME - _ZN19QMediaPlayerControl11qt_metacallEN11QMetaObject4CallEiPPv @ 533 NONAME - _ZN19QMediaPlayerControl11qt_metacastEPKc @ 534 NONAME - _ZN19QMediaPlayerControl12mediaChangedERK13QMediaContent @ 535 NONAME - _ZN19QMediaPlayerControl12mutedChangedEb @ 536 NONAME - _ZN19QMediaPlayerControl12stateChangedEN12QMediaPlayer5StateE @ 537 NONAME - _ZN19QMediaPlayerControl13volumeChangedEi @ 538 NONAME - _ZN19QMediaPlayerControl15durationChangedEx @ 539 NONAME - _ZN19QMediaPlayerControl15positionChangedEx @ 540 NONAME - _ZN19QMediaPlayerControl15seekableChangedEb @ 541 NONAME - _ZN19QMediaPlayerControl16staticMetaObjectE @ 542 NONAME DATA 16 - _ZN19QMediaPlayerControl18mediaStatusChangedEN12QMediaPlayer11MediaStatusE @ 543 NONAME - _ZN19QMediaPlayerControl19bufferStatusChangedEi @ 544 NONAME - _ZN19QMediaPlayerControl19getStaticMetaObjectEv @ 545 NONAME - _ZN19QMediaPlayerControl19playbackRateChangedEf @ 546 NONAME - _ZN19QMediaPlayerControl21audioAvailableChangedEb @ 547 NONAME - _ZN19QMediaPlayerControl21videoAvailableChangedEb @ 548 NONAME - _ZN19QMediaPlayerControl30availablePlaybackRangesChangedERK15QMediaTimeRange @ 549 NONAME - _ZN19QMediaPlayerControl5errorEiRK7QString @ 550 NONAME - _ZN19QMediaPlayerControlC2EP7QObject @ 551 NONAME - _ZN19QMediaPlayerControlD0Ev @ 552 NONAME - _ZN19QMediaPlayerControlD1Ev @ 553 NONAME - _ZN19QMediaPlayerControlD2Ev @ 554 NONAME - _ZN19QVideoDeviceControl11qt_metacallEN11QMetaObject4CallEiPPv @ 555 NONAME - _ZN19QVideoDeviceControl11qt_metacastEPKc @ 556 NONAME - _ZN19QVideoDeviceControl14devicesChangedEv @ 557 NONAME - _ZN19QVideoDeviceControl16staticMetaObjectE @ 558 NONAME DATA 16 - _ZN19QVideoDeviceControl19getStaticMetaObjectEv @ 559 NONAME - _ZN19QVideoDeviceControl21selectedDeviceChangedERK7QString @ 560 NONAME - _ZN19QVideoDeviceControl21selectedDeviceChangedEi @ 561 NONAME - _ZN19QVideoDeviceControlC2EP7QObject @ 562 NONAME - _ZN19QVideoDeviceControlD0Ev @ 563 NONAME - _ZN19QVideoDeviceControlD1Ev @ 564 NONAME - _ZN19QVideoDeviceControlD2Ev @ 565 NONAME - _ZN19QVideoOutputControl11qt_metacallEN11QMetaObject4CallEiPPv @ 566 NONAME - _ZN19QVideoOutputControl11qt_metacastEPKc @ 567 NONAME - _ZN19QVideoOutputControl16staticMetaObjectE @ 568 NONAME DATA 16 - _ZN19QVideoOutputControl19getStaticMetaObjectEv @ 569 NONAME - _ZN19QVideoOutputControl23availableOutputsChangedERK5QListINS_6OutputEE @ 570 NONAME - _ZN19QVideoOutputControlC2EP7QObject @ 571 NONAME - _ZN19QVideoOutputControlD0Ev @ 572 NONAME - _ZN19QVideoOutputControlD1Ev @ 573 NONAME - _ZN19QVideoOutputControlD2Ev @ 574 NONAME - _ZN19QVideoWidgetControl10hueChangedEi @ 575 NONAME - _ZN19QVideoWidgetControl11qt_metacallEN11QMetaObject4CallEiPPv @ 576 NONAME - _ZN19QVideoWidgetControl11qt_metacastEPKc @ 577 NONAME - _ZN19QVideoWidgetControl15contrastChangedEi @ 578 NONAME - _ZN19QVideoWidgetControl16staticMetaObjectE @ 579 NONAME DATA 16 - _ZN19QVideoWidgetControl17brightnessChangedEi @ 580 NONAME - _ZN19QVideoWidgetControl17fullScreenChangedEb @ 581 NONAME - _ZN19QVideoWidgetControl17saturationChangedEi @ 582 NONAME - _ZN19QVideoWidgetControl19getStaticMetaObjectEv @ 583 NONAME - _ZN19QVideoWidgetControlC2EP7QObject @ 584 NONAME - _ZN19QVideoWidgetControlD0Ev @ 585 NONAME - _ZN19QVideoWidgetControlD1Ev @ 586 NONAME - _ZN19QVideoWidgetControlD2Ev @ 587 NONAME - _ZN19QVideoWindowControl10hueChangedEi @ 588 NONAME - _ZN19QVideoWindowControl11qt_metacallEN11QMetaObject4CallEiPPv @ 589 NONAME - _ZN19QVideoWindowControl11qt_metacastEPKc @ 590 NONAME - _ZN19QVideoWindowControl15contrastChangedEi @ 591 NONAME - _ZN19QVideoWindowControl16staticMetaObjectE @ 592 NONAME DATA 16 - _ZN19QVideoWindowControl17brightnessChangedEi @ 593 NONAME - _ZN19QVideoWindowControl17fullScreenChangedEb @ 594 NONAME - _ZN19QVideoWindowControl17nativeSizeChangedEv @ 595 NONAME - _ZN19QVideoWindowControl17saturationChangedEi @ 596 NONAME - _ZN19QVideoWindowControl19getStaticMetaObjectEv @ 597 NONAME - _ZN19QVideoWindowControlC2EP7QObject @ 598 NONAME - _ZN19QVideoWindowControlD0Ev @ 599 NONAME - _ZN19QVideoWindowControlD1Ev @ 600 NONAME - _ZN19QVideoWindowControlD2Ev @ 601 NONAME - _ZN20QMediaPlaylistReaderD0Ev @ 602 NONAME - _ZN20QMediaPlaylistReaderD1Ev @ 603 NONAME - _ZN20QMediaPlaylistReaderD2Ev @ 604 NONAME - _ZN20QMediaPlaylistWriterD0Ev @ 605 NONAME - _ZN20QMediaPlaylistWriterD1Ev @ 606 NONAME - _ZN20QMediaPlaylistWriterD2Ev @ 607 NONAME - _ZN20QPainterVideoSurface11qt_metacallEN11QMetaObject4CallEiPPv @ 608 NONAME - _ZN20QPainterVideoSurface11qt_metacastEPKc @ 609 NONAME - _ZN20QPainterVideoSurface11setContrastEi @ 610 NONAME - _ZN20QPainterVideoSurface12frameChangedEv @ 611 NONAME - _ZN20QPainterVideoSurface13createPainterEv @ 612 NONAME - _ZN20QPainterVideoSurface13setBrightnessEi @ 613 NONAME - _ZN20QPainterVideoSurface13setSaturationEi @ 614 NONAME - _ZN20QPainterVideoSurface16staticMetaObjectE @ 615 NONAME DATA 16 - _ZN20QPainterVideoSurface19getStaticMetaObjectEv @ 616 NONAME - _ZN20QPainterVideoSurface4stopEv @ 617 NONAME - _ZN20QPainterVideoSurface5paintEP8QPainterRK6QRectFS4_ @ 618 NONAME - _ZN20QPainterVideoSurface5startERK19QVideoSurfaceFormat @ 619 NONAME - _ZN20QPainterVideoSurface6setHueEi @ 620 NONAME - _ZN20QPainterVideoSurface7presentERK11QVideoFrame @ 621 NONAME - _ZN20QPainterVideoSurface8setReadyEb @ 622 NONAME - _ZN20QPainterVideoSurfaceC1EP7QObject @ 623 NONAME - _ZN20QPainterVideoSurfaceC2EP7QObject @ 624 NONAME - _ZN20QPainterVideoSurfaceD0Ev @ 625 NONAME - _ZN20QPainterVideoSurfaceD1Ev @ 626 NONAME - _ZN20QPainterVideoSurfaceD2Ev @ 627 NONAME - _ZN21QMediaPlaylistControl11qt_metacallEN11QMetaObject4CallEiPPv @ 628 NONAME - _ZN21QMediaPlaylistControl11qt_metacastEPKc @ 629 NONAME - _ZN21QMediaPlaylistControl16staticMetaObjectE @ 630 NONAME DATA 16 - _ZN21QMediaPlaylistControl19currentIndexChangedEi @ 631 NONAME - _ZN21QMediaPlaylistControl19currentMediaChangedERK13QMediaContent @ 632 NONAME - _ZN21QMediaPlaylistControl19getStaticMetaObjectEv @ 633 NONAME - _ZN21QMediaPlaylistControl19playbackModeChangedEN14QMediaPlaylist12PlaybackModeE @ 634 NONAME - _ZN21QMediaPlaylistControl23playlistProviderChangedEv @ 635 NONAME - _ZN21QMediaPlaylistControlC2EP7QObject @ 636 NONAME - _ZN21QMediaPlaylistControlD0Ev @ 637 NONAME - _ZN21QMediaPlaylistControlD1Ev @ 638 NONAME - _ZN21QMediaPlaylistControlD2Ev @ 639 NONAME - _ZN21QMediaServiceProvider11qt_metacallEN11QMetaObject4CallEiPPv @ 640 NONAME - _ZN21QMediaServiceProvider11qt_metacastEPKc @ 641 NONAME - _ZN21QMediaServiceProvider16staticMetaObjectE @ 642 NONAME DATA 16 - _ZN21QMediaServiceProvider17deviceDescriptionERK10QByteArrayS2_ @ 643 NONAME - _ZN21QMediaServiceProvider19getStaticMetaObjectEv @ 644 NONAME - _ZN21QMediaServiceProvider22defaultServiceProviderEv @ 645 NONAME - _ZN21QVideoRendererControl11qt_metacallEN11QMetaObject4CallEiPPv @ 646 NONAME - _ZN21QVideoRendererControl11qt_metacastEPKc @ 647 NONAME - _ZN21QVideoRendererControl16staticMetaObjectE @ 648 NONAME DATA 16 - _ZN21QVideoRendererControl19getStaticMetaObjectEv @ 649 NONAME - _ZN21QVideoRendererControlC2EP7QObject @ 650 NONAME - _ZN21QVideoRendererControlD0Ev @ 651 NONAME - _ZN21QVideoRendererControlD1Ev @ 652 NONAME - _ZN21QVideoRendererControlD2Ev @ 653 NONAME - _ZN22QMediaPlaylistIOPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 654 NONAME - _ZN22QMediaPlaylistIOPlugin11qt_metacastEPKc @ 655 NONAME - _ZN22QMediaPlaylistIOPlugin16staticMetaObjectE @ 656 NONAME DATA 16 - _ZN22QMediaPlaylistIOPlugin19getStaticMetaObjectEv @ 657 NONAME - _ZN22QMediaPlaylistIOPluginC2EP7QObject @ 658 NONAME - _ZN22QMediaPlaylistIOPluginD0Ev @ 659 NONAME - _ZN22QMediaPlaylistIOPluginD1Ev @ 660 NONAME - _ZN22QMediaPlaylistIOPluginD2Ev @ 661 NONAME - _ZN22QMediaPlaylistProvider10loadFailedEN14QMediaPlaylist5ErrorERK7QString @ 662 NONAME - _ZN22QMediaPlaylistProvider11insertMediaEiRK13QMediaContent @ 663 NONAME - _ZN22QMediaPlaylistProvider11insertMediaEiRK5QListI13QMediaContentE @ 664 NONAME - _ZN22QMediaPlaylistProvider11qt_metacallEN11QMetaObject4CallEiPPv @ 665 NONAME - _ZN22QMediaPlaylistProvider11qt_metacastEPKc @ 666 NONAME - _ZN22QMediaPlaylistProvider11removeMediaEi @ 667 NONAME - _ZN22QMediaPlaylistProvider11removeMediaEii @ 668 NONAME - _ZN22QMediaPlaylistProvider12mediaChangedEii @ 669 NONAME - _ZN22QMediaPlaylistProvider12mediaRemovedEii @ 670 NONAME - _ZN22QMediaPlaylistProvider13mediaInsertedEii @ 671 NONAME - _ZN22QMediaPlaylistProvider16staticMetaObjectE @ 672 NONAME DATA 16 - _ZN22QMediaPlaylistProvider19getStaticMetaObjectEv @ 673 NONAME - _ZN22QMediaPlaylistProvider21mediaAboutToBeRemovedEii @ 674 NONAME - _ZN22QMediaPlaylistProvider22mediaAboutToBeInsertedEii @ 675 NONAME - _ZN22QMediaPlaylistProvider4loadEP9QIODevicePKc @ 676 NONAME - _ZN22QMediaPlaylistProvider4loadERK4QUrlPKc @ 677 NONAME - _ZN22QMediaPlaylistProvider4saveEP9QIODevicePKc @ 678 NONAME - _ZN22QMediaPlaylistProvider4saveERK4QUrlPKc @ 679 NONAME - _ZN22QMediaPlaylistProvider5clearEv @ 680 NONAME - _ZN22QMediaPlaylistProvider6loadedEv @ 681 NONAME - _ZN22QMediaPlaylistProvider7shuffleEv @ 682 NONAME - _ZN22QMediaPlaylistProvider8addMediaERK13QMediaContent @ 683 NONAME - _ZN22QMediaPlaylistProvider8addMediaERK5QListI13QMediaContentE @ 684 NONAME - _ZN22QMediaPlaylistProviderC2EP7QObject @ 685 NONAME - _ZN22QMediaPlaylistProviderC2ER29QMediaPlaylistProviderPrivateP7QObject @ 686 NONAME - _ZN22QMediaPlaylistProviderD0Ev @ 687 NONAME - _ZN22QMediaPlaylistProviderD1Ev @ 688 NONAME - _ZN22QMediaPlaylistProviderD2Ev @ 689 NONAME - _ZN23QMediaPlaylistNavigator11qt_metacallEN11QMetaObject4CallEiPPv @ 690 NONAME - _ZN23QMediaPlaylistNavigator11qt_metacastEPKc @ 691 NONAME - _ZN23QMediaPlaylistNavigator11setPlaylistEP22QMediaPlaylistProvider @ 692 NONAME - _ZN23QMediaPlaylistNavigator15setPlaybackModeEN14QMediaPlaylist12PlaybackModeE @ 693 NONAME - _ZN23QMediaPlaylistNavigator16staticMetaObjectE @ 694 NONAME DATA 16 - _ZN23QMediaPlaylistNavigator19currentIndexChangedEi @ 695 NONAME - _ZN23QMediaPlaylistNavigator19getStaticMetaObjectEv @ 696 NONAME - _ZN23QMediaPlaylistNavigator19playbackModeChangedEN14QMediaPlaylist12PlaybackModeE @ 697 NONAME - _ZN23QMediaPlaylistNavigator23surroundingItemsChangedEv @ 698 NONAME - _ZN23QMediaPlaylistNavigator4jumpEi @ 699 NONAME - _ZN23QMediaPlaylistNavigator4nextEv @ 700 NONAME - _ZN23QMediaPlaylistNavigator8previousEv @ 701 NONAME - _ZN23QMediaPlaylistNavigator9activatedERK13QMediaContent @ 702 NONAME - _ZN23QMediaPlaylistNavigatorC1EP22QMediaPlaylistProviderP7QObject @ 703 NONAME - _ZN23QMediaPlaylistNavigatorC2EP22QMediaPlaylistProviderP7QObject @ 704 NONAME - _ZN23QMediaPlaylistNavigatorD0Ev @ 705 NONAME - _ZN23QMediaPlaylistNavigatorD1Ev @ 706 NONAME - _ZN23QMediaPlaylistNavigatorD2Ev @ 707 NONAME - _ZN25QMediaServiceProviderHintC1E6QFlagsINS_7FeatureEE @ 708 NONAME - _ZN25QMediaServiceProviderHintC1ERK10QByteArray @ 709 NONAME - _ZN25QMediaServiceProviderHintC1ERK7QStringRK11QStringList @ 710 NONAME - _ZN25QMediaServiceProviderHintC1ERKS_ @ 711 NONAME - _ZN25QMediaServiceProviderHintC1Ev @ 712 NONAME - _ZN25QMediaServiceProviderHintC2E6QFlagsINS_7FeatureEE @ 713 NONAME - _ZN25QMediaServiceProviderHintC2ERK10QByteArray @ 714 NONAME - _ZN25QMediaServiceProviderHintC2ERK7QStringRK11QStringList @ 715 NONAME - _ZN25QMediaServiceProviderHintC2ERKS_ @ 716 NONAME - _ZN25QMediaServiceProviderHintC2Ev @ 717 NONAME - _ZN25QMediaServiceProviderHintD1Ev @ 718 NONAME - _ZN25QMediaServiceProviderHintD2Ev @ 719 NONAME - _ZN25QMediaServiceProviderHintaSERKS_ @ 720 NONAME - _ZN27QLocalMediaPlaylistProvider11insertMediaEiRK13QMediaContent @ 721 NONAME - _ZN27QLocalMediaPlaylistProvider11insertMediaEiRK5QListI13QMediaContentE @ 722 NONAME - _ZN27QLocalMediaPlaylistProvider11qt_metacallEN11QMetaObject4CallEiPPv @ 723 NONAME - _ZN27QLocalMediaPlaylistProvider11qt_metacastEPKc @ 724 NONAME - _ZN27QLocalMediaPlaylistProvider11removeMediaEi @ 725 NONAME - _ZN27QLocalMediaPlaylistProvider11removeMediaEii @ 726 NONAME - _ZN27QLocalMediaPlaylistProvider16staticMetaObjectE @ 727 NONAME DATA 16 - _ZN27QLocalMediaPlaylistProvider19getStaticMetaObjectEv @ 728 NONAME - _ZN27QLocalMediaPlaylistProvider5clearEv @ 729 NONAME - _ZN27QLocalMediaPlaylistProvider7shuffleEv @ 730 NONAME - _ZN27QLocalMediaPlaylistProvider8addMediaERK13QMediaContent @ 731 NONAME - _ZN27QLocalMediaPlaylistProvider8addMediaERK5QListI13QMediaContentE @ 732 NONAME - _ZN27QLocalMediaPlaylistProviderC1EP7QObject @ 733 NONAME - _ZN27QLocalMediaPlaylistProviderC2EP7QObject @ 734 NONAME - _ZN27QLocalMediaPlaylistProviderD0Ev @ 735 NONAME - _ZN27QLocalMediaPlaylistProviderD1Ev @ 736 NONAME - _ZN27QLocalMediaPlaylistProviderD2Ev @ 737 NONAME - _ZN27QMediaServiceProviderPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 738 NONAME - _ZN27QMediaServiceProviderPlugin11qt_metacastEPKc @ 739 NONAME - _ZN27QMediaServiceProviderPlugin16staticMetaObjectE @ 740 NONAME DATA 16 - _ZN27QMediaServiceProviderPlugin19getStaticMetaObjectEv @ 741 NONAME - _ZNK12QAudioFormat10sampleRateEv @ 742 NONAME - _ZNK12QAudioFormat12channelCountEv @ 743 NONAME - _ZNK12QMediaObject10metaObjectEv @ 744 NONAME - _ZNK12QMediaObject11isAvailableEv @ 745 NONAME - _ZNK12QMediaObject14notifyIntervalEv @ 746 NONAME - _ZNK12QMediaObject16extendedMetaDataERK7QString @ 747 NONAME - _ZNK12QMediaObject17availabilityErrorEv @ 748 NONAME - _ZNK12QMediaObject17availableMetaDataEv @ 749 NONAME - _ZNK12QMediaObject18isMetaDataWritableEv @ 750 NONAME - _ZNK12QMediaObject19isMetaDataAvailableEv @ 751 NONAME - _ZNK12QMediaObject25availableExtendedMetaDataEv @ 752 NONAME - _ZNK12QMediaObject7serviceEv @ 753 NONAME - _ZNK12QMediaObject8metaDataEN12QtMultimedia8MetaDataE @ 754 NONAME - _ZNK12QMediaPlayer10isSeekableEv @ 755 NONAME - _ZNK12QMediaPlayer10metaObjectEv @ 756 NONAME - _ZNK12QMediaPlayer11errorStringEv @ 757 NONAME - _ZNK12QMediaPlayer11mediaStatusEv @ 758 NONAME - _ZNK12QMediaPlayer11mediaStreamEv @ 759 NONAME - _ZNK12QMediaPlayer12bufferStatusEv @ 760 NONAME - _ZNK12QMediaPlayer12playbackRateEv @ 761 NONAME - _ZNK12QMediaPlayer16isAudioAvailableEv @ 762 NONAME - _ZNK12QMediaPlayer16isVideoAvailableEv @ 763 NONAME - _ZNK12QMediaPlayer5errorEv @ 764 NONAME - _ZNK12QMediaPlayer5mediaEv @ 765 NONAME - _ZNK12QMediaPlayer5stateEv @ 766 NONAME - _ZNK12QMediaPlayer6volumeEv @ 767 NONAME - _ZNK12QMediaPlayer7isMutedEv @ 768 NONAME - _ZNK12QMediaPlayer8durationEv @ 769 NONAME - _ZNK12QMediaPlayer8positionEv @ 770 NONAME - _ZNK12QVideoWidget10brightnessEv @ 771 NONAME - _ZNK12QVideoWidget10metaObjectEv @ 772 NONAME - _ZNK12QVideoWidget10saturationEv @ 773 NONAME - _ZNK12QVideoWidget11mediaObjectEv @ 774 NONAME - _ZNK12QVideoWidget15aspectRatioModeEv @ 775 NONAME - _ZNK12QVideoWidget3hueEv @ 776 NONAME - _ZNK12QVideoWidget8contrastEv @ 777 NONAME - _ZNK12QVideoWidget8sizeHintEv @ 778 NONAME - _ZNK13QMediaContent12canonicalUrlEv @ 779 NONAME - _ZNK13QMediaContent16canonicalRequestEv @ 780 NONAME - _ZNK13QMediaContent17canonicalResourceEv @ 781 NONAME - _ZNK13QMediaContent6isNullEv @ 782 NONAME - _ZNK13QMediaContent9resourcesEv @ 783 NONAME - _ZNK13QMediaContenteqERKS_ @ 784 NONAME - _ZNK13QMediaContentneERKS_ @ 785 NONAME - _ZNK13QMediaControl10metaObjectEv @ 786 NONAME - _ZNK13QMediaService10metaObjectEv @ 787 NONAME - _ZNK14QMediaPlaylist10isReadOnlyEv @ 788 NONAME - _ZNK14QMediaPlaylist10mediaCountEv @ 789 NONAME - _ZNK14QMediaPlaylist10metaObjectEv @ 790 NONAME - _ZNK14QMediaPlaylist11errorStringEv @ 791 NONAME - _ZNK14QMediaPlaylist11mediaObjectEv @ 792 NONAME - _ZNK14QMediaPlaylist12currentIndexEv @ 793 NONAME - _ZNK14QMediaPlaylist12currentMediaEv @ 794 NONAME - _ZNK14QMediaPlaylist12playbackModeEv @ 795 NONAME - _ZNK14QMediaPlaylist13previousIndexEi @ 796 NONAME - _ZNK14QMediaPlaylist5errorEv @ 797 NONAME - _ZNK14QMediaPlaylist5mediaEi @ 798 NONAME - _ZNK14QMediaPlaylist7isEmptyEv @ 799 NONAME - _ZNK14QMediaPlaylist9nextIndexEi @ 800 NONAME - _ZNK14QMediaResource10audioCodecEv @ 801 NONAME - _ZNK14QMediaResource10resolutionEv @ 802 NONAME - _ZNK14QMediaResource10sampleRateEv @ 803 NONAME - _ZNK14QMediaResource10videoCodecEv @ 804 NONAME - _ZNK14QMediaResource12audioBitRateEv @ 805 NONAME - _ZNK14QMediaResource12channelCountEv @ 806 NONAME - _ZNK14QMediaResource12videoBitRateEv @ 807 NONAME - _ZNK14QMediaResource3urlEv @ 808 NONAME - _ZNK14QMediaResource6isNullEv @ 809 NONAME - _ZNK14QMediaResource7requestEv @ 810 NONAME - _ZNK14QMediaResource8dataSizeEv @ 811 NONAME - _ZNK14QMediaResource8languageEv @ 812 NONAME - _ZNK14QMediaResource8mimeTypeEv @ 813 NONAME - _ZNK14QMediaResourceeqERKS_ @ 814 NONAME - _ZNK14QMediaResourceneERKS_ @ 815 NONAME - _ZNK15QMediaTimeRange10latestTimeEv @ 816 NONAME - _ZNK15QMediaTimeRange12earliestTimeEv @ 817 NONAME - _ZNK15QMediaTimeRange12isContinuousEv @ 818 NONAME - _ZNK15QMediaTimeRange7isEmptyEv @ 819 NONAME - _ZNK15QMediaTimeRange8containsEx @ 820 NONAME - _ZNK15QMediaTimeRange9intervalsEv @ 821 NONAME - _ZNK16QAudioDeviceInfo20supportedSampleRatesEv @ 822 NONAME - _ZNK16QAudioDeviceInfo22supportedChannelCountsEv @ 823 NONAME - _ZNK16QMetaDataControl10metaObjectEv @ 824 NONAME - _ZNK18QGraphicsVideoItem10metaObjectEv @ 825 NONAME - _ZNK18QGraphicsVideoItem10nativeSizeEv @ 826 NONAME - _ZNK18QGraphicsVideoItem11mediaObjectEv @ 827 NONAME - _ZNK18QGraphicsVideoItem12boundingRectEv @ 828 NONAME - _ZNK18QGraphicsVideoItem15aspectRatioModeEv @ 829 NONAME - _ZNK18QGraphicsVideoItem4sizeEv @ 830 NONAME - _ZNK18QGraphicsVideoItem6offsetEv @ 831 NONAME - _ZNK18QMediaTimeInterval10normalizedEv @ 832 NONAME - _ZNK18QMediaTimeInterval10translatedEx @ 833 NONAME - _ZNK18QMediaTimeInterval3endEv @ 834 NONAME - _ZNK18QMediaTimeInterval5startEv @ 835 NONAME - _ZNK18QMediaTimeInterval8containsEx @ 836 NONAME - _ZNK18QMediaTimeInterval8isNormalEv @ 837 NONAME - _ZNK19QMediaPlayerControl10metaObjectEv @ 838 NONAME - _ZNK19QVideoDeviceControl10metaObjectEv @ 839 NONAME - _ZNK19QVideoOutputControl10metaObjectEv @ 840 NONAME - _ZNK19QVideoWidgetControl10metaObjectEv @ 841 NONAME - _ZNK19QVideoWindowControl10metaObjectEv @ 842 NONAME - _ZNK20QPainterVideoSurface10brightnessEv @ 843 NONAME - _ZNK20QPainterVideoSurface10metaObjectEv @ 844 NONAME - _ZNK20QPainterVideoSurface10saturationEv @ 845 NONAME - _ZNK20QPainterVideoSurface17isFormatSupportedERK19QVideoSurfaceFormatPS0_ @ 846 NONAME - _ZNK20QPainterVideoSurface21supportedPixelFormatsEN20QAbstractVideoBuffer10HandleTypeE @ 847 NONAME - _ZNK20QPainterVideoSurface3hueEv @ 848 NONAME - _ZNK20QPainterVideoSurface7isReadyEv @ 849 NONAME - _ZNK20QPainterVideoSurface8contrastEv @ 850 NONAME - _ZNK21QMediaPlaylistControl10metaObjectEv @ 851 NONAME - _ZNK21QMediaServiceProvider10hasSupportERK10QByteArrayRK7QStringRK11QStringListi @ 852 NONAME - _ZNK21QMediaServiceProvider10metaObjectEv @ 853 NONAME - _ZNK21QMediaServiceProvider18supportedMimeTypesERK10QByteArrayi @ 854 NONAME - _ZNK21QMediaServiceProvider7devicesERK10QByteArray @ 855 NONAME - _ZNK21QVideoRendererControl10metaObjectEv @ 856 NONAME - _ZNK22QMediaPlaylistIOPlugin10metaObjectEv @ 857 NONAME - _ZNK22QMediaPlaylistProvider10isReadOnlyEv @ 858 NONAME - _ZNK22QMediaPlaylistProvider10metaObjectEv @ 859 NONAME - _ZNK23QMediaPlaylistNavigator10metaObjectEv @ 860 NONAME - _ZNK23QMediaPlaylistNavigator11currentItemEv @ 861 NONAME - _ZNK23QMediaPlaylistNavigator12currentIndexEv @ 862 NONAME - _ZNK23QMediaPlaylistNavigator12playbackModeEv @ 863 NONAME - _ZNK23QMediaPlaylistNavigator12previousItemEi @ 864 NONAME - _ZNK23QMediaPlaylistNavigator13previousIndexEi @ 865 NONAME - _ZNK23QMediaPlaylistNavigator6itemAtEi @ 866 NONAME - _ZNK23QMediaPlaylistNavigator8nextItemEi @ 867 NONAME - _ZNK23QMediaPlaylistNavigator8playlistEv @ 868 NONAME - _ZNK23QMediaPlaylistNavigator9nextIndexEi @ 869 NONAME - _ZNK25QMediaServiceProviderHint4typeEv @ 870 NONAME - _ZNK25QMediaServiceProviderHint6codecsEv @ 871 NONAME - _ZNK25QMediaServiceProviderHint6deviceEv @ 872 NONAME - _ZNK25QMediaServiceProviderHint6isNullEv @ 873 NONAME - _ZNK25QMediaServiceProviderHint8featuresEv @ 874 NONAME - _ZNK25QMediaServiceProviderHint8mimeTypeEv @ 875 NONAME - _ZNK25QMediaServiceProviderHinteqERKS_ @ 876 NONAME - _ZNK25QMediaServiceProviderHintneERKS_ @ 877 NONAME - _ZNK27QLocalMediaPlaylistProvider10isReadOnlyEv @ 878 NONAME - _ZNK27QLocalMediaPlaylistProvider10mediaCountEv @ 879 NONAME - _ZNK27QLocalMediaPlaylistProvider10metaObjectEv @ 880 NONAME - _ZNK27QLocalMediaPlaylistProvider5mediaEi @ 881 NONAME - _ZNK27QMediaServiceProviderPlugin10metaObjectEv @ 882 NONAME - _ZTI12QMediaObject @ 883 NONAME - _ZTI12QMediaPlayer @ 884 NONAME - _ZTI12QVideoWidget @ 885 NONAME - _ZTI13QMediaControl @ 886 NONAME - _ZTI13QMediaService @ 887 NONAME - _ZTI14QMediaPlaylist @ 888 NONAME - _ZTI16QMetaDataControl @ 889 NONAME - _ZTI18QGraphicsVideoItem @ 890 NONAME - _ZTI19QMediaPlayerControl @ 891 NONAME - _ZTI19QVideoDeviceControl @ 892 NONAME - _ZTI19QVideoOutputControl @ 893 NONAME - _ZTI19QVideoWidgetControl @ 894 NONAME - _ZTI19QVideoWindowControl @ 895 NONAME - _ZTI20QMediaPlaylistReader @ 896 NONAME - _ZTI20QMediaPlaylistWriter @ 897 NONAME - _ZTI20QPainterVideoSurface @ 898 NONAME - _ZTI21QMediaPlaylistControl @ 899 NONAME - _ZTI21QMediaServiceProvider @ 900 NONAME - _ZTI21QVideoRendererControl @ 901 NONAME - _ZTI22QMediaPlaylistIOPlugin @ 902 NONAME - _ZTI22QMediaPlaylistProvider @ 903 NONAME - _ZTI23QMediaPlaylistNavigator @ 904 NONAME - _ZTI25QMediaPlaylistIOInterface @ 905 NONAME - _ZTI27QLocalMediaPlaylistProvider @ 906 NONAME - _ZTI27QMediaServiceProviderPlugin @ 907 NONAME - _ZTI37QMediaServiceProviderFactoryInterface @ 908 NONAME - _ZTV12QMediaObject @ 909 NONAME - _ZTV12QMediaPlayer @ 910 NONAME - _ZTV12QVideoWidget @ 911 NONAME - _ZTV13QMediaControl @ 912 NONAME - _ZTV13QMediaService @ 913 NONAME - _ZTV14QMediaPlaylist @ 914 NONAME - _ZTV16QMetaDataControl @ 915 NONAME - _ZTV18QGraphicsVideoItem @ 916 NONAME - _ZTV19QMediaPlayerControl @ 917 NONAME - _ZTV19QVideoDeviceControl @ 918 NONAME - _ZTV19QVideoOutputControl @ 919 NONAME - _ZTV19QVideoWidgetControl @ 920 NONAME - _ZTV19QVideoWindowControl @ 921 NONAME - _ZTV20QMediaPlaylistReader @ 922 NONAME - _ZTV20QMediaPlaylistWriter @ 923 NONAME - _ZTV20QPainterVideoSurface @ 924 NONAME - _ZTV21QMediaPlaylistControl @ 925 NONAME - _ZTV21QMediaServiceProvider @ 926 NONAME - _ZTV21QVideoRendererControl @ 927 NONAME - _ZTV22QMediaPlaylistIOPlugin @ 928 NONAME - _ZTV22QMediaPlaylistProvider @ 929 NONAME - _ZTV23QMediaPlaylistNavigator @ 930 NONAME - _ZTV27QLocalMediaPlaylistProvider @ 931 NONAME - _ZTV27QMediaServiceProviderPlugin @ 932 NONAME - _ZThn8_N12QVideoWidgetD0Ev @ 933 NONAME - _ZThn8_N12QVideoWidgetD1Ev @ 934 NONAME - _ZThn8_N18QGraphicsVideoItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 935 NONAME - _ZThn8_N18QGraphicsVideoItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 936 NONAME - _ZThn8_N18QGraphicsVideoItemD0Ev @ 937 NONAME - _ZThn8_N18QGraphicsVideoItemD1Ev @ 938 NONAME - _ZThn8_N22QMediaPlaylistIOPluginD0Ev @ 939 NONAME - _ZThn8_N22QMediaPlaylistIOPluginD1Ev @ 940 NONAME - _ZThn8_NK18QGraphicsVideoItem12boundingRectEv @ 941 NONAME - _ZeqRK15QMediaTimeRangeS1_ @ 942 NONAME - _ZeqRK18QMediaTimeIntervalS1_ @ 943 NONAME - _ZmiRK15QMediaTimeRangeS1_ @ 944 NONAME - _ZneRK15QMediaTimeRangeS1_ @ 945 NONAME - _ZneRK18QMediaTimeIntervalS1_ @ 946 NONAME - _ZplRK15QMediaTimeRangeS1_ @ 947 NONAME - _ZN12QSoundEffect11qt_metacallEN11QMetaObject4CallEiPPv @ 948 NONAME - _ZN12QSoundEffect11qt_metacastEPKc @ 949 NONAME - _ZN12QSoundEffect12loopsChangedEv @ 950 NONAME - _ZN12QSoundEffect12mutedChangedEv @ 951 NONAME - _ZN12QSoundEffect13sourceChangedEv @ 952 NONAME - _ZN12QSoundEffect13volumeChangedEv @ 953 NONAME - _ZN12QSoundEffect16staticMetaObjectE @ 954 NONAME DATA 16 - _ZN12QSoundEffect19getStaticMetaObjectEv @ 955 NONAME - _ZN12QSoundEffect4playEv @ 956 NONAME - _ZN12QSoundEffect8setLoopsEi @ 957 NONAME - _ZN12QSoundEffect8setMutedEb @ 958 NONAME - _ZN12QSoundEffect9setSourceERK4QUrl @ 959 NONAME - _ZN12QSoundEffect9setVolumeEi @ 960 NONAME - _ZN12QSoundEffectC1EP7QObject @ 961 NONAME - _ZN12QSoundEffectC2EP7QObject @ 962 NONAME - _ZN12QSoundEffectD0Ev @ 963 NONAME - _ZN12QSoundEffectD1Ev @ 964 NONAME - _ZN12QSoundEffectD2Ev @ 965 NONAME - _ZN12QVideoWidget18setAspectRatioModeEN2Qt15AspectRatioModeE @ 966 NONAME - _ZNK12QSoundEffect10metaObjectEv @ 967 NONAME - _ZNK12QSoundEffect5loopsEv @ 968 NONAME - _ZNK12QSoundEffect6sourceEv @ 969 NONAME - _ZNK12QSoundEffect6volumeEv @ 970 NONAME - _ZNK12QSoundEffect7isMutedEv @ 971 NONAME - _ZTI12QSoundEffect @ 972 NONAME - _ZTV12QSoundEffect @ 973 NONAME - _ZN18QGraphicsVideoItem10sceneEventEP6QEvent @ 974 NONAME - _ZN18QGraphicsVideoItem5eventEP6QEvent @ 975 NONAME - _ZThn8_N18QGraphicsVideoItem10sceneEventEP6QEvent @ 976 NONAME + _ZNK12QAudioFormat10sampleRateEv @ 299 NONAME + _ZNK12QAudioFormat12channelCountEv @ 300 NONAME + _ZNK16QAudioDeviceInfo20supportedSampleRatesEv @ 301 NONAME + _ZNK16QAudioDeviceInfo22supportedChannelCountsEv @ 302 NONAME diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index dfce7d2..ad196a8 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -153,6 +153,7 @@ symbian: { contains(QT_CONFIG, multimedia) { qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtMultimedia$${QT_LIBINFIX}.dll + qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtMediaServices$${QT_LIBINFIX}.dll } BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)" -- cgit v0.12 From 5efb732bc78e15605ac9d9f770e1bd24c01bb778 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Fri, 16 Apr 2010 16:50:27 +1000 Subject: Update mouse area coordinates automatically when changing position Mouse area coordinates are now updated when the mouse area changes position and positionChanged signals are not emitted on mousePress anymore (only mousePosChanged signals). Task-number: QTBUG-9716 Reviewed-by: Michael Brasser --- .../graphicsitems/qdeclarativeevents_p_p.h | 4 +++ .../graphicsitems/qdeclarativemousearea.cpp | 24 ++++++++++++- .../graphicsitems/qdeclarativemousearea_p.h | 8 +++-- .../graphicsitems/qdeclarativemousearea_p_p.h | 2 ++ .../data/updateMousePosOnResize.qml | 38 ++++++++++++++++++++ .../tst_qdeclarativemousearea.cpp | 41 ++++++++++++++++++++++ 6 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml diff --git a/src/declarative/graphicsitems/qdeclarativeevents_p_p.h b/src/declarative/graphicsitems/qdeclarativeevents_p_p.h index 65ac8de..0e0329e 100644 --- a/src/declarative/graphicsitems/qdeclarativeevents_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeevents_p_p.h @@ -115,6 +115,10 @@ public: bool wasHeld() const { return _wasHeld; } bool isClick() const { return _isClick; } + // only for internal usage + void setX(int x) { _x = x; } + void setY(int y) { _y = y; } + bool isAccepted() { return _accepted; } void setAccepted(bool accepted) { _accepted = accepted; } diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index a6cc75e..52dbc42 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -466,6 +466,9 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) d->moved = true; } QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, d->longPress); + emit mousePosChanged(&me); + me.setX(d->lastPos.x()); + me.setY(d->lastPos.y()); emit positionChanged(&me); } @@ -518,6 +521,9 @@ void QDeclarativeMouseArea::hoverMoveEvent(QGraphicsSceneHoverEvent *event) } else { d->lastPos = event->pos(); QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), Qt::NoButton, d->lastButtons, d->lastModifiers, false, d->longPress); + emit mousePosChanged(&me); + me.setX(d->lastPos.x()); + me.setY(d->lastPos.y()); emit positionChanged(&me); } } @@ -561,6 +567,18 @@ void QDeclarativeMouseArea::timerEvent(QTimerEvent *event) } } +void QDeclarativeMouseArea::geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry) +{ + Q_D(QDeclarativeMouseArea); + QDeclarativeItem::geometryChanged(newGeometry, oldGeometry); + + if (d->lastScenePos.isNull) + d->lastScenePos = mapToScene(d->lastPos); + else if (newGeometry.x() != oldGeometry.x() || newGeometry.y() != oldGeometry.y()) + d->lastPos = mapFromScene(d->lastScenePos); +} + /*! \qmlproperty bool MouseArea::hoverEnabled This property holds whether hover events are handled. @@ -648,9 +666,13 @@ bool QDeclarativeMouseArea::setPressed(bool p) QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, isclick, d->longPress); if (d->pressed) { emit pressed(&me); - emit positionChanged(&me); + me.setX(d->lastPos.x()); + me.setY(d->lastPos.y()); + emit mousePosChanged(&me); } else { emit released(&me); + me.setX(d->lastPos.x()); + me.setY(d->lastPos.y()); if (isclick && !d->longPress) emit clicked(&me); } diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h index 58faac1..cfd5fc7 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h @@ -108,8 +108,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeMouseArea : public QDeclarativeItem { Q_OBJECT - Q_PROPERTY(qreal mouseX READ mouseX NOTIFY positionChanged) - Q_PROPERTY(qreal mouseY READ mouseY NOTIFY positionChanged) + Q_PROPERTY(qreal mouseX READ mouseX NOTIFY mousePosChanged) + Q_PROPERTY(qreal mouseY READ mouseY NOTIFY mousePosChanged) Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged) Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) @@ -144,6 +144,7 @@ Q_SIGNALS: void enabledChanged(); void acceptedButtonsChanged(); void positionChanged(QDeclarativeMouseEvent *mouse); + void mousePosChanged(QDeclarativeMouseEvent *mouse); void pressed(QDeclarativeMouseEvent *mouse); void pressAndHold(QDeclarativeMouseEvent *mouse); @@ -167,6 +168,9 @@ protected: bool sceneEvent(QEvent *); void timerEvent(QTimerEvent *event); + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + private: void handlePress(); void handleRelease(); diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h index 9068c7c..4973957 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h @@ -81,6 +81,7 @@ public: void saveEvent(QGraphicsSceneMouseEvent *event) { lastPos = event->pos(); + lastScenePos = event->scenePos(); lastButton = event->button(); lastButtons = event->buttons(); lastModifiers = event->modifiers(); @@ -105,6 +106,7 @@ public: qreal startX; qreal startY; QPointF lastPos; + QDeclarativeNullableValue lastScenePos; Qt::MouseButton lastButton; Qt::MouseButtons lastButtons; Qt::KeyboardModifiers lastModifiers; diff --git a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml new file mode 100644 index 0000000..138c25a --- /dev/null +++ b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml @@ -0,0 +1,38 @@ +import Qt 4.6 + +Rectangle { + color: "#ffffff" + width: 320; height: 240 + Rectangle { + id: brother + objectName: "brother" + color: "lightgreen" + x: 200; y: 100 + width: 120; height: 120 + } + MouseArea { + id: mouseRegion + objectName: "mouseregion" + + property int x1 + property int y1 + property int x2 + property int y2 + property bool emitPositionChanged: false + property bool mouseMatchesPos: true + + anchors.fill: brother + onPressed: { + if (mouse.x != mouseX || mouse.y != mouseY) + mouseMatchesPos = false + x1 = mouseX; y1 = mouseY + anchors.fill = parent + } + onPositionChanged: { emitPositionChanged = true } + onMousePosChanged: { + if (mouse.x != mouseX || mouse.y != mouseY) + mouseMatchesPos = false + x2 = mouseX; y2 = mouseY + } + } +} diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index bdb8eca..4a58049 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -53,6 +53,7 @@ private slots: void dragProperties(); void resetDrag(); void updateMouseAreaPosOnClick(); + void updateMouseAreaPosOnResize(); void noOnClickedWithPressAndHold(); private: QDeclarativeView *createView(); @@ -203,6 +204,46 @@ void tst_QDeclarativeMouseArea::updateMouseAreaPosOnClick() delete canvas; } +void tst_QDeclarativeMouseArea::updateMouseAreaPosOnResize() +{ + QDeclarativeView *canvas = createView(); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/updateMousePosOnResize.qml")); + canvas->show(); + canvas->setFocus(); + QVERIFY(canvas->rootObject() != 0); + + QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild("mouseregion"); + QVERIFY(mouseRegion != 0); + + QDeclarativeRectangle *rect = canvas->rootObject()->findChild("brother"); + QVERIFY(rect != 0); + + QCOMPARE(mouseRegion->mouseX(), 0.0); + QCOMPARE(mouseRegion->mouseY(), 0.0); + + QGraphicsScene *scene = canvas->scene(); + QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress); + event.setScenePos(rect->pos()); + event.setButton(Qt::LeftButton); + event.setButtons(Qt::LeftButton); + QApplication::sendEvent(scene, &event); + + QVERIFY(!mouseRegion->property("emitPositionChanged").toBool()); + QVERIFY(mouseRegion->property("mouseMatchesPos").toBool()); + + QCOMPARE(mouseRegion->property("x1").toInt(), 0); + QCOMPARE(mouseRegion->property("y1").toInt(), 0); + + // XXX: is it on purpose that mouseX is real and mouse.x is int? + QCOMPARE(mouseRegion->property("x2").toInt(), (int) rect->x()); + QCOMPARE(mouseRegion->property("y2").toInt(), (int) rect->y()); + + QCOMPARE(mouseRegion->mouseX(), rect->x()); + QCOMPARE(mouseRegion->mouseY(), rect->y()); + + delete canvas; +} + void tst_QDeclarativeMouseArea::noOnClickedWithPressAndHold() { QDeclarativeView *canvas = createView(); -- cgit v0.12 From 017cf88ef18cdbf5d302a658c625f605320005f8 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Mon, 19 Apr 2010 10:40:43 +1000 Subject: Fix warning about illegal empty declaration. Q_PRIVATE_SLOT declarations don't require a semi-colon. Reviewed-by: Justin McPherson --- src/multimedia/mediaservices/base/qvideowidget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multimedia/mediaservices/base/qvideowidget.h b/src/multimedia/mediaservices/base/qvideowidget.h index 3722857..a21739a 100644 --- a/src/multimedia/mediaservices/base/qvideowidget.h +++ b/src/multimedia/mediaservices/base/qvideowidget.h @@ -121,7 +121,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_hueChanged(int)) Q_PRIVATE_SLOT(d_func(), void _q_saturationChanged(int)) Q_PRIVATE_SLOT(d_func(), void _q_fullScreenChanged(bool)) - Q_PRIVATE_SLOT(d_func(), void _q_dimensionsChanged()); + Q_PRIVATE_SLOT(d_func(), void _q_dimensionsChanged()) }; QT_END_NAMESPACE -- cgit v0.12 From 5c09309811c13fa360ba5e7b3173039da9c038f6 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Mon, 19 Apr 2010 10:08:35 +1000 Subject: Tests; Fix media tests, make sure they are using mediaservies. Reviewed-by: Dmytro Poplavskiy --- .../qdeclarativeaudio/tst_qdeclarativeaudio.cpp | 28 +++++----- .../qdeclarativevideo/tst_qdeclarativevideo.cpp | 12 ++--- .../qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp | 12 ++--- tests/auto/qmediacontent/tst_qmediacontent.cpp | 2 +- tests/auto/qmediaobject/tst_qmediaobject.cpp | 44 +++++++-------- tests/auto/qmediaplayer/tst_qmediaplayer.cpp | 8 +-- tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp | 10 ++-- .../tst_qmediaplaylistnavigator.cpp | 4 +- .../qmediapluginloader/tst_qmediapluginloader.cpp | 4 +- tests/auto/qmediaresource/tst_qmediaresource.cpp | 2 +- tests/auto/qmediaservice/tst_qmediaservice.cpp | 6 +-- .../tst_qmediaserviceprovider.cpp | 62 +++++++++++----------- tests/auto/qmediatimerange/qmediatimerange.pro | 2 +- tests/auto/qmediatimerange/tst_qmediatimerange.cpp | 2 +- tests/auto/qsoundeffect/qsoundeffect.pro | 2 +- tests/auto/qvideowidget/qvideowidget.pro | 2 +- tests/auto/qvideowidget/tst_qvideowidget.cpp | 18 +++---- 17 files changed, 110 insertions(+), 110 deletions(-) diff --git a/tests/auto/qdeclarativeaudio/tst_qdeclarativeaudio.cpp b/tests/auto/qdeclarativeaudio/tst_qdeclarativeaudio.cpp index af0ed76..e393599 100644 --- a/tests/auto/qdeclarativeaudio/tst_qdeclarativeaudio.cpp +++ b/tests/auto/qdeclarativeaudio/tst_qdeclarativeaudio.cpp @@ -44,9 +44,9 @@ #include "../../../src/imports/multimedia/qdeclarativeaudio_p.h" #include -#include -#include -#include +#include +#include +#include class tst_QDeclarativeAudio : public QObject @@ -77,7 +77,7 @@ private slots: void error(); }; -Q_DECLARE_METATYPE(QtMultimedia::MetaData); +Q_DECLARE_METATYPE(QtMediaServices::MetaData); Q_DECLARE_METATYPE(QDeclarativeAudio::Error); class QtTestMediaPlayerControl : public QMediaPlayerControl @@ -193,20 +193,20 @@ public: bool isWritable() const { return true; } bool isMetaDataAvailable() const { return true; } - QVariant metaData(QtMultimedia::MetaData key) const { return m_metaData.value(key); } - void setMetaData(QtMultimedia::MetaData key, const QVariant &value) { + QVariant metaData(QtMediaServices::MetaData key) const { return m_metaData.value(key); } + void setMetaData(QtMediaServices::MetaData key, const QVariant &value) { m_metaData.insert(key, value); emit metaDataChanged(); } - void setMetaData(const QMap &metaData) { + void setMetaData(const QMap &metaData) { m_metaData = metaData; emit metaDataChanged(); } - QList availableMetaData() const { return m_metaData.keys(); } + QList availableMetaData() const { return m_metaData.keys(); } QVariant extendedMetaData(const QString &) const { return QVariant(); } void setExtendedMetaData(const QString &, const QVariant &) {} QStringList availableExtendedMetaData() const { return QStringList(); } private: - QMap m_metaData; + QMap m_metaData; }; class QtTestMediaService : public QMediaService @@ -1156,25 +1156,25 @@ void tst_QDeclarativeAudio::status() void tst_QDeclarativeAudio::metaData_data() { QTest::addColumn("propertyName"); - QTest::addColumn("propertyKey"); + QTest::addColumn("propertyKey"); QTest::addColumn("value1"); QTest::addColumn("value2"); QTest::newRow("title") << QByteArray("title") - << QtMultimedia::Title + << QtMediaServices::Title << QVariant(QString::fromLatin1("This is a title")) << QVariant(QString::fromLatin1("This is another title")); QTest::newRow("genre") << QByteArray("genre") - << QtMultimedia::Genre + << QtMediaServices::Genre << QVariant(QString::fromLatin1("rock")) << QVariant(QString::fromLatin1("pop")); QTest::newRow("trackNumber") << QByteArray("trackNumber") - << QtMultimedia::TrackNumber + << QtMediaServices::TrackNumber << QVariant(8) << QVariant(12); } @@ -1182,7 +1182,7 @@ void tst_QDeclarativeAudio::metaData_data() void tst_QDeclarativeAudio::metaData() { QFETCH(QByteArray, propertyName); - QFETCH(QtMultimedia::MetaData, propertyKey); + QFETCH(QtMediaServices::MetaData, propertyKey); QFETCH(QVariant, value1); QFETCH(QVariant, value2); diff --git a/tests/auto/qdeclarativevideo/tst_qdeclarativevideo.cpp b/tests/auto/qdeclarativevideo/tst_qdeclarativevideo.cpp index 0fbd78c..99b447a 100644 --- a/tests/auto/qdeclarativevideo/tst_qdeclarativevideo.cpp +++ b/tests/auto/qdeclarativevideo/tst_qdeclarativevideo.cpp @@ -45,11 +45,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -73,7 +73,7 @@ private slots: void geometry(); }; -Q_DECLARE_METATYPE(QtMultimedia::MetaData); +Q_DECLARE_METATYPE(QtMediaServices::MetaData); Q_DECLARE_METATYPE(QDeclarativeVideo::Error); class QtTestMediaPlayerControl : public QMediaPlayerControl diff --git a/tests/auto/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp b/tests/auto/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp index 7fb6005..1815779 100644 --- a/tests/auto/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp +++ b/tests/auto/qgraphicsvideoitem/tst_qgraphicsvideoitem.cpp @@ -41,19 +41,19 @@ #include -#include +#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include class tst_QGraphicsVideoItem : public QObject { diff --git a/tests/auto/qmediacontent/tst_qmediacontent.cpp b/tests/auto/qmediacontent/tst_qmediacontent.cpp index a0a9bdb..e33149a 100644 --- a/tests/auto/qmediacontent/tst_qmediacontent.cpp +++ b/tests/auto/qmediacontent/tst_qmediacontent.cpp @@ -41,7 +41,7 @@ #include -#include +#include class tst_QMediaContent : public QObject diff --git a/tests/auto/qmediaobject/tst_qmediaobject.cpp b/tests/auto/qmediaobject/tst_qmediaobject.cpp index 2128b35..5a2fdeb 100644 --- a/tests/auto/qmediaobject/tst_qmediaobject.cpp +++ b/tests/auto/qmediaobject/tst_qmediaobject.cpp @@ -43,9 +43,9 @@ #include -#include -#include -#include +#include +#include +#include class tst_QMediaObject : public QObject @@ -93,13 +93,13 @@ public: if (m_available != available) emit metaDataAvailableChanged(m_available = available); } - QList availableMetaData() const { return m_data.keys(); } + QList availableMetaData() const { return m_data.keys(); } bool isWritable() const { return m_writable; } void setWritable(bool writable) { emit writableChanged(m_writable = writable); } - QVariant metaData(QtMultimedia::MetaData key) const { return m_data.value(key); } - void setMetaData(QtMultimedia::MetaData key, const QVariant &value) { + QVariant metaData(QtMediaServices::MetaData key) const { return m_data.value(key); } + void setMetaData(QtMediaServices::MetaData key, const QVariant &value) { m_data.insert(key, value); } QVariant extendedMetaData(const QString &key) const { return m_extendedData.value(key); } @@ -117,7 +117,7 @@ public: bool m_available; bool m_writable; - QMap m_data; + QMap m_data; QMap m_extendedData; }; @@ -376,12 +376,12 @@ void tst_QMediaObject::nullMetaDataControl() QCOMPARE(object.isMetaDataAvailable(), false); QCOMPARE(object.isMetaDataWritable(), false); - object.setMetaData(QtMultimedia::Title, title); + object.setMetaData(QtMediaServices::Title, title); object.setExtendedMetaData(titleKey, title); - QCOMPARE(object.metaData(QtMultimedia::Title).toString(), QString()); + QCOMPARE(object.metaData(QtMediaServices::Title).toString(), QString()); QCOMPARE(object.extendedMetaData(titleKey).toString(), QString()); - QCOMPARE(object.availableMetaData(), QList()); + QCOMPARE(object.availableMetaData(), QList()); QCOMPARE(object.availableExtendedMetaData(), QStringList()); QCOMPARE(spy.count(), 0); } @@ -470,18 +470,18 @@ void tst_QMediaObject::metaData() QtTestMediaObject object(&service); QVERIFY(object.availableMetaData().isEmpty()); - service.metaData.m_data.insert(QtMultimedia::AlbumArtist, artist); - service.metaData.m_data.insert(QtMultimedia::Title, title); - service.metaData.m_data.insert(QtMultimedia::Genre, genre); + service.metaData.m_data.insert(QtMediaServices::AlbumArtist, artist); + service.metaData.m_data.insert(QtMediaServices::Title, title); + service.metaData.m_data.insert(QtMediaServices::Genre, genre); - QCOMPARE(object.metaData(QtMultimedia::AlbumArtist).toString(), artist); - QCOMPARE(object.metaData(QtMultimedia::Title).toString(), title); + QCOMPARE(object.metaData(QtMediaServices::AlbumArtist).toString(), artist); + QCOMPARE(object.metaData(QtMediaServices::Title).toString(), title); - QList metaDataKeys = object.availableMetaData(); + QList metaDataKeys = object.availableMetaData(); QCOMPARE(metaDataKeys.size(), 3); - QVERIFY(metaDataKeys.contains(QtMultimedia::AlbumArtist)); - QVERIFY(metaDataKeys.contains(QtMultimedia::Title)); - QVERIFY(metaDataKeys.contains(QtMultimedia::Genre)); + QVERIFY(metaDataKeys.contains(QtMediaServices::AlbumArtist)); + QVERIFY(metaDataKeys.contains(QtMediaServices::Title)); + QVERIFY(metaDataKeys.contains(QtMediaServices::Genre)); } void tst_QMediaObject::setMetaData_data() @@ -501,9 +501,9 @@ void tst_QMediaObject::setMetaData() QtTestMediaObject object(&service); - object.setMetaData(QtMultimedia::Title, title); - QCOMPARE(object.metaData(QtMultimedia::Title).toString(), title); - QCOMPARE(service.metaData.m_data.value(QtMultimedia::Title).toString(), title); + object.setMetaData(QtMediaServices::Title, title); + QCOMPARE(object.metaData(QtMediaServices::Title).toString(), title); + QCOMPARE(service.metaData.m_data.value(QtMediaServices::Title).toString(), title); } void tst_QMediaObject::extendedMetaData() diff --git a/tests/auto/qmediaplayer/tst_qmediaplayer.cpp b/tests/auto/qmediaplayer/tst_qmediaplayer.cpp index a96e08d..9a597e2 100644 --- a/tests/auto/qmediaplayer/tst_qmediaplayer.cpp +++ b/tests/auto/qmediaplayer/tst_qmediaplayer.cpp @@ -43,10 +43,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include diff --git a/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp b/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp index 383a407..1037f37 100644 --- a/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp +++ b/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp @@ -41,11 +41,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include class MockReadOnlyPlaylistProvider : public QMediaPlaylistProvider diff --git a/tests/auto/qmediaplaylistnavigator/tst_qmediaplaylistnavigator.cpp b/tests/auto/qmediaplaylistnavigator/tst_qmediaplaylistnavigator.cpp index 9130db0..04f736c 100644 --- a/tests/auto/qmediaplaylistnavigator/tst_qmediaplaylistnavigator.cpp +++ b/tests/auto/qmediaplaylistnavigator/tst_qmediaplaylistnavigator.cpp @@ -41,8 +41,8 @@ #include #include -#include -#include +#include +#include class tst_QMediaPlaylistNavigator : public QObject diff --git a/tests/auto/qmediapluginloader/tst_qmediapluginloader.cpp b/tests/auto/qmediapluginloader/tst_qmediapluginloader.cpp index 0d35b05..001e68a 100644 --- a/tests/auto/qmediapluginloader/tst_qmediapluginloader.cpp +++ b/tests/auto/qmediapluginloader/tst_qmediapluginloader.cpp @@ -42,8 +42,8 @@ #include #include -#include -#include +#include +#include diff --git a/tests/auto/qmediaresource/tst_qmediaresource.cpp b/tests/auto/qmediaresource/tst_qmediaresource.cpp index 546c415..984cfef 100644 --- a/tests/auto/qmediaresource/tst_qmediaresource.cpp +++ b/tests/auto/qmediaresource/tst_qmediaresource.cpp @@ -41,7 +41,7 @@ #include -#include +#include class tst_QMediaResource : public QObject diff --git a/tests/auto/qmediaservice/tst_qmediaservice.cpp b/tests/auto/qmediaservice/tst_qmediaservice.cpp index a0cb69d..a544e77 100644 --- a/tests/auto/qmediaservice/tst_qmediaservice.cpp +++ b/tests/auto/qmediaservice/tst_qmediaservice.cpp @@ -41,9 +41,9 @@ #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/auto/qmediaserviceprovider/tst_qmediaserviceprovider.cpp b/tests/auto/qmediaserviceprovider/tst_qmediaserviceprovider.cpp index 06a8f60..64abedb 100644 --- a/tests/auto/qmediaserviceprovider/tst_qmediaserviceprovider.cpp +++ b/tests/auto/qmediaserviceprovider/tst_qmediaserviceprovider.cpp @@ -43,12 +43,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include class MockMediaService : public QMediaService { @@ -88,16 +88,16 @@ public: delete service; } - QtMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const + QtMediaServices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const { if (codecs.contains(QLatin1String("mpeg4"))) - return QtMultimedia::NotSupported; + return QtMediaServices::NotSupported; if (mimeType == "audio/ogg") { - return QtMultimedia::ProbablySupported; + return QtMediaServices::ProbablySupported; } - return QtMultimedia::MaybeSupported; + return QtMediaServices::MaybeSupported; } QStringList supportedMimeTypes() const @@ -147,14 +147,14 @@ public: delete service; } - QtMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const + QtMediaServices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const { Q_UNUSED(codecs); if (mimeType == "audio/wav") - return QtMultimedia::PreferredService; + return QtMediaServices::PreferredService; - return QtMultimedia::NotSupported; + return QtMediaServices::NotSupported; } QStringList supportedMimeTypes() const @@ -239,15 +239,15 @@ public: delete service; } - QtMultimedia::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const + QtMediaServices::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const { if (codecs.contains(QLatin1String("jpeg2000"))) - return QtMultimedia::NotSupported; + return QtMediaServices::NotSupported; if (supportedMimeTypes().contains(mimeType)) - return QtMultimedia::ProbablySupported; + return QtMediaServices::ProbablySupported; - return QtMultimedia::MaybeSupported; + return QtMediaServices::MaybeSupported; } QStringList supportedMimeTypes() const @@ -334,7 +334,7 @@ void tst_QMediaServiceProvider::testHasSupport() { MockMediaServiceProvider mockProvider; QCOMPARE(mockProvider.hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "video/ogv", QStringList()), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); QMediaServiceProvider *provider = QMediaServiceProvider::defaultServiceProvider(); @@ -342,44 +342,44 @@ void tst_QMediaServiceProvider::testHasSupport() QSKIP("No default provider", SkipSingle); QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "video/ogv", QStringList()), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "audio/ogg", QStringList()), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //while the service returns PreferredService, provider should return ProbablySupported QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "audio/wav", QStringList()), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //even while all the plugins with "hasSupport" returned NotSupported, //MockServicePlugin3 has no "hasSupport" interface, so MaybeSupported QCOMPARE(provider->hasSupport(QByteArray(Q_MEDIASERVICE_MEDIAPLAYER), "video/avi", QStringList() << "mpeg4"), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); QCOMPARE(provider->hasSupport(QByteArray("non existing service"), "video/ogv", QStringList()), - QtMultimedia::NotSupported); + QtMediaServices::NotSupported); - QCOMPARE(QMediaPlayer::hasSupport("video/ogv"), QtMultimedia::MaybeSupported); - QCOMPARE(QMediaPlayer::hasSupport("audio/ogg"), QtMultimedia::ProbablySupported); - QCOMPARE(QMediaPlayer::hasSupport("audio/wav"), QtMultimedia::ProbablySupported); + QCOMPARE(QMediaPlayer::hasSupport("video/ogv"), QtMediaServices::MaybeSupported); + QCOMPARE(QMediaPlayer::hasSupport("audio/ogg"), QtMediaServices::ProbablySupported); + QCOMPARE(QMediaPlayer::hasSupport("audio/wav"), QtMediaServices::ProbablySupported); //test low latency flag support QCOMPARE(QMediaPlayer::hasSupport("audio/wav", QStringList(), QMediaPlayer::LowLatency), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //plugin1 probably supports audio/ogg, it checked because it doesn't provide features iface QCOMPARE(QMediaPlayer::hasSupport("audio/ogg", QStringList(), QMediaPlayer::LowLatency), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //Plugin4 is not checked here, sine it's known not support low latency QCOMPARE(QMediaPlayer::hasSupport("video/quicktime", QStringList(), QMediaPlayer::LowLatency), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); //test streaming flag support QCOMPARE(QMediaPlayer::hasSupport("video/quicktime", QStringList(), QMediaPlayer::StreamPlayback), - QtMultimedia::ProbablySupported); + QtMediaServices::ProbablySupported); //Plugin2 is not checked here, sine it's known not support streaming QCOMPARE(QMediaPlayer::hasSupport("audio/wav", QStringList(), QMediaPlayer::StreamPlayback), - QtMultimedia::MaybeSupported); + QtMediaServices::MaybeSupported); //ensure the correct media player plugin is choosen for mime type QMediaPlayer simplePlayer(0, QMediaPlayer::LowLatency); diff --git a/tests/auto/qmediatimerange/qmediatimerange.pro b/tests/auto/qmediatimerange/qmediatimerange.pro index 98c415b..c5e74ce 100644 --- a/tests/auto/qmediatimerange/qmediatimerange.pro +++ b/tests/auto/qmediatimerange/qmediatimerange.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qmediatimerange.cpp -QT = core media +QT = core mediaservices diff --git a/tests/auto/qmediatimerange/tst_qmediatimerange.cpp b/tests/auto/qmediatimerange/tst_qmediatimerange.cpp index 54de3f1..a21abe2 100644 --- a/tests/auto/qmediatimerange/tst_qmediatimerange.cpp +++ b/tests/auto/qmediatimerange/tst_qmediatimerange.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include class tst_QMediaTimeRange: public QObject { diff --git a/tests/auto/qsoundeffect/qsoundeffect.pro b/tests/auto/qsoundeffect/qsoundeffect.pro index 4ed7407..5344a16 100644 --- a/tests/auto/qsoundeffect/qsoundeffect.pro +++ b/tests/auto/qsoundeffect/qsoundeffect.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qsoundeffect.cpp -QT = core media +QT = core multimedia mediaservices wince* { deploy.sources += 4.wav diff --git a/tests/auto/qvideowidget/qvideowidget.pro b/tests/auto/qvideowidget/qvideowidget.pro index fde9030..d6facb9 100644 --- a/tests/auto/qvideowidget/qvideowidget.pro +++ b/tests/auto/qvideowidget/qvideowidget.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qvideowidget.cpp -QT = core gui media +QT = core gui mediaservices diff --git a/tests/auto/qvideowidget/tst_qvideowidget.cpp b/tests/auto/qvideowidget/tst_qvideowidget.cpp index f1eef50..32a4e7c 100644 --- a/tests/auto/qvideowidget/tst_qvideowidget.cpp +++ b/tests/auto/qvideowidget/tst_qvideowidget.cpp @@ -41,15 +41,15 @@ #include -#include - -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include #include #include -- cgit v0.12 From 4e9a4ff3f191094b27a5ab4ef56fcd078a0bc124 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 19 Apr 2010 11:38:47 +1000 Subject: Always allow view position to be fixed. We used to avoid doing fixup in a direction we were not flicking. This was pointless, and caused bugs when the view transitioned from flickable to not flickable, e.g. by content size change. Fixup following content size is also no longer animated. This can be acheived using a behavoir, for example. Task-number: QTBUG-9961 --- .../graphicsitems/qdeclarativeflickable.cpp | 18 ++++++++++-------- src/declarative/graphicsitems/qdeclarativegridview.cpp | 6 ------ src/declarative/graphicsitems/qdeclarativelistview.cpp | 5 ----- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 951b171..018d48f 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -248,18 +248,12 @@ void QDeclarativeFlickablePrivate::fixupX_callback(void *data) void QDeclarativeFlickablePrivate::fixupX() { Q_Q(QDeclarativeFlickable); - if (!q->xflick() || hData.move.timeLine()) - return; - fixup(hData, q->minXExtent(), q->maxXExtent()); } void QDeclarativeFlickablePrivate::fixupY() { Q_Q(QDeclarativeFlickable); - if (!q->yflick() || vData.move.timeLine()) - return; - fixup(vData, q->minYExtent(), q->maxYExtent()); } @@ -1059,8 +1053,12 @@ void QDeclarativeFlickable::setContentWidth(qreal w) else d->viewport->setWidth(w); // Make sure that we're entirely in view. - if (!d->pressed) + if (!d->pressed) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; d->fixupX(); + d->fixupDuration = oldDuration; + } emit contentWidthChanged(); d->updateBeginningEnd(); } @@ -1082,8 +1080,12 @@ void QDeclarativeFlickable::setContentHeight(qreal h) else d->viewport->setHeight(h); // Make sure that we're entirely in view. - if (!d->pressed) + if (!d->pressed) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; d->fixupY(); + d->fixupDuration = oldDuration; + } emit contentHeightChanged(); d->updateBeginningEnd(); } diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index a3d585a..727dba3 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -746,12 +746,6 @@ void QDeclarativeGridViewPrivate::fixupPosition() void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent) { Q_Q(QDeclarativeGridView); - - if ((&data == &vData && !q->yflick()) - || (&data == &hData && !q->xflick()) - || data.move.timeLine()) - return; - int oldDuration = fixupDuration; fixupDuration = moveReason == Mouse ? fixupDuration : 0; diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 80db730..5a0292f 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1101,11 +1101,6 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m || (orient == QDeclarativeListView::Vertical && &data == &hData)) return; - if ((&data == &vData && !q->yflick()) - || (&data == &hData && !q->xflick()) - || data.move.timeLine()) - return; - int oldDuration = fixupDuration; fixupDuration = moveReason == Mouse ? fixupDuration : 0; -- cgit v0.12 From 42b71bbe23eaed2a097c25f325713c453ae45c48 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Mon, 19 Apr 2010 12:50:01 +1000 Subject: Fixed QVideoWidget test, waiting for video surface painted. It's not always sufficient just to call QCoreApplication::processEvents(QEventLoop::AllEvents) to ensure update is processed (at least on mac), so wait for some time until the video frame is rendered. Reviewed-by: Kurt Korbatits --- tests/auto/qvideowidget/tst_qvideowidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qvideowidget/tst_qvideowidget.cpp b/tests/auto/qvideowidget/tst_qvideowidget.cpp index 32a4e7c..8a54789 100644 --- a/tests/auto/qvideowidget/tst_qvideowidget.cpp +++ b/tests/auto/qvideowidget/tst_qvideowidget.cpp @@ -1589,7 +1589,9 @@ void tst_QVideoWidget::paintRendererControl() QCOMPARE(surface->isActive(), true); QCOMPARE(surface->isReady(), false); - QCoreApplication::processEvents(QEventLoop::AllEvents); + //wait up to 2 seconds for the frame to be presented + for (int i=0; i<200 && !surface->isReady(); i++) + QTest::qWait(10); QCOMPARE(surface->isActive(), true); QCOMPARE(surface->isReady(), true); -- cgit v0.12 From a8188c22ad67b339c1c68b39da0064473fec8171 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 19 Apr 2010 13:17:51 +1000 Subject: Speed up Rectangle creation with pen or gradient slightly --- src/declarative/graphicsitems/qdeclarativerectangle.cpp | 11 +++++++++-- src/declarative/graphicsitems/qdeclarativerectangle_p_p.h | 8 +++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 54c8ab2..0328f91 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -172,6 +172,8 @@ void QDeclarativeGradient::doUpdate() \image declarative-rect.png */ +int QDeclarativeRectanglePrivate::doUpdateSlotIdx = -1; + /*! \internal \class QDeclarativeRectangle @@ -252,11 +254,16 @@ void QDeclarativeRectangle::setGradient(QDeclarativeGradient *gradient) Q_D(QDeclarativeRectangle); if (d->gradient == gradient) return; + static int updatedSignalIdx = -1; + if (updatedSignalIdx < 0) + updatedSignalIdx = QDeclarativeGradient::staticMetaObject.indexOfSignal("updated()"); + if (d->doUpdateSlotIdx < 0) + d->doUpdateSlotIdx = QDeclarativeRectangle::staticMetaObject.indexOfSlot("doUpdate()"); if (d->gradient) - disconnect(d->gradient, SIGNAL(updated()), this, SLOT(doUpdate())); + QMetaObject::disconnect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx); d->gradient = gradient; if (d->gradient) - connect(d->gradient, SIGNAL(updated()), this, SLOT(doUpdate())); + QMetaObject::connect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx); update(); } diff --git a/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h b/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h index 84418bc..001b018 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h @@ -81,12 +81,18 @@ public: qreal radius; qreal paintmargin; QPixmap rectImage; + static int doUpdateSlotIdx; QDeclarativePen *getPen() { if (!pen) { Q_Q(QDeclarativeRectangle); pen = new QDeclarativePen; - QObject::connect(pen, SIGNAL(penChanged()), q, SLOT(doUpdate())); + static int penChangedSignalIdx = -1; + if (penChangedSignalIdx < 0) + penChangedSignalIdx = QDeclarativePen::staticMetaObject.indexOfSignal("penChanged()"); + if (doUpdateSlotIdx < 0) + doUpdateSlotIdx = QDeclarativeRectangle::staticMetaObject.indexOfSlot("doUpdate()"); + QMetaObject::connect(pen, penChangedSignalIdx, q, doUpdateSlotIdx); } return pen; } -- cgit v0.12 From 2075925adaa1a1c78b6da9dc10d2b1a165178363 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 19 Apr 2010 13:30:23 +1000 Subject: Add some padding to Rectangles with border to avoid qDrawBorderPixmap() bug. Task-number: QTBUG-5689 --- src/declarative/graphicsitems/qdeclarativerectangle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 0328f91..3daa83f 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -357,7 +357,9 @@ void QDeclarativeRectangle::generateBorderedRect() Q_D(QDeclarativeRectangle); if (d->rectImage.isNull()) { const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0; - d->rectImage = QPixmap(pw*2 + 3, pw*2 + 3); + // Adding 5 here makes qDrawBorderPixmap() paint correctly with smooth: true + // Ideally qDrawBorderPixmap() would be fixed - QTBUG-7999 + d->rectImage = QPixmap(pw*2 + 5, pw*2 + 5); d->rectImage.fill(Qt::transparent); QPainter p(&(d->rectImage)); p.setRenderHint(QPainter::Antialiasing); -- cgit v0.12 From 7aedb72dea904981969c0a4a9e5a6b721381c5a9 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 19 Apr 2010 14:08:20 +1000 Subject: Emit runtime warnings through QDeclarativeEngine QTBUG-9726 --- .../graphicsitems/qdeclarativeanimatedimage.cpp | 5 +- src/declarative/graphicsitems/qdeclarativeitem.cpp | 4 +- .../graphicsitems/qdeclarativeloader.cpp | 4 +- .../graphicsitems/qdeclarativescalegrid.cpp | 2 +- .../graphicsitems/qdeclarativetextedit.cpp | 4 +- .../graphicsitems/qdeclarativetextinput.cpp | 11 +- .../graphicsitems/qdeclarativevisualitemmodel.cpp | 2 +- src/declarative/qml/qdeclarativebinding.cpp | 3 +- src/declarative/qml/qdeclarativeboundsignal.cpp | 2 +- .../qml/qdeclarativecompiledbindings.cpp | 2 +- src/declarative/qml/qdeclarativecompiler.cpp | 9 +- src/declarative/qml/qdeclarativecomponent.cpp | 12 +-- src/declarative/qml/qdeclarativecomponent.h | 3 +- .../qml/qdeclarativecompositetypemanager.cpp | 1 - src/declarative/qml/qdeclarativecontext.cpp | 6 +- src/declarative/qml/qdeclarativedirparser.cpp | 9 +- src/declarative/qml/qdeclarativeengine.cpp | 103 ++++++++++++++++-- src/declarative/qml/qdeclarativeengine.h | 7 +- src/declarative/qml/qdeclarativeengine_p.h | 8 ++ src/declarative/qml/qdeclarativeenginedebug.cpp | 2 - src/declarative/qml/qdeclarativeerror.cpp | 12 ++- src/declarative/qml/qdeclarativeexpression.cpp | 5 +- src/declarative/qml/qdeclarativeinfo.cpp | 119 ++++++++++++++------- src/declarative/qml/qdeclarativeinfo.h | 17 +++ src/declarative/qml/qdeclarativemetatype.cpp | 8 +- .../qml/qdeclarativeproxymetaobject.cpp | 14 --- src/declarative/qml/qdeclarativexmlhttprequest.cpp | 2 +- src/declarative/util/qdeclarativeanimation.cpp | 8 +- src/declarative/util/qdeclarativefontloader.cpp | 7 +- src/declarative/util/qdeclarativelistmodel.cpp | 5 +- .../util/qdeclarativelistmodelworkeragent.cpp | 5 +- src/declarative/util/qdeclarativestategroup.cpp | 3 +- .../util/qdeclarativestateoperations.cpp | 2 +- .../tst_qdeclarativeanchors.cpp | 30 +++--- .../tst_qdeclarativeanimatedimage.cpp | 2 +- .../tst_qdeclarativeanimations.cpp | 14 +-- .../tst_qdeclarativebehaviors.cpp | 6 +- .../tst_qdeclarativeborderimage.cpp | 8 +- .../tst_qdeclarativeecmascript.cpp | 2 +- .../tst_qdeclarativeflipable.cpp | 4 +- .../tst_qdeclarativefontloader.cpp | 4 +- .../qdeclarativeimage/tst_qdeclarativeimage.cpp | 6 +- .../tst_qdeclarativeimageprovider.cpp | 6 +- .../qdeclarativeinfo/tst_qdeclarativeinfo.cpp | 16 +-- .../qdeclarativeitem/tst_qdeclarativeitem.cpp | 7 +- .../tst_qdeclarativelanguage.cpp | 3 +- .../tst_qdeclarativelistmodel.cpp | 56 +++++----- .../qdeclarativeloader/tst_qdeclarativeloader.cpp | 6 +- .../tst_qdeclarativeproperty.cpp | 8 +- .../qdeclarativestates/tst_qdeclarativestates.cpp | 12 +-- .../qdeclarativetext/tst_qdeclarativetext.cpp | 4 +- .../tst_qdeclarativetextedit.cpp | 2 +- 52 files changed, 374 insertions(+), 228 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp index 6ab126d..c81c2d2 100644 --- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp @@ -44,6 +44,7 @@ #ifndef QT_NO_MOVIE +#include #include #include @@ -213,7 +214,7 @@ void QDeclarativeAnimatedImage::setSource(const QUrl &url) //### should be unified with movieRequestFinished d->_movie = new QMovie(lf); if (!d->_movie->isValid()){ - qWarning() << "Error Reading Animated Image File" << d->url; + qmlInfo(this) << "Error Reading Animated Image File " << d->url.toString(); delete d->_movie; d->_movie = 0; return; @@ -270,7 +271,7 @@ void QDeclarativeAnimatedImage::movieRequestFinished() d->_movie = new QMovie(d->reply); if (!d->_movie->isValid()){ - qWarning() << "Error Reading Animated Image File " << d->url; + qmlInfo(this) << "Error Reading Animated Image File " << d->url; delete d->_movie; d->_movie = 0; return; diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 843dfdc..37c7923 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -2242,7 +2242,7 @@ QScriptValue QDeclarativeItem::mapFromItem(const QScriptValue &item, qreal x, qr QScriptValue sv = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this))->newObject(); QDeclarativeItem *itemObj = qobject_cast(item.toQObject()); if (!itemObj && !item.isNull()) { - qWarning().nospace() << "mapFromItem() given argument " << item.toString() << " which is neither null nor an Item"; + qmlInfo(this) << "mapFromItem() given argument \"" << item.toString() << "\" which is neither null nor an Item"; return 0; } @@ -2268,7 +2268,7 @@ QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, qreal x, qrea QScriptValue sv = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this))->newObject(); QDeclarativeItem *itemObj = qobject_cast(item.toQObject()); if (!itemObj && !item.isNull()) { - qWarning().nospace() << "mapToItem() given argument " << item.toString() << " which is neither null nor an Item"; + qmlInfo(this) << "mapToItem() given argument \"" << item.toString() << "\" which is neither null nor an Item"; return 0; } diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index 8cf8235..3f257b5 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -277,7 +277,7 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded() if (component) { if (!component->errors().isEmpty()) { - qWarning() << component->errors(); + QDeclarativeEnginePrivate::warning(qmlEngine(q), component->errors()); emit q->sourceChanged(); emit q->statusChanged(); emit q->progressChanged(); @@ -312,7 +312,7 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded() } } else { if (!component->errors().isEmpty()) - qWarning() << component->errors(); + QDeclarativeEnginePrivate::warning(qmlEngine(q), component->errors()); delete obj; delete ctxt; source = QUrl(); diff --git a/src/declarative/graphicsitems/qdeclarativescalegrid.cpp b/src/declarative/graphicsitems/qdeclarativescalegrid.cpp index e68f645..fe89190 100644 --- a/src/declarative/graphicsitems/qdeclarativescalegrid.cpp +++ b/src/declarative/graphicsitems/qdeclarativescalegrid.cpp @@ -175,7 +175,7 @@ QDeclarativeBorderImage::TileMode QDeclarativeGridScaledImage::stringToRule(cons if (s == QLatin1String("Round")) return QDeclarativeBorderImage::Round; - qWarning() << "Unknown tile rule specified. Using Stretch"; + qWarning("QDeclarativeGridScaledImage: Invalid tile rule specified. Using Stretch."); return QDeclarativeBorderImage::Stretch; } diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 1fec484..77fb459 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -614,7 +614,7 @@ void QDeclarativeTextEdit::loadCursorDelegate() d->cursor->setHeight(QFontMetrics(d->font).height()); moveCursorDelegate(); }else{ - qWarning() << QLatin1String("Error loading cursor delegate for TextEdit:") + objectName(); + qmlInfo(this) << "Error loading cursor delegate."; } } @@ -1076,8 +1076,6 @@ void QDeclarativeTextEditPrivate::updateSelection() q->selectionEndChanged(); startChange = (lastSelectionStart != control->textCursor().selectionStart()); endChange = (lastSelectionEnd != control->textCursor().selectionEnd()); - if(startChange || endChange) - qWarning() << "QDeclarativeTextEditPrivate::updateSelection() has failed you."; } void QDeclarativeTextEdit::updateSelectionMarkers() diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index e00d333..2161e23 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -779,9 +779,8 @@ void QDeclarativeTextInputPrivate::startCreatingCursor() }else if(cursorComponent->isLoading()){ q->connect(cursorComponent, SIGNAL(statusChanged(int)), q, SLOT(createCursor())); - }else{//isError - qmlInfo(q) << QDeclarativeTextInput::tr("Could not load cursor delegate"); - qWarning() << cursorComponent->errors(); + }else {//isError + qmlInfo(q, cursorComponent->errors()) << QDeclarativeTextInput::tr("Could not load cursor delegate"); } } @@ -789,8 +788,7 @@ void QDeclarativeTextInput::createCursor() { Q_D(QDeclarativeTextInput); if(d->cursorComponent->isError()){ - qmlInfo(this) << tr("Could not load cursor delegate"); - qWarning() << d->cursorComponent->errors(); + qmlInfo(this, d->cursorComponent->errors()) << tr("Could not load cursor delegate"); return; } @@ -801,8 +799,7 @@ void QDeclarativeTextInput::createCursor() delete d->cursorItem; d->cursorItem = qobject_cast(d->cursorComponent->create()); if(!d->cursorItem){ - qmlInfo(this) << tr("Could not instantiate cursor delegate"); - //The failed instantiation should print its own error messages + qmlInfo(this, d->cursorComponent->errors()) << tr("Could not instantiate cursor delegate"); return; } diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 751284d..207232d 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -1011,7 +1011,7 @@ QDeclarativeItem *QDeclarativeVisualDataModel::item(int index, const QByteArray } else { delete data; delete ctxt; - qWarning() << d->m_delegate->errors(); + qmlInfo(this, d->m_delegate->errors()) << "Error creating delgate"; } } QDeclarativeItem *item = qobject_cast(nobj); diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index 25492ac..d759427 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -210,8 +210,7 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) } if (data->error.isValid()) { - if (!data->addError(ep)) - qWarning().nospace() << qPrintable(this->error().toString()); + if (!data->addError(ep)) ep->warning(this->error()); } else { data->removeError(); } diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 8c7a977..00a93cc 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -179,7 +179,7 @@ int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) if (m_expression && m_expression->engine()) { QDeclarativeExpressionPrivate::get(m_expression)->value(m_params); if (m_expression && m_expression->hasError()) - qWarning().nospace() << qPrintable(m_expression->error().toString()); + QDeclarativeEnginePrivate::warning(m_expression->engine(), m_expression->error()); } if (m_params) m_params->clearValues(); return -1; diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp index 6fdf706..4a47fc6 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings.cpp +++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp @@ -938,7 +938,7 @@ static void throwException(int id, QDeclarativeDelayedError *error, error->error.setColumn(-1); } if (!context->engine || !error->addError(QDeclarativeEnginePrivate::get(context->engine))) - qWarning() << error->error; + QDeclarativeEnginePrivate::warning(context->engine, error->error); } static void dumpInstruction(const Instr *instr) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 065009a..cced7b1 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1218,7 +1218,14 @@ bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj, bool QDeclarativeCompiler::buildScript(QDeclarativeParser::Object *obj, QDeclarativeParser::Object *script) { - qWarning().nospace() << qPrintable(output->url.toString()) << ":" << obj->location.start.line << ":" << obj->location.start.column << ": Script blocks have been deprecated. Support will be removed entirely shortly."; + { + QDeclarativeError warning; + warning.setUrl(output->url); + warning.setLine(obj->location.start.line); + warning.setColumn(obj->location.start.column); + warning.setDescription(tr("Script blocks have been deprecated. Support will be removed entirely shortly.")); + qWarning() << warning.toString(); + } Object::ScriptBlock scriptBlock; diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 3e4651c..c86f089 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -530,10 +530,8 @@ QScriptValue QDeclarativeComponent::createObject() { Q_D(QDeclarativeComponent); QDeclarativeContext* ctxt = creationContext(); - if(!ctxt){ - qWarning() << QLatin1String("createObject can only be used in QML"); + if(!ctxt) return QScriptValue(); - } QObject* ret = create(ctxt); if (!ret) return QScriptValue(); @@ -613,17 +611,17 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context, cons { Q_Q(QDeclarativeComponent); if (!context) { - qWarning("QDeclarativeComponent::beginCreate(): Cannot create a component in a null context"); + qWarning("QDeclarativeComponent: Cannot create a component in a null context"); return 0; } if (!context->isValid()) { - qWarning("QDeclarativeComponent::beginCreate(): Cannot create a component in an invalid context"); + qWarning("QDeclarativeComponent: Cannot create a component in an invalid context"); return 0; } if (context->engine != engine) { - qWarning("QDeclarativeComponent::beginCreate(): Must create component in context from the same QDeclarativeEngine"); + qWarning("QDeclarativeComponent: Must create component in context from the same QDeclarativeEngine"); return 0; } @@ -766,7 +764,7 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri enginePriv->inProgressCreations--; if (0 == enginePriv->inProgressCreations) { while (enginePriv->erroredBindings) { - qWarning().nospace() << qPrintable(enginePriv->erroredBindings->error.toString()); + enginePriv->warning(enginePriv->erroredBindings->error); enginePriv->erroredBindings->removeError(); } } diff --git a/src/declarative/qml/qdeclarativecomponent.h b/src/declarative/qml/qdeclarativecomponent.h index 6ee5070..526a319 100644 --- a/src/declarative/qml/qdeclarativecomponent.h +++ b/src/declarative/qml/qdeclarativecomponent.h @@ -99,8 +99,6 @@ public: virtual QObject *beginCreate(QDeclarativeContext *); virtual void completeCreate(); - Q_INVOKABLE QScriptValue createObject(); - void loadUrl(const QUrl &url); void setData(const QByteArray &, const QUrl &baseUrl); @@ -114,6 +112,7 @@ Q_SIGNALS: protected: QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject* parent); + Q_INVOKABLE QScriptValue createObject(); private: QDeclarativeComponent(QDeclarativeEngine *, QDeclarativeCompiledData *, int, int, QObject *parent); diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp index 133b71f..adeb7a5 100644 --- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp +++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp @@ -341,7 +341,6 @@ static QString toLocalFileOrQrc(const QUrl& url) if (url.scheme() == QLatin1String("qrc")) { if (url.authority().isEmpty()) return QLatin1Char(':') + url.path(); - qWarning() << "Invalid url:" << url.toString() << "authority" << url.authority() << "not known."; return QString(); } return url.toLocalFile(); diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index 5288923..31430c7 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -660,7 +660,7 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object if (scriptEngine->hasUncaughtException()) { QDeclarativeError error; QDeclarativeExpressionPrivate::exceptionToError(scriptEngine, error); - qWarning().nospace() << qPrintable(error.toString()); + enginePriv->warning(error); } scriptEngine->popContext(); @@ -686,7 +686,7 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object if (scriptEngine->hasUncaughtException()) { QDeclarativeError error; QDeclarativeExpressionPrivate::exceptionToError(scriptEngine, error); - qWarning().nospace() << qPrintable(error.toString()); + enginePriv->warning(error); } scriptEngine->popContext(); @@ -720,7 +720,7 @@ void QDeclarativeContextData::addScript(const QDeclarativeParser::Object::Script if (scriptEngine->hasUncaughtException()) { QDeclarativeError error; QDeclarativeExpressionPrivate::exceptionToError(scriptEngine, error); - qWarning().nospace() << qPrintable(error.toString()); + enginePriv->warning(error); } } diff --git a/src/declarative/qml/qdeclarativedirparser.cpp b/src/declarative/qml/qdeclarativedirparser.cpp index 1e3b37b..3e05853 100644 --- a/src/declarative/qml/qdeclarativedirparser.cpp +++ b/src/declarative/qml/qdeclarativedirparser.cpp @@ -170,10 +170,9 @@ bool QDeclarativeDirParser::parse() const int dotIndex = version.indexOf(QLatin1Char('.')); if (dotIndex == -1) { - qWarning() << "expected '.'"; // ### use reportError + reportError(lineNumber, -1, QLatin1String("expected '.'")); } else if (version.indexOf(QLatin1Char('.'), dotIndex + 1) != -1) { - qWarning() << "unexpected '.'"; // ### use reportError - + reportError(lineNumber, -1, QLatin1String("unexpected '.'")); } else { bool validVersionNumber = false; const int majorVersion = version.left(dotIndex).toInt(&validVersionNumber); @@ -189,8 +188,8 @@ bool QDeclarativeDirParser::parse() } } } else { - // ### use reportError - qWarning() << "a component declaration requires 3 arguments, but" << (sectionCount + 1) << "were provided"; + reportError(lineNumber, -1, + QString::fromUtf8("a component declaration requires 3 arguments, but %1 were provided").arg(sectionCount + 1)); } } diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 4dbd199..9cd6b3c 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -153,10 +153,10 @@ void QDeclarativeEnginePrivate::defineModule() QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e) : captureProperties(false), rootContext(0), currentExpression(0), isDebugging(false), - contextClass(0), sharedContext(0), sharedScope(0), objectClass(0), valueTypeClass(0), - globalClass(0), cleanup(0), erroredBindings(0), inProgressCreations(0), - scriptEngine(this), workerScriptEngine(0), componentAttached(0), inBeginCreate(false), - networkAccessManager(0), networkAccessManagerFactory(0), + outputWarningsToStdErr(true), contextClass(0), sharedContext(0), sharedScope(0), + objectClass(0), valueTypeClass(0), globalClass(0), cleanup(0), erroredBindings(0), + inProgressCreations(0), scriptEngine(this), workerScriptEngine(0), componentAttached(0), + inBeginCreate(false), networkAccessManager(0), networkAccessManagerFactory(0), typeManager(e), uniqueId(1) { if (!qt_QmlQtModule_registered) { @@ -216,8 +216,6 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr offlineStoragePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation).replace(QLatin1Char('/'), QDir::separator()) + QDir::separator() + QLatin1String("QML") + QDir::separator() + QLatin1String("OfflineStorage"); -#else - qWarning("offlineStoragePath is not set by default with QT_NO_DESKTOPSERVICES"); #endif qt_add_qmlxmlhttprequest(this); @@ -650,6 +648,34 @@ void QDeclarativeEngine::setBaseUrl(const QUrl &url) { Q_D(QDeclarativeEngine); d->baseUrl = url; +} + +/*! + Returns true if warning messages will be output to stderr in addition + to being emitted by the warnings() signal, otherwise false. + + The default value is true. +*/ +bool QDeclarativeEngine::outputWarningsToStandardError() const +{ + Q_D(const QDeclarativeEngine); + return d->outputWarningsToStdErr; +} + +/*! + Set whether warning messages will be output to stderr to \a enabled. + + If \a enabled is true, any warning messages generated by QML will be + output to stderr and emitted by the warnings() signal. If \a enabled + is false, on the warnings() signal will be emitted. This allows + applications to handle warning output themselves. + + The default value is true. +*/ +void QDeclarativeEngine::setOutputWarningsToStandardError(bool enabled) +{ + Q_D(QDeclarativeEngine); + d->outputWarningsToStdErr = enabled; } /*! @@ -777,9 +803,8 @@ void qmlExecuteDeferred(QObject *object) QDeclarativeComponentPrivate::complete(ep, &state); - if (!state.errors.isEmpty()) - qWarning() << state.errors; - + if (!state.errors.isEmpty()) + ep->warning(state.errors); } } @@ -1295,6 +1320,65 @@ void QDeclarativeEnginePrivate::sendQuit() emit q->quit(); } +static void dumpwarning(const QDeclarativeError &error) +{ + qWarning().nospace() << qPrintable(error.toString()); +} + +static void dumpwarning(const QList &errors) +{ + for (int ii = 0; ii < errors.count(); ++ii) + dumpwarning(errors.at(ii)); +} + +void QDeclarativeEnginePrivate::warning(const QDeclarativeError &error) +{ + Q_Q(QDeclarativeEngine); + q->warnings(QList() << error); + if (outputWarningsToStdErr) + dumpwarning(error); +} + +void QDeclarativeEnginePrivate::warning(const QList &errors) +{ + Q_Q(QDeclarativeEngine); + q->warnings(errors); + if (outputWarningsToStdErr) + dumpwarning(errors); +} + +void QDeclarativeEnginePrivate::warning(QDeclarativeEngine *engine, const QDeclarativeError &error) +{ + if (engine) + QDeclarativeEnginePrivate::get(engine)->warning(error); + else + dumpwarning(error); +} + +void QDeclarativeEnginePrivate::warning(QDeclarativeEngine *engine, const QList &error) +{ + if (engine) + QDeclarativeEnginePrivate::get(engine)->warning(error); + else + dumpwarning(error); +} + +void QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate *engine, const QDeclarativeError &error) +{ + if (engine) + engine->warning(error); + else + dumpwarning(error); +} + +void QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate *engine, const QList &error) +{ + if (engine) + engine->warning(error); + else + dumpwarning(error); +} + QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptEngine *e) { QDeclarativeEnginePrivate *qe = get (e); @@ -1415,7 +1499,6 @@ static QString toLocalFileOrQrc(const QUrl& url) if (url.scheme() == QLatin1String("qrc")) { if (url.authority().isEmpty()) return QLatin1Char(':') + url.path(); - qWarning() << "Invalid url:" << url.toString() << "authority" << url.authority() << "not known."; return QString(); } return url.toLocalFile(); diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h index 7b058ea..e161cd9 100644 --- a/src/declarative/qml/qdeclarativeengine.h +++ b/src/declarative/qml/qdeclarativeengine.h @@ -46,6 +46,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -102,6 +103,9 @@ public: QUrl baseUrl() const; void setBaseUrl(const QUrl &); + bool outputWarningsToStandardError() const; + void setOutputWarningsToStandardError(bool); + static QDeclarativeContext *contextForObject(const QObject *); static void setContextForObject(QObject *, QDeclarativeContext *); @@ -110,7 +114,8 @@ public: static ObjectOwnership objectOwnership(QObject *); Q_SIGNALS: - void quit (); + void quit(); + void warnings(const QList &warnings); private: Q_DECLARE_PRIVATE(QDeclarativeEngine) diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h index 43d329c..f6b9bcb 100644 --- a/src/declarative/qml/qdeclarativeengine_p.h +++ b/src/declarative/qml/qdeclarativeengine_p.h @@ -162,6 +162,8 @@ public: QDeclarativeExpression *currentExpression; bool isDebugging; + bool outputWarningsToStdErr; + struct ImportedNamespace; QDeclarativeContextScriptClass *contextClass; QDeclarativeContextData *sharedContext; @@ -312,6 +314,12 @@ public: QVariant scriptValueToVariant(const QScriptValue &, int hint = QVariant::Invalid); void sendQuit(); + void warning(const QDeclarativeError &); + void warning(const QList &); + static void warning(QDeclarativeEngine *, const QDeclarativeError &); + static void warning(QDeclarativeEngine *, const QList &); + static void warning(QDeclarativeEnginePrivate *, const QDeclarativeError &); + static void warning(QDeclarativeEnginePrivate *, const QList &); static QScriptValue qmlScriptObject(QObject*, QDeclarativeEngine*); diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index 578733c..264fd8d 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -308,8 +308,6 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message) QByteArray type; ds >> type; - //qDebug() << "QDeclarativeEngineDebugServer::messageReceived()" << type; - if (type == "LIST_ENGINES") { int queryId; ds >> queryId; diff --git a/src/declarative/qml/qdeclarativeerror.cpp b/src/declarative/qml/qdeclarativeerror.cpp index 17e91e3..8717f56 100644 --- a/src/declarative/qml/qdeclarativeerror.cpp +++ b/src/declarative/qml/qdeclarativeerror.cpp @@ -216,9 +216,15 @@ void QDeclarativeError::setColumn(int column) QString QDeclarativeError::toString() const { QString rv; - rv = url().toString() + QLatin1Char(':') + QString::number(line()); - if(column() != -1) - rv += QLatin1Char(':') + QString::number(column()); + if (url().isEmpty()) { + rv = QLatin1String(""); + } else if (line() != -1) { + rv = url().toString() + QLatin1Char(':') + QString::number(line()); + if(column() != -1) + rv += QLatin1Char(':') + QString::number(column()); + } else { + rv = url().toString(); + } rv += QLatin1String(": ") + description(); diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp index 05240a2..8b5a62f 100644 --- a/src/declarative/qml/qdeclarativeexpression.cpp +++ b/src/declarative/qml/qdeclarativeexpression.cpp @@ -695,14 +695,13 @@ void QDeclarativeExpressionPrivate::updateGuards(const QPODVectorexpression() - << "depends on non-NOTIFYable properties:"; + << "depends on non-NOTIFYable properties:"; } const QMetaObject *metaObj = property.object->metaObject(); QMetaProperty metaProp = metaObj->property(property.coreIndex); - qWarning().nospace() << " " << metaObj->className() - << "::" << metaProp.name(); + qWarning().nospace() << " " << metaObj->className() << "::" << metaProp.name(); } } } diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp index 0a4352f..f6560a6 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/declarative/qml/qdeclarativeinfo.cpp @@ -45,6 +45,7 @@ #include "qdeclarativecontext.h" #include "private/qdeclarativecontext_p.h" #include "private/qdeclarativemetatype_p.h" +#include "private/qdeclarativeengine_p.h" #include @@ -77,52 +78,94 @@ QT_BEGIN_NAMESPACE \endcode */ +struct QDeclarativeInfoPrivate +{ + const QObject *object; + QString *buffer; + QList errors; +}; + QDeclarativeInfo::QDeclarativeInfo(const QObject *object) -: QDebug(QtWarningMsg) +: QDebug((*(QString **)&d) = new QString) { - QString pos = QLatin1String("QML"); - if (object) { - pos += QLatin1Char(' '); - - QString typeName; - QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject()); - if (type) { - typeName = QLatin1String(type->qmlTypeName()); - int lastSlash = typeName.lastIndexOf(QLatin1Char('/')); - if (lastSlash != -1) - typeName = typeName.mid(lastSlash+1); - } else { - typeName = QString::fromUtf8(object->metaObject()->className()); - int marker = typeName.indexOf(QLatin1String("_QMLTYPE_")); - if (marker != -1) - typeName = typeName.left(marker); - } + QDeclarativeInfoPrivate *p = new QDeclarativeInfoPrivate; + p->buffer = (QString *)d; + d = p; - pos += typeName; - } - QDeclarativeData *ddata = object?QDeclarativeData::get(object):0; - pos += QLatin1String(" ("); - if (ddata) { - if (ddata->outerContext && !ddata->outerContext->url.isEmpty()) { - pos += ddata->outerContext->url.toString(); - pos += QLatin1Char(':'); - pos += QString::number(ddata->lineNumber); - pos += QLatin1Char(':'); - pos += QString::number(ddata->columnNumber); - } else { - pos += QCoreApplication::translate("QDeclarativeInfo","unknown location"); - } - } else { - pos += QCoreApplication::translate("QDeclarativeInfo","unknown location"); - } - pos += QLatin1Char(')'); - *this << pos; + d->object = object; nospace(); } -QDeclarativeInfo::~QDeclarativeInfo() +QDeclarativeInfo::QDeclarativeInfo(const QObject *object, const QList &errors) +: QDebug((*(QString **)&d) = new QString) { + QDeclarativeInfoPrivate *p = new QDeclarativeInfoPrivate; + p->buffer = (QString *)d; + d = p; + + d->object = object; + d->errors = errors; + nospace(); } +QDeclarativeInfo::QDeclarativeInfo(const QObject *object, const QDeclarativeError &error) +: QDebug((*(QString **)&d) = new QString) +{ + QDeclarativeInfoPrivate *p = new QDeclarativeInfoPrivate; + p->buffer = (QString *)d; + d = p; + + d->object = object; + d->errors << error; + nospace(); +} + +QDeclarativeInfo::~QDeclarativeInfo() +{ + QList errors = d->errors; + + QDeclarativeEngine *engine = 0; + + if (!d->buffer->isEmpty()) { + QDeclarativeError error; + + QObject *object = const_cast(d->object); + + if (object) { + engine = qmlEngine(d->object); + QString typeName; + QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject()); + if (type) { + typeName = QLatin1String(type->qmlTypeName()); + int lastSlash = typeName.lastIndexOf(QLatin1Char('/')); + if (lastSlash != -1) + typeName = typeName.mid(lastSlash+1); + } else { + typeName = QString::fromUtf8(object->metaObject()->className()); + int marker = typeName.indexOf(QLatin1String("_QMLTYPE_")); + if (marker != -1) + typeName = typeName.left(marker); + } + + d->buffer->prepend(QLatin1String("QML ") + typeName + QLatin1String(": ")); + + QDeclarativeData *ddata = QDeclarativeData::get(object, false); + if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) { + error.setUrl(ddata->outerContext->url); + error.setLine(ddata->lineNumber); + error.setColumn(ddata->columnNumber); + } + } + + error.setDescription(*d->buffer); + + errors.prepend(error); + } + + QDeclarativeEnginePrivate::warning(engine, errors); + + delete d->buffer; + delete d; +} QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h index 8f69f73..36de7b1 100644 --- a/src/declarative/qml/qdeclarativeinfo.h +++ b/src/declarative/qml/qdeclarativeinfo.h @@ -43,6 +43,7 @@ #define QDECLARATIVEINFO_H #include +#include QT_BEGIN_HEADER @@ -50,10 +51,13 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +class QDeclarativeInfoPrivate; class Q_DECLARATIVE_EXPORT QDeclarativeInfo : public QDebug { public: QDeclarativeInfo(const QObject *); + QDeclarativeInfo(const QObject *, const QDeclarativeError &); + QDeclarativeInfo(const QObject *, const QList &); ~QDeclarativeInfo(); inline QDeclarativeInfo &operator<<(QChar t) { QDebug::operator<<(t); return *this; } @@ -78,6 +82,9 @@ public: inline QDeclarativeInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; } inline QDeclarativeInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; } inline QDeclarativeInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; } + +private: + QDeclarativeInfoPrivate *d; }; Q_DECLARATIVE_EXPORT inline QDeclarativeInfo qmlInfo(const QObject *me) @@ -85,6 +92,16 @@ Q_DECLARATIVE_EXPORT inline QDeclarativeInfo qmlInfo(const QObject *me) return QDeclarativeInfo(me); } +Q_DECLARATIVE_EXPORT inline QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error) +{ + return QDeclarativeInfo(me, error); +} + +Q_DECLARATIVE_EXPORT inline QDeclarativeInfo qmlInfo(const QObject *me, const QList &errors) +{ + return QDeclarativeInfo(me, errors); +} + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 7b71608..d41bd43 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -403,10 +403,8 @@ int QDeclarativeType::index() const int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &interface) { - if (interface.version > 0) { - qWarning("Cannot mix incompatible QML versions."); - return -1; - } + if (interface.version > 0) + qFatal("qmlRegisterType(): Cannot mix incompatible QML versions."); QWriteLocker lock(metaTypeDataLock()); QDeclarativeMetaTypeData *data = metaTypeData(); @@ -437,7 +435,7 @@ int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &t if (type.elementName) { for (int ii = 0; type.elementName[ii]; ++ii) { if (!isalnum(type.elementName[ii])) { - qWarning("QDeclarativeMetaType: Invalid QML element name %s", type.elementName); + qWarning("qmlRegisterType(): Invalid QML element name \"%s\"", type.elementName); return -1; } } diff --git a/src/declarative/qml/qdeclarativeproxymetaobject.cpp b/src/declarative/qml/qdeclarativeproxymetaobject.cpp index fe0dce7..c2dce0a 100644 --- a/src/declarative/qml/qdeclarativeproxymetaobject.cpp +++ b/src/declarative/qml/qdeclarativeproxymetaobject.cpp @@ -41,17 +41,11 @@ #include "private/qdeclarativeproxymetaobject_p.h" -#include - QT_BEGIN_NAMESPACE QDeclarativeProxyMetaObject::QDeclarativeProxyMetaObject(QObject *obj, QList *mList) : metaObjects(mList), proxies(0), parent(0), object(obj) { -#ifdef QDECLARATIVEPROXYMETAOBJECT_DEBUG - qWarning() << "QDeclarativeProxyMetaObject" << obj->metaObject()->className(); -#endif - *static_cast(this) = *metaObjects->first().metaObject; QObjectPrivate *op = QObjectPrivate::get(obj); @@ -59,14 +53,6 @@ QDeclarativeProxyMetaObject::QDeclarativeProxyMetaObject(QObject *obj, QList(op->metaObject); op->metaObject = this; - -#ifdef QDECLARATIVEPROXYMETAOBJECT_DEBUG - const QMetaObject *mo = obj->metaObject(); - while(mo) { - qWarning() << " " << mo->className(); - mo = mo->superClass(); - } -#endif } QDeclarativeProxyMetaObject::~QDeclarativeProxyMetaObject() diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index be2a1a7..b7e1832 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -1305,7 +1305,7 @@ void QDeclarativeXMLHttpRequest::printError(const QScriptValue& sv) { QDeclarativeError error; QDeclarativeExpressionPrivate::exceptionToError(sv.engine(), error); - qWarning().nospace() << qPrintable(error.toString()); + QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate::get(sv.engine()), error); } void QDeclarativeXMLHttpRequest::destroyNetwork() diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index fd85d91..5f81b26 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -185,7 +185,7 @@ void QDeclarativeAbstractAnimation::setRunning(bool r) return; if (d->group || d->disableUserControl) { - qWarning("QDeclarativeAbstractAnimation: setRunning() cannot be used on non-root animation nodes"); + qmlInfo(this) << "setRunning() cannot be used on non-root animation nodes."; return; } @@ -245,7 +245,7 @@ void QDeclarativeAbstractAnimation::setPaused(bool p) return; if (d->group || d->disableUserControl) { - qWarning("QDeclarativeAbstractAnimation: setPaused() cannot be used on non-root animation nodes"); + qmlInfo(this) << "setPaused() cannot be used on non-root animation nodes."; return; } @@ -781,8 +781,8 @@ void QDeclarativeScriptActionPrivate::execute() if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); expr.value(); - if (expr.hasError()) - qWarning() << expr.error(); + if (expr.hasError()) + qmlInfo(q) << expr.error(); } } diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index 41740a8..4115193 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -53,6 +53,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -136,7 +137,7 @@ void QDeclarativeFontLoader::setSource(const QUrl &url) d->status = QDeclarativeFontLoader::Ready; } else { d->status = QDeclarativeFontLoader::Error; - qWarning() << "Cannot load font:" << url; + qmlInfo(this) << "Cannot load font: \"" << url.toString() << "\""; } emit statusChanged(); } else @@ -231,7 +232,7 @@ void QDeclarativeFontLoader::replyFinished() d->addFontToDatabase(ba); } else { d->status = Error; - qWarning() << "Cannot load font:" << d->reply->url(); + qmlInfo(this) << "Cannot load font: \"" << d->reply->url().toString() << "\""; emit statusChanged(); } d->reply->deleteLater(); @@ -250,7 +251,7 @@ void QDeclarativeFontLoaderPrivate::addFontToDatabase(const QByteArray &ba) status = QDeclarativeFontLoader::Ready; } else { status = QDeclarativeFontLoader::Error; - qWarning() << "Cannot load font:" << url; + qmlInfo(q) << "Cannot load font: \"" << url.toString() << "\""; } emit q->statusChanged(); } diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 2616ccf..6e980d0 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -1187,10 +1187,9 @@ QScriptValue NestedListModel::get(int index) const if (!node) return 0; QDeclarativeEngine *eng = qmlEngine(m_listModel); - if (!eng) { - qWarning("Cannot call QDeclarativeListModel::get() without a QDeclarativeEngine"); + if (!eng) return 0; - } + return QDeclarativeEnginePrivate::qmlScriptObject(node->object(this), eng); } diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp index d91b107..534c923 100644 --- a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp +++ b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp @@ -202,10 +202,9 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e) FlatListModel *orig = m_orig->m_flat; FlatListModel *copy = s->list->m_flat; - if (!orig || !copy) { - qWarning("QML ListModel worker: sync() failed"); + if (!orig || !copy) return QObject::event(e); - } + orig->m_roles = copy->m_roles; orig->m_strings = copy->m_strings; orig->m_values = copy->m_values; diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp index ff78c60..81f4230 100644 --- a/src/declarative/util/qdeclarativestategroup.cpp +++ b/src/declarative/util/qdeclarativestategroup.cpp @@ -50,6 +50,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -381,7 +382,7 @@ void QDeclarativeStateGroupPrivate::setCurrentStateInternal(const QString &state } if (applyingState) { - qWarning() << "Can't apply a state change as part of a state definition."; + qmlInfo(q) << "Can't apply a state change as part of a state definition."; return; } diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 3854b10..eb6ac7b 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -577,7 +577,7 @@ void QDeclarativeStateChangeScript::execute() expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); expr.value(); if (expr.hasError()) - qWarning() << expr.error(); + qmlInfo(this, expr.error()); } } diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp index 01b5bc5..06a8f64 100644 --- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp +++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp @@ -262,7 +262,7 @@ void tst_qdeclarativeanchors::loops() { QUrl source(QUrl::fromLocalFile(SRCDIR "/data/loop1.qml")); - QString expect = "QML Text (" + source.toString() + ":6:5" + ") Possible anchor loop detected on horizontal anchor."; + QString expect = source.toString() + ":6:5: QML Text: Possible anchor loop detected on horizontal anchor."; QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); @@ -277,7 +277,7 @@ void tst_qdeclarativeanchors::loops() { QUrl source(QUrl::fromLocalFile(SRCDIR "/data/loop2.qml")); - QString expect = "QML Image (" + source.toString() + ":8:3" + ") Possible anchor loop detected on horizontal anchor."; + QString expect = source.toString() + ":8:3: QML Image: Possible anchor loop detected on horizontal anchor."; QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); QDeclarativeView *view = new QDeclarativeView; @@ -312,55 +312,55 @@ void tst_qdeclarativeanchors::illegalSets_data() QTest::newRow("H - too many anchors") << "Rectangle { id: rect; Rectangle { anchors.left: rect.left; anchors.right: rect.right; anchors.horizontalCenter: rect.horizontalCenter } }" - << "QML Rectangle (file::2:23) Cannot specify left, right, and hcenter anchors."; + << "file::2:23: QML Rectangle: Cannot specify left, right, and hcenter anchors."; foreach (const QString &side, QStringList() << "left" << "right") { QTest::newRow("H - anchor to V") << QString("Rectangle { Rectangle { anchors.%1: parent.top } }").arg(side) - << "QML Rectangle (file::2:13) Cannot anchor a horizontal edge to a vertical edge."; + << "file::2:13: QML Rectangle: Cannot anchor a horizontal edge to a vertical edge."; QTest::newRow("H - anchor to non parent/sibling") << QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side) - << "QML Rectangle (file::2:45) Cannot anchor to an item that isn't a parent or sibling."; + << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; QTest::newRow("H - anchor to self") << QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side) - << "QML Rectangle (file::2:1) Cannot anchor item to self."; + << "file::2:1: QML Rectangle: Cannot anchor item to self."; } QTest::newRow("V - too many anchors") << "Rectangle { id: rect; Rectangle { anchors.top: rect.top; anchors.bottom: rect.bottom; anchors.verticalCenter: rect.verticalCenter } }" - << "QML Rectangle (file::2:23) Cannot specify top, bottom, and vcenter anchors."; + << "file::2:23: QML Rectangle: Cannot specify top, bottom, and vcenter anchors."; QTest::newRow("V - too many anchors with baseline") << "Rectangle { Text { id: text1; text: \"Hello\" } Text { anchors.baseline: text1.baseline; anchors.top: text1.top; } }" - << "QML Text (file::2:47) Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors."; + << "file::2:47: QML Text: Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors."; foreach (const QString &side, QStringList() << "top" << "bottom" << "baseline") { QTest::newRow("V - anchor to H") << QString("Rectangle { Rectangle { anchors.%1: parent.left } }").arg(side) - << "QML Rectangle (file::2:13) Cannot anchor a vertical edge to a horizontal edge."; + << "file::2:13: QML Rectangle: Cannot anchor a vertical edge to a horizontal edge."; QTest::newRow("V - anchor to non parent/sibling") << QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side) - << "QML Rectangle (file::2:45) Cannot anchor to an item that isn't a parent or sibling."; + << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; QTest::newRow("V - anchor to self") << QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side) - << "QML Rectangle (file::2:1) Cannot anchor item to self."; + << "file::2:1: QML Rectangle: Cannot anchor item to self."; } QTest::newRow("centerIn - anchor to non parent/sibling") << "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.centerIn: rect} }" - << "QML Rectangle (file::2:45) Cannot anchor to an item that isn't a parent or sibling."; + << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; QTest::newRow("fill - anchor to non parent/sibling") << "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.fill: rect} }" - << "QML Rectangle (file::2:45) Cannot anchor to an item that isn't a parent or sibling."; + << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; } void tst_qdeclarativeanchors::reset() @@ -437,7 +437,7 @@ void tst_qdeclarativeanchors::nullItem() const QMetaObject *meta = item->anchors()->metaObject(); QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData())); - QTest::ignoreMessage(QtWarningMsg, "QML Item (unknown location) Cannot anchor to a null item."); + QTest::ignoreMessage(QtWarningMsg, ": QML Item: Cannot anchor to a null item."); QVERIFY(p.write(item->anchors(), qVariantFromValue(anchor))); delete item; @@ -461,7 +461,7 @@ void tst_qdeclarativeanchors::crash1() { QUrl source(QUrl::fromLocalFile(SRCDIR "/data/crash1.qml")); - QString expect = "QML Text (" + source.toString() + ":4:5" + ") Possible anchor loop detected on fill."; + QString expect = source.toString() + ":4:5: QML Text: Possible anchor loop detected on fill."; QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp index 0fb080c..237a436 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp +++ b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp @@ -199,7 +199,7 @@ void tst_qdeclarativeanimatedimage::invalidSource() component.setData("import Qt 4.7\n AnimatedImage { source: \"no-such-file.gif\" }", QUrl::fromLocalFile("")); QVERIFY(component.isReady()); - QTest::ignoreMessage(QtWarningMsg, "Error Reading Animated Image File QUrl( \"file:no-such-file.gif\" ) "); + QTest::ignoreMessage(QtWarningMsg, "file::2:2: QML AnimatedImage: Error Reading Animated Image File file:no-such-file.gif"); QDeclarativeAnimatedImage *anim = qobject_cast(component.create()); QVERIFY(anim); diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index 959cc19..e217e34 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -339,13 +339,13 @@ void tst_qdeclarativeanimations::badProperties() QDeclarativeEngine engine; QDeclarativeComponent c1(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml")); - QByteArray message = "QML ColorAnimation (" + QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml").toString().toUtf8() + ":18:9) Cannot animate non-existent property \"border.colr\""; + QByteArray message = QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate non-existent property \"border.colr\""; QTest::ignoreMessage(QtWarningMsg, message); QDeclarativeRectangle *rect = qobject_cast(c1.create()); QVERIFY(rect); QDeclarativeComponent c2(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml")); - message = "QML ColorAnimation (" + QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml").toString().toUtf8() + ":18:9) Cannot animate read-only property \"border\""; + message = QUrl::fromLocalFile(SRCDIR "/data/badproperty2.qml").toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate read-only property \"border\""; QTest::ignoreMessage(QtWarningMsg, message); rect = qobject_cast(c2.create()); QVERIFY(rect); @@ -549,12 +549,12 @@ void tst_qdeclarativeanimations::propertiesTransition() void tst_qdeclarativeanimations::invalidDuration() { QDeclarativePropertyAnimation *animation = new QDeclarativePropertyAnimation; - QTest::ignoreMessage(QtWarningMsg, "QML PropertyAnimation (unknown location) Cannot set a duration of < 0"); + QTest::ignoreMessage(QtWarningMsg, ": QML PropertyAnimation: Cannot set a duration of < 0"); animation->setDuration(-1); QCOMPARE(animation->duration(), 250); QDeclarativePauseAnimation *pauseAnimation = new QDeclarativePauseAnimation; - QTest::ignoreMessage(QtWarningMsg, "QML PauseAnimation (unknown location) Cannot set a duration of < 0"); + QTest::ignoreMessage(QtWarningMsg, ": QML PauseAnimation: Cannot set a duration of < 0"); pauseAnimation->setDuration(-1); QCOMPARE(pauseAnimation->duration(), 250); } @@ -620,7 +620,8 @@ void tst_qdeclarativeanimations::dontStart() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontStart.qml")); - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeAbstractAnimation: setRunning() cannot be used on non-root animation nodes"); + QString warning = c.url().toString() + ":14:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes."; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); QDeclarativeRectangle *rect = qobject_cast(c.create()); QVERIFY(rect); @@ -634,7 +635,8 @@ void tst_qdeclarativeanimations::dontStart() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontStart2.qml")); - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeAbstractAnimation: setRunning() cannot be used on non-root animation nodes"); + QString warning = c.url().toString() + ":15:17: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes."; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); QDeclarativeRectangle *rect = qobject_cast(c.create()); QVERIFY(rect); diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp index 3bff2f5..ee9e282 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp +++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp @@ -272,7 +272,8 @@ void tst_qdeclarativebehaviors::reassignedAnimation() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml")); - QTest::ignoreMessage(QtWarningMsg, QString("QML Behavior (" + QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:9) Cannot change the animation assigned to a Behavior.").toUtf8().constData()); + QString warning = QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:9: QML Behavior: Cannot change the animation assigned to a Behavior."; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); QDeclarativeRectangle *rect = qobject_cast(c.create()); QTRY_VERIFY(rect); QTRY_COMPARE(qobject_cast( @@ -303,7 +304,8 @@ void tst_qdeclarativebehaviors::dontStart() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/dontStart.qml")); - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeAbstractAnimation: setRunning() cannot be used on non-root animation nodes"); + QString warning = c.url().toString() + ":13:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes."; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); QDeclarativeRectangle *rect = qobject_cast(c.create()); QTRY_VERIFY(rect); diff --git a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp index 8621239..69b4a89 100644 --- a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp +++ b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp @@ -121,10 +121,10 @@ void tst_qdeclarativeborderimage::imageSource_data() QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << false << ""; QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() << false - << "QML BorderImage (file::2:1) Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); + << "file::2:1: QML BorderImage: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true << ""; QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << true - << "QML BorderImage (file::2:1) Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; + << "file::2:1: QML BorderImage: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; } void tst_qdeclarativeborderimage::imageSource() @@ -304,8 +304,8 @@ void tst_qdeclarativeborderimage::sciSource_data() void tst_qdeclarativeborderimage::invalidSciFile() { - QTest::ignoreMessage(QtWarningMsg, "Unknown tile rule specified. Using Stretch "); // for "Roun" - QTest::ignoreMessage(QtWarningMsg, "Unknown tile rule specified. Using Stretch "); // for "Repea" + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Roun" + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Repea" QString componentStr = "import Qt 4.7\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/invalid.sci").toString() +"\"; width: 300; height: 300 }"; QDeclarativeComponent component(&engine); diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 098ac36..a94f4f6 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -320,7 +320,7 @@ void tst_qdeclarativeecmascript::methods() void tst_qdeclarativeecmascript::bindingLoop() { QDeclarativeComponent component(&engine, TEST_FILE("bindingLoop.qml")); - QString warning = "QML MyQmlObject (" + component.url().toString() + ":9:9) Binding loop detected for property \"stringProperty\""; + QString warning = component.url().toString() + ":9:9: QML MyQmlObject: Binding loop detected for property \"stringProperty\""; QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); QObject *object = component.create(); QVERIFY(object != 0); diff --git a/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp b/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp index 4155edb..f32cdbd 100644 --- a/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp +++ b/tests/auto/declarative/qdeclarativeflipable/tst_qdeclarativeflipable.cpp @@ -103,11 +103,11 @@ void tst_qdeclarativeflipable::setFrontAndBack() QVERIFY(obj->front() != 0); QVERIFY(obj->back() != 0); - QString message = "QML Flipable (" + c.url().toString() + ":3:1) front is a write-once property"; + QString message = c.url().toString() + ":3:1: QML Flipable: front is a write-once property"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); obj->setFront(new QDeclarativeRectangle()); - message = "QML Flipable (" + c.url().toString() + ":3:1) back is a write-once property"; + message = c.url().toString() + ":3:1: QML Flipable: back is a write-once property"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); obj->setBack(new QDeclarativeRectangle()); delete obj; diff --git a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp index 5cdc96c..36908d9 100644 --- a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp +++ b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp @@ -121,7 +121,7 @@ void tst_qdeclarativefontloader::localFont() void tst_qdeclarativefontloader::failLocalFont() { QString componentStr = "import Qt 4.7\nFontLoader { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\" }"; - QTest::ignoreMessage(QtWarningMsg, QString("Cannot load font: QUrl( \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\" ) ").toUtf8().constData()); + QTest::ignoreMessage(QtWarningMsg, QString("file::2:1: QML FontLoader: Cannot load font: \"" + QUrl::fromLocalFile(SRCDIR "/data/dummy.ttf").toString() + "\"").toUtf8().constData()); QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativeFontLoader *fontObject = qobject_cast(component.create()); @@ -165,7 +165,7 @@ void tst_qdeclarativefontloader::redirWebFont() void tst_qdeclarativefontloader::failWebFont() { QString componentStr = "import Qt 4.7\nFontLoader { source: \"http://localhost:14448/nonexist.ttf\" }"; - QTest::ignoreMessage(QtWarningMsg, "Cannot load font: QUrl( \"http://localhost:14448/nonexist.ttf\" ) "); + QTest::ignoreMessage(QtWarningMsg, "file::2:1: QML FontLoader: Cannot load font: \"http://localhost:14448/nonexist.ttf\""); QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativeFontLoader *fontObject = qobject_cast(component.create()); diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 854bcdd..f94692b 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -124,13 +124,13 @@ void tst_qdeclarativeimage::imageSource_data() QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << 120.0 << 120.0 << false << false << ""; QTest::newRow("local async") << QUrl::fromLocalFile(SRCDIR "/data/colors1.png").toString() << 120.0 << 120.0 << false << true << ""; QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() << 0.0 << 0.0 << false - << false << "QML Image (file::2:1) Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); + << false << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); QTest::newRow("local async not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString() << 0.0 << 0.0 << false - << true << "QML Image (file::2:1) Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString(); + << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString(); QTest::newRow("remote") << SERVER_ADDR "/colors.png" << 120.0 << 120.0 << true << false << ""; QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << ""; QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << 0.0 << 0.0 << true - << false << "QML Image (file::2:1) Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; + << false << "file::2:1: QML Image: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; } diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp index aca951b..cc4ec20 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp +++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp @@ -96,9 +96,9 @@ void tst_qdeclarativeimageprovider::imageSource_data() QTest::newRow("exists") << "image://test/exists.png" << "" << QSize(100,100) << ""; QTest::newRow("scaled") << "image://test/exists.png" << "sourceSize: \"80x30\"" << QSize(80,30) << ""; QTest::newRow("missing") << "image://test/no-such-file.png" << "" << QSize() - << "QML Image (file::2:1) Failed to get image from provider: image://test/no-such-file.png"; + << "file::2:1: QML Image: Failed to get image from provider: image://test/no-such-file.png"; QTest::newRow("unknown provider") << "image://bogus/exists.png" << "" << QSize() - << "QML Image (file::2:1) Failed to get image from provider: image://bogus/exists.png"; + << "file::2:1: QML Image: Failed to get image from provider: image://bogus/exists.png"; } @@ -158,7 +158,7 @@ void tst_qdeclarativeimageprovider::removeProvider() QCOMPARE(obj->width(), 100.0); // remove the provider and confirm - QString error("QML Image (file::2:1) Failed to get image from provider: image://test2/exists2.png"); + QString error("file::2:1: QML Image: Failed to get image from provider: image://test2/exists2.png"); QTest::ignoreMessage(QtWarningMsg, error.toUtf8()); diff --git a/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp b/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp index aa3f03b..36db448 100644 --- a/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp +++ b/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp @@ -75,14 +75,14 @@ void tst_qdeclarativeinfo::qmlObject() QObject *object = component.create(); QVERIFY(object != 0); - QString message = "QML QObject_QML_0 (" + component.url().toString() + ":3:1) Test Message"; + QString message = component.url().toString() + ":3:1: QML QObject_QML_0: Test Message"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); qmlInfo(object) << "Test Message"; QObject *nested = qvariant_cast(object->property("nested")); QVERIFY(nested != 0); - message = "QML QtObject (" + component.url().toString() + ":6:13) Second Test Message"; + message = component.url().toString() + ":6:13: QML QtObject: Second Test Message"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); qmlInfo(nested) << "Second Test Message"; } @@ -99,11 +99,11 @@ void tst_qdeclarativeinfo::nestedQmlObject() QObject *nested2 = qvariant_cast(object->property("nested2")); QVERIFY(nested2 != 0); - QString message = "QML NestedObject (" + component.url().toString() + ":5:13) Outer Object"; + QString message = component.url().toString() + ":5:13: QML NestedObject: Outer Object"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); qmlInfo(nested) << "Outer Object"; - message = "QML QtObject (" + TEST_FILE("NestedObject.qml").toString() + ":6:14) Inner Object"; + message = TEST_FILE("NestedObject.qml").toString() + ":6:14: QML QtObject: Inner Object"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); qmlInfo(nested2) << "Inner Object"; } @@ -111,17 +111,17 @@ void tst_qdeclarativeinfo::nestedQmlObject() void tst_qdeclarativeinfo::nonQmlObject() { QObject object; - QTest::ignoreMessage(QtWarningMsg, "QML QtObject (unknown location) Test Message"); + QTest::ignoreMessage(QtWarningMsg, ": QML QtObject: Test Message"); qmlInfo(&object) << "Test Message"; QPushButton pbObject; - QTest::ignoreMessage(QtWarningMsg, "QML QPushButton (unknown location) Test Message"); + QTest::ignoreMessage(QtWarningMsg, ": QML QPushButton: Test Message"); qmlInfo(&pbObject) << "Test Message"; } void tst_qdeclarativeinfo::nullObject() { - QTest::ignoreMessage(QtWarningMsg, "QML (unknown location) Null Object Test Message"); + QTest::ignoreMessage(QtWarningMsg, ": Null Object Test Message"); qmlInfo(0) << "Null Object Test Message"; } @@ -130,7 +130,7 @@ void tst_qdeclarativeinfo::nonQmlContextedObject() QObject object; QDeclarativeContext context(&engine); QDeclarativeEngine::setContextForObject(&object, &context); - QTest::ignoreMessage(QtWarningMsg, "QML QtObject (unknown location) Test Message"); + QTest::ignoreMessage(QtWarningMsg, ": QML QtObject: Test Message"); qmlInfo(&object) << "Test Message"; } diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index 4400116..d2c328e 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -385,12 +385,15 @@ void tst_QDeclarativeItem::mapCoordinates() Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); QCOMPARE(result.value(), qobject_cast(a)->mapFromScene(x, y)); - QTest::ignoreMessage(QtWarningMsg, "mapToItem() given argument \"1122\" which is neither null nor an Item"); + QString warning1 = QUrl::fromLocalFile(SRCDIR "/data/mapCoordinates.qml").toString() + ":7:5: QML Item: mapToItem() given argument \"1122\" which is neither null nor an Item"; + QString warning2 = QUrl::fromLocalFile(SRCDIR "/data/mapCoordinates.qml").toString() + ":7:5: QML Item: mapFromItem() given argument \"1122\" which is neither null nor an Item"; + + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QVERIFY(QMetaObject::invokeMethod(root, "checkMapAToInvalid", Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); QVERIFY(result.toBool()); - QTest::ignoreMessage(QtWarningMsg, "mapFromItem() given argument \"1122\" which is neither null nor an Item"); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); QVERIFY(QMetaObject::invokeMethod(root, "checkMapAFromInvalid", Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); QVERIFY(result.toBool()); diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 8feab32..9d4a1f5 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -779,8 +779,7 @@ void tst_qdeclarativelanguage::valueTypes() QDeclarativeComponent component(&engine, TEST_FILE("valueTypes.qml")); VERIFY_ERRORS(0); - QString message = QLatin1String("QML MyTypeObject (") + component.url().toString() + - QLatin1String(":2:1) Binding loop detected for property \"rectProperty.width\""); + QString message = component.url().toString() + ":2:1: QML MyTypeObject: Binding loop detected for property \"rectProperty.width\""; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index 9d61ad0..b44a4f7 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -183,58 +183,58 @@ void tst_QDeclarativeListModel::dynamic_data() QTest::newRow("count") << "count" << 0 << ""; - QTest::newRow("get1") << "{get(0)}" << 0 << "QML ListModel (unknown location) get: index 0 out of range"; - QTest::newRow("get2") << "{get(-1)}" << 0 << "QML ListModel (unknown location) get: index -1 out of range"; + QTest::newRow("get1") << "{get(0)}" << 0 << ": QML ListModel: get: index 0 out of range"; + QTest::newRow("get2") << "{get(-1)}" << 0 << ": QML ListModel: get: index -1 out of range"; QTest::newRow("append1") << "{append({'foo':123});count}" << 1 << ""; QTest::newRow("append2") << "{append({'foo':123,'bar':456});count}" << 1 << ""; QTest::newRow("append3a") << "{append({'foo':123});append({'foo':456});get(0).foo}" << 123 << ""; QTest::newRow("append3b") << "{append({'foo':123});append({'foo':456});get(1).foo}" << 456 << ""; - QTest::newRow("append4a") << "{append(123)}" << 0 << "QML ListModel (unknown location) append: value is not an object"; - QTest::newRow("append4b") << "{append([1,2,3])}" << 0 << "QML ListModel (unknown location) append: value is not an object"; + QTest::newRow("append4a") << "{append(123)}" << 0 << ": QML ListModel: append: value is not an object"; + QTest::newRow("append4b") << "{append([1,2,3])}" << 0 << ": QML ListModel: append: value is not an object"; QTest::newRow("clear1") << "{append({'foo':456});clear();count}" << 0 << ""; QTest::newRow("clear2") << "{append({'foo':123});append({'foo':456});clear();count}" << 0 << ""; - QTest::newRow("clear3") << "{append({'foo':123});clear();get(0).foo}" << 0 << "QML ListModel (unknown location) get: index 0 out of range"; + QTest::newRow("clear3") << "{append({'foo':123});clear();get(0).foo}" << 0 << ": QML ListModel: get: index 0 out of range"; QTest::newRow("remove1") << "{append({'foo':123});remove(0);count}" << 0 << ""; QTest::newRow("remove2a") << "{append({'foo':123});append({'foo':456});remove(0);count}" << 1 << ""; QTest::newRow("remove2b") << "{append({'foo':123});append({'foo':456});remove(0);get(0).foo}" << 456 << ""; QTest::newRow("remove2c") << "{append({'foo':123});append({'foo':456});remove(1);get(0).foo}" << 123 << ""; - QTest::newRow("remove3") << "{append({'foo':123});remove(0);get(0).foo}" << 0 << "QML ListModel (unknown location) get: index 0 out of range"; - QTest::newRow("remove3a") << "{append({'foo':123});remove(-1);count}" << 1 << "QML ListModel (unknown location) remove: index -1 out of range"; - QTest::newRow("remove4a") << "{remove(0)}" << 0 << "QML ListModel (unknown location) remove: index 0 out of range"; - QTest::newRow("remove4b") << "{append({'foo':123});remove(0);remove(0);count}" << 0 << "QML ListModel (unknown location) remove: index 0 out of range"; - QTest::newRow("remove4c") << "{append({'foo':123});remove(1);count}" << 1 << "QML ListModel (unknown location) remove: index 1 out of range"; + QTest::newRow("remove3") << "{append({'foo':123});remove(0);get(0).foo}" << 0 << ": QML ListModel: get: index 0 out of range"; + QTest::newRow("remove3a") << "{append({'foo':123});remove(-1);count}" << 1 << ": QML ListModel: remove: index -1 out of range"; + QTest::newRow("remove4a") << "{remove(0)}" << 0 << ": QML ListModel: remove: index 0 out of range"; + QTest::newRow("remove4b") << "{append({'foo':123});remove(0);remove(0);count}" << 0 << ": QML ListModel: remove: index 0 out of range"; + QTest::newRow("remove4c") << "{append({'foo':123});remove(1);count}" << 1 << ": QML ListModel: remove: index 1 out of range"; QTest::newRow("insert1") << "{insert(0,{'foo':123});count}" << 1 << ""; - QTest::newRow("insert2") << "{insert(1,{'foo':123});count}" << 0 << "QML ListModel (unknown location) insert: index 1 out of range"; + QTest::newRow("insert2") << "{insert(1,{'foo':123});count}" << 0 << ": QML ListModel: insert: index 1 out of range"; QTest::newRow("insert3a") << "{append({'foo':123});insert(1,{'foo':456});count}" << 2 << ""; QTest::newRow("insert3b") << "{append({'foo':123});insert(1,{'foo':456});get(0).foo}" << 123 << ""; QTest::newRow("insert3c") << "{append({'foo':123});insert(1,{'foo':456});get(1).foo}" << 456 << ""; QTest::newRow("insert3d") << "{append({'foo':123});insert(0,{'foo':456});get(0).foo}" << 456 << ""; QTest::newRow("insert3e") << "{append({'foo':123});insert(0,{'foo':456});get(1).foo}" << 123 << ""; - QTest::newRow("insert4") << "{append({'foo':123});insert(-1,{'foo':456});count}" << 1 << "QML ListModel (unknown location) insert: index -1 out of range"; - QTest::newRow("insert5a") << "{insert(0,123)}" << 0 << "QML ListModel (unknown location) insert: value is not an object"; - QTest::newRow("insert5b") << "{insert(0,[1,2,3])}" << 0 << "QML ListModel (unknown location) insert: value is not an object"; + QTest::newRow("insert4") << "{append({'foo':123});insert(-1,{'foo':456});count}" << 1 << ": QML ListModel: insert: index -1 out of range"; + QTest::newRow("insert5a") << "{insert(0,123)}" << 0 << ": QML ListModel: insert: value is not an object"; + QTest::newRow("insert5b") << "{insert(0,[1,2,3])}" << 0 << ": QML ListModel: insert: value is not an object"; QTest::newRow("set1") << "{append({'foo':123});set(0,{'foo':456});count}" << 1 << ""; QTest::newRow("set2") << "{append({'foo':123});set(0,{'foo':456});get(0).foo}" << 456 << ""; QTest::newRow("set3a") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).foo}" << 999 << ""; QTest::newRow("set3b") << "{append({'foo':123,'bar':456});set(0,{'foo':999});get(0).bar}" << 456 << ""; - QTest::newRow("set4a") << "{set(0,{'foo':456})}" << 0 << "QML ListModel (unknown location) set: index 0 out of range"; - QTest::newRow("set4c") << "{set(-1,{'foo':456})}" << 0 << "QML ListModel (unknown location) set: index -1 out of range"; - QTest::newRow("set5a") << "{append({'foo':123,'bar':456});set(0,123);count}" << 1 << "QML ListModel (unknown location) set: value is not an object"; - QTest::newRow("set5b") << "{append({'foo':123,'bar':456});set(0,[1,2,3]);count}" << 1 << "QML ListModel (unknown location) set: value is not an object"; + QTest::newRow("set4a") << "{set(0,{'foo':456})}" << 0 << ": QML ListModel: set: index 0 out of range"; + QTest::newRow("set4c") << "{set(-1,{'foo':456})}" << 0 << ": QML ListModel: set: index -1 out of range"; + QTest::newRow("set5a") << "{append({'foo':123,'bar':456});set(0,123);count}" << 1 << ": QML ListModel: set: value is not an object"; + QTest::newRow("set5b") << "{append({'foo':123,'bar':456});set(0,[1,2,3]);count}" << 1 << ": QML ListModel: set: value is not an object"; QTest::newRow("set6") << "{append({'foo':123});set(1,{'foo':456});count}" << 2 << ""; QTest::newRow("setprop1") << "{append({'foo':123});setProperty(0,'foo',456);count}" << 1 << ""; QTest::newRow("setprop2") << "{append({'foo':123});setProperty(0,'foo',456);get(0).foo}" << 456 << ""; QTest::newRow("setprop3a") << "{append({'foo':123,'bar':456});setProperty(0,'foo',999);get(0).foo}" << 999 << ""; QTest::newRow("setprop3b") << "{append({'foo':123,'bar':456});setProperty(0,'foo',999);get(0).bar}" << 456 << ""; - QTest::newRow("setprop4a") << "{setProperty(0,'foo',456)}" << 0 << "QML ListModel (unknown location) set: index 0 out of range"; - QTest::newRow("setprop4b") << "{setProperty(-1,'foo',456)}" << 0 << "QML ListModel (unknown location) set: index -1 out of range"; - QTest::newRow("setprop4c") << "{append({'foo':123,'bar':456});setProperty(1,'foo',456);count}" << 1 << "QML ListModel (unknown location) set: index 1 out of range"; + QTest::newRow("setprop4a") << "{setProperty(0,'foo',456)}" << 0 << ": QML ListModel: set: index 0 out of range"; + QTest::newRow("setprop4b") << "{setProperty(-1,'foo',456)}" << 0 << ": QML ListModel: set: index -1 out of range"; + QTest::newRow("setprop4c") << "{append({'foo':123,'bar':456});setProperty(1,'foo',456);count}" << 1 << ": QML ListModel: set: index 1 out of range"; QTest::newRow("setprop5") << "{append({'foo':123,'bar':456});append({'foo':111});setProperty(1,'bar',222);get(1).bar}" << 222 << ""; QTest::newRow("move1a") << "{append({'foo':123});append({'foo':456});move(0,1,1);count}" << 2 << ""; @@ -246,10 +246,10 @@ void tst_QDeclarativeListModel::dynamic_data() QTest::newRow("move2b") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(0).foo}" << 789 << ""; QTest::newRow("move2c") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(1).foo}" << 123 << ""; QTest::newRow("move2d") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,1,2);get(2).foo}" << 456 << ""; - QTest::newRow("move3a") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,0,3);count}" << 3 << "QML ListModel (unknown location) move: out of range"; - QTest::newRow("move3b") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,-1,1);count}" << 3 << "QML ListModel (unknown location) move: out of range"; - QTest::newRow("move3c") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,0,-1);count}" << 3 << "QML ListModel (unknown location) move: out of range"; - QTest::newRow("move3d") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,3,1);count}" << 3 << "QML ListModel (unknown location) move: out of range"; + QTest::newRow("move3a") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,0,3);count}" << 3 << ": QML ListModel: move: out of range"; + QTest::newRow("move3b") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,-1,1);count}" << 3 << ": QML ListModel: move: out of range"; + QTest::newRow("move3c") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(1,0,-1);count}" << 3 << ": QML ListModel: move: out of range"; + QTest::newRow("move3d") << "{append({'foo':123});append({'foo':456});append({'foo':789});move(0,3,1);count}" << 3 << ": QML ListModel: move: out of range"; // Nested models @@ -323,7 +323,7 @@ void tst_QDeclarativeListModel::dynamic_worker() // execute a set of commands on the worker list model, then check the // changes are reflected in the list model in the main thread if (QByteArray(QTest::currentDataTag()).startsWith("nested")) - QTest::ignoreMessage(QtWarningMsg, "QML ListModel (unknown location) Cannot add nested list values when modifying or after modification from a worker script"); + QTest::ignoreMessage(QtWarningMsg, ": QML ListModel: Cannot add nested list values when modifying or after modification from a worker script"); QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker", Q_ARG(QVariant, operations.mid(0, operations.length()-1)))); @@ -359,7 +359,7 @@ void tst_QDeclarativeListModel::convertNestedToFlat_fail() model.append(nestedListValue(&s_eng)); QCOMPARE(model.count(), 2); - QTest::ignoreMessage(QtWarningMsg, "QML ListModel (unknown location) List contains nested list values and cannot be used from a worker script"); + QTest::ignoreMessage(QtWarningMsg, ": QML ListModel: List contains nested list values and cannot be used from a worker script"); QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker", Q_ARG(QVariant, script))); waitForWorker(item); @@ -411,7 +411,7 @@ void tst_QDeclarativeListModel::convertNestedToFlat_ok() QCOMPARE(model.count(), count+1); QScriptValue nested = nestedListValue(&s_eng); - const char *warning = "QML ListModel (unknown location) Cannot add nested list values when modifying or after modification from a worker script"; + const char *warning = ": QML ListModel: Cannot add nested list values when modifying or after modification from a worker script"; QTest::ignoreMessage(QtWarningMsg, warning); model.append(nested); diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp index 4a82b50..1b17a56 100644 --- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp +++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp @@ -138,7 +138,7 @@ void tst_QDeclarativeLoader::component() void tst_QDeclarativeLoader::invalidUrl() { - QTest::ignoreMessage(QtWarningMsg, QString("(:-1: File error for URL " + QUrl::fromLocalFile(SRCDIR "/data/IDontExist.qml").toString() + ") ").toUtf8().constData()); + QTest::ignoreMessage(QtWarningMsg, QString(": File error for URL " + QUrl::fromLocalFile(SRCDIR "/data/IDontExist.qml").toString()).toUtf8().constData()); QDeclarativeComponent component(&engine); component.setData(QByteArray("import Qt 4.7\nLoader { source: \"IDontExist.qml\" }"), TEST_FILE("")); @@ -465,7 +465,7 @@ void tst_QDeclarativeLoader::failNetworkRequest() QVERIFY(server.isValid()); server.serveDirectory(SRCDIR "/data"); - QTest::ignoreMessage(QtWarningMsg, "(:-1: Network error for URL http://127.0.0.1:14450/IDontExist.qml) "); + QTest::ignoreMessage(QtWarningMsg, ": Network error for URL http://127.0.0.1:14450/IDontExist.qml"); QDeclarativeComponent component(&engine); component.setData(QByteArray("import Qt 4.7\nLoader { source: \"http://127.0.0.1:14450/IDontExist.qml\" }"), QUrl::fromLocalFile("http://127.0.0.1:14450/dummy.qml")); @@ -505,7 +505,7 @@ void tst_QDeclarativeLoader::deleteComponentCrash() void tst_QDeclarativeLoader::nonItem() { QDeclarativeComponent component(&engine, TEST_FILE("nonItem.qml")); - QString err = QString("QML Loader (") + QUrl::fromLocalFile(SRCDIR).toString() + QString("/data/nonItem.qml:3:1) Loader does not support loading non-visual elements."); + QString err = QUrl::fromLocalFile(SRCDIR).toString() + "/data/nonItem.qml:3:1: QML Loader: Loader does not support loading non-visual elements."; QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData()); QDeclarativeLoader *loader = qobject_cast(component.create()); diff --git a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp index 7d51bb6..53614fe 100644 --- a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp +++ b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp @@ -310,7 +310,7 @@ void tst_qdeclarativeproperty::qmlmetaproperty_object() QCOMPARE(prop.propertyTypeName(), "int"); QCOMPARE(QString(prop.property().name()), QString("defaultProperty")); QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); - QTest::ignoreMessage(QtWarningMsg, ":-1: Unable to assign null to int"); + QTest::ignoreMessage(QtWarningMsg, ": Unable to assign null to int"); QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0); QVERIFY(binding != 0); QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding.data()); @@ -409,7 +409,7 @@ void tst_qdeclarativeproperty::qmlmetaproperty_object_string() QCOMPARE(prop.propertyTypeName(), "int"); QCOMPARE(QString(prop.property().name()), QString("defaultProperty")); QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); - QTest::ignoreMessage(QtWarningMsg, ":-1: Unable to assign null to int"); + QTest::ignoreMessage(QtWarningMsg, ": Unable to assign null to int"); QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0); QVERIFY(binding != 0); QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding.data()); @@ -602,7 +602,7 @@ void tst_qdeclarativeproperty::qmlmetaproperty_object_context() QCOMPARE(prop.propertyTypeName(), "int"); QCOMPARE(QString(prop.property().name()), QString("defaultProperty")); QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); - QTest::ignoreMessage(QtWarningMsg, ":-1: Unable to assign null to int"); + QTest::ignoreMessage(QtWarningMsg, ": Unable to assign null to int"); QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0); QVERIFY(binding != 0); QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding.data()); @@ -701,7 +701,7 @@ void tst_qdeclarativeproperty::qmlmetaproperty_object_string_context() QCOMPARE(prop.propertyTypeName(), "int"); QCOMPARE(QString(prop.property().name()), QString("defaultProperty")); QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); - QTest::ignoreMessage(QtWarningMsg, ":-1: Unable to assign null to int"); + QTest::ignoreMessage(QtWarningMsg, ": Unable to assign null to int"); QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding.data()) == 0); QVERIFY(binding != 0); QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding.data()); diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index 578bcb4..1446920 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -522,7 +522,7 @@ void tst_qdeclarativestates::parentChangeErrors() QDeclarativeRectangle *innerRect = qobject_cast(rect->findChild("MyRect")); QVERIFY(innerRect != 0); - QTest::ignoreMessage(QtWarningMsg, QByteArray("QML ParentChange (" + fullDataPath("/data/parentChange4.qml") + ":25:9) Unable to preserve appearance under non-uniform scale").constData()); + QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange4.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under non-uniform scale"); rect->setState("reparented"); QCOMPARE(innerRect->rotation(), qreal(0)); QCOMPARE(innerRect->scale(), qreal(1)); @@ -538,7 +538,7 @@ void tst_qdeclarativestates::parentChangeErrors() QDeclarativeRectangle *innerRect = qobject_cast(rect->findChild("MyRect")); QVERIFY(innerRect != 0); - QTest::ignoreMessage(QtWarningMsg, QByteArray("QML ParentChange (" + fullDataPath("/data/parentChange5.qml") + ":25:9) Unable to preserve appearance under complex transform").constData()); + QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/parentChange5.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under complex transform"); rect->setState("reparented"); QCOMPARE(innerRect->rotation(), qreal(0)); QCOMPARE(innerRect->scale(), qreal(1)); @@ -813,8 +813,8 @@ void tst_qdeclarativestates::propertyErrors() QCOMPARE(rect->color(),QColor("red")); - QTest::ignoreMessage(QtWarningMsg, QByteArray("QML PropertyChanges (" + fullDataPath("/data/propertyErrors.qml") + ":8:9) Cannot assign to non-existent property \"colr\"").constData()); - QTest::ignoreMessage(QtWarningMsg, QByteArray("QML PropertyChanges (" + fullDataPath("/data/propertyErrors.qml") + ":8:9) Cannot assign to read-only property \"wantsFocus\"").constData()); + QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\""); + QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to read-only property \"wantsFocus\""); rect->setState("blue"); } @@ -946,7 +946,7 @@ void tst_qdeclarativestates::illegalTempState() QDeclarativeRectangle *rect = qobject_cast(rectComponent.create()); QVERIFY(rect != 0); - QTest::ignoreMessage(QtWarningMsg, "Can't apply a state change as part of a state definition. "); + QTest::ignoreMessage(QtWarningMsg, ": QML StateGroup: Can't apply a state change as part of a state definition."); rect->setState("placed"); QCOMPARE(rect->state(), QLatin1String("placed")); } @@ -959,7 +959,7 @@ void tst_qdeclarativestates::nonExistantProperty() QDeclarativeRectangle *rect = qobject_cast(rectComponent.create()); QVERIFY(rect != 0); - QTest::ignoreMessage(QtWarningMsg, QByteArray("QML PropertyChanges (" + fullDataPath("/data/nonExistantProp.qml") + ":9:9) Cannot assign to non-existent property \"colr\"").constData()); + QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/nonExistantProp.qml") + ":9:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\""); rect->setState("blue"); QCOMPARE(rect->state(), QLatin1String("blue")); } diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp index edb4a32..551e17b 100644 --- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp +++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp @@ -871,10 +871,10 @@ void tst_qdeclarativetext::embeddedImages_data() QTest::addColumn("error"); QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesLocal.qml") << ""; QTest::newRow("local-error") << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesLocalError.qml") - << "QML Text ("+QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesLocalError.qml").toString()+":3:1) Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/http/notexists.png").toString(); + << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesLocalError.qml").toString()+":3:1: QML Text: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/http/notexists.png").toString(); QTest::newRow("remote") << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesRemote.qml") << ""; QTest::newRow("remote-error") << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesRemoteError.qml") - << "QML Text ("+QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesRemoteError.qml").toString()+":3:1) Error downloading http://127.0.0.1:14453/notexists.png - server replied: Not found"; + << QUrl::fromLocalFile(SRCDIR "/data/embeddedImagesRemoteError.qml").toString()+":3:1: QML Text: Error downloading http://127.0.0.1:14453/notexists.png - server replied: Not found"; } void tst_qdeclarativetext::embeddedImages() diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 25101ba..3307b7c 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -649,7 +649,7 @@ void tst_qdeclarativetextedit::delegateLoading_data() // import installed QTest::newRow("pass") << "cursorHttpTestPass.qml" << ""; - QTest::newRow("fail1") << "cursorHttpTestFail1.qml" << ":-1: Network error for URL http://localhost:42332/FailItem.qml "; + QTest::newRow("fail1") << "cursorHttpTestFail1.qml" << ": Network error for URL http://localhost:42332/FailItem.qml "; QTest::newRow("fail2") << "cursorHttpTestFail2.qml" << "http://localhost:42332/ErrItem.qml:4:5: Fungus is not a type "; } -- cgit v0.12 From ffe9f4b839da5bc2758845a5eb6ddc78776b06df Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 19 Apr 2010 14:14:30 +1000 Subject: Partial revert of 348d1f6d421a6e23b769af99608fa6d81631a6c3 (accidentally committed changes) --- src/testlib/qtestlightxmlstreamer.cpp | 3 +-- src/testlib/qtestlogger.cpp | 3 --- src/testlib/qtestxmlstreamer.cpp | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/testlib/qtestlightxmlstreamer.cpp b/src/testlib/qtestlightxmlstreamer.cpp index 8c22a4f..0ac9ea8 100644 --- a/src/testlib/qtestlightxmlstreamer.cpp +++ b/src/testlib/qtestlightxmlstreamer.cpp @@ -87,13 +87,12 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, QTestCharBu QXmlTestLogger::xmlQuote("edFile, element->attributeValue(QTest::AI_File)); QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description)); - QTest::qt_asprintf(formatted, "\n %s\n\n", + QTest::qt_asprintf(formatted, "\n \n\n", element->attributeValue(QTest::AI_Type), element->attributeName(QTest::AI_File), quotedFile.constData(), element->attributeName(QTest::AI_Line), element->attributeValue(QTest::AI_Line), - element->attributeValue(QTest::AI_Tag) ? element->attributeValue(QTest::AI_Tag) : "", cdataDesc.constData()); break; } diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp index 79bb84c..6c76388 100644 --- a/src/testlib/qtestlogger.cpp +++ b/src/testlib/qtestlogger.cpp @@ -318,9 +318,6 @@ void QTestLogger::addMessage(MessageTypes type, const char *message, const char break; } - const char *tag = QTestResult::currentDataTag(); - if (tag) - errorElement->addAttribute(QTest::AI_Tag, tag); errorElement->addAttribute(QTest::AI_Type, typeBuf); errorElement->addAttribute(QTest::AI_Description, message); diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp index 9addb31..b9946e5 100644 --- a/src/testlib/qtestxmlstreamer.cpp +++ b/src/testlib/qtestxmlstreamer.cpp @@ -111,13 +111,12 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, QTestCharBuffer QXmlTestLogger::xmlQuote("edFile, element->attributeValue(QTest::AI_File)); QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description)); - QTest::qt_asprintf(formatted, "\n %s\n \n\n", + QTest::qt_asprintf(formatted, "\n \n\n", element->attributeValue(QTest::AI_Type), element->attributeName(QTest::AI_File), quotedFile.constData(), element->attributeName(QTest::AI_Line), element->attributeValue(QTest::AI_Line), - element->attributeValue(QTest::AI_Tag) ? element->attributeValue(QTest::AI_Tag) : "", cdataDesc.constData()); break; } -- cgit v0.12 From 7de92b5b4cee9179d7163a477c03ed411c3975d6 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 19 Apr 2010 14:44:03 +1000 Subject: Compile --- src/declarative/qml/qdeclarativeinfo.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h index 36de7b1..3d5a111 100644 --- a/src/declarative/qml/qdeclarativeinfo.h +++ b/src/declarative/qml/qdeclarativeinfo.h @@ -43,6 +43,7 @@ #define QDECLARATIVEINFO_H #include +#include #include QT_BEGIN_HEADER @@ -82,6 +83,7 @@ public: inline QDeclarativeInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; } inline QDeclarativeInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; } inline QDeclarativeInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; } + inline QDeclarativeInfo &operator<<(const QUrl &t) { static_cast(*this) << t; return *this; } private: QDeclarativeInfoPrivate *d; -- cgit v0.12 From 16d2b97e03ff99583ab25977880affecc1c4463b Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 19 Apr 2010 14:47:11 +1000 Subject: QDeclarativeImage should stretch in one direction when tiling in the other. Task-number: QTBUG-6716 Reviewed-by: Michael Brasser --- .../graphicsitems/qdeclarativeimage.cpp | 25 +++++-- .../declarative/qdeclarativeimage/data/green.png | Bin 0 -> 314 bytes .../declarative/qdeclarativeimage/data/tiling.qml | 16 +++++ .../qdeclarativeimage/tst_qdeclarativeimage.cpp | 77 ++++++++++++++++++++- 4 files changed, 112 insertions(+), 6 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeimage/data/green.png create mode 100644 tests/auto/declarative/qdeclarativeimage/data/tiling.qml diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index 37b07bf..1ca8fe2 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -366,12 +366,27 @@ void QDeclarativeImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWi if (width() != d->pix.width() || height() != d->pix.height()) { if (d->fillMode >= Tile) { - if (d->fillMode == Tile) + if (d->fillMode == Tile) { p->drawTiledPixmap(QRectF(0,0,width(),height()), d->pix); - else if (d->fillMode == TileVertically) - p->drawTiledPixmap(QRectF(0,0,d->pix.width(),height()), d->pix); - else - p->drawTiledPixmap(QRectF(0,0,width(),d->pix.height()), d->pix); + } else { + qreal widthScale = width() / qreal(d->pix.width()); + qreal heightScale = height() / qreal(d->pix.height()); + + QTransform scale; + if (d->fillMode == TileVertically) { + scale.scale(widthScale, 1.0); + QTransform old = p->transform(); + p->setWorldTransform(scale * old); + p->drawTiledPixmap(QRectF(0,0,d->pix.width(),height()), d->pix); + p->setWorldTransform(old); + } else { + scale.scale(1.0, heightScale); + QTransform old = p->transform(); + p->setWorldTransform(scale * old); + p->drawTiledPixmap(QRectF(0,0,width(),d->pix.height()), d->pix); + p->setWorldTransform(old); + } + } } else { qreal widthScale = width() / qreal(d->pix.width()); qreal heightScale = height() / qreal(d->pix.height()); diff --git a/tests/auto/declarative/qdeclarativeimage/data/green.png b/tests/auto/declarative/qdeclarativeimage/data/green.png new file mode 100644 index 0000000..0a2e153 Binary files /dev/null and b/tests/auto/declarative/qdeclarativeimage/data/green.png differ diff --git a/tests/auto/declarative/qdeclarativeimage/data/tiling.qml b/tests/auto/declarative/qdeclarativeimage/data/tiling.qml new file mode 100644 index 0000000..32839bb --- /dev/null +++ b/tests/auto/declarative/qdeclarativeimage/data/tiling.qml @@ -0,0 +1,16 @@ +import Qt 4.7 + +Rectangle { + width: 800; height: 600 + + Image { + objectName: "vTiling"; height: 550; width: 200 + source: "green.png"; fillMode: Image.TileVertically + } + + Image { + objectName: "hTiling"; x: 225; height: 250; width: 550 + source: "green.png"; fillMode: Image.TileHorizontally + } +} + diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index f94692b..73aefaf 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include "../shared/testhttpserver.h" @@ -86,8 +87,12 @@ private slots: void pixmap(); void svg(); void big(); + void tiling_QTBUG_6716(); private: + template + T *findItem(QGraphicsObject *parent, const QString &id, int index=-1); + QDeclarativeEngine engine; }; @@ -161,7 +166,7 @@ void tst_qdeclarativeimage::imageSource() if (async) QVERIFY(obj->asynchronous() == true); - + if (remote || async) TRY_WAIT(obj->status() == QDeclarativeImage::Loading); @@ -339,6 +344,76 @@ void tst_qdeclarativeimage::big() delete obj; } +void tst_qdeclarativeimage::tiling_QTBUG_6716() +{ + QDeclarativeView *canvas = new QDeclarativeView(0); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/tiling.qml")); + canvas->show(); + qApp->processEvents(); + + QDeclarativeImage *vTiling = findItem(canvas->rootObject(), "vTiling"); + QDeclarativeImage *hTiling = findItem(canvas->rootObject(), "hTiling"); + + QVERIFY(vTiling != 0); + QVERIFY(hTiling != 0); + + { + QPixmap pm(vTiling->width(), vTiling->height()); + QPainter p(&pm); + vTiling->paint(&p, 0, 0); + + QImage img = pm.toImage(); + for (int x = 0; x < vTiling->width(); ++x) { + for (int y = 0; y < vTiling->height(); ++y) { + QVERIFY(img.pixel(x, y) == qRgb(0, 255, 0)); + } + } + } + + { + QPixmap pm(hTiling->width(), hTiling->height()); + QPainter p(&pm); + hTiling->paint(&p, 0, 0); + + QImage img = pm.toImage(); + for (int x = 0; x < hTiling->width(); ++x) { + for (int y = 0; y < hTiling->height(); ++y) { + QVERIFY(img.pixel(x, y) == qRgb(0, 255, 0)); + } + } + } +} + +/* + Find an item with the specified objectName. If index is supplied then the + item must also evaluate the {index} expression equal to index +*/ +template +T *tst_qdeclarativeimage::findItem(QGraphicsObject *parent, const QString &objectName, int index) +{ + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->childItems().count() << "children"; + for (int i = 0; i < parent->childItems().count(); ++i) { + QDeclarativeItem *item = qobject_cast(parent->childItems().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { + if (index != -1) { + QDeclarativeExpression e(qmlContext(item), "index", item); + if (e.value().toInt() == index) + return static_cast(item); + } else { + return static_cast(item); + } + } + item = findItem(item, objectName, index); + if (item) + return static_cast(item); + } + + return 0; +} QTEST_MAIN(tst_qdeclarativeimage) -- cgit v0.12 From 2b37eeac9bc9afa30d4f6e772f29ee9e963effd5 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Mon, 19 Apr 2010 15:28:25 +1000 Subject: Fixed typo in QMediaPlayer::play() error reporting Parameters to invokeMethod were omitted, so error was not reported. Reviewed-by: Justin McPherson --- src/multimedia/mediaservices/playback/qmediaplayer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/multimedia/mediaservices/playback/qmediaplayer.cpp b/src/multimedia/mediaservices/playback/qmediaplayer.cpp index e91a64c..90e64c1 100644 --- a/src/multimedia/mediaservices/playback/qmediaplayer.cpp +++ b/src/multimedia/mediaservices/playback/qmediaplayer.cpp @@ -56,7 +56,7 @@ #include #include -//#define DEBUG_PLAYER_STATE +#define DEBUG_PLAYER_STATE QT_BEGIN_HEADER @@ -491,9 +491,9 @@ void QMediaPlayer::play() Q_D(QMediaPlayer); if (d->control == 0) { - QMetaObject::invokeMethod(this, "_q_error", Qt::QueuedConnection); + QMetaObject::invokeMethod(this, "_q_error", Qt::QueuedConnection, Q_ARG(int, QMediaPlayer::ServiceMissingError), - Q_ARG(QString, tr("The QMediaPlayer object does not have a valid service")); + Q_ARG(QString, tr("The QMediaPlayer object does not have a valid service"))); return; } -- cgit v0.12 From ec4591334476d4fe7663c6e6fe1659138ea233fe Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Mon, 19 Apr 2010 15:37:45 +1000 Subject: Disabled QMediaPlayer states debug output. It was enabled accidentally. Reviewed-by: trustme --- src/multimedia/mediaservices/playback/qmediaplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multimedia/mediaservices/playback/qmediaplayer.cpp b/src/multimedia/mediaservices/playback/qmediaplayer.cpp index 90e64c1..ca1f250 100644 --- a/src/multimedia/mediaservices/playback/qmediaplayer.cpp +++ b/src/multimedia/mediaservices/playback/qmediaplayer.cpp @@ -56,7 +56,7 @@ #include #include -#define DEBUG_PLAYER_STATE +//#define DEBUG_PLAYER_STATE QT_BEGIN_HEADER -- cgit v0.12 From cb54ab7c6f60cadc85c25750a1b2aa3bc96a1505 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 19 Apr 2010 15:38:14 +1000 Subject: Reference count ObjectData's to correctly delete objects with no parent QTBUG-9872 --- src/declarative/qml/qdeclarativedata_p.h | 3 ++- src/declarative/qml/qdeclarativeobjectscriptclass.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/declarative/qml/qdeclarativedata_p.h index 2ddd7e5..4a56536 100644 --- a/src/declarative/qml/qdeclarativedata_p.h +++ b/src/declarative/qml/qdeclarativedata_p.h @@ -75,7 +75,7 @@ public: : ownMemory(true), ownContext(false), indestructible(true), explicitIndestructibleSet(false), context(0), outerContext(0), bindings(0), nextContextObject(0), prevContextObject(0), bindingBitsSize(0), bindingBits(0), lineNumber(0), columnNumber(0), deferredComponent(0), deferredIdx(0), - attachedProperties(0), scriptValue(0), propertyCache(0), guards(0) { + attachedProperties(0), scriptValue(0), objectDataRefCount(0), propertyCache(0), guards(0) { init(); } @@ -128,6 +128,7 @@ public: // ### Can we make this QScriptValuePrivate so we incur no additional allocation // cost? QScriptValue *scriptValue; + quint32 objectDataRefCount; QDeclarativePropertyCache *propertyCache; QDeclarativeGuard *guards; diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index 5773fe6..a27d19d 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -59,12 +59,17 @@ Q_DECLARE_METATYPE(QScriptValue); QT_BEGIN_NAMESPACE struct ObjectData : public QScriptDeclarativeClass::Object { - ObjectData(QObject *o, int t) : object(o), type(t) {} + ObjectData(QObject *o, int t) : object(o), type(t) { + if (o) { + QDeclarativeData *ddata = QDeclarativeData::get(object, true); + if (ddata) ddata->objectDataRefCount++; + } + } virtual ~ObjectData() { if (object && !object->parent()) { QDeclarativeData *ddata = QDeclarativeData::get(object, false); - if (ddata && !ddata->indestructible) + if (ddata && !ddata->indestructible && 0 == --ddata->objectDataRefCount) object->deleteLater(); } } -- cgit v0.12 From 8e414cb69e1d27b66f51cd68a7126c5ac647c974 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 19 Apr 2010 15:49:44 +1000 Subject: Documentation fixes. --- src/declarative/graphicsitems/qdeclarativeborderimage.cpp | 10 +++++----- src/declarative/graphicsitems/qdeclarativeimage.cpp | 9 ++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index 7858a7a..06f8363 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -264,9 +264,9 @@ void QDeclarativeBorderImage::load() When the image is scaled: \list \i the corners (sections 1, 3, 7, and 9) are not scaled at all - \i the middle (section 5) is scaled according to BorderImage::horizontalTileMode and BorderImage::verticalTileMode - \i sections 2 and 8 are scaled according to BorderImage::horizontalTileMode - \i sections 4 and 6 are scaled according to BorderImage::verticalTileMode + \i sections 2 and 8 are scaled according to \l{BorderImage::horizontalTileMode}{horizontalTileMode} + \i sections 4 and 6 are scaled according to \l{BorderImage::verticalTileMode}{verticalTileMode} + \i the middle (section 5) is scaled according to both \l{BorderImage::horizontalTileMode}{horizontalTileMode} and \l{BorderImage::verticalTileMode}{verticalTileMode} \endlist Each border line (left, right, top, and bottom) specifies an offset from the respective side. For example, \c{border.bottom: 10} sets the bottom line 10 pixels up from the bottom of the image. @@ -282,8 +282,8 @@ QDeclarativeScaleGrid *QDeclarativeBorderImage::border() } /*! - \qmlproperty TileMode BorderImage::horizontalTileMode - \qmlproperty TileMode BorderImage::verticalTileMode + \qmlproperty enumeration BorderImage::horizontalTileMode + \qmlproperty enumeration BorderImage::verticalTileMode This property describes how to repeat or stretch the middle parts of the border image. diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index 1ca8fe2..247e348 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -236,9 +236,12 @@ qreal QDeclarativeImage::paintedHeight() const to react to the change in status you need to do it yourself, for example in one of the following ways: \list - \o Create a state, so that a state change occurs, e.g. State{name: 'loaded'; when: image.status = Image.Ready;} - \o Do something inside the onStatusChanged signal handler, e.g. Image{id: image; onStatusChanged: if(image.status == Image.Ready) console.log('Loaded');} - \o Bind to the status variable somewhere, e.g. Text{text: if(image.status!=Image.Ready){'Not Loaded';}else{'Loaded';}} + \o Create a state, so that a state change occurs, e.g. + \qml State { name: 'loaded'; when: image.status = Image.Ready } \endqml + \o Do something inside the onStatusChanged signal handler, e.g. + \qml Image { id: image; onStatusChanged: if (image.status == Image.Ready) console.log('Loaded') } \endqml + \o Bind to the status variable somewhere, e.g. + \qml Text { text: if (image.status != Image.Ready) { 'Not Loaded' } else { 'Loaded' } } \endqml \endlist \sa progress -- cgit v0.12 From 1390f6f1208ca914ee801ff8be1352fc0b094f62 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 19 Apr 2010 15:50:35 +1000 Subject: Avoid painfully slow flicking to snap positions. Task-number: QTBUG-9994 --- src/declarative/graphicsitems/qdeclarativelistview.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 5a0292f..672f723 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -50,6 +50,7 @@ #include #include +#include #include QT_BEGIN_NAMESPACE @@ -1206,7 +1207,15 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m data.flickTarget -= overshootDist; } } - dist = -data.flickTarget + data.move.value(); + qreal adjDist = -data.flickTarget + data.move.value(); + if (qAbs(adjDist) > qAbs(dist)) { + // Prevent painfully slow flicking - adjust velocity to suit flickDeceleration + v2 = accel * 2.0f * qAbs(dist); + v = qSqrt(v2); + if (dist > 0) + v = -v; + } + dist = adjDist; accel = v2 / (2.0f * qAbs(dist)); } else if (overShoot) { data.flickTarget = data.move.value() - dist; -- cgit v0.12 From f0f740fadaa4c368df5743502f445f9ce0de1247 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 19 Apr 2010 15:57:39 +1000 Subject: Avoid painfully slow flicking to snap positions in GridView Task-number: QTBUG-9994 --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 727dba3..23140fa 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -50,6 +50,7 @@ #include #include +#include #include QT_BEGIN_NAMESPACE @@ -834,7 +835,15 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m if (v > 0) dist = -dist; data.flickTarget = -snapPosAt(-(data.move.value() - highlightRangeStart) + dist) + highlightRangeStart; - dist = -data.flickTarget + data.move.value(); + qreal adjDist = -data.flickTarget + data.move.value(); + if (qAbs(adjDist) > qAbs(dist)) { + // Prevent painfully slow flicking - adjust velocity to suit flickDeceleration + v2 = accel * 2.0f * qAbs(dist); + v = qSqrt(v2); + if (dist > 0) + v = -v; + } + dist = adjDist; accel = v2 / (2.0f * qAbs(dist)); } else { data.flickTarget = velocity > 0 ? minExtent : maxExtent; -- cgit v0.12 From d2f8eaca50b9997bd66805787b5042faa28f5ec2 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 19 Apr 2010 16:03:10 +1000 Subject: Fiddle with the overshoot correction curve. --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 018d48f..a76d88e 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -266,7 +266,7 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal if (fixupDuration) { qreal dist = minExtent - data.move; timeline.move(data.move, minExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4); - timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutQuint), 3*fixupDuration/4); + timeline.move(data.move, minExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4); } else { data.move.setValue(minExtent); q->viewportMoved(); @@ -278,7 +278,7 @@ void QDeclarativeFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal if (fixupDuration) { qreal dist = maxExtent - data.move; timeline.move(data.move, maxExtent - dist/2, QEasingCurve(QEasingCurve::InQuad), fixupDuration/4); - timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutQuint), 3*fixupDuration/4); + timeline.move(data.move, maxExtent, QEasingCurve(QEasingCurve::OutExpo), 3*fixupDuration/4); } else { data.move.setValue(maxExtent); q->viewportMoved(); -- cgit v0.12 From fae16b674b619b73037841a00577de5922a26595 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 19 Apr 2010 16:25:26 +1000 Subject: Don't crash on deleted objects assigned to variant properties QTBUG-8077 --- src/declarative/qml/qdeclarativevmemetaobject.cpp | 27 +++++++++++++++++----- src/declarative/qml/qdeclarativevmemetaobject_p.h | 1 + .../qdeclarativeecmascript/data/deletedObject.qml | 2 +- .../tst_qdeclarativeecmascript.cpp | 1 - 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp index c4d47b3..45f04a0 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject.cpp +++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp @@ -86,7 +86,6 @@ public: inline void setValue(const QDate &); inline void setValue(const QDateTime &); inline void setValue(const QScriptValue &); - private: int type; void *data[4]; // Large enough to hold all types @@ -112,6 +111,9 @@ void QDeclarativeVMEVariant::cleanup() type == QMetaType::Bool || type == QMetaType::Double) { type = QVariant::Invalid; + } else if (type == QMetaType::QObjectStar) { + ((QDeclarativeGuard*)dataPtr())->~QDeclarativeGuard(); + type = QVariant::Invalid; } else if (type == QMetaType::QString) { ((QString *)dataPtr())->~QString(); type = QVariant::Invalid; @@ -160,7 +162,7 @@ QObject *QDeclarativeVMEVariant::asQObject() if (type != QMetaType::QObjectStar) setValue((QObject *)0); - return *(QObject **)(dataPtr()); + return *(QDeclarativeGuard *)(dataPtr()); } const QVariant &QDeclarativeVMEVariant::asQVariant() @@ -256,8 +258,9 @@ void QDeclarativeVMEVariant::setValue(QObject *v) if (type != QMetaType::QObjectStar) { cleanup(); type = QMetaType::QObjectStar; + new (dataPtr()) QDeclarativeGuard(); } - *(QObject **)(dataPtr()) = v; + *(QDeclarativeGuard*)(dataPtr()) = v; } void QDeclarativeVMEVariant::setValue(const QVariant &v) @@ -465,8 +468,7 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) if (c == QMetaObject::ReadProperty) { *reinterpret_cast(a[0]) = readVarPropertyAsVariant(id); } else if (c == QMetaObject::WriteProperty) { - needActivate = (data[id].asQVariant() != *reinterpret_cast(a[0])); - data[id].setValue(*reinterpret_cast(a[0])); + writeVarProperty(id, *reinterpret_cast(a[0])); } } else { @@ -682,6 +684,8 @@ QScriptValue QDeclarativeVMEMetaObject::readVarProperty(int id) { if (data[id].dataType() == qMetaTypeId()) return data[id].asQScriptValue(); + else if (data[id].dataType() == QMetaType::QObjectStar) + return QDeclarativeEnginePrivate::get(ctxt->engine)->objectClass->newQObject(data[id].asQObject()); else return QDeclarativeEnginePrivate::get(ctxt->engine)->scriptValueFromVariant(data[id].asQVariant()); } @@ -690,7 +694,9 @@ QVariant QDeclarativeVMEMetaObject::readVarPropertyAsVariant(int id) { if (data[id].dataType() == qMetaTypeId()) return QDeclarativeEnginePrivate::get(ctxt->engine)->scriptValueToVariant(data[id].asQScriptValue()); - else + else if (data[id].dataType() == QMetaType::QObjectStar) + return QVariant::fromValue(data[id].asQObject()); + else return data[id].asQVariant(); } @@ -700,6 +706,15 @@ void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QScriptValue &val activate(object, methodOffset + id, 0); } +void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QVariant &value) +{ + if (value.userType() == QMetaType::QObjectStar) + data[id].setValue(qvariant_cast(value)); + else + data[id].setValue(value); + activate(object, methodOffset + id, 0); +} + void QDeclarativeVMEMetaObject::listChanged(int id) { activate(object, methodOffset + id, 0); diff --git a/src/declarative/qml/qdeclarativevmemetaobject_p.h b/src/declarative/qml/qdeclarativevmemetaobject_p.h index 76390c9..4fc3269 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject_p.h +++ b/src/declarative/qml/qdeclarativevmemetaobject_p.h @@ -148,6 +148,7 @@ private: QScriptValue readVarProperty(int); QVariant readVarPropertyAsVariant(int); void writeVarProperty(int, const QScriptValue &); + void writeVarProperty(int, const QVariant &); QAbstractDynamicMetaObject *parent; diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml index 29eba42..64b83af 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml @@ -20,6 +20,6 @@ QtObject { myObject.deleteOnSet = 1; test3 = myObject.value == undefined; - // test4 = obj.value == undefined; + test4 = obj.value == undefined; } } diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index a94f4f6..4036507 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -1764,7 +1764,6 @@ void tst_qdeclarativeecmascript::deletedObject() QCOMPARE(object->property("test1").toBool(), true); QCOMPARE(object->property("test2").toBool(), true); QCOMPARE(object->property("test3").toBool(), true); - QEXPECT_FAIL("", "QTBUG-8077", Continue); QCOMPARE(object->property("test4").toBool(), true); delete object; -- cgit v0.12 From b13def0486a083c48bae40dab2bac014b690f36d Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 19 Apr 2010 15:57:54 +1000 Subject: List properties for dynamic meta objects. Real solution is probably to fix/rewrite/dispose of QDeclarativeOpenMetaObject. Task-number: QTBUG-9420 Reviewed-by: Michael Brasser --- src/declarative/qml/qdeclarativeobjectscriptclass.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index a27d19d..a194354 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -463,12 +463,21 @@ QStringList QDeclarativeObjectScriptClass::propertyNames(Object *object) cache = ddata->propertyCache; if (!cache) { cache = enginePrivate->cache(obj); - if (cache && ddata) { cache->addref(); ddata->propertyCache = cache; } + if (cache) { + if (ddata) { cache->addref(); ddata->propertyCache = cache; } + } else { + // Not cachable - fall back to QMetaObject (eg. dynamic meta object) + // XXX QDeclarativeOpenMetaObject has a cache, so this is suboptimal. + // XXX This is a workaround for QTBUG-9420. + const QMetaObject *mo = obj->metaObject(); + QStringList r; + int pc = mo->propertyCount(); + int po = mo->propertyOffset(); + for (int i=po; iproperty(i).name()); + return r; + } } - - if (!cache) - return QStringList(); - return cache->propertyNames(); } -- cgit v0.12 From 2a9a22c7464b706c1e1998e10910b8f99528c6c4 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 19 Apr 2010 16:20:56 +1000 Subject: Test that ListElements returned by get() can be iterated over in JS. Task-number: QTBUG-9420 --- .../qdeclarativelistmodel/data/enumerate.qml | 24 +++++++++ .../tst_qdeclarativelistmodel.cpp | 62 ++++++++++++++-------- 2 files changed, 64 insertions(+), 22 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml new file mode 100644 index 0000000..8d23d4b --- /dev/null +++ b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml @@ -0,0 +1,24 @@ +import Qt 4.6 + +Item { + property string result + + ListModel { + id: model + + ListElement { + val1: 1 + val2: 2 + val3: "str" + val4: false + val5: true + } + } + + Component.onCompleted: { + var element = model.get(0); + + for (var i in element) + result += i+"="+element[i]+(element[i] ? "Y" : "N")+":"; + } +} diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index b44a4f7..bbea98a 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -51,11 +51,11 @@ #include "../../../shared/util.h" -class tst_QDeclarativeListModel : public QObject +class tst_qdeclarativelistmodel : public QObject { Q_OBJECT public: - tst_QDeclarativeListModel() {} + tst_qdeclarativelistmodel() {} private: QScriptValue nestedListValue(QScriptEngine *eng) const; @@ -76,12 +76,13 @@ private slots: void convertNestedToFlat_fail_data(); void convertNestedToFlat_ok(); void convertNestedToFlat_ok_data(); + void enumerate(); void error_data(); void error(); void set(); }; -QScriptValue tst_QDeclarativeListModel::nestedListValue(QScriptEngine *eng) const +QScriptValue tst_qdeclarativelistmodel::nestedListValue(QScriptEngine *eng) const { QScriptValue list = eng->newArray(); list.setProperty(0, eng->newObject()); @@ -91,7 +92,7 @@ QScriptValue tst_QDeclarativeListModel::nestedListValue(QScriptEngine *eng) cons return sv; } -QDeclarativeItem *tst_QDeclarativeListModel::createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model) +QDeclarativeItem *tst_qdeclarativelistmodel::createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model) { QDeclarativeItem *item = qobject_cast(component->create()); QDeclarativeEngine::setContextForObject(model, eng->rootContext()); @@ -100,7 +101,7 @@ QDeclarativeItem *tst_QDeclarativeListModel::createWorkerTest(QDeclarativeEngine return item; } -void tst_QDeclarativeListModel::waitForWorker(QDeclarativeItem *item) +void tst_qdeclarativelistmodel::waitForWorker(QDeclarativeItem *item) { QEventLoop loop; QTimer timer; @@ -115,7 +116,7 @@ void tst_QDeclarativeListModel::waitForWorker(QDeclarativeItem *item) QVERIFY(timer.isActive()); } -void tst_QDeclarativeListModel::static_i18n() +void tst_qdeclarativelistmodel::static_i18n() { QString expect = QString::fromUtf8("na\303\257ve"); QString componentStr = "import Qt 4.7\nListModel { ListElement { prop1: \""+expect+"\" } }"; @@ -129,7 +130,7 @@ void tst_QDeclarativeListModel::static_i18n() delete obj; } -void tst_QDeclarativeListModel::static_nestedElements() +void tst_qdeclarativelistmodel::static_nestedElements() { QFETCH(int, elementCount); @@ -163,7 +164,7 @@ void tst_QDeclarativeListModel::static_nestedElements() delete obj; } -void tst_QDeclarativeListModel::static_nestedElements_data() +void tst_qdeclarativelistmodel::static_nestedElements_data() { QTest::addColumn("elementCount"); @@ -173,7 +174,7 @@ void tst_QDeclarativeListModel::static_nestedElements_data() QTest::newRow("many items") << 5; } -void tst_QDeclarativeListModel::dynamic_data() +void tst_qdeclarativelistmodel::dynamic_data() { QTest::addColumn("script"); QTest::addColumn("result"); @@ -264,7 +265,7 @@ void tst_QDeclarativeListModel::dynamic_data() //QTest::newRow("nested-setprop") << "{append({'foo':123});setProperty(0,'foo',[{'x':123}]);get(0).foo.get(0).x}" << 123 << ""; } -void tst_QDeclarativeListModel::dynamic() +void tst_qdeclarativelistmodel::dynamic() { QFETCH(QString, script); QFETCH(int, result); @@ -285,12 +286,12 @@ void tst_QDeclarativeListModel::dynamic() QCOMPARE(actual,result); } -void tst_QDeclarativeListModel::dynamic_worker_data() +void tst_qdeclarativelistmodel::dynamic_worker_data() { dynamic_data(); } -void tst_QDeclarativeListModel::dynamic_worker() +void tst_qdeclarativelistmodel::dynamic_worker() { QFETCH(QString, script); QFETCH(int, result); @@ -340,7 +341,7 @@ void tst_QDeclarativeListModel::dynamic_worker() qApp->processEvents(); } -void tst_QDeclarativeListModel::convertNestedToFlat_fail() +void tst_qdeclarativelistmodel::convertNestedToFlat_fail() { // If a model has nested data, it cannot be used at all from a worker script @@ -369,7 +370,7 @@ void tst_QDeclarativeListModel::convertNestedToFlat_fail() qApp->processEvents(); } -void tst_QDeclarativeListModel::convertNestedToFlat_fail_data() +void tst_qdeclarativelistmodel::convertNestedToFlat_fail_data() { QTest::addColumn("script"); @@ -383,7 +384,7 @@ void tst_QDeclarativeListModel::convertNestedToFlat_fail_data() QTest::newRow("get") << "get(0)"; } -void tst_QDeclarativeListModel::convertNestedToFlat_ok() +void tst_qdeclarativelistmodel::convertNestedToFlat_ok() { // If a model only has plain data, it can be modified from a worker script. However, // once the model is used from a worker script, it no longer accepts nested data @@ -428,12 +429,12 @@ void tst_QDeclarativeListModel::convertNestedToFlat_ok() qApp->processEvents(); } -void tst_QDeclarativeListModel::convertNestedToFlat_ok_data() +void tst_qdeclarativelistmodel::convertNestedToFlat_ok_data() { convertNestedToFlat_fail_data(); } -void tst_QDeclarativeListModel::static_types_data() +void tst_qdeclarativelistmodel::static_types_data() { QTest::addColumn("qml"); QTest::addColumn("value"); @@ -463,7 +464,7 @@ void tst_QDeclarativeListModel::static_types_data() << QVariant(double(QDeclarativeText::AlignHCenter)); } -void tst_QDeclarativeListModel::static_types() +void tst_qdeclarativelistmodel::static_types() { QFETCH(QString, qml); QFETCH(QVariant, value); @@ -494,7 +495,24 @@ void tst_QDeclarativeListModel::static_types() delete obj; } -void tst_QDeclarativeListModel::error_data() +void tst_qdeclarativelistmodel::enumerate() +{ + QDeclarativeEngine eng; + QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/enumerate.qml")); + QVERIFY(!component.isError()); + QDeclarativeItem *item = qobject_cast(component.create()); + QVERIFY(item != 0); + QStringList r = item->property("result").toString().split(":"); + QCOMPARE(r[0],QLatin1String("val1=1Y")); + QCOMPARE(r[1],QLatin1String("val2=2Y")); + QCOMPARE(r[2],QLatin1String("val3=strY")); + QCOMPARE(r[3],QLatin1String("val4=falseN")); + QCOMPARE(r[4],QLatin1String("val5=trueY")); + delete item; +} + + +void tst_qdeclarativelistmodel::error_data() { QTest::addColumn("qml"); QTest::addColumn("error"); @@ -532,7 +550,7 @@ void tst_QDeclarativeListModel::error_data() << "ListElement: cannot contain nested elements"; } -void tst_QDeclarativeListModel::error() +void tst_qdeclarativelistmodel::error() { QFETCH(QString, qml); QFETCH(QString, error); @@ -551,7 +569,7 @@ void tst_QDeclarativeListModel::error() } } -void tst_QDeclarativeListModel::set() +void tst_qdeclarativelistmodel::set() { QDeclarativeEngine engine; QDeclarativeListModel model; @@ -575,6 +593,6 @@ void tst_QDeclarativeListModel::set() } -QTEST_MAIN(tst_QDeclarativeListModel) +QTEST_MAIN(tst_qdeclarativelistmodel) #include "tst_qdeclarativelistmodel.moc" -- cgit v0.12 From 9943a3ef522f293c26af0c65b0bc0a1df02a417d Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 19 Apr 2010 16:30:56 +1000 Subject: QML_DECLARE_TYPE is no longer necessary - fix docs and examples --- demos/declarative/minehunt/minehunt.cpp | 2 -- doc/src/declarative/extending-examples.qdoc | 5 ----- doc/src/declarative/extending.qdoc | 1 - doc/src/declarative/integrating.qdoc | 3 +-- .../declarative/snippets/integrating/graphicswidgets/bluecircle.h | 3 --- .../declarative/snippets/integrating/graphicswidgets/redsquare.h | 3 --- examples/declarative/extending/adding/person.h | 1 - examples/declarative/extending/attached/birthdayparty.h | 2 -- examples/declarative/extending/attached/person.h | 4 ---- examples/declarative/extending/binding/birthdayparty.h | 2 -- examples/declarative/extending/binding/happybirthday.h | 2 +- examples/declarative/extending/binding/person.h | 4 ---- examples/declarative/extending/coercion/birthdayparty.h | 1 - examples/declarative/extending/coercion/person.h | 6 +++--- examples/declarative/extending/default/birthdayparty.h | 1 - examples/declarative/extending/default/person.h | 3 --- examples/declarative/extending/extended/lineedit.cpp | 2 +- examples/declarative/extending/grouped/birthdayparty.h | 2 +- examples/declarative/extending/grouped/person.h | 4 ---- examples/declarative/extending/properties/birthdayparty.h | 1 - examples/declarative/extending/properties/person.h | 1 - examples/declarative/extending/signal/birthdayparty.h | 3 --- examples/declarative/extending/signal/person.h | 4 ---- examples/declarative/extending/valuesource/birthdayparty.h | 3 --- examples/declarative/extending/valuesource/happybirthday.h | 1 - examples/declarative/extending/valuesource/person.h | 4 ---- examples/declarative/proxywidgets/proxywidgets.cpp | 2 -- 27 files changed, 7 insertions(+), 63 deletions(-) diff --git a/demos/declarative/minehunt/minehunt.cpp b/demos/declarative/minehunt/minehunt.cpp index d4b0039..93cd1c1 100644 --- a/demos/declarative/minehunt/minehunt.cpp +++ b/demos/declarative/minehunt/minehunt.cpp @@ -305,8 +305,6 @@ bool MinehuntGame::flag(int row, int col) return true; } -QML_DECLARE_TYPE(TileData); - class MinehuntExtensionPlugin : public QDeclarativeExtensionPlugin { Q_OBJECT diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/declarative/extending-examples.qdoc index cc66838..307162e 100644 --- a/doc/src/declarative/extending-examples.qdoc +++ b/doc/src/declarative/extending-examples.qdoc @@ -57,11 +57,6 @@ element, the C++ class can be named differently, or appear in a namespace. \snippet examples/declarative/extending/adding/person.h 0 -Following the class declaration, we include the QML_DECLARE_TYPE() macro. This -is necessary to declare the type to QML. It also includes the logic necessary -to expose the class to Qt's meta system - that is, it includes the -Q_DECLARE_METATYPE() functionality. - \section1 Define the Person class \snippet examples/declarative/extending/adding/person.cpp 0 diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 4d477c6..a1d8a10 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -305,7 +305,6 @@ public: }; QML_DECLARE_TYPEINFO(MyType, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(MyType) \endcode Return an attachment object, of type \a AttachedPropertiesType, for the attachee \a object instance. It is customary, though not strictly required, for diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc index d4034fa..65413ec 100644 --- a/doc/src/declarative/integrating.qdoc +++ b/doc/src/declarative/integrating.qdoc @@ -115,8 +115,7 @@ any custom C++ types and create a plugin that registers the custom types so that they can be used from your QML file. Here is an example. Suppose you have two classes, \c RedSquare and \c BlueCircle, -that both inherit from QGraphicsWidget. First, you need to register these two types -using the \c QML_DECLARE_TYPE macro from \c , like this: +that both inherit from QGraphicsWidget: \c [graphicswidgets/redsquare.h] \snippet doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h 0 diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h b/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h index 028718f..73d66b7 100644 --- a/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h +++ b/doc/src/declarative/snippets/integrating/graphicswidgets/bluecircle.h @@ -39,7 +39,6 @@ ** ****************************************************************************/ //![0] -#include #include #include @@ -53,6 +52,4 @@ public: painter->drawEllipse(0, 0, size().width(), size().height()); } }; - -QML_DECLARE_TYPE(BlueCircle) //![0] diff --git a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h b/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h index 76e7d11..3050662 100644 --- a/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h +++ b/doc/src/declarative/snippets/integrating/graphicswidgets/redsquare.h @@ -39,7 +39,6 @@ ** ****************************************************************************/ //![0] -#include #include #include @@ -52,6 +51,4 @@ public: painter->fillRect(0, 0, size().width(), size().height(), QColor(Qt::red)); } }; - -QML_DECLARE_TYPE(RedSquare) //![0] diff --git a/examples/declarative/extending/adding/person.h b/examples/declarative/extending/adding/person.h index fbaf2df..7a9e0f0 100644 --- a/examples/declarative/extending/adding/person.h +++ b/examples/declarative/extending/adding/person.h @@ -61,7 +61,6 @@ private: QString m_name; int m_shoeSize; }; -QML_DECLARE_TYPE(Person); // ![0] #endif // PERSON_H diff --git a/examples/declarative/extending/attached/birthdayparty.h b/examples/declarative/extending/attached/birthdayparty.h index d8ca2e1..7c45d21 100644 --- a/examples/declarative/extending/attached/birthdayparty.h +++ b/examples/declarative/extending/attached/birthdayparty.h @@ -59,7 +59,6 @@ public: private: QDate m_rsvp; }; -QML_DECLARE_TYPE(BirthdayPartyAttached) class BirthdayParty : public QObject { @@ -84,6 +83,5 @@ private: }; QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(BirthdayParty) #endif // BIRTHDAYPARTY_H diff --git a/examples/declarative/extending/attached/person.h b/examples/declarative/extending/attached/person.h index 08caebf..7a4b9c3 100644 --- a/examples/declarative/extending/attached/person.h +++ b/examples/declarative/extending/attached/person.h @@ -71,7 +71,6 @@ private: QString m_brand; qreal m_price; }; -QML_DECLARE_TYPE(ShoeDescription); class Person : public QObject { Q_OBJECT @@ -88,20 +87,17 @@ private: QString m_name; ShoeDescription m_shoe; }; -QML_DECLARE_TYPE(Person); class Boy : public Person { Q_OBJECT public: Boy(QObject * parent = 0); }; -QML_DECLARE_TYPE(Boy); class Girl : public Person { Q_OBJECT public: Girl(QObject * parent = 0); }; -QML_DECLARE_TYPE(Girl); #endif // PERSON_H diff --git a/examples/declarative/extending/binding/birthdayparty.h b/examples/declarative/extending/binding/birthdayparty.h index 8486442..e2757bc 100644 --- a/examples/declarative/extending/binding/birthdayparty.h +++ b/examples/declarative/extending/binding/birthdayparty.h @@ -63,7 +63,6 @@ signals: private: QDate m_rsvp; }; -QML_DECLARE_TYPE(BirthdayPartyAttached) class BirthdayParty : public QObject { @@ -100,6 +99,5 @@ private: }; QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(BirthdayParty) #endif // BIRTHDAYPARTY_H diff --git a/examples/declarative/extending/binding/happybirthday.h b/examples/declarative/extending/binding/happybirthday.h index eb2da5e..0e5a90a 100644 --- a/examples/declarative/extending/binding/happybirthday.h +++ b/examples/declarative/extending/binding/happybirthday.h @@ -51,6 +51,7 @@ class HappyBirthday : public QObject, public QDeclarativePropertyValueSource { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) +Q_INTERFACES(QDeclarativePropertyValueSource) public: HappyBirthday(QObject *parent = 0); @@ -70,7 +71,6 @@ private: QDeclarativeProperty m_target; QString m_name; }; -QML_DECLARE_TYPE(HappyBirthday); #endif // HAPPYBIRTHDAY_H diff --git a/examples/declarative/extending/binding/person.h b/examples/declarative/extending/binding/person.h index 2d4ec12..0edfcdd 100644 --- a/examples/declarative/extending/binding/person.h +++ b/examples/declarative/extending/binding/person.h @@ -74,7 +74,6 @@ private: QString m_brand; qreal m_price; }; -QML_DECLARE_TYPE(ShoeDescription); class Person : public QObject { Q_OBJECT @@ -96,20 +95,17 @@ private: QString m_name; ShoeDescription m_shoe; }; -QML_DECLARE_TYPE(Person); class Boy : public Person { Q_OBJECT public: Boy(QObject * parent = 0); }; -QML_DECLARE_TYPE(Boy); class Girl : public Person { Q_OBJECT public: Girl(QObject * parent = 0); }; -QML_DECLARE_TYPE(Girl); #endif // PERSON_H diff --git a/examples/declarative/extending/coercion/birthdayparty.h b/examples/declarative/extending/coercion/birthdayparty.h index fffd407..a5d14f9 100644 --- a/examples/declarative/extending/coercion/birthdayparty.h +++ b/examples/declarative/extending/coercion/birthdayparty.h @@ -66,6 +66,5 @@ private: Person *m_celebrant; QList m_guests; }; -QML_DECLARE_TYPE(BirthdayParty); #endif // BIRTHDAYPARTY_H diff --git a/examples/declarative/extending/coercion/person.h b/examples/declarative/extending/coercion/person.h index 298ffb1..861f135 100644 --- a/examples/declarative/extending/coercion/person.h +++ b/examples/declarative/extending/coercion/person.h @@ -60,7 +60,7 @@ private: QString m_name; int m_shoeSize; }; -QML_DECLARE_TYPE(Person); + // ![0] class Boy : public Person { @@ -68,14 +68,14 @@ Q_OBJECT public: Boy(QObject * parent = 0); }; -QML_DECLARE_TYPE(Boy); + class Girl : public Person { Q_OBJECT public: Girl(QObject * parent = 0); }; -QML_DECLARE_TYPE(Girl); + // ![0] #endif // PERSON_H diff --git a/examples/declarative/extending/default/birthdayparty.h b/examples/declarative/extending/default/birthdayparty.h index 49c20bd..c0cb0a4 100644 --- a/examples/declarative/extending/default/birthdayparty.h +++ b/examples/declarative/extending/default/birthdayparty.h @@ -67,6 +67,5 @@ private: QList m_guests; }; // ![0] -QML_DECLARE_TYPE(BirthdayParty); #endif // BIRTHDAYPARTY_H diff --git a/examples/declarative/extending/default/person.h b/examples/declarative/extending/default/person.h index b3eceaa..832bf11 100644 --- a/examples/declarative/extending/default/person.h +++ b/examples/declarative/extending/default/person.h @@ -60,20 +60,17 @@ private: QString m_name; int m_shoeSize; }; -QML_DECLARE_TYPE(Person); class Boy : public Person { Q_OBJECT public: Boy(QObject * parent = 0); }; -QML_DECLARE_TYPE(Boy); class Girl : public Person { Q_OBJECT public: Girl(QObject * parent = 0); }; -QML_DECLARE_TYPE(Girl); #endif // PERSON_H diff --git a/examples/declarative/extending/extended/lineedit.cpp b/examples/declarative/extending/extended/lineedit.cpp index 417fbd9..0e521ec 100644 --- a/examples/declarative/extending/extended/lineedit.cpp +++ b/examples/declarative/extending/extended/lineedit.cpp @@ -102,4 +102,4 @@ void LineEditExtension::setBottomMargin(int m) m_lineedit->setTextMargins(l, t, r, m); } -QML_DECLARE_TYPE(QLineEdit); + diff --git a/examples/declarative/extending/grouped/birthdayparty.h b/examples/declarative/extending/grouped/birthdayparty.h index 42439c4..4ac5602 100644 --- a/examples/declarative/extending/grouped/birthdayparty.h +++ b/examples/declarative/extending/grouped/birthdayparty.h @@ -65,6 +65,6 @@ private: Person *m_celebrant; QList m_guests; }; -QML_DECLARE_TYPE(BirthdayParty); + #endif // BIRTHDAYPARTY_H diff --git a/examples/declarative/extending/grouped/person.h b/examples/declarative/extending/grouped/person.h index 5ea2348..216c015 100644 --- a/examples/declarative/extending/grouped/person.h +++ b/examples/declarative/extending/grouped/person.h @@ -71,7 +71,6 @@ private: QString m_brand; qreal m_price; }; -QML_DECLARE_TYPE(ShoeDescription); class Person : public QObject { Q_OBJECT @@ -90,20 +89,17 @@ private: QString m_name; ShoeDescription m_shoe; }; -QML_DECLARE_TYPE(Person); class Boy : public Person { Q_OBJECT public: Boy(QObject * parent = 0); }; -QML_DECLARE_TYPE(Boy); class Girl : public Person { Q_OBJECT public: Girl(QObject * parent = 0); }; -QML_DECLARE_TYPE(Girl); #endif // PERSON_H diff --git a/examples/declarative/extending/properties/birthdayparty.h b/examples/declarative/extending/properties/birthdayparty.h index c4cb536..dd01562 100644 --- a/examples/declarative/extending/properties/birthdayparty.h +++ b/examples/declarative/extending/properties/birthdayparty.h @@ -71,7 +71,6 @@ private: Person *m_celebrant; QList m_guests; }; -QML_DECLARE_TYPE(BirthdayParty); // ![3] #endif // BIRTHDAYPARTY_H diff --git a/examples/declarative/extending/properties/person.h b/examples/declarative/extending/properties/person.h index 860a607..7504d18 100644 --- a/examples/declarative/extending/properties/person.h +++ b/examples/declarative/extending/properties/person.h @@ -60,6 +60,5 @@ private: QString m_name; int m_shoeSize; }; -QML_DECLARE_TYPE(Person); #endif // PERSON_H diff --git a/examples/declarative/extending/signal/birthdayparty.h b/examples/declarative/extending/signal/birthdayparty.h index bcdc513..a2b35cd 100644 --- a/examples/declarative/extending/signal/birthdayparty.h +++ b/examples/declarative/extending/signal/birthdayparty.h @@ -59,7 +59,6 @@ public: private: QDate m_rsvp; }; -QML_DECLARE_TYPE(BirthdayPartyAttached) class BirthdayParty : public QObject { @@ -89,8 +88,6 @@ private: Person *m_celebrant; QList m_guests; }; - QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(BirthdayParty) #endif // BIRTHDAYPARTY_H diff --git a/examples/declarative/extending/signal/person.h b/examples/declarative/extending/signal/person.h index 08caebf..7a4b9c3 100644 --- a/examples/declarative/extending/signal/person.h +++ b/examples/declarative/extending/signal/person.h @@ -71,7 +71,6 @@ private: QString m_brand; qreal m_price; }; -QML_DECLARE_TYPE(ShoeDescription); class Person : public QObject { Q_OBJECT @@ -88,20 +87,17 @@ private: QString m_name; ShoeDescription m_shoe; }; -QML_DECLARE_TYPE(Person); class Boy : public Person { Q_OBJECT public: Boy(QObject * parent = 0); }; -QML_DECLARE_TYPE(Boy); class Girl : public Person { Q_OBJECT public: Girl(QObject * parent = 0); }; -QML_DECLARE_TYPE(Girl); #endif // PERSON_H diff --git a/examples/declarative/extending/valuesource/birthdayparty.h b/examples/declarative/extending/valuesource/birthdayparty.h index 819a200..a9b3102 100644 --- a/examples/declarative/extending/valuesource/birthdayparty.h +++ b/examples/declarative/extending/valuesource/birthdayparty.h @@ -60,7 +60,6 @@ public: private: QDate m_rsvp; }; -QML_DECLARE_TYPE(BirthdayPartyAttached) class BirthdayParty : public QObject { @@ -95,8 +94,6 @@ private: Person *m_celebrant; QList m_guests; }; - QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(BirthdayParty) #endif // BIRTHDAYPARTY_H diff --git a/examples/declarative/extending/valuesource/happybirthday.h b/examples/declarative/extending/valuesource/happybirthday.h index b48c012..8548eb8 100644 --- a/examples/declarative/extending/valuesource/happybirthday.h +++ b/examples/declarative/extending/valuesource/happybirthday.h @@ -74,7 +74,6 @@ private: // ![2] }; // ![2] -QML_DECLARE_TYPE(HappyBirthday); #endif // HAPPYBIRTHDAY_H diff --git a/examples/declarative/extending/valuesource/person.h b/examples/declarative/extending/valuesource/person.h index 08caebf..7a4b9c3 100644 --- a/examples/declarative/extending/valuesource/person.h +++ b/examples/declarative/extending/valuesource/person.h @@ -71,7 +71,6 @@ private: QString m_brand; qreal m_price; }; -QML_DECLARE_TYPE(ShoeDescription); class Person : public QObject { Q_OBJECT @@ -88,20 +87,17 @@ private: QString m_name; ShoeDescription m_shoe; }; -QML_DECLARE_TYPE(Person); class Boy : public Person { Q_OBJECT public: Boy(QObject * parent = 0); }; -QML_DECLARE_TYPE(Boy); class Girl : public Person { Q_OBJECT public: Girl(QObject * parent = 0); }; -QML_DECLARE_TYPE(Girl); #endif // PERSON_H diff --git a/examples/declarative/proxywidgets/proxywidgets.cpp b/examples/declarative/proxywidgets/proxywidgets.cpp index 47d0cb9..067eb2c 100644 --- a/examples/declarative/proxywidgets/proxywidgets.cpp +++ b/examples/declarative/proxywidgets/proxywidgets.cpp @@ -94,6 +94,4 @@ public: #include "proxywidgets.moc" -QML_DECLARE_TYPE(MyPushButton) - Q_EXPORT_PLUGIN2(proxywidgetsplugin, ProxyWidgetsPlugin); -- cgit v0.12 From 698a39fc699c3f8d6b7e28e10a8e3048fed274bd Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 19 Apr 2010 16:45:50 +1000 Subject: Fix tests: remove unnecessary calls to QML_DECLARE_TYPE --- .../auto/declarative/qdeclarativeecmascript/testtypes.h | 6 ------ tests/auto/declarative/qdeclarativelanguage/testtypes.h | 16 ++++------------ .../qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 2 -- .../tst_qdeclarativelistreference.cpp | 1 - .../qdeclarativemoduleplugin/plugin/plugin.cpp | 2 -- .../qdeclarativestates/tst_qdeclarativestates.cpp | 2 -- .../auto/declarative/qdeclarativevaluetypes/testtypes.h | 3 --- 7 files changed, 4 insertions(+), 28 deletions(-) diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h index 4424419..79d3226 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h @@ -170,7 +170,6 @@ private: }; QML_DECLARE_TYPEINFO(MyQmlObject, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(MyQmlObject); class MyQmlContainer : public QObject { @@ -185,7 +184,6 @@ private: QList m_children; }; -QML_DECLARE_TYPE(MyQmlContainer); class MyExpression : public QDeclarativeExpression { @@ -258,7 +256,6 @@ private: QObject *m_object; QObject *m_object2; }; -QML_DECLARE_TYPE(MyDeferredObject); class MyBaseExtendedObject : public QObject { @@ -273,7 +270,6 @@ public: private: int m_value; }; -QML_DECLARE_TYPE(MyBaseExtendedObject); class MyExtendedObject : public MyBaseExtendedObject { @@ -288,7 +284,6 @@ public: private: int m_value; }; -QML_DECLARE_TYPE(MyExtendedObject); class MyTypeObject : public QObject { @@ -555,7 +550,6 @@ signals: void rectPropertyChanged(); }; Q_DECLARE_OPERATORS_FOR_FLAGS(MyTypeObject::MyFlags) -QML_DECLARE_TYPE(MyTypeObject); Q_DECLARE_METATYPE(QScriptValue); class MyInvokableObject : public QObject diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h index 8c163a5..951cea0 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h @@ -167,8 +167,9 @@ private: MyCustomVariantType m_custom; int m_propertyWithNotify; }; +QML_DECLARE_TYPE(MyQmlObject) QML_DECLARE_TYPEINFO(MyQmlObject, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(MyQmlObject); + class MyGroupedObject : public QObject { @@ -187,8 +188,6 @@ private: QDeclarativeScriptString m_script; }; -QML_DECLARE_TYPE(MyGroupedObject); - class MyTypeObject : public QObject { @@ -462,7 +461,7 @@ signals: void rectPropertyChanged(); }; Q_DECLARE_OPERATORS_FOR_FLAGS(MyTypeObject::MyFlags) -QML_DECLARE_TYPE(MyTypeObject); + class MyContainer : public QObject { @@ -482,8 +481,6 @@ public: QList m_interfaces; }; -QML_DECLARE_TYPE(MyContainer); - class MyPropertyValueSource : public QObject, public QDeclarativePropertyValueSource { @@ -499,7 +496,7 @@ public: prop = p; } }; -QML_DECLARE_TYPE(MyPropertyValueSource); + class MyDotPropertyObject : public QObject { @@ -540,7 +537,6 @@ private: bool m_ownRWObj; }; -QML_DECLARE_TYPE(MyDotPropertyObject); namespace MyNamespace { class MyNamespacedType : public QObject @@ -559,8 +555,6 @@ namespace MyNamespace { QList m_list; }; } -QML_DECLARE_TYPE(MyNamespace::MyNamespacedType); -QML_DECLARE_TYPE(MyNamespace::MySecondNamespacedType); class MyCustomParserType : public QObject { @@ -574,8 +568,6 @@ public: void setCustomData(QObject *, const QByteArray &) {} }; -QML_DECLARE_TYPE(MyCustomParserType); - void registerTypes(); #endif // TESTTYPES_H diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 9d4a1f5..07fbf83 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -1132,8 +1132,6 @@ void tst_qdeclarativelanguage::testType(const QString& qml, const QString& type, } } -QML_DECLARE_TYPE(TestType) -QML_DECLARE_TYPE(TestType2) // Import tests (QT-558) diff --git a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp index 908f336..7689270 100644 --- a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp +++ b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp @@ -102,7 +102,6 @@ public: QList data; QDeclarativeListProperty property; }; -QML_DECLARE_TYPE(TestType); void tst_qdeclarativelistreference::initTestCase() { diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp index fd94cc6..7d89bee 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp @@ -61,8 +61,6 @@ private: int v; }; -QML_DECLARE_TYPE(MyPluginType); - class MyPlugin : public QDeclarativeExtensionPlugin { diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index 1446920..bd3186a 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -68,8 +68,6 @@ private: int m_prop; }; -QML_DECLARE_TYPE(MyRect) - class tst_qdeclarativestates : public QObject { diff --git a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h index dd13429..8a9b981 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h +++ b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h @@ -133,7 +133,6 @@ signals: public slots: QSize method() { return QSize(13, 14); } }; -QML_DECLARE_TYPE(MyTypeObject); class MyConstantValueSource : public QObject, public QDeclarativePropertyValueSource { @@ -142,7 +141,6 @@ class MyConstantValueSource : public QObject, public QDeclarativePropertyValueSo public: virtual void setTarget(const QDeclarativeProperty &p) { p.write(3345); } }; -QML_DECLARE_TYPE(MyConstantValueSource); class MyOffsetValueInterceptor : public QObject, public QDeclarativePropertyValueInterceptor { @@ -155,7 +153,6 @@ public: private: QDeclarativeProperty prop; }; -QML_DECLARE_TYPE(MyOffsetValueInterceptor); void registerTypes(); -- cgit v0.12 From 4223acff70de3036c5b7d75bccaec0c540c23556 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 19 Apr 2010 17:08:13 +1000 Subject: Remove Script {} support --- .../qml/qdeclarativecompiledbindings.cpp | 7 -- src/declarative/qml/qdeclarativecompiler.cpp | 113 --------------------- src/declarative/qml/qdeclarativecompiler_p.h | 1 - src/declarative/qml/qdeclarativecontext.cpp | 33 ------ src/declarative/qml/qdeclarativecontext_p.h | 2 - .../qml/qdeclarativecontextscriptclass.cpp | 8 -- src/declarative/qml/qdeclarativeinstruction.cpp | 3 - src/declarative/qml/qdeclarativeinstruction_p.h | 1 - src/declarative/qml/qdeclarativeparser.cpp | 2 - src/declarative/qml/qdeclarativeparser_p.h | 4 +- src/declarative/qml/qdeclarativescriptparser.cpp | 94 ++++------------- src/declarative/qml/qdeclarativevme.cpp | 7 -- .../qdeclarativeecmascript/data/ScopeObject.qml | 6 +- .../data/externalScript.1.qml | 11 -- .../data/externalScript.2.js | 8 -- .../data/externalScript.2.qml | 11 -- .../data/externalScript.3.qml | 13 --- .../data/externalScript.4.qml | 15 --- .../qdeclarativeecmascript/data/externalScript.js | 6 -- .../qdeclarativeecmascript/data/scope.2.qml | 6 +- .../qdeclarativeecmascript/data/scope.qml | 14 +-- .../qdeclarativeecmascript/data/scriptAccess.js | 7 -- .../qdeclarativeecmascript/data/scriptAccess.qml | 17 ---- .../qdeclarativeecmascript/data/scriptConnect.1.js | 4 + .../data/scriptConnect.1.qml | 10 +- .../qdeclarativeecmascript/data/scriptConnect.2.js | 5 + .../data/scriptConnect.2.qml | 10 +- .../qdeclarativeecmascript/data/scriptConnect.6.js | 3 + .../data/scriptConnect.6.qml | 11 +- .../data/scriptDisconnect.1.js | 6 ++ .../data/scriptDisconnect.1.qml | 11 +- .../data/scriptDisconnect.2.qml | 11 +- .../data/scriptDisconnect.3.qml | 11 +- .../data/scriptDisconnect.4.qml | 13 +-- .../qdeclarativeecmascript/data/scriptErrors.js | 2 + .../qdeclarativeecmascript/data/scriptErrors.qml | 6 +- .../qdeclarativeecmascript/data/scriptScope.1.qml | 13 --- .../qdeclarativeecmascript/data/scriptScope.2.qml | 11 -- .../qdeclarativeecmascript/data/scriptScope.js | 5 - .../tst_qdeclarativeecmascript.cpp | 107 ++----------------- .../tst_qdeclarativeinstruction.cpp | 57 +++++------ 41 files changed, 103 insertions(+), 582 deletions(-) delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/externalScript.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/externalScript.2.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/externalScript.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/externalScript.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/externalScript.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/externalScript.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptAccess.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptAccess.qml create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.js diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp index 4a47fc6..6596aba 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings.cpp +++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp @@ -888,13 +888,6 @@ void QDeclarativeCompiledBindingsPrivate::findgeneric(Register *output, return; } - for (int ii = 0; ii < context->scripts.count(); ++ii) { - QScriptValue function = QScriptDeclarativeClass::function(context->scripts.at(ii), name); - if (function.isValid()) { - qFatal("Binding optimizer resolved name to QScript method"); - } - } - if (QObject *root = context->contextObject) { if (findproperty(root, output, enginePriv, subIdx, name, isTerminal)) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index cced7b1..2614764 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -733,10 +733,6 @@ bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt) return true; } - // Build any script blocks for this type - for (int ii = 0; ii < obj->scriptBlockObjects.count(); ++ii) - COMPILE_CHECK(buildScript(obj, obj->scriptBlockObjects.at(ii))); - // Object instantiations reset the binding context BindingContext objCtxt(obj); @@ -961,17 +957,6 @@ void QDeclarativeCompiler::genObject(QDeclarativeParser::Object *obj) output->bytecode << id; } - // Set any script blocks - for (int ii = 0; ii < obj->scripts.count(); ++ii) { - QDeclarativeInstruction script; - script.type = QDeclarativeInstruction::StoreScript; - script.line = 0; // ### - int idx = output->scripts.count(); - output->scripts << obj->scripts.at(ii); - script.storeScript.value = idx; - output->bytecode << script; - } - // Begin the class if (obj->parserStatusCast != -1) { QDeclarativeInstruction begin; @@ -1177,9 +1162,6 @@ bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj, (obj->properties.count() == 1 && obj->properties.begin().key() != "id")) COMPILE_EXCEPTION(*obj->properties.begin(), tr("Component elements may not contain properties other than id")); - if (!obj->scriptBlockObjects.isEmpty()) - COMPILE_EXCEPTION(obj->scriptBlockObjects.first(), tr("Component elements may not contain script blocks")); - if (obj->properties.count()) idProp = *obj->properties.begin(); @@ -1216,101 +1198,6 @@ bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj, return true; } -bool QDeclarativeCompiler::buildScript(QDeclarativeParser::Object *obj, QDeclarativeParser::Object *script) -{ - { - QDeclarativeError warning; - warning.setUrl(output->url); - warning.setLine(obj->location.start.line); - warning.setColumn(obj->location.start.column); - warning.setDescription(tr("Script blocks have been deprecated. Support will be removed entirely shortly.")); - qWarning() << warning.toString(); - } - - Object::ScriptBlock scriptBlock; - - if (script->properties.count() == 1 && - script->properties.begin().key() == QByteArray("source")) { - - Property *source = *script->properties.begin(); - if (script->defaultProperty) - COMPILE_EXCEPTION(source, tr("Invalid Script block. Specify either the source property or inline script")); - - if (source->value || source->values.count() != 1 || - source->values.at(0)->object || !source->values.at(0)->value.isStringList()) - COMPILE_EXCEPTION(source, tr("Invalid Script source value")); - - QStringList sources = source->values.at(0)->value.asStringList(); - - for (int jj = 0; jj < sources.count(); ++jj) { - QString sourceUrl = output->url.resolved(QUrl(sources.at(jj))).toString(); - QString scriptCode; - int lineNumber = 1; - - for (int ii = 0; ii < unit->resources.count(); ++ii) { - if (unit->resources.at(ii)->url == sourceUrl) { - scriptCode = QString::fromUtf8(unit->resources.at(ii)->data); - break; - } - } - - if (!scriptCode.isEmpty()) { - scriptBlock.codes.append(scriptCode); - scriptBlock.files.append(sourceUrl); - scriptBlock.lineNumbers.append(lineNumber); - scriptBlock.pragmas.append(Object::ScriptBlock::None); - } - } - - } else if (!script->properties.isEmpty()) { - COMPILE_EXCEPTION(*script->properties.begin(), tr("Properties cannot be set on Script block")); - } else if (script->defaultProperty) { - - QString scriptCode; - int lineNumber = 1; - QString sourceUrl = output->url.toString(); - - QDeclarativeParser::Location currentLocation; - - for (int ii = 0; ii < script->defaultProperty->values.count(); ++ii) { - Value *v = script->defaultProperty->values.at(ii); - if (lineNumber == 1) - lineNumber = v->location.start.line; - if (v->object || !v->value.isString()) - COMPILE_EXCEPTION(v, tr("Invalid Script block")); - - if (ii == 0) { - currentLocation = v->location.start; - scriptCode.append(QString(currentLocation.column, QLatin1Char(' '))); - } - - while (currentLocation.line < v->location.start.line) { - scriptCode.append(QLatin1Char('\n')); - currentLocation.line++; - currentLocation.column = 0; - } - - scriptCode.append(QString(v->location.start.column - currentLocation.column, QLatin1Char(' '))); - - scriptCode += v->value.asString(); - currentLocation = v->location.end; - currentLocation.column++; - } - - if (!scriptCode.isEmpty()) { - scriptBlock.codes.append(scriptCode); - scriptBlock.files.append(sourceUrl); - scriptBlock.lineNumbers.append(lineNumber); - scriptBlock.pragmas.append(Object::ScriptBlock::None); - } - } - - if (!scriptBlock.codes.isEmpty()) - obj->scripts << scriptBlock; - - return true; -} - bool QDeclarativeCompiler::buildComponentFromRoot(QDeclarativeParser::Object *obj, const BindingContext &ctxt) { diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h index 867db2c..cdc514d 100644 --- a/src/declarative/qml/qdeclarativecompiler_p.h +++ b/src/declarative/qml/qdeclarativecompiler_p.h @@ -186,7 +186,6 @@ private: bool buildObject(QDeclarativeParser::Object *obj, const BindingContext &); - bool buildScript(QDeclarativeParser::Object *obj, QDeclarativeParser::Object *script); bool buildComponent(QDeclarativeParser::Object *obj, const BindingContext &); bool buildSubObject(QDeclarativeParser::Object *obj, const BindingContext &); bool buildSignal(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index 31430c7..2041e0a 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -696,39 +696,6 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object } } -void QDeclarativeContextData::addScript(const QDeclarativeParser::Object::ScriptBlock &script, - QObject *scopeObject) -{ - if (!engine) - return; - - QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine); - QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine); - - QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine); - - scriptContext->pushScope(enginePriv->contextClass->newContext(this, scopeObject)); - scriptContext->pushScope(enginePriv->globalClass->globalObject()); - - QScriptValue scope = scriptEngine->newObject(); - scriptContext->setActivationObject(scope); - scriptContext->pushScope(scope); - - for (int ii = 0; ii < script.codes.count(); ++ii) { - scriptEngine->evaluate(script.codes.at(ii), script.files.at(ii), script.lineNumbers.at(ii)); - - if (scriptEngine->hasUncaughtException()) { - QDeclarativeError error; - QDeclarativeExpressionPrivate::exceptionToError(scriptEngine, error); - enginePriv->warning(error); - } - } - - scriptEngine->popContext(); - - scripts.append(scope); -} - void QDeclarativeContextData::setIdProperty(int idx, QObject *obj) { idValues[idx] = obj; diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h index 77a6d94..c7fb099 100644 --- a/src/declarative/qml/qdeclarativecontext_p.h +++ b/src/declarative/qml/qdeclarativecontext_p.h @@ -145,10 +145,8 @@ public: QObject *contextObject; // Any script blocks that exist on this context - QList scripts; QList importedScripts; void addImportedScript(const QDeclarativeParser::Object::ScriptBlock &script); - void addScript(const QDeclarativeParser::Object::ScriptBlock &script, QObject *scopeObject); // Context base url QUrl url; diff --git a/src/declarative/qml/qdeclarativecontextscriptclass.cpp b/src/declarative/qml/qdeclarativecontextscriptclass.cpp index 461fab5..1336a1a 100644 --- a/src/declarative/qml/qdeclarativecontextscriptclass.cpp +++ b/src/declarative/qml/qdeclarativecontextscriptclass.cpp @@ -189,14 +189,6 @@ QDeclarativeContextScriptClass::queryProperty(QDeclarativeContextData *bindConte } } - for (int ii = 0; ii < bindContext->scripts.count(); ++ii) { - lastFunction = QScriptDeclarativeClass::function(bindContext->scripts.at(ii), name); - if (lastFunction.isValid()) { - lastContext = bindContext; - return QScriptClass::HandlesReadAccess; - } - } - if (scopeObject) { QScriptClass::QueryFlags rv = ep->objectClass->queryProperty(scopeObject, name, flags, bindContext, diff --git a/src/declarative/qml/qdeclarativeinstruction.cpp b/src/declarative/qml/qdeclarativeinstruction.cpp index d88d06a..99f1cc8 100644 --- a/src/declarative/qml/qdeclarativeinstruction.cpp +++ b/src/declarative/qml/qdeclarativeinstruction.cpp @@ -149,9 +149,6 @@ void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx) case QDeclarativeInstruction::StoreSignal: qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIGNAL\t\t" << instr->storeSignal.signalIndex << "\t" << instr->storeSignal.value << "\t\t" << primitives.at(instr->storeSignal.value); break; - case QDeclarativeInstruction::StoreScript: - qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SCRIPT\t\t" << instr->storeScript.value; - break; case QDeclarativeInstruction::StoreImportedScript: qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_IMPORTED_SCRIPT\t" << instr->storeScript.value; break; diff --git a/src/declarative/qml/qdeclarativeinstruction_p.h b/src/declarative/qml/qdeclarativeinstruction_p.h index e8287c0..c09b157 100644 --- a/src/declarative/qml/qdeclarativeinstruction_p.h +++ b/src/declarative/qml/qdeclarativeinstruction_p.h @@ -121,7 +121,6 @@ public: StoreInterface, /* storeObject */ StoreSignal, /* storeSignal */ - StoreScript, /* storeScript */ StoreImportedScript, /* storeScript */ StoreScriptString, /* storeScriptString */ diff --git a/src/declarative/qml/qdeclarativeparser.cpp b/src/declarative/qml/qdeclarativeparser.cpp index d1f209a..b38bd76 100644 --- a/src/declarative/qml/qdeclarativeparser.cpp +++ b/src/declarative/qml/qdeclarativeparser.cpp @@ -89,8 +89,6 @@ QDeclarativeParser::Object::~Object() prop.first->release(); foreach(const DynamicProperty &prop, dynamicProperties) if (prop.defaultValue) prop.defaultValue->release(); - foreach(Object *obj, scriptBlockObjects) - obj->release(); } void Object::setBindingBit(int b) diff --git a/src/declarative/qml/qdeclarativeparser_p.h b/src/declarative/qml/qdeclarativeparser_p.h index 00fc65b..0870cfb 100644 --- a/src/declarative/qml/qdeclarativeparser_p.h +++ b/src/declarative/qml/qdeclarativeparser_p.h @@ -160,8 +160,6 @@ namespace QDeclarativeParser Property *defaultProperty; QHash properties; - QList scriptBlockObjects; - // Output of the compilation phase (these properties continue to exist // in either the defaultProperty or properties members too) void addValueProperty(Property *); @@ -190,7 +188,9 @@ namespace QDeclarativeParser QList lineNumbers; QList pragmas; }; +#if 0 QList scripts; +#endif // The bytes to cast instances by to get to the QDeclarativeParserStatus // interface. -1 indicates the type doesn't support this interface. diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index ac49332..674df9d 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -296,27 +296,12 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName, if (lastTypeDot >= 0) resolvableObjectType.replace(QLatin1Char('.'),QLatin1Char('/')); - bool isScript = resolvableObjectType == QLatin1String("Script"); - - if (isScript) { - if (_stateStack.isEmpty() || _stateStack.top().property) { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","Invalid use of Script block")); - error.setLine(typeLocation.startLine); - error.setColumn(typeLocation.startColumn); - _parser->_errors << error; - return 0; - } - } - Object *obj = new Object; - if (!isScript) { - QDeclarativeScriptParser::TypeReference *typeRef = _parser->findOrCreateType(resolvableObjectType); - obj->type = typeRef->id; + QDeclarativeScriptParser::TypeReference *typeRef = _parser->findOrCreateType(resolvableObjectType); + obj->type = typeRef->id; - typeRef->refObjects.append(obj); - } + typeRef->refObjects.append(obj); // XXX this doesn't do anything (_scope never builds up) _scope.append(resolvableObjectType); @@ -325,11 +310,7 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName, obj->location = location; - if (isScript) { - - _stateStack.top().object->scriptBlockObjects.append(obj); - - } else if (propertyCount) { + if (propertyCount) { Property *prop = currentProperty(); Value *v = new Value; @@ -827,62 +808,29 @@ bool ProcessAST::visit(AST::UiSourceElement *node) { QDeclarativeParser::Object *obj = currentObject(); - bool isScript = (obj && obj->typeName == "Script"); - - if (!isScript) { - - if (AST::FunctionDeclaration *funDecl = AST::cast(node->sourceElement)) { - - Object::DynamicSlot slot; - slot.location = location(funDecl->firstSourceLocation(), funDecl->lastSourceLocation()); - - AST::FormalParameterList *f = funDecl->formals; - while (f) { - slot.parameterNames << f->name->asString().toUtf8(); - f = f->finish(); - } - - QString body = textAt(funDecl->lbraceToken, funDecl->rbraceToken); - slot.name = funDecl->name->asString().toUtf8(); - slot.body = body; - obj->dynamicSlots << slot; + if (AST::FunctionDeclaration *funDecl = AST::cast(node->sourceElement)) { - } else { - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser","JavaScript declaration outside Script element")); - error.setLine(node->firstSourceLocation().startLine); - error.setColumn(node->firstSourceLocation().startColumn); - _parser->_errors << error; - } - return false; - - } else { - QString source; - - int line = 0; - if (AST::FunctionDeclaration *funDecl = AST::cast(node->sourceElement)) { - line = funDecl->functionToken.startLine; - source = asString(funDecl); - } else if (AST::VariableStatement *varStmt = AST::cast(node->sourceElement)) { - // ignore variable declarations - line = varStmt->declarationKindToken.startLine; + Object::DynamicSlot slot; + slot.location = location(funDecl->firstSourceLocation(), funDecl->lastSourceLocation()); - QDeclarativeError error; - error.setDescription(QCoreApplication::translate("QDeclarativeParser", "Variable declarations not allow in inline Script blocks")); - error.setLine(node->firstSourceLocation().startLine); - error.setColumn(node->firstSourceLocation().startColumn); - _parser->_errors << error; - return false; + AST::FormalParameterList *f = funDecl->formals; + while (f) { + slot.parameterNames << f->name->asString().toUtf8(); + f = f->finish(); } - Value *value = new Value; - value->location = location(node->firstSourceLocation(), - node->lastSourceLocation()); - value->value = QDeclarativeParser::Variant(source); + QString body = textAt(funDecl->lbraceToken, funDecl->rbraceToken); + slot.name = funDecl->name->asString().toUtf8(); + slot.body = body; + obj->dynamicSlots << slot; - obj->getDefaultProperty()->addValue(value); + } else { + QDeclarativeError error; + error.setDescription(QCoreApplication::translate("QDeclarativeParser","JavaScript declaration outside Script element")); + error.setLine(node->firstSourceLocation().startLine); + error.setColumn(node->firstSourceLocation().startColumn); + _parser->_errors << error; } - return false; } diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index fdcbeee..57bf726 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -623,13 +623,6 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack &stack, } break; - case QDeclarativeInstruction::StoreScript: - { - QObject *target = stack.top(); - ctxt->addScript(scripts.at(instr.storeScript.value), target); - } - break; - case QDeclarativeInstruction::StoreImportedScript: { ctxt->addImportedScript(scripts.at(instr.storeScript.value)); diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml index b7bec63..12ac754 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml @@ -5,10 +5,8 @@ Item { property int binding: myFunction(); property int binding2: myCompFunction(); - Script { - function myCompFunction() { - return a; - } + function myCompFunction() { + return a; } } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.1.qml deleted file mode 100644 index 2ac7b6e..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.1.qml +++ /dev/null @@ -1,11 +0,0 @@ -import Qt 4.6 - -QtObject { - property int test: external_script_func(); - - Script { - // Single source as non-array literal - source: "externalScript.js" - } -} - diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.2.js b/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.2.js deleted file mode 100644 index 78c3a86..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.2.js +++ /dev/null @@ -1,8 +0,0 @@ -function external_script_func2() { - return a; -} - -function is_a_undefined() { - return a == undefined; -} - diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.2.qml deleted file mode 100644 index dec657c..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.2.qml +++ /dev/null @@ -1,11 +0,0 @@ -import Qt 4.6 - -QtObject { - property int test: external_script_func(); - - Script { - // Single source as array - source: [ "externalScript.js" ] - } -} - diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.3.qml deleted file mode 100644 index d7acf38..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.3.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Qt 4.6 - -QtObject { - property int test: external_script_func(); - property int test2: external_script_func2(); - property bool test3: is_a_undefined(); - - Script { - // Multiple script - source: [ "externalScript.js", "externalScript.2.js" ] - } -} - diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.4.qml deleted file mode 100644 index 16211aa..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.4.qml +++ /dev/null @@ -1,15 +0,0 @@ -import Qt 4.6 - -QtObject { - property int test: external_script_func(); - property bool test2: is_a_undefined(); - - // Disconnected scripts - Script { - source: "externalScript.js" - } - - Script { - source: "externalScript.2.js" - } -} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.js b/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.js deleted file mode 100644 index 8928652..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/externalScript.js +++ /dev/null @@ -1,6 +0,0 @@ -var a = 92; - -function external_script_func() { - return a; -} - diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml index 8e5aa0b..9beda6a 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml @@ -4,10 +4,8 @@ Item { property int a: 0 property int b: 0 - Script { - function b() { return 11; } - function c() { return 33; } - } + function b() { return 11; } + function c() { return 33; } QtObject { id: a diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml index cccd3d3..1c0be98 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml @@ -7,21 +7,17 @@ Item { property int binding: a property string binding2: a + "Test" property int binding3: myFunction() - property int binding4: myNestedFunction() + property int binding4: nestedObject.myNestedFunction() - Script { - function myFunction() { - return a; - } + function myFunction() { + return a; } Item { id: nestedObject - Script { - function myNestedFunction() { - return a; - } + function myNestedFunction() { + return a; } property int a: 2 diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptAccess.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptAccess.js deleted file mode 100644 index c00d285..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptAccess.js +++ /dev/null @@ -1,7 +0,0 @@ -var extVariable = 19; - -function extMethod() -{ - return extVariable; -} - diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptAccess.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptAccess.qml deleted file mode 100644 index feb6d16..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptAccess.qml +++ /dev/null @@ -1,17 +0,0 @@ -import Qt 4.6 - -Item { - Script { - function method() { - return 10; - } - } - - Script { - source: "scriptAccess.js" - } - - property int test1: method() - property int test2: extMethod() - property int test3: extVariable -} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js new file mode 100644 index 0000000..54284fe --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js @@ -0,0 +1,4 @@ +function testFunction() { + test = true; +} + diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml index 2bdd706..d6e4207 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml @@ -1,16 +1,10 @@ import Qt.test 1.0 import Qt 4.6 - +import "scriptConnect.1.js" as Script MyQmlObject { property bool test: false id: root - Script { - function testFunction() { - test = true; - } - } - - Component.onCompleted: root.argumentSignal.connect(testFunction); + Component.onCompleted: root.argumentSignal.connect(Script.testFunction); } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js new file mode 100644 index 0000000..595c778 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js @@ -0,0 +1,5 @@ +function testFunction() { + if (this.b == 12) + test = true; +} + diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml index fa90918..7992ba5 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml @@ -1,22 +1,16 @@ import Qt.test 1.0 import Qt 4.6 +import "scriptConnect.2.js" as Script MyQmlObject { property bool test: false id: root - Script { - function testFunction() { - if (this.b == 12) - test = true; - } - } - Component.onCompleted: { var a = new Object; a.b = 12; - root.argumentSignal.connect(a, testFunction); + root.argumentSignal.connect(a, Script.testFunction); } } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js new file mode 100644 index 0000000..71bdd08 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js @@ -0,0 +1,3 @@ +function testFunction() { + test++; +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml index 8c35db1..d546495 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml @@ -1,20 +1,15 @@ import Qt.test 1.0 import Qt 4.6 +import "scriptConnect.6.js" as Script MyQmlObject { property int test: 0 id: root - - Script { - function testFunction() { - test++; - } - } Component.onCompleted: { - root.argumentSignal.connect(testFunction); - root.argumentSignal.connect(testFunction); + root.argumentSignal.connect(Script.testFunction); + root.argumentSignal.connect(Script.testFunction); } } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js new file mode 100644 index 0000000..407426f --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js @@ -0,0 +1,6 @@ +function testFunction() { + test++; +} + +function otherFunction() { +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml index 45c4f73..0d262c6 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml @@ -1,18 +1,13 @@ import Qt.test 1.0 import Qt 4.6 +import "scriptDisconnect.1.js" as Script MyQmlObject { property int test: 0 id: root - Script { - function testFunction() { - test++; - } - } + Component.onCompleted: root.argumentSignal.connect(Script.testFunction); - Component.onCompleted: root.argumentSignal.connect(testFunction); - - onBasicSignal: root.argumentSignal.disconnect(testFunction); + onBasicSignal: root.argumentSignal.disconnect(Script.testFunction); } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml index a47fe74..6d379e6 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml @@ -1,19 +1,14 @@ import Qt.test 1.0 import Qt 4.6 +import "scriptDisconnect.1.js" as Script MyQmlObject { property int test: 0 id: root - Script { - function testFunction() { - test++; - } - } + Component.onCompleted: root.argumentSignal.connect(root, Script.testFunction); - Component.onCompleted: root.argumentSignal.connect(root, testFunction); - - onBasicSignal: root.argumentSignal.disconnect(root, testFunction); + onBasicSignal: root.argumentSignal.disconnect(root, Script.testFunction); } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml index c95ffbf..526580a 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml @@ -1,19 +1,14 @@ import Qt.test 1.0 import Qt 4.6 +import "scriptDisconnect.1.js" as Script MyQmlObject { property int test: 0 id: root - Script { - function testFunction() { - test++; - } - } + Component.onCompleted: root.argumentSignal.connect(root, Script.testFunction); - Component.onCompleted: root.argumentSignal.connect(root, testFunction); - - onBasicSignal: root.argumentSignal.disconnect(testFunction); + onBasicSignal: root.argumentSignal.disconnect(Script.testFunction); } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml index 342f24a..18b05ad 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml @@ -1,20 +1,13 @@ import Qt.test 1.0 import Qt 4.6 +import "scriptDisconnect.1.js" as Script MyQmlObject { property int test: 0 id: root - Script { - function testFunction() { - test++; - } - function otherFunction() { - } - } + Component.onCompleted: root.argumentSignal.connect(Script.testFunction); - Component.onCompleted: root.argumentSignal.connect(testFunction); - - onBasicSignal: root.argumentSignal.disconnect(otherFunction); + onBasicSignal: root.argumentSignal.disconnect(Script.otherFunction); } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js index 1d7b357..d22f623 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js @@ -1,2 +1,4 @@ // Comment a = 10 + +function getValue() { a = 10; return 0; } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml index c2edb41..e8f7b62 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml @@ -1,11 +1,9 @@ import Qt.test 1.0 +import "scriptErrors.js" as Script MyQmlObject { - Script { source: "scriptErrors.js" } - Script { function getValue() { a = 10; return 0; } } - property int t: a.value - property int w: getValue(); + property int w: Script.getValue(); property int x: undefinedObject property int y: (a.value, undefinedObject) diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.1.qml deleted file mode 100644 index 9b11fa9..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.1.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - property string result - - Script{ - function f() { - result = b - } - - } - onArgumentSignal: f() -} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.2.qml deleted file mode 100644 index ec727e2..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.2.qml +++ /dev/null @@ -1,11 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject { - property string result - property string aProp: "hello" - - Script{ - source: "scriptScope.js" - } - onBasicSignal: f() -} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.js b/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.js deleted file mode 100644 index 5689930..0000000 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptScope.js +++ /dev/null @@ -1,5 +0,0 @@ -var aProp = "world"; - -function f() { - result = aProp; -} diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 4036507..33629b8 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -100,7 +100,6 @@ private slots: void scope(); void signalParameterTypes(); void objectsCompareAsEqual(); - void scriptAccess(); void dynamicCreation_data(); void dynamicCreation(); void dynamicDestruction(); @@ -117,14 +116,12 @@ private slots: void exceptionBindingProducesWarning(); void transientErrors(); void shutdownErrors(); - void externalScript(); void compositePropertyType(); void jsObject(); void undefinedResetsProperty(); void listToVariant(); void multiEngineObject(); void deletedObject(); - void scriptScope(); void attachedPropertyScope(); void scriptConnect(); void scriptDisconnect(); @@ -837,24 +834,6 @@ void tst_qdeclarativeecmascript::aliasPropertyAndBinding() QCOMPARE(object->property("c3").toInt(), 19); } -/* -Tests that only methods of Script {} blocks are exposed. -*/ -void tst_qdeclarativeecmascript::scriptAccess() -{ - QDeclarativeComponent component(&engine, TEST_FILE("scriptAccess.qml")); - - QString warning = component.url().toString() + ":16: Unable to assign [undefined] to int"; - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); - - QObject *object = component.create(); - QVERIFY(object != 0); - - QCOMPARE(object->property("test1").toInt(), 10); - QCOMPARE(object->property("test2").toInt(), 19); - QCOMPARE(object->property("test3").toInt(), 0); -} - void tst_qdeclarativeecmascript::dynamicCreation_data() { QTest::addColumn("method"); @@ -977,13 +956,13 @@ void tst_qdeclarativeecmascript::scriptErrors() QString url = component.url().toString(); QString warning1 = url.left(url.length() - 3) + "js:2: Error: Invalid write to global property \"a\""; - QString warning2 = url + ":7: TypeError: Result of expression 'a' [undefined] is not an object."; - QString warning3 = url + ":5: Error: Invalid write to global property \"a\""; - QString warning4 = url + ":12: TypeError: Result of expression 'a' [undefined] is not an object."; - QString warning5 = url + ":10: TypeError: Result of expression 'a' [undefined] is not an object."; - QString warning6 = url + ":9: Unable to assign [undefined] to int"; - QString warning7 = url + ":14: Error: Cannot assign to read-only property \"trueProperty\""; - QString warning8 = url + ":15: Error: Cannot assign to non-existent property \"fakeProperty\""; + QString warning2 = url + ":5: TypeError: Result of expression 'a' [undefined] is not an object."; + QString warning3 = url.left(url.length() - 3) + "js:4: Error: Invalid write to global property \"a\""; + QString warning4 = url + ":10: TypeError: Result of expression 'a' [undefined] is not an object."; + QString warning5 = url + ":8: TypeError: Result of expression 'a' [undefined] is not an object."; + QString warning6 = url + ":7: Unable to assign [undefined] to int"; + QString warning7 = url + ":12: Error: Cannot assign to read-only property \"trueProperty\""; + QString warning8 = url + ":13: Error: Cannot assign to non-existent property \"fakeProperty\""; QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData()); QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData()); @@ -1166,53 +1145,6 @@ void tst_qdeclarativeecmascript::shutdownErrors() QCOMPARE(transientErrorsMsgCount, 0); } -// Check that Script::source property works as expected -void tst_qdeclarativeecmascript::externalScript() -{ - { - QDeclarativeComponent component(&engine, TEST_FILE("externalScript.1.qml")); - QObject *object = component.create(); - QVERIFY(object != 0); - - QCOMPARE(object->property("test").toInt(), 92); - - delete object; - } - - { - QDeclarativeComponent component(&engine, TEST_FILE("externalScript.2.qml")); - QObject *object = component.create(); - QVERIFY(object != 0); - - QCOMPARE(object->property("test").toInt(), 92); - - delete object; - } - - { - QDeclarativeComponent component(&engine, TEST_FILE("externalScript.3.qml")); - QObject *object = component.create(); - QVERIFY(object != 0); - - QCOMPARE(object->property("test").toInt(), 92); - QCOMPARE(object->property("test2").toInt(), 92); - QCOMPARE(object->property("test3").toBool(), false); - - delete object; - } - - { - QDeclarativeComponent component(&engine, TEST_FILE("externalScript.4.qml")); - QObject *object = component.create(); - QVERIFY(object != 0); - - QCOMPARE(object->property("test").toInt(), 92); - QCOMPARE(object->property("test2").toBool(), true); - - delete object; - } -} - void tst_qdeclarativeecmascript::compositePropertyType() { QDeclarativeComponent component(&engine, TEST_FILE("compositePropertyType.qml")); @@ -1769,31 +1701,6 @@ void tst_qdeclarativeecmascript::deletedObject() delete object; } -void tst_qdeclarativeecmascript::scriptScope() -{ - { - QDeclarativeComponent component(&engine, TEST_FILE("scriptScope.1.qml")); - - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - emit object->argumentSignal(19, "Hello world!", 10.3); - QCOMPARE(object->property("result").toString(), QString()); - - delete object; - } - - { - QDeclarativeComponent component(&engine, TEST_FILE("scriptScope.2.qml")); - - MyQmlObject *object = qobject_cast(component.create()); - QVERIFY(object != 0); - emit object->basicSignal(); - QCOMPARE(object->property("result").toString(), QLatin1String("world")); - - delete object; - } -} - void tst_qdeclarativeecmascript::attachedPropertyScope() { QDeclarativeComponent component(&engine, TEST_FILE("attachedPropertyScope.qml")); diff --git a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp index f4df130..9ae26f2 100644 --- a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp +++ b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp @@ -332,16 +332,6 @@ void tst_qdeclarativeinstruction::dump() { QDeclarativeInstruction i; - i.line = 28; - i.type = QDeclarativeInstruction::StoreScript; - i.storeScript.value = 2; - //i.storeScript.fileName = 18; - //i.storeScript.lineNumber = 28; - data->bytecode << i; - } - - { - QDeclarativeInstruction i; i.line = 29; i.type = QDeclarativeInstruction::StoreScriptString; i.storeScriptString.propertyIndex = 24; @@ -571,30 +561,29 @@ void tst_qdeclarativeinstruction::dump() << "25\t\t25\tSTORE_VARIANT_OBJECT\t22" << "26\t\t26\tSTORE_INTERFACE\t\t23" << "27\t\t27\tSTORE_SIGNAL\t\t2\t3\t\t\"console.log(1921)\"" - << "28\t\t28\tSTORE_SCRIPT\t\t2" - << "29\t\t29\tSTORE_SCRIPT_STRING\t24\t3\t1" - << "30\t\t30\tASSIGN_SIGNAL_OBJECT\t0\t\t\t\"mySignal\"" - << "31\t\t31\tASSIGN_CUSTOMTYPE\t25\t4" - << "32\t\t32\tSTORE_BINDING\t26\t3\t2" - << "33\t\t33\tSTORE_COMPILED_BINDING\t27\t2\t4" - << "34\t\t34\tSTORE_VALUE_SOURCE\t29\t4" - << "35\t\t35\tSTORE_VALUE_INTERCEPTOR\t30\t-4" - << "36\t\t36\tBEGIN\t\t\t4" - << "37\t\t38\tSTORE_OBJECT_QLIST" - << "38\t\t39\tASSIGN_OBJECT_LIST" - << "39\t\t40\tFETCH_ATTACHED\t\t23" - << "40\t\t42\tFETCH_QLIST\t\t32" - << "41\t\t43\tFETCH\t\t\t33" - << "42\t\t44\tFETCH_VALUE\t\t34\t6" - << "43\t\t45\tPOP" - << "44\t\t46\tPOP_QLIST" - << "45\t\t47\tPOP_VALUE\t\t35\t8" - << "46\t\t48\tDEFER\t\t\t7" - << "47\t\tNA\tDEFER\t\t\t7" - << "48\t\t48\tSTORE_IMPORTED_SCRIPT\t2" - << "49\t\t50\tXXX UNKOWN INSTRUCTION\t1234" - << "50\t\t51\tSTORE_VARIANT_INTEGER\t\t32\t11" - << "51\t\t52\tSTORE_VARIANT_DOUBLE\t\t19\t33.7" + << "28\t\t29\tSTORE_SCRIPT_STRING\t24\t3\t1" + << "29\t\t30\tASSIGN_SIGNAL_OBJECT\t0\t\t\t\"mySignal\"" + << "30\t\t31\tASSIGN_CUSTOMTYPE\t25\t4" + << "31\t\t32\tSTORE_BINDING\t26\t3\t2" + << "32\t\t33\tSTORE_COMPILED_BINDING\t27\t2\t4" + << "33\t\t34\tSTORE_VALUE_SOURCE\t29\t4" + << "34\t\t35\tSTORE_VALUE_INTERCEPTOR\t30\t-4" + << "35\t\t36\tBEGIN\t\t\t4" + << "36\t\t38\tSTORE_OBJECT_QLIST" + << "37\t\t39\tASSIGN_OBJECT_LIST" + << "38\t\t40\tFETCH_ATTACHED\t\t23" + << "39\t\t42\tFETCH_QLIST\t\t32" + << "40\t\t43\tFETCH\t\t\t33" + << "41\t\t44\tFETCH_VALUE\t\t34\t6" + << "42\t\t45\tPOP" + << "43\t\t46\tPOP_QLIST" + << "44\t\t47\tPOP_VALUE\t\t35\t8" + << "45\t\t48\tDEFER\t\t\t7" + << "46\t\tNA\tDEFER\t\t\t7" + << "47\t\t48\tSTORE_IMPORTED_SCRIPT\t2" + << "48\t\t50\tXXX UNKOWN INSTRUCTION\t1234" + << "49\t\t51\tSTORE_VARIANT_INTEGER\t\t32\t11" + << "50\t\t52\tSTORE_VARIANT_DOUBLE\t\t19\t33.7" << "-------------------------------------------------------------------------------"; messages = QStringList(); -- cgit v0.12 From 9b4df240c1007040f4be7bccb952fb422eaf34f5 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Mon, 19 Apr 2010 17:12:03 +1000 Subject: Renamed mousePosChanged signal to mousePositionChanged --- src/declarative/graphicsitems/qdeclarativemousearea.cpp | 6 +++--- src/declarative/graphicsitems/qdeclarativemousearea_p.h | 6 +++--- .../qdeclarativemousearea/data/updateMousePosOnResize.qml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 52dbc42..bdb4868 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -466,7 +466,7 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) d->moved = true; } QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, d->longPress); - emit mousePosChanged(&me); + emit mousePositionChanged(&me); me.setX(d->lastPos.x()); me.setY(d->lastPos.y()); emit positionChanged(&me); @@ -521,7 +521,7 @@ void QDeclarativeMouseArea::hoverMoveEvent(QGraphicsSceneHoverEvent *event) } else { d->lastPos = event->pos(); QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), Qt::NoButton, d->lastButtons, d->lastModifiers, false, d->longPress); - emit mousePosChanged(&me); + emit mousePositionChanged(&me); me.setX(d->lastPos.x()); me.setY(d->lastPos.y()); emit positionChanged(&me); @@ -668,7 +668,7 @@ bool QDeclarativeMouseArea::setPressed(bool p) emit pressed(&me); me.setX(d->lastPos.x()); me.setY(d->lastPos.y()); - emit mousePosChanged(&me); + emit mousePositionChanged(&me); } else { emit released(&me); me.setX(d->lastPos.x()); diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h index cfd5fc7..630840f 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h @@ -108,8 +108,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeMouseArea : public QDeclarativeItem { Q_OBJECT - Q_PROPERTY(qreal mouseX READ mouseX NOTIFY mousePosChanged) - Q_PROPERTY(qreal mouseY READ mouseY NOTIFY mousePosChanged) + Q_PROPERTY(qreal mouseX READ mouseX NOTIFY mousePositionChanged) + Q_PROPERTY(qreal mouseY READ mouseY NOTIFY mousePositionChanged) Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged) Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) @@ -144,7 +144,7 @@ Q_SIGNALS: void enabledChanged(); void acceptedButtonsChanged(); void positionChanged(QDeclarativeMouseEvent *mouse); - void mousePosChanged(QDeclarativeMouseEvent *mouse); + void mousePositionChanged(QDeclarativeMouseEvent *mouse); void pressed(QDeclarativeMouseEvent *mouse); void pressAndHold(QDeclarativeMouseEvent *mouse); diff --git a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml index 138c25a..63de624 100644 --- a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml +++ b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml @@ -29,7 +29,7 @@ Rectangle { anchors.fill = parent } onPositionChanged: { emitPositionChanged = true } - onMousePosChanged: { + onMousePositionChanged: { if (mouse.x != mouseX || mouse.y != mouseY) mouseMatchesPos = false x2 = mouseX; y2 = mouseY -- cgit v0.12 From 906a4c123794efd02b64b03fc544925ce3f4a012 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 19 Apr 2010 17:13:50 +1000 Subject: Remove "property var" support --- src/declarative/qml/qdeclarativescriptparser.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index 674df9d..e7c8a12 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -516,7 +516,6 @@ bool ProcessAST::visit(AST::UiPublicMember *node) // { "time", Object::DynamicProperty::Time, "QTime" }, // { "date", Object::DynamicProperty::Date, "QDate" }, { "date", Object::DynamicProperty::DateTime, "QDateTime" }, - { "var", Object::DynamicProperty::Variant, "QVariant" }, { "variant", Object::DynamicProperty::Variant, "QVariant" } }; const int propTypeNameToTypesCount = sizeof(propTypeNameToTypes) / @@ -628,11 +627,6 @@ bool ProcessAST::visit(AST::UiPublicMember *node) property.location = location(node->firstSourceLocation(), node->lastSourceLocation()); - if (memberType == QLatin1String("var")) - qWarning().nospace() << qPrintable(_parser->_scriptFile) << ":" << property.location.start.line << ":" - << property.location.start.column << ": var type has been replaced by variant. " - << "Support will be removed entirely shortly."; - if (node->expression) { // default value property.defaultValue = new Property; property.defaultValue->parent = _stateStack.top().object; -- cgit v0.12 From 685549ea36f84c84805eee0191b362eea6c66728 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Mon, 19 Apr 2010 11:16:48 +1000 Subject: Indentation and whitespace fixes in qml's samegame tutorial --- demos/declarative/samegame/SamegameCore/BoomBlock.qml | 10 ++++++---- demos/declarative/samegame/SamegameCore/Button.qml | 4 ++-- demos/declarative/samegame/SamegameCore/Dialog.qml | 2 +- demos/declarative/samegame/samegame.qml | 2 +- examples/declarative/tutorials/samegame/samegame1/Block.qml | 4 ++-- examples/declarative/tutorials/samegame/samegame1/Button.qml | 4 ++-- examples/declarative/tutorials/samegame/samegame2/Block.qml | 4 ++-- examples/declarative/tutorials/samegame/samegame2/Button.qml | 4 ++-- examples/declarative/tutorials/samegame/samegame2/samegame.qml | 2 +- examples/declarative/tutorials/samegame/samegame3/Block.qml | 4 ++-- examples/declarative/tutorials/samegame/samegame3/Button.qml | 4 ++-- examples/declarative/tutorials/samegame/samegame3/Dialog.qml | 2 +- examples/declarative/tutorials/samegame/samegame3/samegame.qml | 2 +- .../tutorials/samegame/samegame4/content/BoomBlock.qml | 8 ++++---- .../tutorials/samegame/samegame4/content/Button.qml | 4 ++-- .../tutorials/samegame/samegame4/content/Dialog.qml | 2 +- examples/declarative/tutorials/samegame/samegame4/samegame.qml | 2 +- 17 files changed, 33 insertions(+), 31 deletions(-) diff --git a/demos/declarative/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/SamegameCore/BoomBlock.qml index bad1bf4..47f43c2 100644 --- a/demos/declarative/samegame/SamegameCore/BoomBlock.qml +++ b/demos/declarative/samegame/SamegameCore/BoomBlock.qml @@ -1,7 +1,8 @@ import Qt 4.7 import Qt.labs.particles 1.0 -Item { id:block +Item { + id: block property bool dying: false property bool spawned: false property int type: 0 @@ -11,7 +12,8 @@ Item { id:block SpringFollow on x { enabled: spawned; to: targetX; spring: 2; damping: 0.2 } SpringFollow on y { to: targetY; spring: 2; damping: 0.2 } - Image { id: img + Image { + id: img source: { if(type == 0){ "pics/redStone.png"; @@ -26,10 +28,10 @@ Item { id:block anchors.fill: parent } - Particles { + Particles { id: particles - width: 1; height: 1 + width: 1; height: 1 anchors.centerIn: parent emissionRate: 0 diff --git a/demos/declarative/samegame/SamegameCore/Button.qml b/demos/declarative/samegame/SamegameCore/Button.qml index 0faabc9..6d5d75d 100644 --- a/demos/declarative/samegame/SamegameCore/Button.qml +++ b/demos/declarative/samegame/SamegameCore/Button.qml @@ -17,9 +17,9 @@ Rectangle { GradientStop { position: 0.0 color: { - if (mouseArea.pressed) + if (mouseArea.pressed) return activePalette.dark - else + else return activePalette.light } } diff --git a/demos/declarative/samegame/SamegameCore/Dialog.qml b/demos/declarative/samegame/SamegameCore/Dialog.qml index 8784348..d4f188c 100644 --- a/demos/declarative/samegame/SamegameCore/Dialog.qml +++ b/demos/declarative/samegame/SamegameCore/Dialog.qml @@ -22,7 +22,7 @@ Rectangle { border.width: 1 opacity: 0 - Behavior on opacity { + Behavior on opacity { NumberAnimation { duration: 1000 } } diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml index 92201f5..f1b41c9 100644 --- a/demos/declarative/samegame/samegame.qml +++ b/demos/declarative/samegame/samegame.qml @@ -38,7 +38,7 @@ Rectangle { Dialog { id: nameInputDialog - + property int initialWidth: 0 anchors.centerIn: parent diff --git a/examples/declarative/tutorials/samegame/samegame1/Block.qml b/examples/declarative/tutorials/samegame/samegame1/Block.qml index a535235..a23654b 100644 --- a/examples/declarative/tutorials/samegame/samegame1/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame1/Block.qml @@ -1,9 +1,9 @@ //![0] import Qt 4.7 -Item { +Item { id: block - + Image { id: img anchors.fill: parent diff --git a/examples/declarative/tutorials/samegame/samegame1/Button.qml b/examples/declarative/tutorials/samegame/samegame1/Button.qml index e8034ac..e84b1ce 100644 --- a/examples/declarative/tutorials/samegame/samegame1/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame1/Button.qml @@ -18,9 +18,9 @@ Rectangle { GradientStop { position: 0.0 color: { - if (mouseArea.pressed) + if (mouseArea.pressed) return activePalette.dark - else + else return activePalette.light } } diff --git a/examples/declarative/tutorials/samegame/samegame2/Block.qml b/examples/declarative/tutorials/samegame/samegame2/Block.qml index 88b3d79..4e71e60 100644 --- a/examples/declarative/tutorials/samegame/samegame2/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame2/Block.qml @@ -1,8 +1,8 @@ import Qt 4.7 -Item { +Item { id: block - + Image { id: img anchors.fill: parent diff --git a/examples/declarative/tutorials/samegame/samegame2/Button.qml b/examples/declarative/tutorials/samegame/samegame2/Button.qml index 8d322de5..737d886 100644 --- a/examples/declarative/tutorials/samegame/samegame2/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame2/Button.qml @@ -17,9 +17,9 @@ Rectangle { GradientStop { position: 0.0 color: { - if (mouseArea.pressed) + if (mouseArea.pressed) return activePalette.dark - else + else return activePalette.light } } diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.qml b/examples/declarative/tutorials/samegame/samegame2/samegame.qml index 7a17d16..a7d1fba 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.qml @@ -31,7 +31,7 @@ Rectangle { //![1] Button { anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } - text: "New Game" + text: "New Game" onClicked: SameGame.startNewGame() } //![1] diff --git a/examples/declarative/tutorials/samegame/samegame3/Block.qml b/examples/declarative/tutorials/samegame/samegame3/Block.qml index dd0fb48..7411259 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Block.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Block.qml @@ -1,11 +1,11 @@ //![0] import Qt 4.7 -Item { +Item { id: block property int type: 0 - + Image { id: img diff --git a/examples/declarative/tutorials/samegame/samegame3/Button.qml b/examples/declarative/tutorials/samegame/samegame3/Button.qml index 8d322de5..737d886 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Button.qml @@ -17,9 +17,9 @@ Rectangle { GradientStop { position: 0.0 color: { - if (mouseArea.pressed) + if (mouseArea.pressed) return activePalette.dark - else + else return activePalette.light } } diff --git a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml index be3a7b7..15b3b2f 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml @@ -21,7 +21,7 @@ Rectangle { border.width: 1 opacity: 0 - Behavior on opacity { + Behavior on opacity { NumberAnimation { duration: 1000 } } diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.qml b/examples/declarative/tutorials/samegame/samegame3/samegame.qml index bc5f2f8..50f9d5d 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.qml @@ -52,7 +52,7 @@ Rectangle { Button { anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } - text: "New Game" + text: "New Game" onClicked: SameGame.startNewGame() } diff --git a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml index d3a9df7..d6ef2e5 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml @@ -17,21 +17,21 @@ Item { //![1] //![2] - Image { + Image { id: img anchors.fill: parent source: { if (type == 0) return "../../shared/pics/redStone.png"; - else if (type == 1) + else if (type == 1) return "../../shared/pics/blueStone.png"; else return "../../shared/pics/greenStone.png"; } opacity: 0 - Behavior on opacity { + Behavior on opacity { NumberAnimation { properties:"opacity"; duration: 200 } } } @@ -41,7 +41,7 @@ Item { Particles { id: particles - width: 1; height: 1 + width: 1; height: 1 anchors.centerIn: parent emissionRate: 0 diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml index 8d322de5..737d886 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml @@ -17,9 +17,9 @@ Rectangle { GradientStop { position: 0.0 color: { - if (mouseArea.pressed) + if (mouseArea.pressed) return activePalette.dark - else + else return activePalette.light } } diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml index adb3f9e..6848534 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml @@ -20,7 +20,7 @@ Rectangle { border.width: 1 opacity: 0 - Behavior on opacity { + Behavior on opacity { NumberAnimation { duration: 1000 } } diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml index b2a490d..404af0a 100644 --- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml @@ -73,7 +73,7 @@ Rectangle { Button { anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } - text: "New Game" + text: "New Game" onClicked: SameGame.startNewGame() } -- cgit v0.12 From b557e478a2be17131ac147f72bec7c8ad9ffedfc Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 19 Apr 2010 17:47:53 +1000 Subject: Typo. --- src/declarative/graphicsitems/qdeclarativepositioners_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h index 24b65fa..b5fc979 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners_p.h +++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h @@ -136,7 +136,7 @@ private: class Q_DECLARATIVE_EXPORT QDeclarativeGrid : public QDeclarativeBasePositioner { Q_OBJECT - Q_PROPERTY(int rows READ rows WRITE setRows NOTIFY rowChanged) + Q_PROPERTY(int rows READ rows WRITE setRows NOTIFY rowsChanged) Q_PROPERTY(int columns READ columns WRITE setColumns NOTIFY columnsChanged) Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged) -- cgit v0.12 From 441e7486f59ecb25ac03d9cfa882f0bf164cf788 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 19 Apr 2010 17:49:36 +1000 Subject: Improve fillmode example. --- examples/declarative/fillmode/content/QtLogo.qml | 30 +++++++++++++ examples/declarative/fillmode/content/qt-logo.png | Bin 0 -> 5149 bytes examples/declarative/fillmode/face.png | Bin 905 -> 0 bytes examples/declarative/fillmode/fillmode.qml | 52 +++++++--------------- 4 files changed, 45 insertions(+), 37 deletions(-) create mode 100644 examples/declarative/fillmode/content/QtLogo.qml create mode 100644 examples/declarative/fillmode/content/qt-logo.png delete mode 100644 examples/declarative/fillmode/face.png diff --git a/examples/declarative/fillmode/content/QtLogo.qml b/examples/declarative/fillmode/content/QtLogo.qml new file mode 100644 index 0000000..6dd714d --- /dev/null +++ b/examples/declarative/fillmode/content/QtLogo.qml @@ -0,0 +1,30 @@ +import Qt 4.7 + +Item { + id: qtLogo + + property alias fillMode: image.fillMode + property alias label: labelText.text + + width: ((window.width - 20) - ((grid.columns - 1) * grid.spacing)) / grid.columns + height: ((window.height - 20) - ((grid.rows - 1) * grid.spacing)) / grid.rows + + Column { + anchors.fill: parent + + Rectangle { + height: qtLogo.height - 30; width: qtLogo.width + border.color: "black"; clip: true + + Image { + id: image + anchors.fill: parent; smooth: true; source: "qt-logo.png" + } + } + + Text { + id: labelText; anchors.horizontalCenter: parent.horizontalCenter + height: 30; verticalAlignment: Text.AlignVCenter + } + } +} diff --git a/examples/declarative/fillmode/content/qt-logo.png b/examples/declarative/fillmode/content/qt-logo.png new file mode 100644 index 0000000..14ddf2a Binary files /dev/null and b/examples/declarative/fillmode/content/qt-logo.png differ diff --git a/examples/declarative/fillmode/face.png b/examples/declarative/fillmode/face.png deleted file mode 100644 index 9623b1a..0000000 Binary files a/examples/declarative/fillmode/face.png and /dev/null differ diff --git a/examples/declarative/fillmode/fillmode.qml b/examples/declarative/fillmode/fillmode.qml index e47fc9b..e5b0336 100644 --- a/examples/declarative/fillmode/fillmode.qml +++ b/examples/declarative/fillmode/fillmode.qml @@ -1,44 +1,22 @@ import Qt 4.7 +import "content" -Image { - width: 400 - height: 250 - source: "face.png" +Rectangle { + id: window - SequentialAnimation on fillMode { - loops: Animation.Infinite - PropertyAction { value: Image.Stretch } - PropertyAction { target: label; property: "text"; value: "Stretch" } - PauseAnimation { duration: 1000 } - PropertyAction { value: Image.PreserveAspectFit } - PropertyAction { target: label; property: "text"; value: "PreserveAspectFit" } - PauseAnimation { duration: 1000 } - PropertyAction { value: Image.PreserveAspectCrop } - PropertyAction { target: label; property: "text"; value: "PreserveAspectCrop" } - PauseAnimation { duration: 1000 } - PropertyAction { value: Image.Tile } - PropertyAction { target: label; property: "text"; value: "Tile" } - PauseAnimation { duration: 1000 } - PropertyAction { value: Image.TileHorizontally } - PropertyAction { target: label; property: "text"; value: "TileHorizontally" } - PauseAnimation { duration: 1000 } - PropertyAction { value: Image.TileVertically } - PropertyAction { target: label; property: "text"; value: "TileVertically" } - PauseAnimation { duration: 1000 } - } + width: 800; height: 480 + color: "#cdcdcd" - Text { - id: label - font.pointSize: 24 - color: "blue" - style: Text.Outline - styleColor: "white" - anchors.centerIn: parent - } + Grid { + id: grid + anchors { fill: parent; topMargin: 10; leftMargin: 10; rightMargin: 10; bottomMargin: 10 } + columns: 3; rows: 2; spacing: 20 - Rectangle { - border.color: "black" - color: "transparent" - anchors { fill: parent; rightMargin: 1; bottomMargin: 1 } + QtLogo { fillMode: Image.Stretch; label: "Stretch" } + QtLogo { fillMode: Image.PreserveAspectFit; label: "PreserveAspectFit" } + QtLogo { fillMode: Image.PreserveAspectCrop; label: "PreserveAspectCrop" } + QtLogo { fillMode: Image.Tile; label: "Tile" } + QtLogo { fillMode: Image.TileHorizontally; label: "TileHorizontally" } + QtLogo { fillMode: Image.TileVertically; label: "TileVertically" } } } -- cgit v0.12 From 2ac290f56c6ad4f3e236034a7b99ecdb598ecc3a Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 19 Apr 2010 21:15:51 +1000 Subject: Document default easing curve. --- src/declarative/util/qdeclarativeanimation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 5f81b26..27f37df 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1748,7 +1748,8 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t) \brief the easing curve used for the animation. To specify an easing curve you need to specify at least the type. For some curves you can also specify - amplitude, period and/or overshoot (more details provided after the table). + amplitude, period and/or overshoot (more details provided after the table). The default easing curve is + Linear. \qml PropertyAnimation { properties: "y"; easing.type: "InOutElastic"; easing.amplitude: 2.0; easing.period: 1.5 } -- cgit v0.12 From 20d1a78e07e74ff7518e040c6fbd32e4609ca7fc Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 19 Apr 2010 12:56:52 +0200 Subject: Fix flipable behaviour when back element is resized Task-number: QTBUG-8424 Reviewed-by: mae --- .../graphicsitems/qdeclarativeflipable.cpp | 49 ++++++++++++++++------ .../graphicsitems/qdeclarativeflipable_p.h | 3 ++ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp index 98e34a9..57045f1 100644 --- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp @@ -57,10 +57,14 @@ public: QDeclarativeFlipablePrivate() : current(QDeclarativeFlipable::Front), front(0), back(0) {} void updateSceneTransformFromParent(); + void setBackTransform(); QDeclarativeFlipable::Side current; QDeclarativeGuard front; QDeclarativeGuard back; + + bool wantBackXFlipped; + bool wantBackYFlipped; }; /*! @@ -148,6 +152,17 @@ void QDeclarativeFlipable::setBack(QGraphicsObject *back) d->back->setParentItem(this); if (Front == d->current) d->back->setOpacity(0.); + connect(back, SIGNAL(widthChanged()), + this, SLOT(retransformBack())); + connect(back, SIGNAL(heightChanged()), + this, SLOT(retransformBack())); +} + +void QDeclarativeFlipable::retransformBack() +{ + Q_D(QDeclarativeFlipable); + if (d->current == QDeclarativeFlipable::Back && d->back) + d->setBackTransform(); } /*! @@ -184,26 +199,20 @@ void QDeclarativeFlipablePrivate::updateSceneTransformFromParent() qreal cross = (p1.x() - p2.x()) * (p3.y() - p2.y()) - (p1.y() - p2.y()) * (p3.x() - p2.x()); + wantBackYFlipped = p1.x() >= p2.x(); + wantBackXFlipped = p2.y() >= p3.y(); + QDeclarativeFlipable::Side newSide; if (cross > 0) { - newSide = QDeclarativeFlipable::Back; + newSide = QDeclarativeFlipable::Back; } else { newSide = QDeclarativeFlipable::Front; } if (newSide != current) { current = newSide; - if (current == QDeclarativeFlipable::Back && back) { - QTransform mat; - QGraphicsItemPrivate *dBack = QGraphicsItemPrivate::get(back); - mat.translate(dBack->width()/2,dBack->height()/2); - if (dBack->width() && p1.x() >= p2.x()) - mat.rotate(180, Qt::YAxis); - if (dBack->height() && p2.y() >= p3.y()) - mat.rotate(180, Qt::XAxis); - mat.translate(-dBack->width()/2,-dBack->height()/2); - back->setTransform(mat); - } + if (current == QDeclarativeFlipable::Back && back) + setBackTransform(); if (front) front->setOpacity((current==QDeclarativeFlipable::Front)?1.:0.); if (back) @@ -212,4 +221,20 @@ void QDeclarativeFlipablePrivate::updateSceneTransformFromParent() } } +/* Depends on the width/height of the back item, and so needs reevaulating + if those change. +*/ +void QDeclarativeFlipablePrivate::setBackTransform() +{ + QTransform mat; + QGraphicsItemPrivate *dBack = QGraphicsItemPrivate::get(back); + mat.translate(dBack->width()/2,dBack->height()/2); + if (dBack->width() && wantBackYFlipped) + mat.rotate(180, Qt::YAxis); + if (dBack->height() && wantBackXFlipped) + mat.rotate(180, Qt::XAxis); + mat.translate(-dBack->width()/2,-dBack->height()/2); + back->setTransform(mat); +} + QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qdeclarativeflipable_p.h b/src/declarative/graphicsitems/qdeclarativeflipable_p.h index 302f083..fd0119b 100644 --- a/src/declarative/graphicsitems/qdeclarativeflipable_p.h +++ b/src/declarative/graphicsitems/qdeclarativeflipable_p.h @@ -81,6 +81,9 @@ public: Q_SIGNALS: void sideChanged(); +private Q_SLOTS: + void retransformBack(); + private: Q_DISABLE_COPY(QDeclarativeFlipable) Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeFlipable) -- cgit v0.12 From 813f10c861d14a9c2af2832f597bc3987756221d Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 19 Apr 2010 14:24:05 +0200 Subject: Add test verifying QTBUG-8424 fix --- .../data/test_flipable_resize.qml | 207 +++++++++++++++++++++ .../qdeclarativeflipable/test_flipable_resize.qml | 62 ++++++ 2 files changed, 269 insertions(+) create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml new file mode 100644 index 0000000..6e5f7a0 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml @@ -0,0 +1,207 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "04382a80a203e1fe3d0d4944c9195e0b" + } + Frame { + msec: 32 + hash: "8d8c6a3c37ba3cb77afcc7ed4234d40f" + } + Frame { + msec: 48 + hash: "93ab01494e2229c0921c25d3acbcffe6" + } + Frame { + msec: 64 + hash: "5036bf3c842e5ad09b7bac5512e433ad" + } + Frame { + msec: 80 + hash: "ef02ef4598fbe6390391b7f2c17ec99d" + } + Frame { + msec: 96 + hash: "7fa83afca86cfec48a4986ba3df08e3b" + } + Frame { + msec: 112 + hash: "d9388827bd7755bb9bc1ef78507cc0ac" + } + Frame { + msec: 128 + hash: "d18778f4f748f7ee54404db334831ff7" + } + Frame { + msec: 144 + hash: "fee69ae3b4d79b795d4443b055a8a91a" + } + Frame { + msec: 160 + hash: "f80fa0131c859286e900071b51e74784" + } + Frame { + msec: 176 + hash: "b654e51ea71ec118e6b985743281b6a1" + } + Frame { + msec: 192 + hash: "91c771226e9c97e0f00c6f7c6fc6c95c" + } + Frame { + msec: 208 + hash: "0f612f81541b093442e68d99e00c288c" + } + Frame { + msec: 224 + hash: "246b619598606fef9f0442439cee4ec6" + } + Frame { + msec: 240 + hash: "1d2f34459b2128877218cef340f46f06" + } + Frame { + msec: 256 + hash: "af3c2eef734da05d45484bbb19646425" + } + Frame { + msec: 272 + hash: "85dfe5680e47919500728de6e93c8290" + } + Frame { + msec: 288 + hash: "8fd7d439bafa07461a65a3c97cf8602a" + } + Frame { + msec: 304 + hash: "1ebf543a84aae4abfd480f24ad362cb0" + } + Frame { + msec: 320 + hash: "60a9c9300981282986659e7c73d381b0" + } + Frame { + msec: 336 + hash: "686f3ff048f2b214033988d989ed087a" + } + Frame { + msec: 352 + hash: "24694e17476b0ffe9848159aa282e931" + } + Frame { + msec: 368 + hash: "c05e1bdf62e3e58972f868b930823a58" + } + Frame { + msec: 384 + hash: "cbc1a3c78b8f79047d1221d5ae06f0f8" + } + Frame { + msec: 400 + hash: "05ad366e74bf30b1619cf2ef1f530d82" + } + Frame { + msec: 416 + hash: "4c5c536f2c03ecfb7d3d8f56638001ec" + } + Frame { + msec: 432 + hash: "9754048ffcb7863a8a676e5bee4a7991" + } + Frame { + msec: 448 + hash: "047aa8203ad18023f5af340a41f1084e" + } + Frame { + msec: 464 + hash: "1351b7c92cd873db387e93dc74cca848" + } + Frame { + msec: 480 + hash: "4066f52fae753013396195dc98311058" + } + Frame { + msec: 496 + hash: "21d969b92993e428e79babb574e9203d" + } + Frame { + msec: 512 + hash: "62c00f52e8b0592fbb59f88deb3b022e" + } + Frame { + msec: 528 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 544 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 560 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 576 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 592 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 608 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 624 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 640 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 656 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 672 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 688 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 704 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 720 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 736 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 752 + hash: "322719dee40d3495e9b4d2faac351e89" + } + Frame { + msec: 768 + hash: "322719dee40d3495e9b4d2faac351e89" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml new file mode 100644 index 0000000..5a73e67 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml @@ -0,0 +1,62 @@ +import Qt 4.6 +Item { //realWindow + width: 370 + height: 480 + Item { + id: window + NumberAnimation on width{ from:320; to:370; duration: 500 } + NumberAnimation on height{ from:480; to:320; duration: 500 } + Flipable { + id: flipable + x: 0 + y: window.height / 3.0 - 40 + width: parent.width + height: parent.height + transform: Rotation { + id: transform + origin.x: window.width / 2.0 + origin.y: 0 + origin.z: 0 + axis.x: 0 + axis.y: 1 + axis.z: 0 + angle: 0; + } + front: Rectangle{ + width: parent.width + height: 80 + color: "blue" + }back: Rectangle{ + width: parent.width + height: 80 + color: "red" + } + } + Flipable { + id: flipableBack + x: 0 + y: 2.0 * window.height / 3.0 - 40 + width: parent.width + height: parent.height + transform: Rotation { + id: transformBack + origin.x: window.width / 2.0 + origin.y: 0 + origin.z: 0 + axis.x: 0 + axis.y: 1 + axis.z: 0 + angle: 180; + } + front: Rectangle{ + width: parent.width + height: 80 + color: "blue" + }back: Rectangle{ + width: parent.width + height: 80 + color: "red" + } + } + } +} -- cgit v0.12 From 8d508cc1fe9d1ac528f90dcd88d95ac5b6687df8 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 16 Apr 2010 15:37:34 +1000 Subject: Doc clarification. --- src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp index f5f1a1f..b116129 100644 --- a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp +++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp @@ -45,8 +45,8 @@ QT_BEGIN_NAMESPACE /*! \class QDeclarativeNetworkAccessManagerFactory - \since 4.7 - \brief The QDeclarativeNetworkAccessManagerFactory class provides a factory for QNetworkAccessManager + \since 4.7 + \brief The QDeclarativeNetworkAccessManagerFactory class provides a factory for QNetworkAccessManager for use by a Qt Declarative engine. QNetworkAccessManager is used for all network access by QML. By implementing a factory it is possible to create custom @@ -82,6 +82,8 @@ QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactor Implement this method to create a QNetworkAccessManager with \a parent. This allows proxies, caching and cookie support to be setup appropriately. + This method should return a new QNetworkAccessManager each time it is called. + Note: this method may be called by multiple threads, so ensure the implementation of this method is reentrant. */ -- cgit v0.12 From af4322e8d284d4ccc137fe0a8b5a8f340720e82b Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 19 Apr 2010 12:19:43 +1000 Subject: Minor internal anchor refactoring. --- .../graphicsitems/qdeclarativeanchors.cpp | 104 ++++++++++----------- .../graphicsitems/qdeclarativeanchors_p.h | 26 +++--- .../graphicsitems/qdeclarativeanchors_p_p.h | 2 +- .../util/qdeclarativestateoperations.cpp | 91 +++++++++--------- .../util/qdeclarativestateoperations_p.h | 2 +- .../tst_qdeclarativeanchors.cpp | 20 ++-- 6 files changed, 122 insertions(+), 123 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp index 96d0867..f15316b 100644 --- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp @@ -221,31 +221,31 @@ void QDeclarativeAnchorsPrivate::clearItem(QGraphicsObject *item) centerIn = 0; if (left.item == item) { left.item = 0; - usedAnchors &= ~QDeclarativeAnchors::HasLeftAnchor; + usedAnchors &= ~QDeclarativeAnchors::LeftAnchor; } if (right.item == item) { right.item = 0; - usedAnchors &= ~QDeclarativeAnchors::HasRightAnchor; + usedAnchors &= ~QDeclarativeAnchors::RightAnchor; } if (top.item == item) { top.item = 0; - usedAnchors &= ~QDeclarativeAnchors::HasTopAnchor; + usedAnchors &= ~QDeclarativeAnchors::TopAnchor; } if (bottom.item == item) { bottom.item = 0; - usedAnchors &= ~QDeclarativeAnchors::HasBottomAnchor; + usedAnchors &= ~QDeclarativeAnchors::BottomAnchor; } if (vCenter.item == item) { vCenter.item = 0; - usedAnchors &= ~QDeclarativeAnchors::HasVCenterAnchor; + usedAnchors &= ~QDeclarativeAnchors::VCenterAnchor; } if (hCenter.item == item) { hCenter.item = 0; - usedAnchors &= ~QDeclarativeAnchors::HasHCenterAnchor; + usedAnchors &= ~QDeclarativeAnchors::HCenterAnchor; } if (baseline.item == item) { baseline.item = 0; - usedAnchors &= ~QDeclarativeAnchors::HasBaselineAnchor; + usedAnchors &= ~QDeclarativeAnchors::BaselineAnchor; } } @@ -495,13 +495,13 @@ void QDeclarativeAnchorsPrivate::updateVerticalAnchors() if (updatingVerticalAnchor < 2) { ++updatingVerticalAnchor; QGraphicsItemPrivate *itemPrivate = QGraphicsItemPrivate::get(item); - if (usedAnchors & QDeclarativeAnchors::HasTopAnchor) { + if (usedAnchors & QDeclarativeAnchors::TopAnchor) { //Handle stretching bool invalid = true; int height = 0; - if (usedAnchors & QDeclarativeAnchors::HasBottomAnchor) { + if (usedAnchors & QDeclarativeAnchors::BottomAnchor) { invalid = calcStretch(top, bottom, topMargin, -bottomMargin, QDeclarativeAnchorLine::Top, height); - } else if (usedAnchors & QDeclarativeAnchors::HasVCenterAnchor) { + } else if (usedAnchors & QDeclarativeAnchors::VCenterAnchor) { invalid = calcStretch(top, vCenter, topMargin, vCenterOffset, QDeclarativeAnchorLine::Top, height); height *= 2; } @@ -514,9 +514,9 @@ void QDeclarativeAnchorsPrivate::updateVerticalAnchors() } else if (top.item->parentItem() == item->parentItem()) { setItemY(position(top.item, top.anchorLine) + topMargin); } - } else if (usedAnchors & QDeclarativeAnchors::HasBottomAnchor) { + } else if (usedAnchors & QDeclarativeAnchors::BottomAnchor) { //Handle stretching (top + bottom case is handled above) - if (usedAnchors & QDeclarativeAnchors::HasVCenterAnchor) { + if (usedAnchors & QDeclarativeAnchors::VCenterAnchor) { int height = 0; bool invalid = calcStretch(vCenter, bottom, vCenterOffset, -bottomMargin, QDeclarativeAnchorLine::Top, height); @@ -530,7 +530,7 @@ void QDeclarativeAnchorsPrivate::updateVerticalAnchors() } else if (bottom.item->parentItem() == item->parentItem()) { setItemY(position(bottom.item, bottom.anchorLine) - itemPrivate->height() - bottomMargin); } - } else if (usedAnchors & QDeclarativeAnchors::HasVCenterAnchor) { + } else if (usedAnchors & QDeclarativeAnchors::VCenterAnchor) { //(stetching handled above) //Handle vCenter @@ -540,7 +540,7 @@ void QDeclarativeAnchorsPrivate::updateVerticalAnchors() } else if (vCenter.item->parentItem() == item->parentItem()) { setItemY(position(vCenter.item, vCenter.anchorLine) - itemPrivate->height()/2 + vCenterOffset); } - } else if (usedAnchors & QDeclarativeAnchors::HasBaselineAnchor) { + } else if (usedAnchors & QDeclarativeAnchors::BaselineAnchor) { //Handle baseline if (baseline.item == item->parentItem()) { if (itemPrivate->isDeclarativeItem) @@ -567,13 +567,13 @@ void QDeclarativeAnchorsPrivate::updateHorizontalAnchors() if (updatingHorizontalAnchor < 2) { ++updatingHorizontalAnchor; QGraphicsItemPrivate *itemPrivate = QGraphicsItemPrivate::get(item); - if (usedAnchors & QDeclarativeAnchors::HasLeftAnchor) { + if (usedAnchors & QDeclarativeAnchors::LeftAnchor) { //Handle stretching bool invalid = true; int width = 0; - if (usedAnchors & QDeclarativeAnchors::HasRightAnchor) { + if (usedAnchors & QDeclarativeAnchors::RightAnchor) { invalid = calcStretch(left, right, leftMargin, -rightMargin, QDeclarativeAnchorLine::Left, width); - } else if (usedAnchors & QDeclarativeAnchors::HasHCenterAnchor) { + } else if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) { invalid = calcStretch(left, hCenter, leftMargin, hCenterOffset, QDeclarativeAnchorLine::Left, width); width *= 2; } @@ -586,9 +586,9 @@ void QDeclarativeAnchorsPrivate::updateHorizontalAnchors() } else if (left.item->parentItem() == item->parentItem()) { setItemX(position(left.item, left.anchorLine) + leftMargin); } - } else if (usedAnchors & QDeclarativeAnchors::HasRightAnchor) { + } else if (usedAnchors & QDeclarativeAnchors::RightAnchor) { //Handle stretching (left + right case is handled in updateLeftAnchor) - if (usedAnchors & QDeclarativeAnchors::HasHCenterAnchor) { + if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) { int width = 0; bool invalid = calcStretch(hCenter, right, hCenterOffset, -rightMargin, QDeclarativeAnchorLine::Left, width); @@ -602,7 +602,7 @@ void QDeclarativeAnchorsPrivate::updateHorizontalAnchors() } else if (right.item->parentItem() == item->parentItem()) { setItemX(position(right.item, right.anchorLine) - itemPrivate->width() - rightMargin); } - } else if (usedAnchors & QDeclarativeAnchors::HasHCenterAnchor) { + } else if (usedAnchors & QDeclarativeAnchors::HCenterAnchor) { //Handle hCenter if (hCenter.item == item->parentItem()) { setItemX(adjustedPosition(hCenter.item, hCenter.anchorLine) - itemPrivate->width()/2 + hCenterOffset); @@ -630,10 +630,10 @@ void QDeclarativeAnchors::setTop(const QDeclarativeAnchorLine &edge) if (!d->checkVAnchorValid(edge) || d->top == edge) return; - d->usedAnchors |= HasTopAnchor; + d->usedAnchors |= TopAnchor; if (!d->checkVValid()) { - d->usedAnchors &= ~HasTopAnchor; + d->usedAnchors &= ~TopAnchor; return; } @@ -647,7 +647,7 @@ void QDeclarativeAnchors::setTop(const QDeclarativeAnchorLine &edge) void QDeclarativeAnchors::resetTop() { Q_D(QDeclarativeAnchors); - d->usedAnchors &= ~HasTopAnchor; + d->usedAnchors &= ~TopAnchor; d->remDepend(d->top.item); d->top = QDeclarativeAnchorLine(); emit topChanged(); @@ -666,10 +666,10 @@ void QDeclarativeAnchors::setBottom(const QDeclarativeAnchorLine &edge) if (!d->checkVAnchorValid(edge) || d->bottom == edge) return; - d->usedAnchors |= HasBottomAnchor; + d->usedAnchors |= BottomAnchor; if (!d->checkVValid()) { - d->usedAnchors &= ~HasBottomAnchor; + d->usedAnchors &= ~BottomAnchor; return; } @@ -683,7 +683,7 @@ void QDeclarativeAnchors::setBottom(const QDeclarativeAnchorLine &edge) void QDeclarativeAnchors::resetBottom() { Q_D(QDeclarativeAnchors); - d->usedAnchors &= ~HasBottomAnchor; + d->usedAnchors &= ~BottomAnchor; d->remDepend(d->bottom.item); d->bottom = QDeclarativeAnchorLine(); emit bottomChanged(); @@ -702,10 +702,10 @@ void QDeclarativeAnchors::setVerticalCenter(const QDeclarativeAnchorLine &edge) if (!d->checkVAnchorValid(edge) || d->vCenter == edge) return; - d->usedAnchors |= HasVCenterAnchor; + d->usedAnchors |= VCenterAnchor; if (!d->checkVValid()) { - d->usedAnchors &= ~HasVCenterAnchor; + d->usedAnchors &= ~VCenterAnchor; return; } @@ -719,7 +719,7 @@ void QDeclarativeAnchors::setVerticalCenter(const QDeclarativeAnchorLine &edge) void QDeclarativeAnchors::resetVerticalCenter() { Q_D(QDeclarativeAnchors); - d->usedAnchors &= ~HasVCenterAnchor; + d->usedAnchors &= ~VCenterAnchor; d->remDepend(d->vCenter.item); d->vCenter = QDeclarativeAnchorLine(); emit verticalCenterChanged(); @@ -738,10 +738,10 @@ void QDeclarativeAnchors::setBaseline(const QDeclarativeAnchorLine &edge) if (!d->checkVAnchorValid(edge) || d->baseline == edge) return; - d->usedAnchors |= HasBaselineAnchor; + d->usedAnchors |= BaselineAnchor; if (!d->checkVValid()) { - d->usedAnchors &= ~HasBaselineAnchor; + d->usedAnchors &= ~BaselineAnchor; return; } @@ -755,7 +755,7 @@ void QDeclarativeAnchors::setBaseline(const QDeclarativeAnchorLine &edge) void QDeclarativeAnchors::resetBaseline() { Q_D(QDeclarativeAnchors); - d->usedAnchors &= ~HasBaselineAnchor; + d->usedAnchors &= ~BaselineAnchor; d->remDepend(d->baseline.item); d->baseline = QDeclarativeAnchorLine(); emit baselineChanged(); @@ -774,10 +774,10 @@ void QDeclarativeAnchors::setLeft(const QDeclarativeAnchorLine &edge) if (!d->checkHAnchorValid(edge) || d->left == edge) return; - d->usedAnchors |= HasLeftAnchor; + d->usedAnchors |= LeftAnchor; if (!d->checkHValid()) { - d->usedAnchors &= ~HasLeftAnchor; + d->usedAnchors &= ~LeftAnchor; return; } @@ -791,7 +791,7 @@ void QDeclarativeAnchors::setLeft(const QDeclarativeAnchorLine &edge) void QDeclarativeAnchors::resetLeft() { Q_D(QDeclarativeAnchors); - d->usedAnchors &= ~HasLeftAnchor; + d->usedAnchors &= ~LeftAnchor; d->remDepend(d->left.item); d->left = QDeclarativeAnchorLine(); emit leftChanged(); @@ -810,10 +810,10 @@ void QDeclarativeAnchors::setRight(const QDeclarativeAnchorLine &edge) if (!d->checkHAnchorValid(edge) || d->right == edge) return; - d->usedAnchors |= HasRightAnchor; + d->usedAnchors |= RightAnchor; if (!d->checkHValid()) { - d->usedAnchors &= ~HasRightAnchor; + d->usedAnchors &= ~RightAnchor; return; } @@ -827,7 +827,7 @@ void QDeclarativeAnchors::setRight(const QDeclarativeAnchorLine &edge) void QDeclarativeAnchors::resetRight() { Q_D(QDeclarativeAnchors); - d->usedAnchors &= ~HasRightAnchor; + d->usedAnchors &= ~RightAnchor; d->remDepend(d->right.item); d->right = QDeclarativeAnchorLine(); emit rightChanged(); @@ -846,10 +846,10 @@ void QDeclarativeAnchors::setHorizontalCenter(const QDeclarativeAnchorLine &edge if (!d->checkHAnchorValid(edge) || d->hCenter == edge) return; - d->usedAnchors |= HasHCenterAnchor; + d->usedAnchors |= HCenterAnchor; if (!d->checkHValid()) { - d->usedAnchors &= ~HasHCenterAnchor; + d->usedAnchors &= ~HCenterAnchor; return; } @@ -863,7 +863,7 @@ void QDeclarativeAnchors::setHorizontalCenter(const QDeclarativeAnchorLine &edge void QDeclarativeAnchors::resetHorizontalCenter() { Q_D(QDeclarativeAnchors); - d->usedAnchors &= ~HasHCenterAnchor; + d->usedAnchors &= ~HCenterAnchor; d->remDepend(d->hCenter.item); d->hCenter = QDeclarativeAnchorLine(); emit horizontalCenterChanged(); @@ -1025,7 +1025,7 @@ void QDeclarativeAnchors::setBaselineOffset(qreal offset) emit baselineOffsetChanged(); } -QDeclarativeAnchors::UsedAnchors QDeclarativeAnchors::usedAnchors() const +QDeclarativeAnchors::Anchors QDeclarativeAnchors::usedAnchors() const { Q_D(const QDeclarativeAnchors); return d->usedAnchors; @@ -1033,9 +1033,9 @@ QDeclarativeAnchors::UsedAnchors QDeclarativeAnchors::usedAnchors() const bool QDeclarativeAnchorsPrivate::checkHValid() const { - if (usedAnchors & QDeclarativeAnchors::HasLeftAnchor && - usedAnchors & QDeclarativeAnchors::HasRightAnchor && - usedAnchors & QDeclarativeAnchors::HasHCenterAnchor) { + if (usedAnchors & QDeclarativeAnchors::LeftAnchor && + usedAnchors & QDeclarativeAnchors::RightAnchor && + usedAnchors & QDeclarativeAnchors::HCenterAnchor) { qmlInfo(item) << QDeclarativeAnchors::tr("Cannot specify left, right, and hcenter anchors."); return false; } @@ -1064,15 +1064,15 @@ bool QDeclarativeAnchorsPrivate::checkHAnchorValid(QDeclarativeAnchorLine anchor bool QDeclarativeAnchorsPrivate::checkVValid() const { - if (usedAnchors & QDeclarativeAnchors::HasTopAnchor && - usedAnchors & QDeclarativeAnchors::HasBottomAnchor && - usedAnchors & QDeclarativeAnchors::HasVCenterAnchor) { + if (usedAnchors & QDeclarativeAnchors::TopAnchor && + usedAnchors & QDeclarativeAnchors::BottomAnchor && + usedAnchors & QDeclarativeAnchors::VCenterAnchor) { qmlInfo(item) << QDeclarativeAnchors::tr("Cannot specify top, bottom, and vcenter anchors."); return false; - } else if (usedAnchors & QDeclarativeAnchors::HasBaselineAnchor && - (usedAnchors & QDeclarativeAnchors::HasTopAnchor || - usedAnchors & QDeclarativeAnchors::HasBottomAnchor || - usedAnchors & QDeclarativeAnchors::HasVCenterAnchor)) { + } else if (usedAnchors & QDeclarativeAnchors::BaselineAnchor && + (usedAnchors & QDeclarativeAnchors::TopAnchor || + usedAnchors & QDeclarativeAnchors::BottomAnchor || + usedAnchors & QDeclarativeAnchors::VCenterAnchor)) { qmlInfo(item) << QDeclarativeAnchors::tr("Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors."); return false; } diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p.h index f2e57cc..1bd7608 100644 --- a/src/declarative/graphicsitems/qdeclarativeanchors_p.h +++ b/src/declarative/graphicsitems/qdeclarativeanchors_p.h @@ -83,18 +83,18 @@ public: QDeclarativeAnchors(QGraphicsObject *item, QObject *parent=0); virtual ~QDeclarativeAnchors(); - enum UsedAnchor { - HasLeftAnchor = 0x01, - HasRightAnchor = 0x02, - HasTopAnchor = 0x04, - HasBottomAnchor = 0x08, - HasHCenterAnchor = 0x10, - HasVCenterAnchor = 0x20, - HasBaselineAnchor = 0x40, - Horizontal_Mask = HasLeftAnchor | HasRightAnchor | HasHCenterAnchor, - Vertical_Mask = HasTopAnchor | HasBottomAnchor | HasVCenterAnchor | HasBaselineAnchor + enum Anchor { + LeftAnchor = 0x01, + RightAnchor = 0x02, + TopAnchor = 0x04, + BottomAnchor = 0x08, + HCenterAnchor = 0x10, + VCenterAnchor = 0x20, + BaselineAnchor = 0x40, + Horizontal_Mask = LeftAnchor | RightAnchor | HCenterAnchor, + Vertical_Mask = TopAnchor | BottomAnchor | VCenterAnchor | BaselineAnchor }; - Q_DECLARE_FLAGS(UsedAnchors, UsedAnchor) + Q_DECLARE_FLAGS(Anchors, Anchor) QDeclarativeAnchorLine left() const; void setLeft(const QDeclarativeAnchorLine &edge); @@ -156,7 +156,7 @@ public: void setCenterIn(QGraphicsObject *); void resetCenterIn(); - UsedAnchors usedAnchors() const; + Anchors usedAnchors() const; void classBegin(); void componentComplete(); @@ -188,7 +188,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_widgetGeometryChanged()) Q_PRIVATE_SLOT(d_func(), void _q_widgetDestroyed(QObject *obj)) }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeAnchors::UsedAnchors) +Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeAnchors::Anchors) QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h index f8489aa..05be6c5 100644 --- a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h @@ -139,7 +139,7 @@ public: void centerInChanged(); QGraphicsObject *item; - QDeclarativeAnchors::UsedAnchors usedAnchors; + QDeclarativeAnchors::Anchors usedAnchors; QGraphicsObject *fill; QGraphicsObject *centerIn; diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index eb6ac7b..56ed335 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -620,15 +620,14 @@ class QDeclarativeAnchorSetPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QDeclarativeAnchorSet) public: QDeclarativeAnchorSetPrivate() - : usedAnchors(0), fill(0), + : usedAnchors(0), resetAnchors(0), fill(0), centerIn(0)/*, leftMargin(0), rightMargin(0), topMargin(0), bottomMargin(0), margins(0), vCenterOffset(0), hCenterOffset(0), baselineOffset(0)*/ { } - QDeclarativeAnchors::UsedAnchors usedAnchors; - //### change to QDeclarativeAnchors::UsedAnchors resetAnchors - QStringList resetList; + QDeclarativeAnchors::Anchors usedAnchors; + QDeclarativeAnchors::Anchors resetAnchors; QDeclarativeItem *fill; QDeclarativeItem *centerIn; @@ -669,16 +668,16 @@ QDeclarativeAnchorLine QDeclarativeAnchorSet::top() const void QDeclarativeAnchorSet::setTop(const QDeclarativeAnchorLine &edge) { Q_D(QDeclarativeAnchorSet); - d->usedAnchors |= QDeclarativeAnchors::HasTopAnchor; + d->usedAnchors |= QDeclarativeAnchors::TopAnchor; d->top = edge; } void QDeclarativeAnchorSet::resetTop() { Q_D(QDeclarativeAnchorSet); - d->usedAnchors &= ~QDeclarativeAnchors::HasTopAnchor; + d->usedAnchors &= ~QDeclarativeAnchors::TopAnchor; d->top = QDeclarativeAnchorLine(); - d->resetList << QLatin1String("top"); + d->resetAnchors |= QDeclarativeAnchors::TopAnchor; } QDeclarativeAnchorLine QDeclarativeAnchorSet::bottom() const @@ -690,16 +689,16 @@ QDeclarativeAnchorLine QDeclarativeAnchorSet::bottom() const void QDeclarativeAnchorSet::setBottom(const QDeclarativeAnchorLine &edge) { Q_D(QDeclarativeAnchorSet); - d->usedAnchors |= QDeclarativeAnchors::HasBottomAnchor; + d->usedAnchors |= QDeclarativeAnchors::BottomAnchor; d->bottom = edge; } void QDeclarativeAnchorSet::resetBottom() { Q_D(QDeclarativeAnchorSet); - d->usedAnchors &= ~QDeclarativeAnchors::HasBottomAnchor; + d->usedAnchors &= ~QDeclarativeAnchors::BottomAnchor; d->bottom = QDeclarativeAnchorLine(); - d->resetList << QLatin1String("bottom"); + d->resetAnchors |= QDeclarativeAnchors::BottomAnchor; } QDeclarativeAnchorLine QDeclarativeAnchorSet::verticalCenter() const @@ -711,16 +710,16 @@ QDeclarativeAnchorLine QDeclarativeAnchorSet::verticalCenter() const void QDeclarativeAnchorSet::setVerticalCenter(const QDeclarativeAnchorLine &edge) { Q_D(QDeclarativeAnchorSet); - d->usedAnchors |= QDeclarativeAnchors::HasVCenterAnchor; + d->usedAnchors |= QDeclarativeAnchors::VCenterAnchor; d->vCenter = edge; } void QDeclarativeAnchorSet::resetVerticalCenter() { Q_D(QDeclarativeAnchorSet); - d->usedAnchors &= ~QDeclarativeAnchors::HasVCenterAnchor; + d->usedAnchors &= ~QDeclarativeAnchors::VCenterAnchor; d->vCenter = QDeclarativeAnchorLine(); - d->resetList << QLatin1String("verticalCenter"); + d->resetAnchors |= QDeclarativeAnchors::VCenterAnchor; } QDeclarativeAnchorLine QDeclarativeAnchorSet::baseline() const @@ -732,16 +731,16 @@ QDeclarativeAnchorLine QDeclarativeAnchorSet::baseline() const void QDeclarativeAnchorSet::setBaseline(const QDeclarativeAnchorLine &edge) { Q_D(QDeclarativeAnchorSet); - d->usedAnchors |= QDeclarativeAnchors::HasBaselineAnchor; + d->usedAnchors |= QDeclarativeAnchors::BaselineAnchor; d->baseline = edge; } void QDeclarativeAnchorSet::resetBaseline() { Q_D(QDeclarativeAnchorSet); - d->usedAnchors &= ~QDeclarativeAnchors::HasBaselineAnchor; + d->usedAnchors &= ~QDeclarativeAnchors::BaselineAnchor; d->baseline = QDeclarativeAnchorLine(); - d->resetList << QLatin1String("baseline"); + d->resetAnchors |= QDeclarativeAnchors::BaselineAnchor; } QDeclarativeAnchorLine QDeclarativeAnchorSet::left() const @@ -753,16 +752,16 @@ QDeclarativeAnchorLine QDeclarativeAnchorSet::left() const void QDeclarativeAnchorSet::setLeft(const QDeclarativeAnchorLine &edge) { Q_D(QDeclarativeAnchorSet); - d->usedAnchors |= QDeclarativeAnchors::HasLeftAnchor; + d->usedAnchors |= QDeclarativeAnchors::LeftAnchor; d->left = edge; } void QDeclarativeAnchorSet::resetLeft() { Q_D(QDeclarativeAnchorSet); - d->usedAnchors &= ~QDeclarativeAnchors::HasLeftAnchor; + d->usedAnchors &= ~QDeclarativeAnchors::LeftAnchor; d->left = QDeclarativeAnchorLine(); - d->resetList << QLatin1String("left"); + d->resetAnchors |= QDeclarativeAnchors::LeftAnchor; } QDeclarativeAnchorLine QDeclarativeAnchorSet::right() const @@ -774,16 +773,16 @@ QDeclarativeAnchorLine QDeclarativeAnchorSet::right() const void QDeclarativeAnchorSet::setRight(const QDeclarativeAnchorLine &edge) { Q_D(QDeclarativeAnchorSet); - d->usedAnchors |= QDeclarativeAnchors::HasRightAnchor; + d->usedAnchors |= QDeclarativeAnchors::RightAnchor; d->right = edge; } void QDeclarativeAnchorSet::resetRight() { Q_D(QDeclarativeAnchorSet); - d->usedAnchors &= ~QDeclarativeAnchors::HasRightAnchor; + d->usedAnchors &= ~QDeclarativeAnchors::RightAnchor; d->right = QDeclarativeAnchorLine(); - d->resetList << QLatin1String("right"); + d->resetAnchors |= QDeclarativeAnchors::RightAnchor; } QDeclarativeAnchorLine QDeclarativeAnchorSet::horizontalCenter() const @@ -795,16 +794,16 @@ QDeclarativeAnchorLine QDeclarativeAnchorSet::horizontalCenter() const void QDeclarativeAnchorSet::setHorizontalCenter(const QDeclarativeAnchorLine &edge) { Q_D(QDeclarativeAnchorSet); - d->usedAnchors |= QDeclarativeAnchors::HasHCenterAnchor; + d->usedAnchors |= QDeclarativeAnchors::HCenterAnchor; d->hCenter = edge; } void QDeclarativeAnchorSet::resetHorizontalCenter() { Q_D(QDeclarativeAnchorSet); - d->usedAnchors &= ~QDeclarativeAnchors::HasHCenterAnchor; + d->usedAnchors &= ~QDeclarativeAnchors::HCenterAnchor; d->hCenter = QDeclarativeAnchorLine(); - d->resetList << QLatin1String("horizontalCenter"); + d->resetAnchors |= QDeclarativeAnchors::HCenterAnchor; } QDeclarativeItem *QDeclarativeAnchorSet::fill() const @@ -975,19 +974,19 @@ void QDeclarativeAnchorChanges::execute() d->target->anchors()->setBaseline(d->origBaseline); //reset any anchors that have been specified - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("left"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::LeftAnchor) d->target->anchors()->resetLeft(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("right"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::RightAnchor) d->target->anchors()->resetRight(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("horizontalCenter"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::HCenterAnchor) d->target->anchors()->resetHorizontalCenter(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("top"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::TopAnchor) d->target->anchors()->resetTop(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("bottom"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BottomAnchor) d->target->anchors()->resetBottom(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("verticalCenter"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::VCenterAnchor) d->target->anchors()->resetVerticalCenter(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("baseline"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BaselineAnchor) d->target->anchors()->resetBaseline(); //set any anchors that have been specified @@ -1121,25 +1120,25 @@ void QDeclarativeAnchorChanges::copyOriginals(QDeclarativeActionEvent *other) //probably also need to revert some things d->applyOrigLeft = (acp->anchorSet->d_func()->left.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetList.contains(QLatin1String("left"))); + acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::LeftAnchor); d->applyOrigRight = (acp->anchorSet->d_func()->right.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetList.contains(QLatin1String("right"))); + acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::RightAnchor); d->applyOrigHCenter = (acp->anchorSet->d_func()->hCenter.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetList.contains(QLatin1String("horizontalCenter"))); + acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::HCenterAnchor); d->applyOrigTop = (acp->anchorSet->d_func()->top.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetList.contains(QLatin1String("top"))); + acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::TopAnchor); d->applyOrigBottom = (acp->anchorSet->d_func()->bottom.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetList.contains(QLatin1String("bottom"))); + acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BottomAnchor); d->applyOrigVCenter = (acp->anchorSet->d_func()->vCenter.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetList.contains(QLatin1String("verticalCenter"))); + acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::VCenterAnchor); d->applyOrigBaseline = (acp->anchorSet->d_func()->baseline.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetList.contains(QLatin1String("baseline"))); + acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BaselineAnchor); d->origLeft = ac->d_func()->origLeft; d->origRight = ac->d_func()->origRight; @@ -1180,19 +1179,19 @@ void QDeclarativeAnchorChanges::clearBindings() d->target->anchors()->resetBaseline(); //reset any anchors that have been specified - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("left"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::LeftAnchor) d->target->anchors()->resetLeft(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("right"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::RightAnchor) d->target->anchors()->resetRight(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("horizontalCenter"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::HCenterAnchor) d->target->anchors()->resetHorizontalCenter(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("top"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::TopAnchor) d->target->anchors()->resetTop(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("bottom"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BottomAnchor) d->target->anchors()->resetBottom(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("verticalCenter"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::VCenterAnchor) d->target->anchors()->resetVerticalCenter(); - if (d->anchorSet->d_func()->resetList .contains(QLatin1String("baseline"))) + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BaselineAnchor) d->target->anchors()->resetBaseline(); //reset any anchors that we'll be setting in the state diff --git a/src/declarative/util/qdeclarativestateoperations_p.h b/src/declarative/util/qdeclarativestateoperations_p.h index d49ec63..5dc21e1 100644 --- a/src/declarative/util/qdeclarativestateoperations_p.h +++ b/src/declarative/util/qdeclarativestateoperations_p.h @@ -232,7 +232,7 @@ public: qreal baselineOffset() const; void setBaselineOffset(qreal);*/ - QDeclarativeAnchors::UsedAnchors usedAnchors() const; + QDeclarativeAnchors::Anchors usedAnchors() const; /*Q_SIGNALS: void leftMarginChanged(); diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp index 06a8f64..dff62c7 100644 --- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp +++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp @@ -49,7 +49,7 @@ #include #include -Q_DECLARE_METATYPE(QDeclarativeAnchors::UsedAnchor) +Q_DECLARE_METATYPE(QDeclarativeAnchors::Anchor) Q_DECLARE_METATYPE(QDeclarativeAnchorLine::AnchorLine) @@ -367,7 +367,7 @@ void tst_qdeclarativeanchors::reset() { QFETCH(QString, side); QFETCH(QDeclarativeAnchorLine::AnchorLine, anchorLine); - QFETCH(QDeclarativeAnchors::UsedAnchor, usedAnchor); + QFETCH(QDeclarativeAnchors::Anchor, usedAnchor); QDeclarativeItem *baseItem = new QDeclarativeItem; @@ -394,16 +394,16 @@ void tst_qdeclarativeanchors::reset_data() { QTest::addColumn("side"); QTest::addColumn("anchorLine"); - QTest::addColumn("usedAnchor"); + QTest::addColumn("usedAnchor"); - QTest::newRow("left") << "left" << QDeclarativeAnchorLine::Left << QDeclarativeAnchors::HasLeftAnchor; - QTest::newRow("top") << "top" << QDeclarativeAnchorLine::Top << QDeclarativeAnchors::HasTopAnchor; - QTest::newRow("right") << "right" << QDeclarativeAnchorLine::Right << QDeclarativeAnchors::HasRightAnchor; - QTest::newRow("bottom") << "bottom" << QDeclarativeAnchorLine::Bottom << QDeclarativeAnchors::HasBottomAnchor; + QTest::newRow("left") << "left" << QDeclarativeAnchorLine::Left << QDeclarativeAnchors::LeftAnchor; + QTest::newRow("top") << "top" << QDeclarativeAnchorLine::Top << QDeclarativeAnchors::TopAnchor; + QTest::newRow("right") << "right" << QDeclarativeAnchorLine::Right << QDeclarativeAnchors::RightAnchor; + QTest::newRow("bottom") << "bottom" << QDeclarativeAnchorLine::Bottom << QDeclarativeAnchors::BottomAnchor; - QTest::newRow("hcenter") << "horizontalCenter" << QDeclarativeAnchorLine::HCenter << QDeclarativeAnchors::HasHCenterAnchor; - QTest::newRow("vcenter") << "verticalCenter" << QDeclarativeAnchorLine::VCenter << QDeclarativeAnchors::HasVCenterAnchor; - QTest::newRow("baseline") << "baseline" << QDeclarativeAnchorLine::Baseline << QDeclarativeAnchors::HasBaselineAnchor; + QTest::newRow("hcenter") << "horizontalCenter" << QDeclarativeAnchorLine::HCenter << QDeclarativeAnchors::HCenterAnchor; + QTest::newRow("vcenter") << "verticalCenter" << QDeclarativeAnchorLine::VCenter << QDeclarativeAnchors::VCenterAnchor; + QTest::newRow("baseline") << "baseline" << QDeclarativeAnchorLine::Baseline << QDeclarativeAnchors::BaselineAnchor; } void tst_qdeclarativeanchors::resetConvenience() -- cgit v0.12 From 18cbadd8edd233b843d04441a05788264da0a67b Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 20 Apr 2010 08:34:56 +1000 Subject: Doc fix. --- src/declarative/util/qdeclarativestateoperations.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 56ed335..082a869 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -601,15 +601,22 @@ QString QDeclarativeStateChangeScript::typeName() const In the following example we change the top and bottom anchors of an item: \qml - AnchorChanges { - target: content; top: window.top; bottom: window.bottom + State { + name: "reanchored" + AnchorChanges { + target: content; + anchors.top: window.top; + anchors.bottom: window.bottom + } } \endqml AnchorChanges can be animated using AnchorAnimation. \qml //animate our anchor changes - AnchorAnimation {} + Transition { + AnchorAnimation {} + } \endqml For more information on anchors see \l {anchor-layout}{Anchor Layouts}. -- cgit v0.12 From 115ecbea664e9f3b213f0d9244ea023a1623d94e Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Tue, 20 Apr 2010 09:28:02 +1000 Subject: Multimedia tests; fix for missing dependency Reviewed-by: Andrew den Exter --- tests/auto/qdeclarativevideo/qdeclarativevideo.pro | 2 +- tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro | 2 +- tests/auto/qvideowidget/qvideowidget.pro | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/qdeclarativevideo/qdeclarativevideo.pro b/tests/auto/qdeclarativevideo/qdeclarativevideo.pro index c2bcdfe..64a20da 100644 --- a/tests/auto/qdeclarativevideo/qdeclarativevideo.pro +++ b/tests/auto/qdeclarativevideo/qdeclarativevideo.pro @@ -11,4 +11,4 @@ SOURCES += \ $$PWD/../../../src/imports/multimedia/qdeclarativemediabase.cpp \ $$PWD/../../../src/imports/multimedia/qmetadatacontrolmetaobject.cpp -QT += mediaservices declarative +QT += multimedia mediaservices declarative diff --git a/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro b/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro index 60e1933..b57e8e3 100644 --- a/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro +++ b/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro @@ -1,5 +1,5 @@ load(qttest_p4) SOURCES += tst_qgraphicsvideoitem.cpp -QT += mediaservices +QT += multimedia mediaservices requires(contains(QT_CONFIG, mediaservices)) diff --git a/tests/auto/qvideowidget/qvideowidget.pro b/tests/auto/qvideowidget/qvideowidget.pro index d6facb9..12686f3 100644 --- a/tests/auto/qvideowidget/qvideowidget.pro +++ b/tests/auto/qvideowidget/qvideowidget.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES = tst_qvideowidget.cpp -QT = core gui mediaservices +QT = core gui multimedia mediaservices -- cgit v0.12 From 1b80a6bc28cb49b9f6e1a2132d929819924aa604 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 20 Apr 2010 10:05:39 +1000 Subject: Allow Loader sourceComponent to be set to undefeined. --- src/declarative/graphicsitems/qdeclarativeloader.cpp | 10 +++++++++- src/declarative/graphicsitems/qdeclarativeloader_p.h | 3 ++- .../qdeclarativeloader/data/SetSourceComponent.qml | 5 ++++- .../qdeclarativeloader/tst_qdeclarativeloader.cpp | 20 ++++++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index 3f257b5..bdd2c87 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -132,12 +132,15 @@ void QDeclarativeLoaderPrivate::initResize() \endcode If the Loader source is changed, any previous items instantiated - will be destroyed. Setting \c source to an empty string + will be destroyed. Setting \c source to an empty string, or setting + sourceComponent to \e undefined will destroy the currently instantiated items, freeing resources and leaving the Loader empty. For example: \code pageLoader.source = "" + or + pageLoader.sourceComponent = undefined \endcode unloads "Page1.qml" and frees resources consumed by it. @@ -271,6 +274,11 @@ void QDeclarativeLoader::setSourceComponent(QDeclarativeComponent *comp) } } +void QDeclarativeLoader::resetSourceComponent() +{ + setSourceComponent(0); +} + void QDeclarativeLoaderPrivate::_q_sourceLoaded() { Q_Q(QDeclarativeLoader); diff --git a/src/declarative/graphicsitems/qdeclarativeloader_p.h b/src/declarative/graphicsitems/qdeclarativeloader_p.h index 65538a8..e9fd8e9 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader_p.h +++ b/src/declarative/graphicsitems/qdeclarativeloader_p.h @@ -58,7 +58,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeLoader : public QDeclarativeItem Q_ENUMS(ResizeMode) Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) - Q_PROPERTY(QDeclarativeComponent *sourceComponent READ sourceComponent WRITE setSourceComponent NOTIFY sourceChanged) + Q_PROPERTY(QDeclarativeComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceChanged) Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode NOTIFY resizeModeChanged) Q_PROPERTY(QGraphicsObject *item READ item NOTIFY itemChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) @@ -73,6 +73,7 @@ public: QDeclarativeComponent *sourceComponent() const; void setSourceComponent(QDeclarativeComponent *); + void resetSourceComponent(); enum Status { Null, Ready, Loading, Error }; Status status() const; diff --git a/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml b/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml index 1db56c4..f600e85 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml @@ -1,6 +1,9 @@ import Qt 4.6 Item { + function clear() { + loader.sourceComponent = undefined + } Component { id: comp; Rectangle { width: 100; height: 50 } } - Loader { sourceComponent: comp } + Loader { id: loader; sourceComponent: comp } } diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp index 1b17a56..a5f75bd 100644 --- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp +++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp @@ -198,6 +198,26 @@ void tst_QDeclarativeLoader::clear() delete item; } + { + QDeclarativeComponent component(&engine, TEST_FILE("/SetSourceComponent.qml")); + QDeclarativeItem *item = qobject_cast(component.create()); + QVERIFY(item); + + QDeclarativeLoader *loader = qobject_cast(item->QGraphicsObject::children().at(1)); + QVERIFY(loader); + QVERIFY(loader->item()); + QCOMPARE(loader->progress(), 1.0); + QCOMPARE(static_cast(loader)->children().count(), 1); + + QMetaObject::invokeMethod(item, "clear"); + + QVERIFY(loader->item() == 0); + QCOMPARE(loader->progress(), 0.0); + QCOMPARE(loader->status(), QDeclarativeLoader::Null); + QCOMPARE(static_cast(loader)->children().count(), 0); + + delete item; + } } void tst_QDeclarativeLoader::urlToComponent() -- cgit v0.12 From 58d509da551595d2a3e49de9f8b01b0206723d01 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Tue, 20 Apr 2010 10:22:09 +1000 Subject: Fixed Qt build with mediaservices disabled. Disabled decalarative multimedia module and the player demo if qt is build without mediaservices. Reviewed-by: Kurt Korbatits --- demos/multimedia/multimedia.pro | 3 +-- src/imports/imports.pro | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/demos/multimedia/multimedia.pro b/demos/multimedia/multimedia.pro index 042650f..fa29a12 100644 --- a/demos/multimedia/multimedia.pro +++ b/demos/multimedia/multimedia.pro @@ -1,4 +1,3 @@ TEMPLATE = subdirs -SUBDIRS = player - +contains(QT_CONFIG, mediaservices): SUBDIRS = player diff --git a/src/imports/imports.pro b/src/imports/imports.pro index 3886f5c..ecde0cc 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -3,5 +3,5 @@ TEMPLATE = subdirs SUBDIRS += widgets particles contains(QT_CONFIG, webkit): SUBDIRS += webkit -contains(QT_CONFIG, multimedia): SUBDIRS += multimedia +contains(QT_CONFIG, mediaservices): SUBDIRS += multimedia -- cgit v0.12 From 0574eded91a1cb37299917541f3afb51cba5b014 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 20 Apr 2010 10:54:59 +1000 Subject: Add .qmlproject files to declarative examples. --- examples/declarative/animations/animations.qmlproject | 16 ++++++++++++++++ examples/declarative/aspectratio/aspectratio.qmlproject | 16 ++++++++++++++++ examples/declarative/behaviors/behaviors.qmlproject | 16 ++++++++++++++++ .../declarative/border-image/border-image.qmlproject | 16 ++++++++++++++++ examples/declarative/clocks/clocks.qmlproject | 16 ++++++++++++++++ examples/declarative/connections/connections.qmlproject | 16 ++++++++++++++++ examples/declarative/dial/dial.qmlproject | 16 ++++++++++++++++ examples/declarative/dynamic/dynamic.qmlproject | 16 ++++++++++++++++ examples/declarative/effects/effects.qmlproject | 16 ++++++++++++++++ examples/declarative/extending/extending.qmlproject | 16 ++++++++++++++++ examples/declarative/fillmode/fillmode.qmlproject | 16 ++++++++++++++++ examples/declarative/flipable/flipable.qmlproject | 16 ++++++++++++++++ examples/declarative/focus/focus.qmlproject | 16 ++++++++++++++++ examples/declarative/fonts/fonts.qmlproject | 16 ++++++++++++++++ examples/declarative/gestures/gestures.qmlproject | 16 ++++++++++++++++ examples/declarative/gridview/gridview.qmlproject | 16 ++++++++++++++++ .../declarative/imageprovider/imageprovider.qmlproject | 16 ++++++++++++++++ examples/declarative/images/images.qmlproject | 16 ++++++++++++++++ examples/declarative/layouts/layouts.qmlproject | 16 ++++++++++++++++ .../listmodel-threaded/listmodel-threaded.qmlproject | 16 ++++++++++++++++ examples/declarative/listview/listview.qmlproject | 16 ++++++++++++++++ examples/declarative/mousearea/mousearea.qmlproject | 16 ++++++++++++++++ .../objectlistmodel/objectlistmodel.qmlproject | 16 ++++++++++++++++ examples/declarative/package/package.qmlproject | 16 ++++++++++++++++ examples/declarative/parallax/parallax.qmlproject | 16 ++++++++++++++++ examples/declarative/plugins/plugins.qmlproject | 16 ++++++++++++++++ examples/declarative/progressbar/progressbar.qmlproject | 16 ++++++++++++++++ .../declarative/proxywidgets/proxywidgets.qmlproject | 16 ++++++++++++++++ examples/declarative/scrollbar/scrollbar.qmlproject | 16 ++++++++++++++++ examples/declarative/searchbox/searchbox.qmlproject | 16 ++++++++++++++++ examples/declarative/slideswitch/slideswitch.qmlproject | 16 ++++++++++++++++ examples/declarative/sql/sql.qmlproject | 16 ++++++++++++++++ examples/declarative/states/states.qmlproject | 16 ++++++++++++++++ examples/declarative/tabwidget/tabwidget.qmlproject | 16 ++++++++++++++++ examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject | 16 ++++++++++++++++ examples/declarative/tutorials/tutorials.qmlproject | 16 ++++++++++++++++ examples/declarative/tvtennis/tvtennis.qmlproject | 16 ++++++++++++++++ examples/declarative/velocity/velocity.qmlproject | 16 ++++++++++++++++ examples/declarative/webview/webview.qmlproject | 16 ++++++++++++++++ .../declarative/workerscript/workerscript.qmlproject | 16 ++++++++++++++++ examples/declarative/xmldata/xmldata.qmlproject | 16 ++++++++++++++++ .../declarative/xmlhttprequest/xmlhttprequest.qmlproject | 16 ++++++++++++++++ 42 files changed, 672 insertions(+) create mode 100644 examples/declarative/animations/animations.qmlproject create mode 100644 examples/declarative/aspectratio/aspectratio.qmlproject create mode 100644 examples/declarative/behaviors/behaviors.qmlproject create mode 100644 examples/declarative/border-image/border-image.qmlproject create mode 100644 examples/declarative/clocks/clocks.qmlproject create mode 100644 examples/declarative/connections/connections.qmlproject create mode 100644 examples/declarative/dial/dial.qmlproject create mode 100644 examples/declarative/dynamic/dynamic.qmlproject create mode 100644 examples/declarative/effects/effects.qmlproject create mode 100644 examples/declarative/extending/extending.qmlproject create mode 100644 examples/declarative/fillmode/fillmode.qmlproject create mode 100644 examples/declarative/flipable/flipable.qmlproject create mode 100644 examples/declarative/focus/focus.qmlproject create mode 100644 examples/declarative/fonts/fonts.qmlproject create mode 100644 examples/declarative/gestures/gestures.qmlproject create mode 100644 examples/declarative/gridview/gridview.qmlproject create mode 100644 examples/declarative/imageprovider/imageprovider.qmlproject create mode 100644 examples/declarative/images/images.qmlproject create mode 100644 examples/declarative/layouts/layouts.qmlproject create mode 100644 examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject create mode 100644 examples/declarative/listview/listview.qmlproject create mode 100644 examples/declarative/mousearea/mousearea.qmlproject create mode 100644 examples/declarative/objectlistmodel/objectlistmodel.qmlproject create mode 100644 examples/declarative/package/package.qmlproject create mode 100644 examples/declarative/parallax/parallax.qmlproject create mode 100644 examples/declarative/plugins/plugins.qmlproject create mode 100644 examples/declarative/progressbar/progressbar.qmlproject create mode 100644 examples/declarative/proxywidgets/proxywidgets.qmlproject create mode 100644 examples/declarative/scrollbar/scrollbar.qmlproject create mode 100644 examples/declarative/searchbox/searchbox.qmlproject create mode 100644 examples/declarative/slideswitch/slideswitch.qmlproject create mode 100644 examples/declarative/sql/sql.qmlproject create mode 100644 examples/declarative/states/states.qmlproject create mode 100644 examples/declarative/tabwidget/tabwidget.qmlproject create mode 100644 examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject create mode 100644 examples/declarative/tutorials/tutorials.qmlproject create mode 100644 examples/declarative/tvtennis/tvtennis.qmlproject create mode 100644 examples/declarative/velocity/velocity.qmlproject create mode 100644 examples/declarative/webview/webview.qmlproject create mode 100644 examples/declarative/workerscript/workerscript.qmlproject create mode 100644 examples/declarative/xmldata/xmldata.qmlproject create mode 100644 examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject diff --git a/examples/declarative/animations/animations.qmlproject b/examples/declarative/animations/animations.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/animations/animations.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/aspectratio/aspectratio.qmlproject b/examples/declarative/aspectratio/aspectratio.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/aspectratio/aspectratio.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/behaviors/behaviors.qmlproject b/examples/declarative/behaviors/behaviors.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/behaviors/behaviors.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/border-image/border-image.qmlproject b/examples/declarative/border-image/border-image.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/border-image/border-image.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/clocks/clocks.qmlproject b/examples/declarative/clocks/clocks.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/clocks/clocks.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/connections/connections.qmlproject b/examples/declarative/connections/connections.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/connections/connections.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/dial/dial.qmlproject b/examples/declarative/dial/dial.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/dial/dial.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/dynamic/dynamic.qmlproject b/examples/declarative/dynamic/dynamic.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/dynamic/dynamic.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/effects/effects.qmlproject b/examples/declarative/effects/effects.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/effects/effects.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/extending/extending.qmlproject b/examples/declarative/extending/extending.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/extending/extending.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/fillmode/fillmode.qmlproject b/examples/declarative/fillmode/fillmode.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/fillmode/fillmode.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/flipable/flipable.qmlproject b/examples/declarative/flipable/flipable.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/flipable/flipable.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/focus/focus.qmlproject b/examples/declarative/focus/focus.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/focus/focus.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/fonts/fonts.qmlproject b/examples/declarative/fonts/fonts.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/fonts/fonts.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/gestures/gestures.qmlproject b/examples/declarative/gestures/gestures.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/gestures/gestures.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/gridview/gridview.qmlproject b/examples/declarative/gridview/gridview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/gridview/gridview.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/imageprovider/imageprovider.qmlproject b/examples/declarative/imageprovider/imageprovider.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/imageprovider/imageprovider.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/images/images.qmlproject b/examples/declarative/images/images.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/images/images.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/layouts/layouts.qmlproject b/examples/declarative/layouts/layouts.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/layouts/layouts.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject b/examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/listmodel-threaded/listmodel-threaded.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/listview/listview.qmlproject b/examples/declarative/listview/listview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/listview/listview.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/mousearea/mousearea.qmlproject b/examples/declarative/mousearea/mousearea.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/mousearea/mousearea.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/objectlistmodel/objectlistmodel.qmlproject b/examples/declarative/objectlistmodel/objectlistmodel.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/objectlistmodel/objectlistmodel.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/package/package.qmlproject b/examples/declarative/package/package.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/package/package.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/parallax/parallax.qmlproject b/examples/declarative/parallax/parallax.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/parallax/parallax.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/plugins/plugins.qmlproject b/examples/declarative/plugins/plugins.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/plugins/plugins.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/progressbar/progressbar.qmlproject b/examples/declarative/progressbar/progressbar.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/progressbar/progressbar.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/proxywidgets/proxywidgets.qmlproject b/examples/declarative/proxywidgets/proxywidgets.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/proxywidgets/proxywidgets.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/scrollbar/scrollbar.qmlproject b/examples/declarative/scrollbar/scrollbar.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/scrollbar/scrollbar.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/searchbox/searchbox.qmlproject b/examples/declarative/searchbox/searchbox.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/searchbox/searchbox.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/slideswitch/slideswitch.qmlproject b/examples/declarative/slideswitch/slideswitch.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/slideswitch/slideswitch.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/sql/sql.qmlproject b/examples/declarative/sql/sql.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/sql/sql.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/states/states.qmlproject b/examples/declarative/states/states.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/states/states.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/tabwidget/tabwidget.qmlproject b/examples/declarative/tabwidget/tabwidget.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/tabwidget/tabwidget.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject b/examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/tic-tac-toe/tic-tac-toe.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/tutorials/tutorials.qmlproject b/examples/declarative/tutorials/tutorials.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/tutorials/tutorials.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/tvtennis/tvtennis.qmlproject b/examples/declarative/tvtennis/tvtennis.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/tvtennis/tvtennis.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/velocity/velocity.qmlproject b/examples/declarative/velocity/velocity.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/velocity/velocity.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/webview/webview.qmlproject b/examples/declarative/webview/webview.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/webview/webview.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/workerscript/workerscript.qmlproject b/examples/declarative/workerscript/workerscript.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/workerscript/workerscript.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/xmldata/xmldata.qmlproject b/examples/declarative/xmldata/xmldata.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/xmldata/xmldata.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject b/examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/xmlhttprequest/xmlhttprequest.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} -- cgit v0.12 From 8efa7be3fd66119753730be643d0882afe329348 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 20 Apr 2010 10:56:00 +1000 Subject: Add an examples.qmlproject for all QML examples. --- examples/declarative/examples.qmlproject | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 examples/declarative/examples.qmlproject diff --git a/examples/declarative/examples.qmlproject b/examples/declarative/examples.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/examples/declarative/examples.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} -- cgit v0.12 From fca7ddd5522f1462192b6c2b4b9e9e5a0f8449d9 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Tue, 20 Apr 2010 10:56:04 +1000 Subject: Add drag.active property to MouseArea in qml The drag.active property specifies if the target item is being dragged. Task-number: QTBUG-9833 Reviewed-by: Martin Jones --- .../graphicsitems/qdeclarativemousearea.cpp | 35 +++++++++++--- .../graphicsitems/qdeclarativemousearea_p.h | 6 +++ .../graphicsitems/qdeclarativemousearea_p_p.h | 4 +- .../qdeclarativemousearea/data/dragging.qml | 28 +++++++++++ .../tst_qdeclarativemousearea.cpp | 56 ++++++++++++++++++++++ 5 files changed, 120 insertions(+), 9 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativemousearea/data/dragging.qml diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index bdb4868..969c60e 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -50,7 +50,8 @@ QT_BEGIN_NAMESPACE static const int PressAndHoldDelay = 800; QDeclarativeDrag::QDeclarativeDrag(QObject *parent) -: QObject(parent), _target(0), _axis(XandYAxis), _xmin(0), _xmax(0), _ymin(0), _ymax(0) +: QObject(parent), _target(0), _axis(XandYAxis), _xmin(0), _xmax(0), _ymin(0), _ymax(0), +_active(false) { } @@ -144,6 +145,19 @@ void QDeclarativeDrag::setYmax(qreal m) emit maximumYChanged(); } +bool QDeclarativeDrag::active() const +{ + return _active; +} + +void QDeclarativeDrag::setActive(bool drag) +{ + if (_active == drag) + return; + _active = drag; + emit activeChanged(); +} + QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() { delete drag; @@ -389,7 +403,8 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event) d->dragX = drag()->axis() & QDeclarativeDrag::XAxis; d->dragY = drag()->axis() & QDeclarativeDrag::YAxis; } - d->dragged = false; + if (d->drag) + d->drag->setActive(false); setHovered(true); d->startScene = event->scenePos(); // we should only start timer if pressAndHold is connected to. @@ -438,7 +453,7 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) qreal dx = qAbs(curLocalPos.x() - startLocalPos.x()); qreal dy = qAbs(curLocalPos.y() - startLocalPos.y()); if ((d->dragX && !(dx < dragThreshold)) || (d->dragY && !(dy < dragThreshold))) - d->dragged = true; + d->drag->setActive(true); if (!keepMouseGrab()) { if ((!d->dragY && dy < dragThreshold && d->dragX && dx > dragThreshold) || (!d->dragX && dx < dragThreshold && d->dragY && dy > dragThreshold) @@ -447,7 +462,7 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) } } - if (d->dragX && d->dragged) { + if (d->dragX && d->drag->active()) { qreal x = (curLocalPos.x() - startLocalPos.x()) + d->startX; if (x < drag()->xmin()) x = drag()->xmin(); @@ -455,7 +470,7 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) x = drag()->xmax(); drag()->target()->setX(x); } - if (d->dragY && d->dragged) { + if (d->dragY && d->drag->active()) { qreal y = (curLocalPos.y() - startLocalPos.y()) + d->startY; if (y < drag()->ymin()) y = drag()->ymin(); @@ -481,6 +496,8 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } else { d->saveEvent(event); setPressed(false); + if (d->drag) + d->drag->setActive(false); // If we don't accept hover, we need to reset containsMouse. if (!acceptHoverEvents()) setHovered(false); @@ -559,7 +576,8 @@ void QDeclarativeMouseArea::timerEvent(QTimerEvent *event) Q_D(QDeclarativeMouseArea); if (event->timerId() == d->pressAndHoldTimer.timerId()) { d->pressAndHoldTimer.stop(); - if (d->pressed && d->dragged == false && d->hovered == true) { + bool dragged = d->drag && d->drag->active(); + if (d->pressed && dragged == false && d->hovered == true) { d->longPress = true; QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, d->longPress); emit pressAndHold(&me); @@ -659,7 +677,8 @@ void QDeclarativeMouseArea::setAcceptedButtons(Qt::MouseButtons buttons) bool QDeclarativeMouseArea::setPressed(bool p) { Q_D(QDeclarativeMouseArea); - bool isclick = d->pressed == true && p == false && d->dragged == false && d->hovered == true; + bool dragged = d->drag && d->drag->active(); + bool isclick = d->pressed == true && p == false && dragged == false && d->hovered == true; if (d->pressed != p) { d->pressed = p; @@ -693,6 +712,7 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag() /*! \qmlproperty Item MouseArea::drag.target + \qmlproperty bool MouseArea::drag.active \qmlproperty Axis MouseArea::drag.axis \qmlproperty real MouseArea::drag.minimumX \qmlproperty real MouseArea::drag.maximumX @@ -703,6 +723,7 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag() \list \i \c target specifies the item to drag. + \i \c active specifies if the target item is being currently dragged. \i \c axis specifies whether dragging can be done horizontally (XAxis), vertically (YAxis), or both (XandYAxis) \i the minimum and maximum properties limit how far the target can be dragged along the corresponding axes. \endlist diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h index 630840f..4f7df62 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h @@ -61,6 +61,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeDrag : public QObject Q_PROPERTY(qreal maximumX READ xmax WRITE setXmax NOTIFY maximumXChanged) Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin NOTIFY minimumYChanged) Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged) + Q_PROPERTY(bool active READ active NOTIFY activeChanged) //### consider drag and drop public: @@ -84,6 +85,9 @@ public: qreal ymax() const; void setYmax(qreal); + bool active() const; + void setActive(bool); + Q_SIGNALS: void targetChanged(); void axisChanged(); @@ -91,6 +95,7 @@ Q_SIGNALS: void maximumXChanged(); void minimumYChanged(); void maximumYChanged(); + void activeChanged(); private: QGraphicsObject *_target; @@ -99,6 +104,7 @@ private: qreal _xmax; qreal _ymin; qreal _ymax; + bool _active; Q_DISABLE_COPY(QDeclarativeDrag) }; diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h index 4973957..4e909ff 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h @@ -67,7 +67,8 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate public: QDeclarativeMouseAreaPrivate() - : absorb(true), hovered(false), pressed(false), longPress(false), drag(0) + : absorb(true), hovered(false), pressed(false), longPress(false), + moved(false), drag(0) { } @@ -100,7 +101,6 @@ public: bool moved : 1; bool dragX : 1; bool dragY : 1; - bool dragged : 1; QDeclarativeDrag *drag; QPointF startScene; qreal startX; diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml b/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml new file mode 100644 index 0000000..a28f049 --- /dev/null +++ b/tests/auto/declarative/qdeclarativemousearea/data/dragging.qml @@ -0,0 +1,28 @@ +import Qt 4.7 +Rectangle { + id: whiteRect + width: 200 + height: 200 + color: "white" + Rectangle { + id: blackRect + objectName: "blackrect" + color: "black" + y: 50 + x: 50 + width: 100 + height: 100 + opacity: (whiteRect.width-blackRect.x+whiteRect.height-blackRect.y-199)/200 + Text { text: blackRect.opacity} + MouseArea { + objectName: "mouseregion" + anchors.fill: parent + drag.target: blackRect + drag.axis: Drag.XandYAxis + drag.minimumX: 0 + drag.maximumX: whiteRect.width-blackRect.width + drag.minimumY: 0 + drag.maximumY: whiteRect.height-blackRect.height + } + } + } diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index 4a58049..eb4aa12 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -52,6 +52,7 @@ class tst_QDeclarativeMouseArea: public QObject private slots: void dragProperties(); void resetDrag(); + void dragging(); void updateMouseAreaPosOnClick(); void updateMouseAreaPosOnResize(); void noOnClickedWithPressAndHold(); @@ -163,6 +164,61 @@ void tst_QDeclarativeMouseArea::resetDrag() } +void tst_QDeclarativeMouseArea::dragging() +{ + QDeclarativeView *canvas = createView(); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/dragging.qml")); + canvas->show(); + canvas->setFocus(); + QVERIFY(canvas->rootObject() != 0); + + QDeclarativeMouseArea *mouseRegion = canvas->rootObject()->findChild("mouseregion"); + QDeclarativeDrag *drag = mouseRegion->drag(); + QVERIFY(mouseRegion != 0); + QVERIFY(drag != 0); + + // target + QDeclarativeItem *blackRect = canvas->rootObject()->findChild("blackrect"); + QVERIFY(blackRect != 0); + QVERIFY(blackRect == drag->target()); + + QVERIFY(!drag->active()); + + QGraphicsScene *scene = canvas->scene(); + QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress); + pressEvent.setScenePos(QPointF(100, 100)); + pressEvent.setButton(Qt::LeftButton); + pressEvent.setButtons(Qt::LeftButton); + QApplication::sendEvent(scene, &pressEvent); + + QVERIFY(!drag->active()); + QCOMPARE(blackRect->x(), 50.0); + QCOMPARE(blackRect->y(), 50.0); + + QGraphicsSceneMouseEvent moveEvent(QEvent::GraphicsSceneMouseMove); + moveEvent.setScenePos(QPointF(110, 110)); + moveEvent.setButton(Qt::LeftButton); + moveEvent.setButtons(Qt::LeftButton); + QApplication::sendEvent(scene, &moveEvent); + + QVERIFY(drag->active()); + QCOMPARE(blackRect->x(), 60.0); + QCOMPARE(blackRect->y(), 60.0); + + QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); + releaseEvent.setScenePos(QPointF(110, 110)); + releaseEvent.setButton(Qt::LeftButton); + releaseEvent.setButtons(Qt::LeftButton); + QApplication::sendEvent(scene, &releaseEvent); + + QVERIFY(!drag->active()); + QCOMPARE(blackRect->x(), 60.0); + QCOMPARE(blackRect->y(), 60.0); + + delete canvas; +} + QDeclarativeView *tst_QDeclarativeMouseArea::createView() { QDeclarativeView *canvas = new QDeclarativeView(0); -- cgit v0.12 From c734d6eecbdb594346b3008bd5a843605d761af8 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 20 Apr 2010 11:25:02 +1000 Subject: Handle overrides correctly in extension objects QTBUG-7817 --- src/declarative/qml/qdeclarativemetatype.cpp | 75 +++++++++++++++++++++- .../qdeclarativeecmascript/testtypes.cpp | 10 +++ .../declarative/qdeclarativeecmascript/testtypes.h | 25 ++++++++ .../tst_qdeclarativeecmascript.cpp | 11 ++++ 4 files changed, 119 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index d41bd43..96bf4e5 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -221,6 +221,76 @@ bool QDeclarativeType::availableInVersion(int vmajor, int vminor) const return vmajor > d->m_version_maj || (vmajor == d->m_version_maj && vminor >= d->m_version_min); } +static void clone(QMetaObjectBuilder &builder, const QMetaObject *mo, + const QMetaObject *ignoreStart, const QMetaObject *ignoreEnd) +{ + // Clone Q_CLASSINFO + for (int ii = mo->classInfoOffset(); ii < mo->classInfoCount(); ++ii) { + QMetaClassInfo info = mo->classInfo(ii); + + int otherIndex = ignoreEnd->indexOfClassInfo(info.name()); + if (otherIndex >= ignoreStart->classInfoOffset() + ignoreStart->classInfoCount()) { + // Skip + } else { + builder.addClassInfo(info.name(), info.value()); + } + } + + // Clone Q_PROPERTY + for (int ii = mo->propertyOffset(); ii < mo->propertyCount(); ++ii) { + QMetaProperty property = mo->property(ii); + + int otherIndex = ignoreEnd->indexOfProperty(property.name()); + if (otherIndex >= ignoreStart->classInfoOffset() + ignoreStart->classInfoCount()) { + builder.addProperty(QByteArray("__qml_ignore__") + property.name(), QByteArray("void")); + // Skip + } else { + builder.addProperty(property); + } + } + + // Clone Q_METHODS + for (int ii = mo->methodOffset(); ii < mo->methodCount(); ++ii) { + QMetaMethod method = mo->method(ii); + + // More complex - need to search name + QByteArray name = method.signature(); + int parenIdx = name.indexOf('('); + if (parenIdx != -1) name = name.left(parenIdx); + + + bool found = false; + + for (int ii = ignoreStart->methodOffset() + ignoreStart->methodCount(); + !found && ii < ignoreEnd->methodOffset() + ignoreEnd->methodCount(); + ++ii) { + + QMetaMethod other = ignoreEnd->method(ii); + QByteArray othername = other.signature(); + int parenIdx = othername.indexOf('('); + if (parenIdx != -1) othername = othername.left(parenIdx); + + found = name == othername; + } + + QMetaMethodBuilder m = builder.addMethod(method); + if (found) // SKIP + m.setAccess(QMetaMethod::Private); + } + + // Clone Q_ENUMS + for (int ii = mo->enumeratorOffset(); ii < mo->enumeratorCount(); ++ii) { + QMetaEnum enumerator = mo->enumerator(ii); + + int otherIndex = ignoreEnd->indexOfEnumerator(enumerator.name()); + if (otherIndex >= ignoreStart->enumeratorOffset() + ignoreStart->enumeratorCount()) { + // Skip + } else { + builder.addEnumerator(enumerator); + } + } +} + void QDeclarativeTypePrivate::init() const { if (m_isSetup) return; @@ -245,8 +315,9 @@ void QDeclarativeTypePrivate::init() const QDeclarativeType *t = metaTypeData()->metaObjectToType.value(mo); if (t) { if (t->d->m_extFunc) { - QMetaObject *mmo = new QMetaObject; - *mmo = *t->d->m_extMetaObject; + QMetaObjectBuilder builder; + clone(builder, t->d->m_extMetaObject, t->d->m_baseMetaObject, m_baseMetaObject); + QMetaObject *mmo = builder.toMetaObject(); mmo->d.superdata = m_baseMetaObject; if (!m_metaObjects.isEmpty()) m_metaObjects.last().metaObject->d.superdata = mmo; diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp index 0d07055..154ff4d 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp @@ -72,6 +72,14 @@ private: int m_value; }; +class DefaultPropertyExtensionObject : public QObject +{ + Q_OBJECT + Q_CLASSINFO("DefaultProperty", "firstProperty") +public: + DefaultPropertyExtensionObject(QObject *parent) : QObject(parent) {} +}; + void registerTypes() { qmlRegisterType("Qt.test", 1,0, "MyQmlObject"); @@ -81,6 +89,8 @@ void registerTypes() qmlRegisterExtendedType("Qt.test", 1,0, "MyExtendedObject"); qmlRegisterType("Qt.test", 1,0, "MyTypeObject"); qmlRegisterType("Qt.test", 1,0, "NumberAssignment"); + qmlRegisterExtendedType("Qt.test", 1,0, "DefaultPropertyExtendedObject"); + qmlRegisterType("Qt.test", 1,0, "OverrideDefaultPropertyObject"); } #include "testtypes.moc" diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h index 79d3226..1381d57 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h @@ -659,6 +659,31 @@ public: void setTest12(unsigned int v) { _test12 = v; } }; +class DefaultPropertyExtendedObject : public QObject +{ + Q_OBJECT + Q_PROPERTY(QObject *firstProperty READ firstProperty WRITE setFirstProperty) + Q_PROPERTY(QObject *secondProperty READ secondProperty WRITE setSecondProperty) +public: + DefaultPropertyExtendedObject(QObject *parent = 0) : QObject(parent), m_firstProperty(0), m_secondProperty(0) {} + + QObject *firstProperty() const { return m_firstProperty; } + QObject *secondProperty() const { return m_secondProperty; } + void setFirstProperty(QObject *property) { m_firstProperty = property; } + void setSecondProperty(QObject *property) { m_secondProperty = property; } +private: + QObject* m_firstProperty; + QObject* m_secondProperty; +}; + +class OverrideDefaultPropertyObject : public DefaultPropertyExtendedObject +{ + Q_OBJECT + Q_CLASSINFO("DefaultProperty", "secondProperty") +public: + OverrideDefaultPropertyObject() {} +}; + void registerTypes(); #endif // TESTTYPES_H diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 33629b8..a2ecf74 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -90,6 +90,7 @@ private slots: void objectPropertiesTriggerReeval(); void deferredProperties(); void extensionObjects(); + void overrideExtensionProperties(); void attachedProperties(); void enums(); void valueTypeFunctions(); @@ -565,6 +566,16 @@ void tst_qdeclarativeecmascript::extensionObjects() } +void tst_qdeclarativeecmascript::overrideExtensionProperties() +{ + QDeclarativeComponent component(&engine, TEST_FILE("extensionObjectsPropertyOverride.qml")); + OverrideDefaultPropertyObject *object = + qobject_cast(component.create()); + QVERIFY(object != 0); + QVERIFY(object->secondProperty() != 0); + QVERIFY(object->firstProperty() == 0); +} + void tst_qdeclarativeecmascript::attachedProperties() { QDeclarativeComponent component(&engine, TEST_FILE("attachedProperty.qml")); -- cgit v0.12 From db6d92f8c65de79951cec3d833894f41c99e25c5 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 19 Apr 2010 10:26:13 +1000 Subject: Modify qdoc to handle qml examples files. Reviewed-by: Michael Brasser --- tools/qdoc3/cppcodeparser.cpp | 68 ++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 6884781..730f122 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -492,7 +492,7 @@ const FunctionNode *CppCodeParser::findFunctionNode(const QString& synopsis, candidates << overload; } - + /* There are several functions with the correct parameter count, but only one has the correct @@ -545,7 +545,7 @@ QSet CppCodeParser::topicCommands() } /*! - Process the topic \a command in context \a doc with argument \a arg. + Process the topic \a command in context \a doc with argument \a arg. */ Node *CppCodeParser::processTopicCommand(const Doc& doc, const QString& command, @@ -731,7 +731,7 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, return new QmlClassNode(tre->root(), names[0], classNode); } else if (command == COMMAND_QMLBASICTYPE) { -#if 0 +#if 0 QStringList parts = arg.split(" "); qDebug() << command << parts; if (parts.size() > 1) { @@ -741,7 +741,7 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, return new QmlBasicTypeNode(pageNode, parts[0]); } } -#endif +#endif return new QmlBasicTypeNode(tre->root(), arg); } else if ((command == COMMAND_QMLSIGNAL) || @@ -912,13 +912,13 @@ QSet CppCodeParser::otherMetaCommands() << COMMAND_NEXTPAGE << COMMAND_PREVIOUSPAGE << COMMAND_INDEXPAGE -#ifdef QDOC_QML +#ifdef QDOC_QML << COMMAND_STARTPAGE << COMMAND_QMLINHERITS << COMMAND_QMLDEFAULT; -#else +#else << COMMAND_STARTPAGE; -#endif +#endif } /*! @@ -2119,7 +2119,7 @@ bool CppCodeParser::matchDocsAndStuff() } ++a; } -#endif +#endif } NodeList::Iterator n = nodes.begin(); @@ -2268,31 +2268,46 @@ void CppCodeParser::instantiateIteratorMacro(const QString &container, void CppCodeParser::createExampleFileNodes(FakeNode *fake) { QString examplePath = fake->name(); - - // we can assume that this file always exists - QString proFileName = examplePath + "/" + - examplePath.split("/").last() + ".pro"; - QString userFriendlyFilePath; + bool isQmlExample = false; + + // let's check if this is a QML example + QString proFileName = examplePath + "/" + examplePath.split("/").last() + ".qmlproject"; QString fullPath = Config::findFile(fake->doc().location(), exampleFiles, exampleDirs, proFileName, userFriendlyFilePath); - - if (fullPath.isEmpty()) { - QString tmp = proFileName; - proFileName = examplePath + "/" + "qbuild.pro"; + + if (!fullPath.isEmpty()) { + isQmlExample = true; + } else { + // let's check if there is a .pro file + proFileName = examplePath + "/" + examplePath.split("/").last() + ".pro"; userFriendlyFilePath.clear(); + fullPath = Config::findFile(fake->doc().location(), exampleFiles, exampleDirs, proFileName, userFriendlyFilePath); + if (fullPath.isEmpty()) { - fake->doc().location().warning( - tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName)); - return; + // let's check if there is a qbuild.pro file + QString tmp = proFileName; + proFileName = examplePath + "/" + "qbuild.pro"; + userFriendlyFilePath.clear(); + fullPath = Config::findFile(fake->doc().location(), + exampleFiles, + exampleDirs, + proFileName, + userFriendlyFilePath); + + if (fullPath.isEmpty()) { + fake->doc().location().warning( + tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName)); + return; + } } } @@ -2300,7 +2315,14 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake) fullPath.truncate(fullPath.lastIndexOf('/')); QStringList exampleFiles = Config::getFilesHere(fullPath,exampleNameFilter); - QString imagesPath = fullPath + "/images"; + + // QML examples do not put images in a "images" directory. + QString imagesPath; + if (isQmlExample) + imagesPath = fullPath; + else + imagesPath = fullPath + "/images"; + QStringList imageFiles = Config::getFilesHere(imagesPath,exampleImageFilter); if (!exampleFiles.isEmpty()) { @@ -2315,14 +2337,14 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake) i.remove(); } else if (fileName.contains("/qrc_") || fileName.contains("/moc_") - || fileName.contains("/ui_")) + || fileName.contains("/ui_")) i.remove(); } if (!mainCpp.isEmpty()) exampleFiles.append(mainCpp); // add any qmake Qt resource files and qmake project files - exampleFiles += Config::getFilesHere(fullPath, "*.qrc *.pro"); + exampleFiles += Config::getFilesHere(fullPath, "*.qrc *.pro qmldir"); } foreach (const QString &exampleFile, exampleFiles) -- cgit v0.12 From 7214e00414c5c6f1a6e062e53ec730e2d88ee8a1 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 20 Apr 2010 11:48:05 +1000 Subject: Missing file --- .../data/extensionObjectsPropertyOverride.qml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml new file mode 100644 index 0000000..3c443cb --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml @@ -0,0 +1,7 @@ +import Qt.test 1.0 + +OverrideDefaultPropertyObject +{ + MyBaseExtendedObject { + } +} -- cgit v0.12 From 537594d794c9e5eb379e4a099781b4857e91cd68 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Tue, 20 Apr 2010 12:00:48 +1000 Subject: QT7 mediaservice; fix leaking strings. Reviewed-by: Dmytro Poplavskiy --- .../mediaservices/qt7/mediaplayer/qt7playersession.mm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm index 024f7b0..0405bbd 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm @@ -153,10 +153,9 @@ QT_BEGIN_NAMESPACE -static CFStringRef qString2CFStringRef(const QString &string) +static inline NSString *qString2CFStringRef(const QString &string) { - return CFStringCreateWithCharacters(0, reinterpret_cast(string.unicode()), - string.length()); + return [NSString stringWithCharacters:reinterpret_cast(string.unicode()) length:string.length()]; } QT7PlayerSession::QT7PlayerSession(QObject *parent) @@ -391,10 +390,10 @@ void QT7PlayerSession::setMedia(const QMediaContent &content, QIODevice *stream) foreach (const QNetworkCookie &requestCookie, cookieList) { NSMutableDictionary *p = [NSMutableDictionary dictionaryWithObjectsAndKeys: - (NSString*)qString2CFStringRef(requestCookie.name()), NSHTTPCookieName, - (NSString*)qString2CFStringRef(requestCookie.value()), NSHTTPCookieValue, - (NSString*)qString2CFStringRef(requestCookie.domain()), NSHTTPCookieDomain, - (NSString*)qString2CFStringRef(requestCookie.path()), NSHTTPCookiePath, + qString2CFStringRef(requestCookie.name()), NSHTTPCookieName, + qString2CFStringRef(requestCookie.value()), NSHTTPCookieValue, + qString2CFStringRef(requestCookie.domain()), NSHTTPCookieDomain, + qString2CFStringRef(requestCookie.path()), NSHTTPCookiePath, nil ]; if (requestCookie.isSessionCookie()) @@ -407,7 +406,7 @@ void QT7PlayerSession::setMedia(const QMediaContent &content, QIODevice *stream) } NSError *err = 0; - NSString *urlString = (NSString *)qString2CFStringRef(request.url().toString()); + NSString *urlString = qString2CFStringRef(request.url().toString()); NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys: [NSURL URLWithString:urlString], QTMovieURLAttribute, -- cgit v0.12 From f31f7ee8e966f1ccb954c0bca614f5c5605c820f Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 20 Apr 2010 12:40:08 +1000 Subject: Improve error messages, especially on embedded. With embedded, it is often the case that some QT_NO_* features are turned off (eg. QT_NO_XMLPATTERNS), which in turn leads to QML types not being available. --- doc/src/declarative/qtdeclarative.qdoc | 55 +++++++++++++++++- .../graphicsitems/qdeclarativeitemsmodule.cpp | 20 ++++--- src/declarative/qml/qdeclarative.h | 14 ++++- src/declarative/qml/qdeclarativecompiler.cpp | 12 +++- src/declarative/qml/qdeclarativecustomparser.cpp | 20 +++++++ src/declarative/qml/qdeclarativecustomparser_p.h | 4 +- src/declarative/qml/qdeclarativemetatype.cpp | 7 +++ src/declarative/qml/qdeclarativemetatype_p.h | 1 + src/declarative/qml/qdeclarativeprivate.h | 1 + .../qml/qdeclarativetypenotavailable.cpp | 49 ++++++++++++++++ .../qml/qdeclarativetypenotavailable_p.h | 65 ++++++++++++++++++++++ src/declarative/qml/qdeclarativevaluetype.cpp | 2 + src/declarative/qml/qml.pri | 2 + src/declarative/util/qdeclarativeutilmodule.cpp | 22 +++++--- .../data/noCreation.errors.txt | 1 + .../qdeclarativelanguage/data/noCreation.qml | 4 ++ .../declarative/qdeclarativelanguage/testtypes.cpp | 3 +- .../tst_qdeclarativelanguage.cpp | 1 + tools/qml/qmlruntime.cpp | 2 +- 19 files changed, 259 insertions(+), 26 deletions(-) create mode 100644 src/declarative/qml/qdeclarativetypenotavailable.cpp create mode 100644 src/declarative/qml/qdeclarativetypenotavailable_p.h create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/noCreation.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index b4d8a2e..a986fbc 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -79,7 +79,7 @@ \relates QDeclarativeEngine This template function registers the C++ type in the QML system with - the name \a qmlName. in the library imported from \a uri having the + the name \a qmlName, in the library imported from \a uri having the version number composed from \a versionMajor and \a versionMinor. Returns the QML type id. @@ -94,6 +94,59 @@ */ /*! + \fn int qmlRegisterTypeUncreatable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message) + \relates QDeclarativeEngine + + This template function registers the C++ type in the QML system with + the name \a qmlName, in the library imported from \a uri having the + version number composed from \a versionMajor and \a versionMinor. + + While the type has a name and a type, it cannot be created, and the + given error \a message will result if creation is attempted. + + This is useful where the type is only intended for providing attached properties or enum values. + + Returns the QML type id. + + \sa qmlRegisterTypeNotAvailable +*/ + +/*! + \fn int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message) + \relates QDeclarativeEngine + + This function registers a type in the QML system with the name \a qmlName, in the library imported from \a uri having the + version number composed from \a versionMajor and \a versionMinor, but any attempt to instantiate the type + will produce the given error \a message. + + Normally, the types exported by a module should be fixed. However, if a C++ type is not available, you should + at least "reserve" the QML type name, and give the user of your module a meaningful error message. + + Returns the QML type id. + + Example: + + \code + #ifdef NO_GAMES_ALLOWED + qmlRegisterTypeNotAvailable("MinehuntCore", 0, 1, "Game", "Get back to work, slacker!"); + #else + qmlRegisterType("MinehuntCore", 0, 1, "Game"); + #endif + \endcode + + This will cause any QML which uses this module and attempts to use the type to produce an error message: + \code +fun.qml: Get back to work, slacker! + Game { + ^ + \endcode + + Without this, a generic "Game is not a type" message would be given. + + \sa qmlRegisterTypeUncreatable +*/ + +/*! \fn int qmlRegisterType() \relates QDeclarativeEngine \overload diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 2d01eef..16972a8 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -82,7 +82,10 @@ void QDeclarativeItemModule::defineModule() { -#ifndef QT_NO_MOVIE +#ifdef QT_NO_MOVIE + qmlRegisterTypeNotAvailable("Qt",4,6,"AnimatedImage", + qApp->translate("QDeclarativeAnimatedImage","Qt was built without support for QMovie")); +#else qmlRegisterType("Qt",4,6,"AnimatedImage"); #endif qmlRegisterType("Qt",4,6,"BorderImage"); @@ -141,17 +144,20 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); -#ifndef QT_NO_GRAPHICSEFFECT +#ifdef QT_NO_GRAPHICSEFFECT + QString no_graphicseffect = qApp->translate("QGraphicsBlurEffect","Qt was built without support for graphicseffects"); + qmlRegisterTypeNotAvailable("Qt",4,6,"Blur",no_graphicseffect); + qmlRegisterTypeNotAvailable("Qt",4,6,"Colorize",no_graphicseffect); + qmlRegisterTypeNotAvailable("Qt",4,6,"DropShadow",no_graphicseffect); + qmlRegisterTypeNotAvailable("Qt",4,6,"Opacity",no_graphicseffect); +#else qmlRegisterType(); qmlRegisterType("Qt",4,6,"Blur"); qmlRegisterType("Qt",4,6,"Colorize"); qmlRegisterType("Qt",4,6,"DropShadow"); qmlRegisterType("Qt",4,6,"Opacity"); #endif -#ifdef QT_WEBKIT_LIB - qmlRegisterType(); -#endif - qmlRegisterUncreatableType("Qt",4,6,"KeyNavigation"); - qmlRegisterUncreatableType("Qt",4,6,"Keys"); + qmlRegisterUncreatableType("Qt",4,6,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); + qmlRegisterUncreatableType("Qt",4,6,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties")); } diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h index 6e36d4f..d75f0a8 100644 --- a/src/declarative/qml/qdeclarative.h +++ b/src/declarative/qml/qdeclarative.h @@ -100,6 +100,7 @@ int qmlRegisterType() qRegisterMetaType(pointerName.constData()), qRegisterMetaType >(listName.constData()), 0, 0, + QString(), 0, 0, 0, 0, &T::staticMetaObject, @@ -118,8 +119,10 @@ int qmlRegisterType() return QDeclarativePrivate::registerType(type); } +int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message); + template -int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) +int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason) { QByteArray name(T::staticMetaObject.className()); @@ -132,6 +135,7 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin qRegisterMetaType(pointerName.constData()), qRegisterMetaType >(listName.constData()), 0, 0, + reason, uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -164,6 +168,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c qRegisterMetaType(pointerName.constData()), qRegisterMetaType >(listName.constData()), sizeof(T), QDeclarativePrivate::createInto, + QString(), uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -196,6 +201,7 @@ int qmlRegisterExtendedType() qRegisterMetaType(pointerName.constData()), qRegisterMetaType >(listName.constData()), 0, 0, + QString(), 0, 0, 0, 0, &T::staticMetaObject, @@ -236,6 +242,7 @@ int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor, qRegisterMetaType(pointerName.constData()), qRegisterMetaType >(listName.constData()), sizeof(T), QDeclarativePrivate::createInto, + QString(), uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -276,9 +283,9 @@ int qmlRegisterInterface(const char *typeName) template int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor, - const char *qmlName, const char *typeName, QDeclarativeCustomParser *parser) + const char *qmlName, QDeclarativeCustomParser *parser) { - QByteArray name(typeName); + QByteArray name(T::staticMetaObject.className()); QByteArray pointerName(name + '*'); QByteArray listName("QDeclarativeListProperty<" + name + ">"); @@ -289,6 +296,7 @@ int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor, qRegisterMetaType(pointerName.constData()), qRegisterMetaType >(listName.constData()), sizeof(T), QDeclarativePrivate::createInto, + QString(), uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 2614764..10e4746 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -571,8 +571,12 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine, QDeclarativeScriptParser::TypeReference *parserRef = unit->data.referencedTypes().at(ii); if (tref.type) { ref.type = tref.type; - if (!ref.type->isCreatable()) - COMPILE_EXCEPTION(parserRef->refObjects.first(), tr( "Element is not creatable.")); + if (!ref.type->isCreatable()) { + QString err = ref.type->noCreationReason(); + if (err.isEmpty()) + err = tr( "Element is not creatable."); + COMPILE_EXCEPTION(parserRef->refObjects.first(), err); + } } else if (tref.unit) { ref.component = tref.unit->toComponent(engine); @@ -864,12 +868,14 @@ bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt) defaultProperty->release(); // Compile custom parser parts - if (isCustomParser && !customProps.isEmpty()) { + if (isCustomParser/* && !customProps.isEmpty()*/) { QDeclarativeCustomParser *cp = output->types.at(obj->type).type->customParser(); cp->clearErrors(); cp->compiler = this; + cp->object = obj; obj->custom = cp->compile(customProps); cp->compiler = 0; + cp->object = 0; foreach (QDeclarativeError err, cp->errors()) { err.setUrl(output->url); exceptions << err; diff --git a/src/declarative/qml/qdeclarativecustomparser.cpp b/src/declarative/qml/qdeclarativecustomparser.cpp index 1a97315..472a883 100644 --- a/src/declarative/qml/qdeclarativecustomparser.cpp +++ b/src/declarative/qml/qdeclarativecustomparser.cpp @@ -89,6 +89,8 @@ using namespace QDeclarativeParser; by \a data, which is a block of data previously returned by a call to compile(). + Errors should be reported using qmlInfo(object). + The \a object will be an instance of the TypeClass specified by QML_REGISTER_CUSTOM_TYPE. */ @@ -235,6 +237,24 @@ void QDeclarativeCustomParser::clearErrors() } /*! + Reports an error with the given \a description. + + This can only be used during the compile() step. For errors during setCustomData(), use qmlInfo(). + + An error is generated referring to the position of the element in the source file. +*/ +void QDeclarativeCustomParser::error(const QString& description) +{ + Q_ASSERT(object); + QDeclarativeError error; + QString exceptionDescription; + error.setLine(object->location.start.line); + error.setColumn(object->location.start.column); + error.setDescription(description); + exceptions << error; +} + +/*! Reports an error in parsing \a prop, with the given \a description. An error is generated referring to the position of \a node in the source file. diff --git a/src/declarative/qml/qdeclarativecustomparser_p.h b/src/declarative/qml/qdeclarativecustomparser_p.h index da0358a..0e397c5 100644 --- a/src/declarative/qml/qdeclarativecustomparser_p.h +++ b/src/declarative/qml/qdeclarativecustomparser_p.h @@ -113,7 +113,7 @@ private: class Q_DECLARATIVE_EXPORT QDeclarativeCustomParser { public: - QDeclarativeCustomParser() : compiler(0) {} + QDeclarativeCustomParser() : compiler(0), object(0) {} virtual ~QDeclarativeCustomParser() {} void clearErrors(); @@ -124,6 +124,7 @@ public: QList errors() const { return exceptions; } protected: + void error(const QString& description); void error(const QDeclarativeCustomParserProperty&, const QString& description); void error(const QDeclarativeCustomParserNode&, const QString& description); @@ -132,6 +133,7 @@ protected: private: QList exceptions; QDeclarativeCompiler *compiler; + QDeclarativeParser::Object *object; friend class QDeclarativeCompiler; }; diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 96bf4e5..8fee8a7 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -134,6 +134,7 @@ public: int m_allocationSize; void (*m_newFunc)(void *); + QString m_noCreationReason; const QMetaObject *m_baseMetaObject; QDeclarativeAttachedPropertiesFunc m_attachedPropertiesFunc; @@ -186,6 +187,7 @@ QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::Registe d->m_listId = type.listId; d->m_allocationSize = type.objectSize; d->m_newFunc = type.create; + d->m_noCreationReason = type.noCreationReason; d->m_baseMetaObject = type.metaObject; d->m_attachedPropertiesFunc = type.attachedPropertiesFunction; d->m_attachedPropertiesType = type.attachedPropertiesMetaObject; @@ -389,6 +391,11 @@ QDeclarativeType::CreateFunc QDeclarativeType::createFunction() const return d->m_newFunc; } +QString QDeclarativeType::noCreationReason() const +{ + return d->m_noCreationReason; +} + int QDeclarativeType::createSize() const { return d->m_allocationSize; diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h index 70b7c90..bf6a700 100644 --- a/src/declarative/qml/qdeclarativemetatype_p.h +++ b/src/declarative/qml/qdeclarativemetatype_p.h @@ -123,6 +123,7 @@ public: bool isCreatable() const; bool isExtendedType() const; + QString noCreationReason() const; bool isInterface() const; int typeId() const; diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h index 6e240d8..e657dd5 100644 --- a/src/declarative/qml/qdeclarativeprivate.h +++ b/src/declarative/qml/qdeclarativeprivate.h @@ -184,6 +184,7 @@ namespace QDeclarativePrivate int listId; int objectSize; void (*create)(void *); + QString noCreationReason; const char *uri; int versionMajor; diff --git a/src/declarative/qml/qdeclarativetypenotavailable.cpp b/src/declarative/qml/qdeclarativetypenotavailable.cpp new file mode 100644 index 0000000..7a84732 --- /dev/null +++ b/src/declarative/qml/qdeclarativetypenotavailable.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2009 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 "qdeclarativetypenotavailable_p.h" + +int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message) +{ + return qmlRegisterUncreatableType(uri,versionMajor,versionMinor,qmlName,message); +} + +QDeclarativeTypeNotAvailable::QDeclarativeTypeNotAvailable() { } diff --git a/src/declarative/qml/qdeclarativetypenotavailable_p.h b/src/declarative/qml/qdeclarativetypenotavailable_p.h new file mode 100644 index 0000000..9c1c256 --- /dev/null +++ b/src/declarative/qml/qdeclarativetypenotavailable_p.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** 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 QDECLARATIVETYPENOTAVAILABLE_H +#define QDECLARATIVETYPENOTAVAILABLE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QDeclarativeTypeNotAvailable : public QObject { + Q_OBJECT +public: + QDeclarativeTypeNotAvailable(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QDeclarativeTypeNotAvailable) + +QT_END_HEADER + +#endif // QDECLARATIVETYPENOTAVAILABLE_H diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp index c5f6d6a..d4bb8ee 100644 --- a/src/declarative/qml/qdeclarativevaluetype.cpp +++ b/src/declarative/qml/qdeclarativevaluetype.cpp @@ -59,6 +59,8 @@ int qmlRegisterValueTypeEnums(const char *qmlName) qRegisterMetaType(pointerName.constData()), 0, 0, 0, + QString(), + "Qt", 4, 6, qmlName, &T::staticMetaObject, 0, 0, diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index c48662c..3848593 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -40,6 +40,7 @@ SOURCES += \ $$PWD/qdeclarativepropertycache.cpp \ $$PWD/qdeclarativenotifier.cpp \ $$PWD/qdeclarativeintegercache.cpp \ + $$PWD/qdeclarativetypenotavailable.cpp \ $$PWD/qdeclarativetypenamecache.cpp \ $$PWD/qdeclarativescriptstring.cpp \ $$PWD/qdeclarativeobjectscriptclass.cpp \ @@ -112,6 +113,7 @@ HEADERS += \ $$PWD/qdeclarativepropertycache_p.h \ $$PWD/qdeclarativenotifier_p.h \ $$PWD/qdeclarativeintegercache_p.h \ + $$PWD/qdeclarativetypenotavailable_p.h \ $$PWD/qdeclarativetypenamecache_p.h \ $$PWD/qdeclarativescriptstring.h \ $$PWD/qdeclarativeobjectscriptclass_p.h \ diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp index b9f1abb..ee72423 100644 --- a/src/declarative/util/qdeclarativeutilmodule.cpp +++ b/src/declarative/util/qdeclarativeutilmodule.cpp @@ -68,6 +68,8 @@ #include "private/qdeclarativetransitionmanager_p_p.h" #include "private/qdeclarativetransition_p.h" #include "qdeclarativeview.h" +#include "qdeclarativeinfo.h" +#include "private/qdeclarativetypenotavailable_p.h" #ifndef QT_NO_XMLPATTERNS #include "private/qdeclarativexmllistmodel_p.h" #endif @@ -103,7 +105,12 @@ void QDeclarativeUtilModule::defineModule() qmlRegisterType("Qt",4,6,"Timer"); qmlRegisterType("Qt",4,6,"Transition"); qmlRegisterType("Qt",4,6,"Vector3dAnimation"); -#ifndef QT_NO_XMLPATTERNS +#ifdef QT_NO_XMLPATTERNS + qmlRegisterTypeNotAvailable("Qt",4,6,"XmlListModel", + qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns")); + qmlRegisterTypeNotAvailable("Qt",4,6,"XmlRole", + qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns")); +#else qmlRegisterType("Qt",4,6,"XmlListModel"); qmlRegisterType("Qt",4,6,"XmlRole"); #endif @@ -112,12 +119,11 @@ void QDeclarativeUtilModule::defineModule() qmlRegisterType(); qmlRegisterType(); - qmlRegisterUncreatableType("Qt",4,6,"Animation"); + qmlRegisterUncreatableType("Qt",4,6,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class")); - qmlRegisterCustomType("Qt", 4,6, "ListModel", "QDeclarativeListModel", - new QDeclarativeListModelParser); - qmlRegisterCustomType("Qt", 4, 6, "PropertyChanges", "QDeclarativePropertyChanges", - new QDeclarativePropertyChangesParser); - qmlRegisterCustomType("Qt", 4, 6, "Connections", "QDeclarativeConnections", - new QDeclarativeConnectionsParser); + qmlRegisterCustomType("Qt", 4,6, "ListModel", new QDeclarativeListModelParser); + qmlRegisterCustomType("Qt", 4, 6, "PropertyChanges", new QDeclarativePropertyChangesParser); + qmlRegisterCustomType("Qt", 4, 6, "Connections", new QDeclarativeConnectionsParser); } + +#include "qdeclarativeutilmodule.moc" diff --git a/tests/auto/declarative/qdeclarativelanguage/data/noCreation.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.errors.txt new file mode 100644 index 0000000..23cd3f3 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.errors.txt @@ -0,0 +1 @@ +3:1:Keys is only available via attached properties diff --git a/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml new file mode 100644 index 0000000..0612fa2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml @@ -0,0 +1,4 @@ +import Qt 4.6 + +Keys { +} diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp index 623775a..5d87404 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.cpp @@ -52,8 +52,7 @@ void registerTypes() qmlRegisterType("Test",1,0,"MySecondNamespacedType"); qmlRegisterType(); - qmlRegisterCustomType("Test", 1, 0, "MyCustomParserType", "MyCustomParserType", - new MyCustomParserTypeParser); + qmlRegisterCustomType("Test", 1, 0, "MyCustomParserType", new MyCustomParserTypeParser); } QVariant myCustomVariantTypeConverter(const QString &data) diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 07fbf83..3d56d1f 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -330,6 +330,7 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("missingValueTypeProperty") << "missingValueTypeProperty.qml" << "missingValueTypeProperty.errors.txt" << false; QTest::newRow("objectValueTypeProperty") << "objectValueTypeProperty.qml" << "objectValueTypeProperty.errors.txt" << false; QTest::newRow("enumTypes") << "enumTypes.qml" << "enumTypes.errors.txt" << false; + QTest::newRow("noCreation") << "noCreation.qml" << "noCreation.errors.txt" << false; QTest::newRow("destroyedSignal") << "destroyedSignal.qml" << "destroyedSignal.errors.txt" << false; } diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 7b4706b..68940c7 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -1431,7 +1431,7 @@ void QDeclarativeViewer::registerTypes() if (!registered) { // registering only for exposing the DeviceOrientation::Orientation enum - qmlRegisterUncreatableType("Qt",4,6,"Orientation"); + qmlRegisterUncreatableType("Qt",4,6,"Orientation",""); registered = true; } } -- cgit v0.12 From d51a698f83e3b47f50c058105ac81467d9e48a32 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 20 Apr 2010 12:47:53 +1000 Subject: Fix test failure. --- .../qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp index cf7e357..831e318 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp +++ b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp @@ -222,7 +222,7 @@ void tst_qdeclarativexmllistmodel::roles() void tst_qdeclarativexmllistmodel::roleErrors() { QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleErrors.qml")); - QTest::ignoreMessage(QtWarningMsg, QString("QML XmlRole (" + QUrl::fromLocalFile(SRCDIR "/data/roleErrors.qml").toString() + ":6:5) An XmlRole query must not start with '/'").toUtf8().constData()); + QTest::ignoreMessage(QtWarningMsg, (QUrl::fromLocalFile(SRCDIR "/data/roleErrors.qml").toString() + ":6:5: QML XmlRole: An XmlRole query must not start with '/'").toUtf8().constData()); //### make sure we receive all expected warning messages. QDeclarativeXmlListModel *model = qobject_cast(component.create()); QVERIFY(model != 0); @@ -247,7 +247,7 @@ void tst_qdeclarativexmllistmodel::roleErrors() void tst_qdeclarativexmllistmodel::uniqueRoleNames() { QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/unique.qml")); - QTest::ignoreMessage(QtWarningMsg, QString("QML XmlRole (" + QUrl::fromLocalFile(SRCDIR "/data/unique.qml").toString() + ":7:5) \"name\" duplicates a previous role name and will be disabled.").toUtf8().constData()); + QTest::ignoreMessage(QtWarningMsg, (QUrl::fromLocalFile(SRCDIR "/data/unique.qml").toString() + ":7:5: QML XmlRole: \"name\" duplicates a previous role name and will be disabled.").toUtf8().constData()); QDeclarativeXmlListModel *model = qobject_cast(component.create()); QVERIFY(model != 0); QTRY_COMPARE(model->count(), 9); -- cgit v0.12 From acdd79ab5c16a7f0f9d4b7335b06f56873ee3324 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 20 Apr 2010 13:06:27 +1000 Subject: Create doc pages for QML focus and minehunt examples. Link to declarative examples from Qt's examples page. --- doc/src/declarative/declarativeui.qdoc | 2 +- doc/src/declarative/examples.qdoc | 34 ++++++++--------- doc/src/declarative/qdeclarativereference.qdoc | 4 +- doc/src/examples/qml-focus.qdoc | 49 +++++++++++++++++++++++++ doc/src/examples/qml-minehunt.qdoc | 49 +++++++++++++++++++++++++ doc/src/getting-started/examples.qdoc | 17 +++++++-- doc/src/images/qml-focus-example.png | Bin 0 -> 26833 bytes doc/src/images/qml-minehunt-example.png | Bin 0 -> 170648 bytes 8 files changed, 132 insertions(+), 23 deletions(-) create mode 100644 doc/src/examples/qml-focus.qdoc create mode 100644 doc/src/examples/qml-minehunt.qdoc create mode 100644 doc/src/images/qml-focus-example.png create mode 100644 doc/src/images/qml-minehunt-example.png diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index a2a5283..55945e6 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -75,7 +75,7 @@ completely new applications. QML is fully \l {Extending QML in C++}{extensible \o \l {Introduction to the QML language} \o \l {QML Tutorial}{Tutorial: 'Hello World'} \o \l {QML Advanced Tutorial}{Tutorial: 'Same Game'} -\o \l {QML Examples and Walkthroughs} +\o \l {QML Examples and Demos} \o \l {Using QML in C++ Applications} \o \l {QML for Qt programmers} \endlist diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc index 3d8325e..8e28e59 100644 --- a/doc/src/declarative/examples.qdoc +++ b/doc/src/declarative/examples.qdoc @@ -41,18 +41,22 @@ /*! \page qdeclarativeexamples.html -\title QML Examples and Walkthroughs +\title QML Examples and Demos -\section1 Running Examples and Demos +\previouspage Graphics View Examples +\contentspage Qt Examples +\nextpage Painting Examples + +\section1 Running the examples You can find many simple examples in the \c examples/declarative sub-directory that show how to use various aspects of QML. In addition, the \c demos/declarative sub-directory contains more sophisticated demos of large applications. These demos are intended to show integrated functionality -rather than being instructive on specifice elements. +rather than being instructive on specific elements. -To run the examples and demos, use the included \l {Qt Declarative UI Runtime}{qml} -application. It has some useful options, revealed by: +To run the examples and demos, you can use Qt Creator or the included \l {Qt Declarative UI Runtime}{qml} +command-line application. It has some useful options, revealed by: \code bin/qml -help @@ -66,18 +70,14 @@ For example, from your build directory, run: \section1 Examples -These will be documented, and demonstrate how to achieve various things in QML. +\list +\o \l{declarative/focus}{Focus} +\endlist + +\section1 Demos -\table -\row - \o Elastic Dial - \o \image dial-example.gif -\row - \o \l{qdeclarativeexampletoggleswitch.html}{Toggle Switch} - \o \image switch-example.gif -\row - \o \l{QML Advanced Tutorial}{SameGame} - \o \image declarative-adv-tutorial4.gif -\endtable +\list +\o \l{demos/declarative/minehunt}{Minehunt} +\endlist */ diff --git a/doc/src/declarative/qdeclarativereference.qdoc b/doc/src/declarative/qdeclarativereference.qdoc index b2cfba8..4c1f449 100644 --- a/doc/src/declarative/qdeclarativereference.qdoc +++ b/doc/src/declarative/qdeclarativereference.qdoc @@ -55,7 +55,7 @@ That is, you specify \e what the UI should look like and how it should behave rather than specifying step-by-step \e how to build it. Specifying a UI declaratively does not just include the layout of the interface items, but also the way each - individual item looks and behaves and the overall flow of the application. + individual item looks and behaves and the overall flow of the application. The QML elements provide a sophisticated set of graphical and behavioral building blocks. These different elements are combined together in \l {QML Documents}{QML documents} to build components @@ -67,7 +67,7 @@ \o \l {Introduction to the QML language} \o \l {QML Tutorial}{Tutorial: 'Hello World'} \o \l {QML Advanced Tutorial}{Advanced Tutorial: 'Same Game'} - \o \l {QML Examples and Walkthroughs} + \o \l {QML Examples and Demos} \endlist \section1 Core QML Features: diff --git a/doc/src/examples/qml-focus.qdoc b/doc/src/examples/qml-focus.qdoc new file mode 100644 index 0000000..92d93b2 --- /dev/null +++ b/doc/src/examples/qml-focus.qdoc @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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 documentation 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$ +** +****************************************************************************/ + +/*! + \title Focus + \example declarative/focus + + This example shows how to handle keys and focus in QML. + + \image qml-focus-example.png +*/ diff --git a/doc/src/examples/qml-minehunt.qdoc b/doc/src/examples/qml-minehunt.qdoc new file mode 100644 index 0000000..773f216 --- /dev/null +++ b/doc/src/examples/qml-minehunt.qdoc @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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 documentation 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$ +** +****************************************************************************/ + +/*! + \title Minehunt + \example demos/declarative/minehunt + + This demo shows how to create a simple Minehunt game with QML and C++. + + \image qml-minehunt-example.png +*/ diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 885e96c..9ddafc4 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -151,6 +151,17 @@ classes. \clearfloat + \section1 \l{QML Examples and Demos}{Declarative} + \beginfloatleft + \l{QML Examples and Demos}{\inlineimage declarative-examples.png + } + + \endfloat + The Qt Declarative module provides a declarative framework for building + highly dynamic, custom user interfaces. + classes. + + \clearfloat \section1 \l{Painting Examples}{Painting} \beginfloatleft \l{Painting Examples}{\inlineimage painting-examples.png @@ -626,7 +637,7 @@ \previouspage Item Views Examples \contentspage Qt Examples - \nextpage Painting Examples + \nextpage QML Examples and Demos \image graphicsview-examples.png @@ -669,7 +680,7 @@ \page examples-painting.html \title Painting Examples - \previouspage Graphics View Examples + \previouspage QML Examples and Demos \contentspage Qt Examples \nextpage Rich Text Examples @@ -1323,7 +1334,7 @@ \o \l{dbus/complexpingpong}{Complex Ping Pong} \o \l{dbus/listnames}{List Names} \o \l{dbus/pingpong}{Ping Pong} - \o \l{dbus/remotecontrolledcar}{Remote Controlled Car} + \o \l{dbus/remotecontrolledcar}{Remote Controlled Car} \endlist Examples marked with an asterisk (*) are fully documented. diff --git a/doc/src/images/qml-focus-example.png b/doc/src/images/qml-focus-example.png new file mode 100644 index 0000000..5a114a0 Binary files /dev/null and b/doc/src/images/qml-focus-example.png differ diff --git a/doc/src/images/qml-minehunt-example.png b/doc/src/images/qml-minehunt-example.png new file mode 100644 index 0000000..3b69569 Binary files /dev/null and b/doc/src/images/qml-minehunt-example.png differ -- cgit v0.12 From 00750a0184494a171b27492bb8b7933cba092ddc Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 20 Apr 2010 13:10:14 +1000 Subject: Add .qmlproject files for declarative demos. --- demos/declarative/calculator/calculator.qmlproject | 16 ++++++++++++++++ demos/declarative/demos.qmlproject | 16 ++++++++++++++++ demos/declarative/flickr/flickr.qmlproject | 16 ++++++++++++++++ demos/declarative/minehunt/minehunt.qmlproject | 16 ++++++++++++++++ demos/declarative/photoviewer/photoviewer.qmlproject | 16 ++++++++++++++++ demos/declarative/samegame/samegame.qmlproject | 16 ++++++++++++++++ demos/declarative/snake/snake.qmlproject | 16 ++++++++++++++++ demos/declarative/twitter/twitter.qmlproject | 16 ++++++++++++++++ demos/declarative/webbrowser/webbrowser.qmlproject | 16 ++++++++++++++++ 9 files changed, 144 insertions(+) create mode 100644 demos/declarative/calculator/calculator.qmlproject create mode 100644 demos/declarative/demos.qmlproject create mode 100644 demos/declarative/flickr/flickr.qmlproject create mode 100644 demos/declarative/minehunt/minehunt.qmlproject create mode 100644 demos/declarative/photoviewer/photoviewer.qmlproject create mode 100644 demos/declarative/samegame/samegame.qmlproject create mode 100644 demos/declarative/snake/snake.qmlproject create mode 100644 demos/declarative/twitter/twitter.qmlproject create mode 100644 demos/declarative/webbrowser/webbrowser.qmlproject diff --git a/demos/declarative/calculator/calculator.qmlproject b/demos/declarative/calculator/calculator.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/demos/declarative/calculator/calculator.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/demos/declarative/demos.qmlproject b/demos/declarative/demos.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/demos/declarative/demos.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/demos/declarative/flickr/flickr.qmlproject b/demos/declarative/flickr/flickr.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/demos/declarative/flickr/flickr.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/demos/declarative/minehunt/minehunt.qmlproject b/demos/declarative/minehunt/minehunt.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/demos/declarative/minehunt/minehunt.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/demos/declarative/photoviewer/photoviewer.qmlproject b/demos/declarative/photoviewer/photoviewer.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/demos/declarative/photoviewer/photoviewer.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/demos/declarative/samegame/samegame.qmlproject b/demos/declarative/samegame/samegame.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/demos/declarative/samegame/samegame.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/demos/declarative/snake/snake.qmlproject b/demos/declarative/snake/snake.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/demos/declarative/snake/snake.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/demos/declarative/twitter/twitter.qmlproject b/demos/declarative/twitter/twitter.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/demos/declarative/twitter/twitter.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/demos/declarative/webbrowser/webbrowser.qmlproject b/demos/declarative/webbrowser/webbrowser.qmlproject new file mode 100644 index 0000000..d4909f8 --- /dev/null +++ b/demos/declarative/webbrowser/webbrowser.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} -- cgit v0.12 From 1cfa7484cf2b7f42b929bd26c77f3d74f1bc9509 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 20 Apr 2010 13:15:56 +1000 Subject: Image for declarative examples. --- doc/src/images/declarative-examples.png | Bin 0 -> 39074 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/src/images/declarative-examples.png diff --git a/doc/src/images/declarative-examples.png b/doc/src/images/declarative-examples.png new file mode 100644 index 0000000..913dfac Binary files /dev/null and b/doc/src/images/declarative-examples.png differ -- cgit v0.12 From a604d769b02c658e992548c09003eae4a613bb27 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 20 Apr 2010 13:30:01 +1000 Subject: Doc QTBUG-9457 --- doc/src/declarative/globalobject.qdoc | 76 +++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index 97f5d91..c41c344 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -286,11 +286,79 @@ of their use. been loaded, and so it is safe to use createQmlObject to load built-in components. -\section1 Asynchronous JavaScript and XML -QML script supports the XMLHttpRequest object, which can be used to asynchronously obtain data from over a network. -\section2 XMLHttpRequest() -In QML you can construct an XMLHttpRequest object just like in a web browser! TODO: Real documentation for this object. +\section1 XMLHttpRequest +QML script supports the XMLHttpRequest object, which can be used to asynchronously obtain +data from over a network. + +The XMLHttpRequest API implements the same \l {http://www.w3.org/TR/XMLHttpRequest/}{W3C standard} +as many popular web browsers with following exceptions: +\list +\i QML's XMLHttpRequest does not enforce the same origin policty. +\i QML's XMLHttpRequest does not support \e synchronous requests. +\endlist + +Additionally, the \c responseXML XML DOM tree currently supported by QML is a reduced subset +of the \l {http://www.w3.org/TR/DOM-Level-3-Core/}{DOM Level 3 Core} API supported in a web +browser. The following objects and properties are supported by the QML implementation: + +\table +\header +\o \bold {Node} +\o \bold {Document} +\o \bold {Element} +\o \bold {Attr} +\o \bold {CharacterData} +\o \bold {Text} + +\row +\o +\list +\o nodeName +\o nodeValue +\o nodeType +\o parentNode +\o childNodes +\o firstChild +\o lastChild +\o previousSibling +\o nextSibling +\o attribtes +\endlist + +\o +\list +\o xmlVersion +\o xmlEncoding +\o xmlStandalone +\o documentElement +\endlist + +\o +\list +\o tagName +\endlist + +\o +\list +\o name +\o value +\o ownerElement +\endlist + +\o +\list +\o data +\o length +\endlist + +\o +\list +\o isElementContentWhitespace +\o wholeText +\endlist + +\endtable \section1 Offline Storage API -- cgit v0.12 From b86087963b7b45c2970c612322b2d0425ac7cda3 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Tue, 20 Apr 2010 12:25:14 +1000 Subject: Regenerate recordsnapshot to fix fillmode visual test in qml Reviewed-by: Michael Brasser --- .../qmlvisual/fillmode/data/fillmode.0.png | Bin 26099 -> 28886 bytes .../qmlvisual/fillmode/data/fillmode.qml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.0.png b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.0.png index 9c9ceae..02fa5c9 100644 Binary files a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.0.png and b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.0.png differ diff --git a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml index 08ed609..1dc2d29 100644 --- a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml +++ b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml @@ -7,5 +7,5 @@ VisualTest { Frame { msec: 16 image: "fillmode.0.png" - } + } } -- cgit v0.12 From caeb2d433189a500ad52c66ed1eb0d46a4723988 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 20 Apr 2010 13:45:04 +1000 Subject: Complete tst_qdeclarativedom::position autotest QTBUG-10036 --- tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp index 1f0c47c..a951827 100644 --- a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp +++ b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp @@ -1303,7 +1303,8 @@ void tst_qdeclarativedom::position() QCOMPARE(child2Value.length(), 6); // All QDeclarativeDomList - qWarning("QDeclarativeListValue position test required"); + QCOMPARE(childrenList.position(), 189); + QCOMPARE(childrenList.length(), 18); } QTEST_MAIN(tst_qdeclarativedom) -- cgit v0.12 From ddb4f7dfb6ca8d9c730ea2a610f53e03b76c9dde Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 20 Apr 2010 13:51:45 +1000 Subject: Compile --- src/declarative/util/qdeclarativeutilmodule.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp index ee72423..0611093 100644 --- a/src/declarative/util/qdeclarativeutilmodule.cpp +++ b/src/declarative/util/qdeclarativeutilmodule.cpp @@ -125,5 +125,3 @@ void QDeclarativeUtilModule::defineModule() qmlRegisterCustomType("Qt", 4, 6, "PropertyChanges", new QDeclarativePropertyChangesParser); qmlRegisterCustomType("Qt", 4, 6, "Connections", new QDeclarativeConnectionsParser); } - -#include "qdeclarativeutilmodule.moc" -- cgit v0.12 From f191091ab38b0c06d0f3d13d71ec45ec877f18fe Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 20 Apr 2010 12:46:17 +1000 Subject: Fix AnchorChanges to work with parent.right. "parent" needs to be evaluated with the AnchorChanges target as the scope object. Task-number: QTBUG-5338 --- .../util/qdeclarativepropertychanges.cpp | 4 +- src/declarative/util/qdeclarativestate.cpp | 4 +- src/declarative/util/qdeclarativestate_p.h | 6 +- .../util/qdeclarativestateoperations.cpp | 516 +++++++++++++-------- .../util/qdeclarativestateoperations_p.h | 52 +-- .../util/qdeclarativetransitionmanager.cpp | 5 +- .../qdeclarativestates/tst_qdeclarativestates.cpp | 39 +- 7 files changed, 385 insertions(+), 241 deletions(-) diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 9c3ee9f..8a6937d 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -159,12 +159,12 @@ public: QDeclarativeExpression *rewindExpression; QDeclarativeGuard ownedExpression; - virtual void execute() { + virtual void execute(Reason) { ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, expression); } virtual bool isReversable() { return true; } - virtual void reverse() { + virtual void reverse(Reason) { ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression); } diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp index 78813fa..684f527 100644 --- a/src/declarative/util/qdeclarativestate.cpp +++ b/src/declarative/util/qdeclarativestate.cpp @@ -95,7 +95,7 @@ QString QDeclarativeActionEvent::typeName() const return QString(); } -void QDeclarativeActionEvent::execute() +void QDeclarativeActionEvent::execute(Reason) { } @@ -104,7 +104,7 @@ bool QDeclarativeActionEvent::isReversable() return false; } -void QDeclarativeActionEvent::reverse() +void QDeclarativeActionEvent::reverse(Reason) { } diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h index 472897e..0ba67b0 100644 --- a/src/declarative/util/qdeclarativestate_p.h +++ b/src/declarative/util/qdeclarativestate_p.h @@ -90,9 +90,11 @@ public: virtual ~QDeclarativeActionEvent(); virtual QString typeName() const; - virtual void execute(); + enum Reason { ActualChange, FastForward }; + + virtual void execute(Reason reason = ActualChange); virtual bool isReversable(); - virtual void reverse(); + virtual void reverse(Reason reason = ActualChange); virtual void saveOriginals() {} virtual void copyOriginals(QDeclarativeActionEvent *) {} diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 082a869..8f22de5 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -50,6 +50,8 @@ #include #include #include "private/qdeclarativecontext_p.h" +#include "private/qdeclarativeproperty_p.h" +#include "private/qdeclarativebinding_p.h" #include #include @@ -86,7 +88,6 @@ public: void QDeclarativeParentChangePrivate::doChange(QDeclarativeItem *targetParent, QDeclarativeItem *stackBefore) { if (targetParent && target && target->parentItem()) { - //### for backwards direction, can we just restore original x, y, scale, rotation Q_Q(QDeclarativeParentChange); bool ok; const QTransform &transform = target->parentItem()->itemTransform(targetParent, &ok); @@ -415,7 +416,7 @@ void QDeclarativeParentChange::copyOriginals(QDeclarativeActionEvent *other) saveCurrentValues(); } -void QDeclarativeParentChange::execute() +void QDeclarativeParentChange::execute(Reason) { Q_D(QDeclarativeParentChange); d->doChange(d->parent); @@ -426,7 +427,7 @@ bool QDeclarativeParentChange::isReversable() return true; } -void QDeclarativeParentChange::reverse() +void QDeclarativeParentChange::reverse(Reason) { Q_D(QDeclarativeParentChange); d->doChange(d->origParent, d->origStackBefore); @@ -566,7 +567,7 @@ void QDeclarativeStateChangeScript::setName(const QString &n) d->name = n; } -void QDeclarativeStateChangeScript::execute() +void QDeclarativeStateChangeScript::execute(Reason) { Q_D(QDeclarativeStateChangeScript); const QString &script = d->script.script(); @@ -639,13 +640,13 @@ public: QDeclarativeItem *fill; QDeclarativeItem *centerIn; - QDeclarativeAnchorLine left; - QDeclarativeAnchorLine right; - QDeclarativeAnchorLine top; - QDeclarativeAnchorLine bottom; - QDeclarativeAnchorLine vCenter; - QDeclarativeAnchorLine hCenter; - QDeclarativeAnchorLine baseline; + QDeclarativeScriptString leftScript; + QDeclarativeScriptString rightScript; + QDeclarativeScriptString topScript; + QDeclarativeScriptString bottomScript; + QDeclarativeScriptString hCenterScript; + QDeclarativeScriptString vCenterScript; + QDeclarativeScriptString baselineScript; /*qreal leftMargin; qreal rightMargin; @@ -666,150 +667,164 @@ QDeclarativeAnchorSet::~QDeclarativeAnchorSet() { } -QDeclarativeAnchorLine QDeclarativeAnchorSet::top() const +QDeclarativeScriptString QDeclarativeAnchorSet::top() const { Q_D(const QDeclarativeAnchorSet); - return d->top; + return d->topScript; } -void QDeclarativeAnchorSet::setTop(const QDeclarativeAnchorLine &edge) +void QDeclarativeAnchorSet::setTop(const QDeclarativeScriptString &edge) { Q_D(QDeclarativeAnchorSet); d->usedAnchors |= QDeclarativeAnchors::TopAnchor; - d->top = edge; + d->topScript = edge; + if (edge.script() == QLatin1String("undefined")) + resetTop(); } void QDeclarativeAnchorSet::resetTop() { Q_D(QDeclarativeAnchorSet); d->usedAnchors &= ~QDeclarativeAnchors::TopAnchor; - d->top = QDeclarativeAnchorLine(); + d->topScript = QDeclarativeScriptString(); d->resetAnchors |= QDeclarativeAnchors::TopAnchor; } -QDeclarativeAnchorLine QDeclarativeAnchorSet::bottom() const +QDeclarativeScriptString QDeclarativeAnchorSet::bottom() const { Q_D(const QDeclarativeAnchorSet); - return d->bottom; + return d->bottomScript; } -void QDeclarativeAnchorSet::setBottom(const QDeclarativeAnchorLine &edge) +void QDeclarativeAnchorSet::setBottom(const QDeclarativeScriptString &edge) { Q_D(QDeclarativeAnchorSet); d->usedAnchors |= QDeclarativeAnchors::BottomAnchor; - d->bottom = edge; + d->bottomScript = edge; + if (edge.script() == QLatin1String("undefined")) + resetBottom(); } void QDeclarativeAnchorSet::resetBottom() { Q_D(QDeclarativeAnchorSet); d->usedAnchors &= ~QDeclarativeAnchors::BottomAnchor; - d->bottom = QDeclarativeAnchorLine(); + d->bottomScript = QDeclarativeScriptString(); d->resetAnchors |= QDeclarativeAnchors::BottomAnchor; } -QDeclarativeAnchorLine QDeclarativeAnchorSet::verticalCenter() const +QDeclarativeScriptString QDeclarativeAnchorSet::verticalCenter() const { Q_D(const QDeclarativeAnchorSet); - return d->vCenter; + return d->vCenterScript; } -void QDeclarativeAnchorSet::setVerticalCenter(const QDeclarativeAnchorLine &edge) +void QDeclarativeAnchorSet::setVerticalCenter(const QDeclarativeScriptString &edge) { Q_D(QDeclarativeAnchorSet); d->usedAnchors |= QDeclarativeAnchors::VCenterAnchor; - d->vCenter = edge; + d->vCenterScript = edge; + if (edge.script() == QLatin1String("undefined")) + resetVerticalCenter(); } void QDeclarativeAnchorSet::resetVerticalCenter() { Q_D(QDeclarativeAnchorSet); d->usedAnchors &= ~QDeclarativeAnchors::VCenterAnchor; - d->vCenter = QDeclarativeAnchorLine(); + d->vCenterScript = QDeclarativeScriptString(); d->resetAnchors |= QDeclarativeAnchors::VCenterAnchor; } -QDeclarativeAnchorLine QDeclarativeAnchorSet::baseline() const +QDeclarativeScriptString QDeclarativeAnchorSet::baseline() const { Q_D(const QDeclarativeAnchorSet); - return d->baseline; + return d->baselineScript; } -void QDeclarativeAnchorSet::setBaseline(const QDeclarativeAnchorLine &edge) +void QDeclarativeAnchorSet::setBaseline(const QDeclarativeScriptString &edge) { Q_D(QDeclarativeAnchorSet); d->usedAnchors |= QDeclarativeAnchors::BaselineAnchor; - d->baseline = edge; + d->baselineScript = edge; + if (edge.script() == QLatin1String("undefined")) + resetBaseline(); } void QDeclarativeAnchorSet::resetBaseline() { Q_D(QDeclarativeAnchorSet); d->usedAnchors &= ~QDeclarativeAnchors::BaselineAnchor; - d->baseline = QDeclarativeAnchorLine(); + d->baselineScript = QDeclarativeScriptString(); d->resetAnchors |= QDeclarativeAnchors::BaselineAnchor; } -QDeclarativeAnchorLine QDeclarativeAnchorSet::left() const +QDeclarativeScriptString QDeclarativeAnchorSet::left() const { Q_D(const QDeclarativeAnchorSet); - return d->left; + return d->leftScript; } -void QDeclarativeAnchorSet::setLeft(const QDeclarativeAnchorLine &edge) +void QDeclarativeAnchorSet::setLeft(const QDeclarativeScriptString &edge) { Q_D(QDeclarativeAnchorSet); d->usedAnchors |= QDeclarativeAnchors::LeftAnchor; - d->left = edge; + d->leftScript = edge; + if (edge.script() == QLatin1String("undefined")) + resetLeft(); } void QDeclarativeAnchorSet::resetLeft() { Q_D(QDeclarativeAnchorSet); d->usedAnchors &= ~QDeclarativeAnchors::LeftAnchor; - d->left = QDeclarativeAnchorLine(); + d->leftScript = QDeclarativeScriptString(); d->resetAnchors |= QDeclarativeAnchors::LeftAnchor; } -QDeclarativeAnchorLine QDeclarativeAnchorSet::right() const +QDeclarativeScriptString QDeclarativeAnchorSet::right() const { Q_D(const QDeclarativeAnchorSet); - return d->right; + return d->rightScript; } -void QDeclarativeAnchorSet::setRight(const QDeclarativeAnchorLine &edge) +void QDeclarativeAnchorSet::setRight(const QDeclarativeScriptString &edge) { Q_D(QDeclarativeAnchorSet); d->usedAnchors |= QDeclarativeAnchors::RightAnchor; - d->right = edge; + d->rightScript = edge; + if (edge.script() == QLatin1String("undefined")) + resetRight(); } void QDeclarativeAnchorSet::resetRight() { Q_D(QDeclarativeAnchorSet); d->usedAnchors &= ~QDeclarativeAnchors::RightAnchor; - d->right = QDeclarativeAnchorLine(); + d->rightScript = QDeclarativeScriptString(); d->resetAnchors |= QDeclarativeAnchors::RightAnchor; } -QDeclarativeAnchorLine QDeclarativeAnchorSet::horizontalCenter() const +QDeclarativeScriptString QDeclarativeAnchorSet::horizontalCenter() const { Q_D(const QDeclarativeAnchorSet); - return d->hCenter; + return d->hCenterScript; } -void QDeclarativeAnchorSet::setHorizontalCenter(const QDeclarativeAnchorLine &edge) +void QDeclarativeAnchorSet::setHorizontalCenter(const QDeclarativeScriptString &edge) { Q_D(QDeclarativeAnchorSet); d->usedAnchors |= QDeclarativeAnchors::HCenterAnchor; - d->hCenter = edge; + d->hCenterScript = edge; + if (edge.script() == QLatin1String("undefined")) + resetHorizontalCenter(); } void QDeclarativeAnchorSet::resetHorizontalCenter() { Q_D(QDeclarativeAnchorSet); d->usedAnchors &= ~QDeclarativeAnchors::HCenterAnchor; - d->hCenter = QDeclarativeAnchorLine(); + d->hCenterScript = QDeclarativeScriptString(); d->resetAnchors |= QDeclarativeAnchors::HCenterAnchor; } @@ -852,19 +867,35 @@ class QDeclarativeAnchorChangesPrivate : public QObjectPrivate { public: QDeclarativeAnchorChangesPrivate() - : target(0), anchorSet(new QDeclarativeAnchorSet) {} + : target(0), anchorSet(new QDeclarativeAnchorSet), + leftBinding(0), rightBinding(0), hCenterBinding(0), + topBinding(0), bottomBinding(0), vCenterBinding(0), baselineBinding(0), + origLeftBinding(0), origRightBinding(0), origHCenterBinding(0), + origTopBinding(0), origBottomBinding(0), origVCenterBinding(0), + origBaselineBinding(0) + { + + } ~QDeclarativeAnchorChangesPrivate() { delete anchorSet; } QDeclarativeItem *target; QDeclarativeAnchorSet *anchorSet; - QDeclarativeAnchorLine origLeft; - QDeclarativeAnchorLine origRight; - QDeclarativeAnchorLine origHCenter; - QDeclarativeAnchorLine origTop; - QDeclarativeAnchorLine origBottom; - QDeclarativeAnchorLine origVCenter; - QDeclarativeAnchorLine origBaseline; + QDeclarativeBinding *leftBinding; + QDeclarativeBinding *rightBinding; + QDeclarativeBinding *hCenterBinding; + QDeclarativeBinding *topBinding; + QDeclarativeBinding *bottomBinding; + QDeclarativeBinding *vCenterBinding; + QDeclarativeBinding *baselineBinding; + + QDeclarativeAbstractBinding *origLeftBinding; + QDeclarativeAbstractBinding *origRightBinding; + QDeclarativeAbstractBinding *origHCenterBinding; + QDeclarativeAbstractBinding *origTopBinding; + QDeclarativeAbstractBinding *origBottomBinding; + QDeclarativeAbstractBinding *origVCenterBinding; + QDeclarativeAbstractBinding *origBaselineBinding; QDeclarativeAnchorLine rewindLeft; QDeclarativeAnchorLine rewindRight; @@ -896,6 +927,16 @@ public: bool applyOrigBottom; bool applyOrigVCenter; bool applyOrigBaseline; + + QList oldBindings; + + QDeclarativeProperty leftProp; + QDeclarativeProperty rightProp; + QDeclarativeProperty hCenterProp; + QDeclarativeProperty topProp; + QDeclarativeProperty bottomProp; + QDeclarativeProperty vCenterProp; + QDeclarativeProperty baselineProp; }; /*! @@ -914,6 +955,47 @@ QDeclarativeAnchorChanges::~QDeclarativeAnchorChanges() QDeclarativeAnchorChanges::ActionList QDeclarativeAnchorChanges::actions() { + Q_D(QDeclarativeAnchorChanges); + d->leftBinding = d->rightBinding = d->hCenterBinding = d->topBinding + = d->bottomBinding = d->vCenterBinding = d->baselineBinding = 0; + + d->leftProp = QDeclarativeProperty(d->target, QLatin1String("anchors.left")); + d->rightProp = QDeclarativeProperty(d->target, QLatin1String("anchors.right")); + d->hCenterProp = QDeclarativeProperty(d->target, QLatin1String("anchors.horizontalCenter")); + d->topProp = QDeclarativeProperty(d->target, QLatin1String("anchors.top")); + d->bottomProp = QDeclarativeProperty(d->target, QLatin1String("anchors.bottom")); + d->vCenterProp = QDeclarativeProperty(d->target, QLatin1String("anchors.verticalCenter")); + d->baselineProp = QDeclarativeProperty(d->target, QLatin1String("anchors.baseline")); + + if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::LeftAnchor) { + d->leftBinding = new QDeclarativeBinding(d->anchorSet->d_func()->leftScript.script(), d->target, qmlContext(this)); + d->leftBinding->setTarget(d->leftProp); + } + if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::RightAnchor) { + d->rightBinding = new QDeclarativeBinding(d->anchorSet->d_func()->rightScript.script(), d->target, qmlContext(this)); + d->rightBinding->setTarget(d->rightProp); + } + if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::HCenterAnchor) { + d->hCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->hCenterScript.script(), d->target, qmlContext(this)); + d->hCenterBinding->setTarget(d->hCenterProp); + } + if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::TopAnchor) { + d->topBinding = new QDeclarativeBinding(d->anchorSet->d_func()->topScript.script(), d->target, qmlContext(this)); + d->topBinding->setTarget(d->topProp); + } + if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::BottomAnchor) { + d->bottomBinding = new QDeclarativeBinding(d->anchorSet->d_func()->bottomScript.script(), d->target, qmlContext(this)); + d->bottomBinding->setTarget(d->bottomProp); + } + if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::VCenterAnchor) { + d->vCenterBinding = new QDeclarativeBinding(d->anchorSet->d_func()->vCenterScript.script(), d->target, qmlContext(this)); + d->vCenterBinding->setTarget(d->vCenterProp); + } + if (d->anchorSet->d_func()->usedAnchors & QDeclarativeAnchors::BaselineAnchor) { + d->baselineBinding = new QDeclarativeBinding(d->anchorSet->d_func()->baselineScript.script(), d->target, qmlContext(this)); + d->baselineBinding->setTarget(d->baselineProp); + } + QDeclarativeAction a; a.event = this; return ActionList() << a; @@ -958,59 +1040,104 @@ void QDeclarativeAnchorChanges::setObject(QDeclarativeItem *target) \endqml */ -void QDeclarativeAnchorChanges::execute() +void QDeclarativeAnchorChanges::execute(Reason reason) { Q_D(QDeclarativeAnchorChanges); if (!d->target) return; //incorporate any needed "reverts" - if (d->applyOrigLeft) - d->target->anchors()->setLeft(d->origLeft); - if (d->applyOrigRight) - d->target->anchors()->setRight(d->origRight); - if (d->applyOrigHCenter) - d->target->anchors()->setHorizontalCenter(d->origHCenter); - if (d->applyOrigTop) - d->target->anchors()->setTop(d->origTop); - if (d->applyOrigBottom) - d->target->anchors()->setBottom(d->origBottom); - if (d->applyOrigVCenter) - d->target->anchors()->setVerticalCenter(d->origVCenter); - if (d->applyOrigBaseline) - d->target->anchors()->setBaseline(d->origBaseline); - - //reset any anchors that have been specified - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::LeftAnchor) + if (d->applyOrigLeft) { + if (!d->origLeftBinding) + d->target->anchors()->resetLeft(); + QDeclarativePropertyPrivate::setBinding(d->leftProp, d->origLeftBinding); + } + if (d->applyOrigRight) { + if (!d->origRightBinding) + d->target->anchors()->resetRight(); + QDeclarativePropertyPrivate::setBinding(d->rightProp, d->origRightBinding); + } + if (d->applyOrigHCenter) { + if (!d->origHCenterBinding) + d->target->anchors()->resetHorizontalCenter(); + QDeclarativePropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding); + } + if (d->applyOrigTop) { + if (!d->origTopBinding) + d->target->anchors()->resetTop(); + QDeclarativePropertyPrivate::setBinding(d->topProp, d->origTopBinding); + } + if (d->applyOrigBottom) { + if (!d->origBottomBinding) + d->target->anchors()->resetBottom(); + QDeclarativePropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding); + } + if (d->applyOrigVCenter) { + if (!d->origVCenterBinding) + d->target->anchors()->resetVerticalCenter(); + QDeclarativePropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding); + } + if (d->applyOrigBaseline) { + if (!d->origBaselineBinding) + d->target->anchors()->resetBaseline(); + QDeclarativePropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding); + } + + //destroy old bindings + if (reason == ActualChange) { + for (int i = 0; i < d->oldBindings.size(); ++i) { + QDeclarativeAbstractBinding *binding = d->oldBindings.at(i); + if (binding) + binding->destroy(); + } + d->oldBindings.clear(); + } + + //reset any anchors that have been specified as "undefined" + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::LeftAnchor) { d->target->anchors()->resetLeft(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::RightAnchor) + QDeclarativePropertyPrivate::setBinding(d->leftProp, 0); + } + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::RightAnchor) { d->target->anchors()->resetRight(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::HCenterAnchor) + QDeclarativePropertyPrivate::setBinding(d->rightProp, 0); + } + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::HCenterAnchor) { d->target->anchors()->resetHorizontalCenter(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::TopAnchor) + QDeclarativePropertyPrivate::setBinding(d->hCenterProp, 0); + } + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::TopAnchor) { d->target->anchors()->resetTop(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BottomAnchor) + QDeclarativePropertyPrivate::setBinding(d->topProp, 0); + } + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BottomAnchor) { d->target->anchors()->resetBottom(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::VCenterAnchor) + QDeclarativePropertyPrivate::setBinding(d->bottomProp, 0); + } + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::VCenterAnchor) { d->target->anchors()->resetVerticalCenter(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BaselineAnchor) + QDeclarativePropertyPrivate::setBinding(d->vCenterProp, 0); + } + if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BaselineAnchor) { d->target->anchors()->resetBaseline(); + QDeclarativePropertyPrivate::setBinding(d->baselineProp, 0); + } //set any anchors that have been specified - if (d->anchorSet->d_func()->left.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setLeft(d->anchorSet->d_func()->left); - if (d->anchorSet->d_func()->right.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setRight(d->anchorSet->d_func()->right); - if (d->anchorSet->d_func()->hCenter.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setHorizontalCenter(d->anchorSet->d_func()->hCenter); - if (d->anchorSet->d_func()->top.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setTop(d->anchorSet->d_func()->top); - if (d->anchorSet->d_func()->bottom.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setBottom(d->anchorSet->d_func()->bottom); - if (d->anchorSet->d_func()->vCenter.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setVerticalCenter(d->anchorSet->d_func()->vCenter); - if (d->anchorSet->d_func()->baseline.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setBaseline(d->anchorSet->d_func()->baseline); + if (d->leftBinding) + QDeclarativePropertyPrivate::setBinding(d->leftBinding->property(), d->leftBinding); + if (d->rightBinding) + QDeclarativePropertyPrivate::setBinding(d->rightBinding->property(), d->rightBinding); + if (d->hCenterBinding) + QDeclarativePropertyPrivate::setBinding(d->hCenterBinding->property(), d->hCenterBinding); + if (d->topBinding) + QDeclarativePropertyPrivate::setBinding(d->topBinding->property(), d->topBinding); + if (d->bottomBinding) + QDeclarativePropertyPrivate::setBinding(d->bottomBinding->property(), d->bottomBinding); + if (d->vCenterBinding) + QDeclarativePropertyPrivate::setBinding(d->vCenterBinding->property(), d->vCenterBinding); + if (d->baselineBinding) + QDeclarativePropertyPrivate::setBinding(d->baselineBinding->property(), d->baselineBinding); } bool QDeclarativeAnchorChanges::isReversable() @@ -1018,43 +1145,78 @@ bool QDeclarativeAnchorChanges::isReversable() return true; } -void QDeclarativeAnchorChanges::reverse() +void QDeclarativeAnchorChanges::reverse(Reason reason) { Q_D(QDeclarativeAnchorChanges); if (!d->target) return; //reset any anchors set by the state - if (d->anchorSet->d_func()->left.anchorLine != QDeclarativeAnchorLine::Invalid) + if (d->leftBinding) { d->target->anchors()->resetLeft(); - if (d->anchorSet->d_func()->right.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->leftBinding->property(), 0); + if (reason == ActualChange) { + d->leftBinding->destroy(); d->leftBinding = 0; + } + } + if (d->rightBinding) { d->target->anchors()->resetRight(); - if (d->anchorSet->d_func()->hCenter.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->rightBinding->property(), 0); + if (reason == ActualChange) { + d->rightBinding->destroy(); d->rightBinding = 0; + } + } + if (d->hCenterBinding) { d->target->anchors()->resetHorizontalCenter(); - if (d->anchorSet->d_func()->top.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->hCenterBinding->property(), 0); + if (reason == ActualChange) { + d->hCenterBinding->destroy(); d->hCenterBinding = 0; + } + } + if (d->topBinding) { d->target->anchors()->resetTop(); - if (d->anchorSet->d_func()->bottom.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->topBinding->property(), 0); + if (reason == ActualChange) { + d->topBinding->destroy(); d->topBinding = 0; + } + } + if (d->bottomBinding) { d->target->anchors()->resetBottom(); - if (d->anchorSet->d_func()->vCenter.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->bottomBinding->property(), 0); + if (reason == ActualChange) { + d->bottomBinding->destroy(); d->bottomBinding = 0; + } + } + if (d->vCenterBinding) { d->target->anchors()->resetVerticalCenter(); - if (d->anchorSet->d_func()->baseline.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->vCenterBinding->property(), 0); + if (reason == ActualChange) { + d->vCenterBinding->destroy(); d->vCenterBinding = 0; + } + } + if (d->baselineBinding) { d->target->anchors()->resetBaseline(); + QDeclarativePropertyPrivate::setBinding(d->baselineBinding->property(), 0); + if (reason == ActualChange) { + d->baselineBinding->destroy(); d->baselineBinding = 0; + } + } //restore previous anchors - if (d->origLeft.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setLeft(d->origLeft); - if (d->origRight.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setRight(d->origRight); - if (d->origHCenter.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setHorizontalCenter(d->origHCenter); - if (d->origTop.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setTop(d->origTop); - if (d->origBottom.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setBottom(d->origBottom); - if (d->origVCenter.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setVerticalCenter(d->origVCenter); - if (d->origBaseline.anchorLine != QDeclarativeAnchorLine::Invalid) - d->target->anchors()->setBaseline(d->origBaseline); + if (d->origLeftBinding) + QDeclarativePropertyPrivate::setBinding(d->leftProp, d->origLeftBinding); + if (d->origRightBinding) + QDeclarativePropertyPrivate::setBinding(d->rightProp, d->origRightBinding); + if (d->origHCenterBinding) + QDeclarativePropertyPrivate::setBinding(d->hCenterProp, d->origHCenterBinding); + if (d->origTopBinding) + QDeclarativePropertyPrivate::setBinding(d->topProp, d->origTopBinding); + if (d->origBottomBinding) + QDeclarativePropertyPrivate::setBinding(d->bottomProp, d->origBottomBinding); + if (d->origVCenterBinding) + QDeclarativePropertyPrivate::setBinding(d->vCenterProp, d->origVCenterBinding); + if (d->origBaselineBinding) + QDeclarativePropertyPrivate::setBinding(d->baselineProp, d->origBaselineBinding); } QString QDeclarativeAnchorChanges::typeName() const @@ -1105,13 +1267,13 @@ void QDeclarativeAnchorChanges::saveOriginals() if (!d->target) return; - d->origLeft = d->target->anchors()->left(); - d->origRight = d->target->anchors()->right(); - d->origHCenter = d->target->anchors()->horizontalCenter(); - d->origTop = d->target->anchors()->top(); - d->origBottom = d->target->anchors()->bottom(); - d->origVCenter = d->target->anchors()->verticalCenter(); - d->origBaseline = d->target->anchors()->baseline(); + d->origLeftBinding = QDeclarativePropertyPrivate::binding(d->leftProp); + d->origRightBinding = QDeclarativePropertyPrivate::binding(d->rightProp); + d->origHCenterBinding = QDeclarativePropertyPrivate::binding(d->hCenterProp); + d->origTopBinding = QDeclarativePropertyPrivate::binding(d->topProp); + d->origBottomBinding = QDeclarativePropertyPrivate::binding(d->bottomProp); + d->origVCenterBinding = QDeclarativePropertyPrivate::binding(d->vCenterProp); + d->origBaselineBinding = QDeclarativePropertyPrivate::binding(d->baselineProp); d->applyOrigLeft = d->applyOrigRight = d->applyOrigHCenter = d->applyOrigTop = d->applyOrigBottom = d->applyOrigVCenter = d->applyOrigBaseline = false; @@ -1125,35 +1287,29 @@ void QDeclarativeAnchorChanges::copyOriginals(QDeclarativeActionEvent *other) QDeclarativeAnchorChanges *ac = static_cast(other); QDeclarativeAnchorChangesPrivate *acp = ac->d_func(); - //probably also need to revert some things - d->applyOrigLeft = (acp->anchorSet->d_func()->left.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::LeftAnchor); - - d->applyOrigRight = (acp->anchorSet->d_func()->right.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::RightAnchor); - - d->applyOrigHCenter = (acp->anchorSet->d_func()->hCenter.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::HCenterAnchor); + QDeclarativeAnchors::Anchors combined = acp->anchorSet->d_func()->usedAnchors | + acp->anchorSet->d_func()->resetAnchors; - d->applyOrigTop = (acp->anchorSet->d_func()->top.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::TopAnchor); - - d->applyOrigBottom = (acp->anchorSet->d_func()->bottom.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BottomAnchor); - - d->applyOrigVCenter = (acp->anchorSet->d_func()->vCenter.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::VCenterAnchor); - - d->applyOrigBaseline = (acp->anchorSet->d_func()->baseline.anchorLine != QDeclarativeAnchorLine::Invalid || - acp->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BaselineAnchor); - - d->origLeft = ac->d_func()->origLeft; - d->origRight = ac->d_func()->origRight; - d->origHCenter = ac->d_func()->origHCenter; - d->origTop = ac->d_func()->origTop; - d->origBottom = ac->d_func()->origBottom; - d->origVCenter = ac->d_func()->origVCenter; - d->origBaseline = ac->d_func()->origBaseline; + //probably also need to revert some things + d->applyOrigLeft = (combined & QDeclarativeAnchors::LeftAnchor); + d->applyOrigRight = (combined & QDeclarativeAnchors::RightAnchor); + d->applyOrigHCenter = (combined & QDeclarativeAnchors::HCenterAnchor); + d->applyOrigTop = (combined & QDeclarativeAnchors::TopAnchor); + d->applyOrigBottom = (combined & QDeclarativeAnchors::BottomAnchor); + d->applyOrigVCenter = (combined & QDeclarativeAnchors::VCenterAnchor); + d->applyOrigBaseline = (combined & QDeclarativeAnchors::BaselineAnchor); + + d->origLeftBinding = acp->origLeftBinding; + d->origRightBinding = acp->origRightBinding; + d->origHCenterBinding = acp->origHCenterBinding; + d->origTopBinding = acp->origTopBinding; + d->origBottomBinding = acp->origBottomBinding; + d->origVCenterBinding = acp->origVCenterBinding; + d->origBaselineBinding = acp->origBaselineBinding; + + d->oldBindings.clear(); + d->oldBindings << acp->leftBinding << acp->rightBinding << acp->hCenterBinding + << acp->topBinding << acp->bottomBinding << acp->baselineBinding; saveCurrentValues(); } @@ -1170,52 +1326,38 @@ void QDeclarativeAnchorChanges::clearBindings() d->fromHeight = d->target->height(); //reset any anchors with corresponding reverts - if (d->applyOrigLeft) - d->target->anchors()->resetLeft(); - if (d->applyOrigRight) - d->target->anchors()->resetRight(); - if (d->applyOrigHCenter) - d->target->anchors()->resetHorizontalCenter(); - if (d->applyOrigTop) - d->target->anchors()->resetTop(); - if (d->applyOrigBottom) - d->target->anchors()->resetBottom(); - if (d->applyOrigVCenter) - d->target->anchors()->resetVerticalCenter(); - if (d->applyOrigBaseline) - d->target->anchors()->resetBaseline(); - - //reset any anchors that have been specified - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::LeftAnchor) - d->target->anchors()->resetLeft(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::RightAnchor) - d->target->anchors()->resetRight(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::HCenterAnchor) - d->target->anchors()->resetHorizontalCenter(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::TopAnchor) - d->target->anchors()->resetTop(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BottomAnchor) - d->target->anchors()->resetBottom(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::VCenterAnchor) - d->target->anchors()->resetVerticalCenter(); - if (d->anchorSet->d_func()->resetAnchors & QDeclarativeAnchors::BaselineAnchor) - d->target->anchors()->resetBaseline(); - + //reset any anchors that have been specified as "undefined" //reset any anchors that we'll be setting in the state - if (d->anchorSet->d_func()->left.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativeAnchors::Anchors combined = d->anchorSet->d_func()->resetAnchors | + d->anchorSet->d_func()->usedAnchors; + if (d->applyOrigLeft || (combined & QDeclarativeAnchors::LeftAnchor)) { d->target->anchors()->resetLeft(); - if (d->anchorSet->d_func()->right.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->leftProp, 0); + } + if (d->applyOrigRight || (combined & QDeclarativeAnchors::RightAnchor)) { d->target->anchors()->resetRight(); - if (d->anchorSet->d_func()->hCenter.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->rightProp, 0); + } + if (d->applyOrigHCenter || (combined & QDeclarativeAnchors::HCenterAnchor)) { d->target->anchors()->resetHorizontalCenter(); - if (d->anchorSet->d_func()->top.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->hCenterProp, 0); + } + if (d->applyOrigTop || (combined & QDeclarativeAnchors::TopAnchor)) { d->target->anchors()->resetTop(); - if (d->anchorSet->d_func()->bottom.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->topProp, 0); + } + if (d->applyOrigBottom || (combined & QDeclarativeAnchors::BottomAnchor)) { d->target->anchors()->resetBottom(); - if (d->anchorSet->d_func()->vCenter.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->bottomProp, 0); + } + if (d->applyOrigVCenter || (combined & QDeclarativeAnchors::VCenterAnchor)) { d->target->anchors()->resetVerticalCenter(); - if (d->anchorSet->d_func()->baseline.anchorLine != QDeclarativeAnchorLine::Invalid) + QDeclarativePropertyPrivate::setBinding(d->vCenterProp, 0); + } + if (d->applyOrigBaseline || (combined & QDeclarativeAnchors::BaselineAnchor)) { d->target->anchors()->resetBaseline(); + QDeclarativePropertyPrivate::setBinding(d->baselineProp, 0); + } } bool QDeclarativeAnchorChanges::override(QDeclarativeActionEvent*other) diff --git a/src/declarative/util/qdeclarativestateoperations_p.h b/src/declarative/util/qdeclarativestateoperations_p.h index 5dc21e1..e22c1e2 100644 --- a/src/declarative/util/qdeclarativestateoperations_p.h +++ b/src/declarative/util/qdeclarativestateoperations_p.h @@ -108,9 +108,9 @@ public: virtual void saveOriginals(); virtual void copyOriginals(QDeclarativeActionEvent*); - virtual void execute(); + virtual void execute(Reason reason = ActualChange); virtual bool isReversable(); - virtual void reverse(); + virtual void reverse(Reason reason = ActualChange); virtual QString typeName() const; virtual bool override(QDeclarativeActionEvent*other); virtual void rewind(); @@ -140,7 +140,7 @@ public: QString name() const; void setName(const QString &); - virtual void execute(); + virtual void execute(Reason reason = ActualChange); }; class QDeclarativeAnchorChanges; @@ -149,13 +149,13 @@ class Q_AUTOTEST_EXPORT QDeclarativeAnchorSet : public QObject { Q_OBJECT - Q_PROPERTY(QDeclarativeAnchorLine left READ left WRITE setLeft RESET resetLeft) - Q_PROPERTY(QDeclarativeAnchorLine right READ right WRITE setRight RESET resetRight) - Q_PROPERTY(QDeclarativeAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter) - Q_PROPERTY(QDeclarativeAnchorLine top READ top WRITE setTop RESET resetTop) - Q_PROPERTY(QDeclarativeAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom) - Q_PROPERTY(QDeclarativeAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter) - Q_PROPERTY(QDeclarativeAnchorLine baseline READ baseline WRITE setBaseline RESET resetBaseline) + Q_PROPERTY(QDeclarativeScriptString left READ left WRITE setLeft RESET resetLeft) + Q_PROPERTY(QDeclarativeScriptString right READ right WRITE setRight RESET resetRight) + Q_PROPERTY(QDeclarativeScriptString horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter) + Q_PROPERTY(QDeclarativeScriptString top READ top WRITE setTop RESET resetTop) + Q_PROPERTY(QDeclarativeScriptString bottom READ bottom WRITE setBottom RESET resetBottom) + Q_PROPERTY(QDeclarativeScriptString verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter) + Q_PROPERTY(QDeclarativeScriptString baseline READ baseline WRITE setBaseline RESET resetBaseline) //Q_PROPERTY(QDeclarativeItem *fill READ fill WRITE setFill RESET resetFill) //Q_PROPERTY(QDeclarativeItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn) @@ -172,32 +172,32 @@ public: QDeclarativeAnchorSet(QObject *parent=0); virtual ~QDeclarativeAnchorSet(); - QDeclarativeAnchorLine left() const; - void setLeft(const QDeclarativeAnchorLine &edge); + QDeclarativeScriptString left() const; + void setLeft(const QDeclarativeScriptString &edge); void resetLeft(); - QDeclarativeAnchorLine right() const; - void setRight(const QDeclarativeAnchorLine &edge); + QDeclarativeScriptString right() const; + void setRight(const QDeclarativeScriptString &edge); void resetRight(); - QDeclarativeAnchorLine horizontalCenter() const; - void setHorizontalCenter(const QDeclarativeAnchorLine &edge); + QDeclarativeScriptString horizontalCenter() const; + void setHorizontalCenter(const QDeclarativeScriptString &edge); void resetHorizontalCenter(); - QDeclarativeAnchorLine top() const; - void setTop(const QDeclarativeAnchorLine &edge); + QDeclarativeScriptString top() const; + void setTop(const QDeclarativeScriptString &edge); void resetTop(); - QDeclarativeAnchorLine bottom() const; - void setBottom(const QDeclarativeAnchorLine &edge); + QDeclarativeScriptString bottom() const; + void setBottom(const QDeclarativeScriptString &edge); void resetBottom(); - QDeclarativeAnchorLine verticalCenter() const; - void setVerticalCenter(const QDeclarativeAnchorLine &edge); + QDeclarativeScriptString verticalCenter() const; + void setVerticalCenter(const QDeclarativeScriptString &edge); void resetVerticalCenter(); - QDeclarativeAnchorLine baseline() const; - void setBaseline(const QDeclarativeAnchorLine &edge); + QDeclarativeScriptString baseline() const; + void setBaseline(const QDeclarativeScriptString &edge); void resetBaseline(); QDeclarativeItem *fill() const; @@ -270,9 +270,9 @@ public: QDeclarativeItem *object() const; void setObject(QDeclarativeItem *); - virtual void execute(); + virtual void execute(Reason reason = ActualChange); virtual bool isReversable(); - virtual void reverse(); + virtual void reverse(Reason reason = ActualChange); virtual QString typeName() const; virtual bool override(QDeclarativeActionEvent*other); virtual bool changesBindings(); diff --git a/src/declarative/util/qdeclarativetransitionmanager.cpp b/src/declarative/util/qdeclarativetransitionmanager.cpp index bc40377..368d484 100644 --- a/src/declarative/util/qdeclarativetransitionmanager.cpp +++ b/src/declarative/util/qdeclarativetransitionmanager.cpp @@ -42,6 +42,7 @@ #include "private/qdeclarativetransitionmanager_p_p.h" #include "private/qdeclarativestate_p_p.h" +#include "private/qdeclarativestate_p.h" #include #include @@ -150,9 +151,9 @@ void QDeclarativeTransitionManager::transition(const QList & QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); } else if (action.event->isReversable()) { if (action.reverseEvent) - action.event->reverse(); + action.event->reverse(QDeclarativeActionEvent::FastForward); else - action.event->execute(); + action.event->execute(QDeclarativeActionEvent::FastForward); } } diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index bd3186a..a016fa7 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -566,10 +566,10 @@ void tst_qdeclarativestates::anchorChanges() rect->setState("right"); QCOMPARE(innerRect->x(), qreal(150)); - QCOMPARE(aChanges->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all) QCOMPARE(aChanges->object(), qobject_cast(innerRect)); - QCOMPARE(aChanges->anchors()->right().item, rect->right().item); - QCOMPARE(aChanges->anchors()->right().anchorLine, rect->right().anchorLine); + QCOMPARE(aChanges->object()->anchors()->left().anchorLine, QDeclarativeAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all) + QCOMPARE(aChanges->object()->anchors()->right().item, rect->right().item); + QCOMPARE(aChanges->object()->anchors()->right().anchorLine, rect->right().anchorLine); rect->setState(""); QCOMPARE(innerRect->x(), qreal(5)); @@ -589,7 +589,6 @@ void tst_qdeclarativestates::anchorChanges2() QVERIFY(innerRect != 0); rect->setState("right"); - QEXPECT_FAIL("", "QTBUG-5338", Continue); QCOMPARE(innerRect->x(), qreal(150)); rect->setState(""); @@ -625,14 +624,14 @@ void tst_qdeclarativestates::anchorChanges3() rect->setState("reanchored"); QCOMPARE(aChanges->object(), qobject_cast(innerRect)); - QCOMPARE(aChanges->anchors()->left().item, leftGuideline->left().item); - QCOMPARE(aChanges->anchors()->left().anchorLine, leftGuideline->left().anchorLine); - QCOMPARE(aChanges->anchors()->right().item, rect->right().item); - QCOMPARE(aChanges->anchors()->right().anchorLine, rect->right().anchorLine); - QCOMPARE(aChanges->anchors()->top().item, rect->top().item); - QCOMPARE(aChanges->anchors()->top().anchorLine, rect->top().anchorLine); - QCOMPARE(aChanges->anchors()->bottom().item, bottomGuideline->bottom().item); - QCOMPARE(aChanges->anchors()->bottom().anchorLine, bottomGuideline->bottom().anchorLine); + QCOMPARE(aChanges->object()->anchors()->left().item, leftGuideline->left().item); + QCOMPARE(aChanges->object()->anchors()->left().anchorLine, leftGuideline->left().anchorLine); + QCOMPARE(aChanges->object()->anchors()->right().item, rect->right().item); + QCOMPARE(aChanges->object()->anchors()->right().anchorLine, rect->right().anchorLine); + QCOMPARE(aChanges->object()->anchors()->top().item, rect->top().item); + QCOMPARE(aChanges->object()->anchors()->top().anchorLine, rect->top().anchorLine); + QCOMPARE(aChanges->object()->anchors()->bottom().item, bottomGuideline->bottom().item); + QCOMPARE(aChanges->object()->anchors()->bottom().anchorLine, bottomGuideline->bottom().anchorLine); QCOMPARE(innerRect->x(), qreal(10)); QCOMPARE(innerRect->y(), qreal(0)); @@ -675,10 +674,10 @@ void tst_qdeclarativestates::anchorChanges4() rect->setState("reanchored"); QCOMPARE(aChanges->object(), qobject_cast(innerRect)); - QCOMPARE(aChanges->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item); - QCOMPARE(aChanges->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine); - QCOMPARE(aChanges->anchors()->verticalCenter().item, leftGuideline->verticalCenter().item); - QCOMPARE(aChanges->anchors()->verticalCenter().anchorLine, leftGuideline->verticalCenter().anchorLine); + QCOMPARE(aChanges->object()->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item); + QCOMPARE(aChanges->object()->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine); + QCOMPARE(aChanges->object()->anchors()->verticalCenter().item, leftGuideline->verticalCenter().item); + QCOMPARE(aChanges->object()->anchors()->verticalCenter().anchorLine, leftGuideline->verticalCenter().anchorLine); delete rect; } @@ -710,10 +709,10 @@ void tst_qdeclarativestates::anchorChanges5() rect->setState("reanchored"); QCOMPARE(aChanges->object(), qobject_cast(innerRect)); - QCOMPARE(aChanges->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item); - QCOMPARE(aChanges->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine); - QCOMPARE(aChanges->anchors()->baseline().item, leftGuideline->baseline().item); - QCOMPARE(aChanges->anchors()->baseline().anchorLine, leftGuideline->baseline().anchorLine); + //QCOMPARE(aChanges->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item); + //QCOMPARE(aChanges->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine); + //QCOMPARE(aChanges->anchors()->baseline().item, leftGuideline->baseline().item); + //QCOMPARE(aChanges->anchors()->baseline().anchorLine, leftGuideline->baseline().anchorLine); delete rect; } -- cgit v0.12 From 12c18dd03e49aab7cef71883ff105a8c49b19106 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 20 Apr 2010 14:21:35 +1000 Subject: Doc QTBUG-9768 --- doc/src/declarative/propertybinding.qdoc | 56 ++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/doc/src/declarative/propertybinding.qdoc b/doc/src/declarative/propertybinding.qdoc index 02f9868..ab3682d 100644 --- a/doc/src/declarative/propertybinding.qdoc +++ b/doc/src/declarative/propertybinding.qdoc @@ -78,16 +78,52 @@ Rectangle { } \endcode -Being JavaScript expressions, bindings are evaluated in a scope chain. The \l {QML Scope} -documentation covers the specifics of scoping in QML. - -\list -\o When does a binding not get updated? -\o Scope -\o Assigning a constant/other binding clears existing binding -\o Loops -\o Using model data -\endlist +While syntactically bindings can be of arbitrary complexity, if a binding starts to become +overly complex - such as involving multiple lines, or imperative loops - it may be better +to refactor the component entirely, or at least factor the binding out into a separate +function. + +\section1 Changing Bindings + +The \l PropertyChanges element can be used within a state change to modify the bindings on +properties. + +This example modifies the \l Rectangle's width property binding to be \c {otherItem.height} +when in the "square" state. When it returns to its default state, width's original property +binding will have been restored. + +\code +Rectangle { + id: rectangle + width: otherItem.width + height: otherItem.height + + states: State { + name: "square" + PropertyChanges { + target: rectangle + width: otherItem.height + } + } +} +\endcode + +Imperatively assigning a value directly to a property will also implicitly remove a binding +on a property. A property can only have one value at a time, and if code explicitly sets +this value the binding must be removed. The \l Rectangle in the example below will have +a width of 13, regardless of the otherItem's width. + +\code +Rectangle { + width: otherItem.width + + Component.onCompleted: { + width = 13; + } +} +\endcode + +There is no way to create a property binding directly from imperative JavaScript code. \section1 Binding Element -- cgit v0.12 From 27b09c283d68fa4b1eae32f82a1041bca1a28656 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 20 Apr 2010 14:29:50 +1000 Subject: Typo. --- doc/src/getting-started/examples.qdoc | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 9ddafc4..071a107 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -159,7 +159,6 @@ \endfloat The Qt Declarative module provides a declarative framework for building highly dynamic, custom user interfaces. - classes. \clearfloat \section1 \l{Painting Examples}{Painting} -- cgit v0.12 From 78c78085449149b5c48bbecd49424974cdf79bee Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 20 Apr 2010 14:49:36 +1000 Subject: Allow null to be assigned to object properties --- src/declarative/qml/qdeclarativebinding.cpp | 4 +++ .../qml/qdeclarativeobjectscriptclass.cpp | 8 +++++- .../data/canAssignNullToQObject.1.qml | 9 +++++++ .../data/canAssignNullToQObject.2.qml | 11 ++++++++ .../tst_qdeclarativeecmascript.cpp | 30 ++++++++++++++++++++++ 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index d759427..95520da 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -156,6 +156,9 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) QScriptValue scriptValue = d->scriptValue(0, &isUndefined); if (data->property.propertyTypeCategory() == QDeclarativeProperty::List) { value = ep->scriptValueToVariant(scriptValue, qMetaTypeId >()); + } else if (scriptValue.isNull() && + data->property.propertyTypeCategory() == QDeclarativeProperty::Object) { + value = QVariant::fromValue((QObject *)0); } else { value = ep->scriptValueToVariant(scriptValue, data->property.propertyType()); if (value.userType() == QMetaType::QObjectStar && !qvariant_cast(value)) { @@ -168,6 +171,7 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) } } + if (data->error.isValid()) { } else if (isUndefined && data->property.isResettable()) { diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index a194354..bb5c8b7 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -353,7 +353,13 @@ void QDeclarativeObjectScriptClass::setProperty(QObject *obj, if (delBinding) delBinding->destroy(); - if (value.isUndefined() && lastData->flags & QDeclarativePropertyCache::Data::IsResettable) { + if (value.isNull() && lastData->flags & QDeclarativePropertyCache::Data::IsQObjectDerived) { + QObject *o = 0; + int status = -1; + int flags = 0; + void *argv[] = { &o, 0, &status, &flags }; + QMetaObject::metacall(obj, QMetaObject::WriteProperty, lastData->coreIndex, argv); + } else if (value.isUndefined() && lastData->flags & QDeclarativePropertyCache::Data::IsResettable) { void *a[] = { 0 }; QMetaObject::metacall(obj, QMetaObject::ResetProperty, lastData->coreIndex, a); } else if (value.isUndefined() && lastData->propType == qMetaTypeId()) { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml new file mode 100644 index 0000000..3fd9131 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml @@ -0,0 +1,9 @@ +import Qt.test 1.0 + +MyQmlObject { + property bool runTest: false + + property variant a: MyQmlObject {} + + objectProperty: (runTest == false)?a:null +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml new file mode 100644 index 0000000..19b0c42 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml @@ -0,0 +1,11 @@ +import Qt.test 1.0 +import Qt 4.6 + +MyQmlObject { + objectProperty: MyQmlObject {} + + Component.onCompleted: { + objectProperty = null; + } +} + diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index a2ecf74..6939290 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -141,6 +141,7 @@ private slots: void variantsAssignedUndefined(); void qtbug_9792(); void noSpuriousWarningsAtShutdown(); + void canAssignNullToQObject(); void callQtInvokables(); private: @@ -2190,6 +2191,35 @@ void tst_qdeclarativeecmascript::noSpuriousWarningsAtShutdown() } } +void tst_qdeclarativeecmascript::canAssignNullToQObject() +{ + { + QDeclarativeComponent component(&engine, TEST_FILE("canAssignNullToQObject.1.qml")); + + MyQmlObject *o = qobject_cast(component.create()); + QVERIFY(o != 0); + + QVERIFY(o->objectProperty() != 0); + + o->setProperty("runTest", true); + + QVERIFY(o->objectProperty() == 0); + + delete o; + } + + { + QDeclarativeComponent component(&engine, TEST_FILE("canAssignNullToQObject.2.qml")); + + MyQmlObject *o = qobject_cast(component.create()); + QVERIFY(o != 0); + + QVERIFY(o->objectProperty() == 0); + + delete o; + } +} + QTEST_MAIN(tst_qdeclarativeecmascript) #include "tst_qdeclarativeecmascript.moc" -- cgit v0.12 From 2801cc86b442e3a1256e48ffdf6dd92ffeb74a17 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 20 Apr 2010 15:14:19 +1000 Subject: Pass double clicks like other mouse events. Task-number: QTBUG-9940 --- src/gui/widgets/qlinecontrol.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 42df800..d027b91 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -1350,6 +1350,7 @@ bool QLineControl::processEvent(QEvent* ev) #endif switch(ev->type()){ #ifndef QT_NO_GRAPHICSVIEW + case QEvent::GraphicsSceneMouseDoubleClick: case QEvent::GraphicsSceneMouseMove: case QEvent::GraphicsSceneMouseRelease: case QEvent::GraphicsSceneMousePress:{ @@ -1439,6 +1440,7 @@ void QLineControl::processMouseEvent(QMouseEvent* ev) moveCursor(cursor, mark); break; } + case QEvent::GraphicsSceneMouseDoubleClick: case QEvent::MouseButtonDblClick: if (ev->button() == Qt::LeftButton) { selectWordAtPos(xToPos(ev->pos().x())); -- cgit v0.12 From a9a42f51ca7079652b16ba8883a8d0f69f82c1e6 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 20 Apr 2010 16:14:29 +1000 Subject: Fix API call for multiple tags. Spec says comma, not eg. space separated. --- demos/declarative/flickr/common/RssModel.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/demos/declarative/flickr/common/RssModel.qml b/demos/declarative/flickr/common/RssModel.qml index d0960db..415a9e9 100644 --- a/demos/declarative/flickr/common/RssModel.qml +++ b/demos/declarative/flickr/common/RssModel.qml @@ -3,7 +3,12 @@ import Qt 4.7 XmlListModel { property string tags : "" - source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "")+"format=rss2" + function commasep(x) + { + return x.replace(' ',','); + } + + source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+commasep(tags)+"&" : "")+"format=rss2" query: "/rss/channel/item" namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" -- cgit v0.12 From b0fd95e035888bbfc474814bc6796a4acbf6e958 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 20 Apr 2010 16:25:22 +1000 Subject: doc typo --- doc/src/declarative/qtdeclarative.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index a986fbc..5d1e18f 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -94,7 +94,7 @@ */ /*! - \fn int qmlRegisterTypeUncreatable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message) + \fn int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message) \relates QDeclarativeEngine This template function registers the C++ type in the QML system with @@ -143,7 +143,7 @@ fun.qml: Get back to work, slacker! Without this, a generic "Game is not a type" message would be given. - \sa qmlRegisterTypeUncreatable + \sa qmlRegisterUncreatableType */ /*! -- cgit v0.12 From 7d196d3558321623de2de0b6c145239dd475b749 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 20 Apr 2010 16:39:38 +1000 Subject: doc --- doc/src/declarative/globalobject.qdoc | 2 ++ doc/src/declarative/qdeclarativesecurity.qdoc | 4 ++-- src/declarative/graphicsitems/qdeclarativeitem.cpp | 23 +++++++++++----------- src/declarative/qml/qdeclarativecontext.cpp | 6 ++++++ src/declarative/qml/qdeclarativeengine.cpp | 5 ++++- src/declarative/util/qdeclarativeview.cpp | 1 + 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index c41c344..d84754b 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -288,6 +288,8 @@ of their use. \section1 XMLHttpRequest +\target XMLHttpRequest + QML script supports the XMLHttpRequest object, which can be used to asynchronously obtain data from over a network. diff --git a/doc/src/declarative/qdeclarativesecurity.qdoc b/doc/src/declarative/qdeclarativesecurity.qdoc index 290d78f..91d6d87 100644 --- a/doc/src/declarative/qdeclarativesecurity.qdoc +++ b/doc/src/declarative/qdeclarativesecurity.qdoc @@ -72,7 +72,7 @@ A non-exhaustive list of the ways you could shoot yourself in the foot is: \list \i Using \c import to import QML or JavaScript you do not control. BAD \i Using \l Loader to import QML you do not control. BAD - \i Using \l{XMLHttpRequest()}{XMLHttpRequest} to load data you do not control and executing it. BAD + \i Using \l{XMLHttpRequest}{XMLHttpRequest} to load data you do not control and executing it. BAD \endlist However, the above does not mean that you have no use for the network transparency of QML. @@ -81,7 +81,7 @@ There are many good and useful things you \e can do: \list \i Create \l Image elements with source URLs of any online images. GOOD \i Use XmlListModel to present online content. GOOD - \i Use \l{XMLHttpRequest()}{XMLHttpRequest} to interact with online services. GOOD + \i Use \l{XMLHttpRequest}{XMLHttpRequest} to interact with online services. GOOD \endlist The only reason this page is necessary at all is that JavaScript, when run in a \e{web browser}, diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 37c7923..d19967a 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -275,17 +275,6 @@ QDeclarativeContents::QDeclarativeContents() : m_x(0), m_y(0), m_width(0), m_hei { } -/*! - \qmlproperty real Item::childrenRect.x - \qmlproperty real Item::childrenRect.y - \qmlproperty real Item::childrenRect.width - \qmlproperty real Item::childrenRect.height - - The childrenRect properties allow an item access to the geometry of its - children. This property is useful if you have an item that needs to be - sized to fit its children. -*/ - QRectF QDeclarativeContents::rectF() const { return QRectF(m_x, m_y, m_width, m_height); @@ -1457,6 +1446,18 @@ QDeclarativeItem *QDeclarativeItem::parentItem() const } /*! + \qmlproperty real Item::childrenRect.x + \qmlproperty real Item::childrenRect.y + \qmlproperty real Item::childrenRect.width + \qmlproperty real Item::childrenRect.height + + The childrenRect properties allow an item access to the geometry of its + children. This property is useful if you have an item that needs to be + sized to fit its children. +*/ + + +/*! \qmlproperty list Item::children \qmlproperty list Item::resources diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index 2041e0a..ae4223e 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -208,6 +208,12 @@ QDeclarativeContext::~QDeclarativeContext() d->data->destroy(); } +/*! + Returns whether the context is valid. + + To be valid, a context must have a engine, and it's contextObject(), if any, + must not have been deleted. +*/ bool QDeclarativeContext::isValid() const { Q_D(const QDeclarativeContext); diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 9cd6b3c..dc80ac4 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -2031,7 +2031,8 @@ QStringList QDeclarativeEngine::pluginPathList() const /*! Sets the list of directories where the engine searches for - native plugins for imported modules (referenced in the \c qmldir file). + native plugins for imported modules (referenced in the \c qmldir file) + to \a paths. By default, the list contains only \c ., i.e. the engine searches in the directory of the \c qmldir file itself. @@ -2049,6 +2050,8 @@ void QDeclarativeEngine::setPluginPathList(const QStringList &paths) Imports the plugin named \a filePath with the \a uri provided. Returns true if the plugin was successfully imported; otherwise returns false. + On failure and if non-null, *\a errorString will be set to a message describing the failure. + The plugin has to be a Qt plugin which implements the QDeclarativeExtensionPlugin interface. */ bool QDeclarativeEngine::importPlugin(const QString &filePath, const QString &uri, QString *errorString) diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index 5cfa0e8..62d913c 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -599,6 +599,7 @@ void QDeclarativeView::timerEvent(QTimerEvent* e) } } +/*! \reimp */ bool QDeclarativeView::eventFilter(QObject *watched, QEvent *e) { if (watched == d->root && d->resizeMode == SizeViewToRootObject) { -- cgit v0.12 From 6f6767f434e957a4062c827ad01196a359bb706b Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 20 Apr 2010 16:48:52 +1000 Subject: Cleanup --- demos/declarative/flickr/common/LikeOMeter.qml | 35 ---------------- demos/declarative/flickr/common/Loading.qml | 8 ---- demos/declarative/flickr/common/Star.qml | 45 --------------------- .../declarative/flickr/common/pics/background.png | Bin 60504 -> 0 bytes .../flickr/common/pics/button-pressed.png | Bin 571 -> 0 bytes .../flickr/common/pics/button-pressed.sci | 5 --- demos/declarative/flickr/common/pics/button.png | Bin 564 -> 0 bytes demos/declarative/flickr/common/pics/button.sci | 5 --- demos/declarative/flickr/common/pics/ghns_star.png | Bin 891 -> 0 bytes demos/declarative/flickr/common/pics/loading.png | Bin 813 -> 0 bytes .../declarative/flickr/common/pics/reflection.png | Bin 4839 -> 0 bytes .../flickr/common/pics/shadow-bottom.png | Bin 656 -> 0 bytes .../flickr/common/pics/shadow-corner.png | Bin 405 -> 0 bytes .../flickr/common/pics/shadow-right-screen.png | Bin 227 -> 0 bytes .../flickr/common/pics/shadow-right.png | Bin 635 -> 0 bytes demos/declarative/flickr/flickr.qml | 1 - 16 files changed, 99 deletions(-) delete mode 100644 demos/declarative/flickr/common/LikeOMeter.qml delete mode 100644 demos/declarative/flickr/common/Loading.qml delete mode 100644 demos/declarative/flickr/common/Star.qml delete mode 100644 demos/declarative/flickr/common/pics/background.png delete mode 100644 demos/declarative/flickr/common/pics/button-pressed.png delete mode 100644 demos/declarative/flickr/common/pics/button-pressed.sci delete mode 100644 demos/declarative/flickr/common/pics/button.png delete mode 100644 demos/declarative/flickr/common/pics/button.sci delete mode 100644 demos/declarative/flickr/common/pics/ghns_star.png delete mode 100644 demos/declarative/flickr/common/pics/loading.png delete mode 100644 demos/declarative/flickr/common/pics/reflection.png delete mode 100644 demos/declarative/flickr/common/pics/shadow-bottom.png delete mode 100644 demos/declarative/flickr/common/pics/shadow-corner.png delete mode 100644 demos/declarative/flickr/common/pics/shadow-right-screen.png delete mode 100644 demos/declarative/flickr/common/pics/shadow-right.png diff --git a/demos/declarative/flickr/common/LikeOMeter.qml b/demos/declarative/flickr/common/LikeOMeter.qml deleted file mode 100644 index 17e3998..0000000 --- a/demos/declarative/flickr/common/LikeOMeter.qml +++ /dev/null @@ -1,35 +0,0 @@ -import Qt 4.7 - -Item { - id: container - - property int rating: 2 - - Row { - Star { - rating: 0 - onClicked: { container.rating = rating } - on: container.rating >= 0 - } - Star { - rating: 1 - onClicked: { container.rating = rating } - on: container.rating >= 1 - } - Star { - rating: 2 - onClicked: { container.rating = rating } - on: container.rating >= 2 - } - Star { - rating: 3 - onClicked: { container.rating = rating } - on: container.rating >= 3 - } - Star { - rating: 4 - onClicked: { container.rating = rating } - on: container.rating >= 4 - } - } -} diff --git a/demos/declarative/flickr/common/Loading.qml b/demos/declarative/flickr/common/Loading.qml deleted file mode 100644 index 8daed48..0000000 --- a/demos/declarative/flickr/common/Loading.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Qt 4.7 - -Image { - id: loading; source: "pics/loading.png" - NumberAnimation on rotation { - from: 0; to: 360; running: loading.visible == true; loops: Animation.Infinite; duration: 900 - } -} diff --git a/demos/declarative/flickr/common/Star.qml b/demos/declarative/flickr/common/Star.qml deleted file mode 100644 index fcca742..0000000 --- a/demos/declarative/flickr/common/Star.qml +++ /dev/null @@ -1,45 +0,0 @@ -import Qt 4.7 - -Item { - id: container - width: 24 - height: 24 - - property int rating - property bool on - signal clicked - - Image { - id: starImage - source: "pics/ghns_star.png" - x: 6 - y: 7 - opacity: 0.4 - scale: 0.5 - } - MouseArea { - anchors.fill: container - onClicked: { container.clicked() } - } - states: [ - State { - name: "on" - when: container.on == true - PropertyChanges { - target: starImage - opacity: 1 - scale: 1 - x: 1 - y: 0 - } - } - ] - transitions: [ - Transition { - NumberAnimation { - properties: "opacity,scale,x,y" - easing.type: "OutBounce" - } - } - ] -} diff --git a/demos/declarative/flickr/common/pics/background.png b/demos/declarative/flickr/common/pics/background.png deleted file mode 100644 index 5b37072..0000000 Binary files a/demos/declarative/flickr/common/pics/background.png and /dev/null differ diff --git a/demos/declarative/flickr/common/pics/button-pressed.png b/demos/declarative/flickr/common/pics/button-pressed.png deleted file mode 100644 index e434d32..0000000 Binary files a/demos/declarative/flickr/common/pics/button-pressed.png and /dev/null differ diff --git a/demos/declarative/flickr/common/pics/button-pressed.sci b/demos/declarative/flickr/common/pics/button-pressed.sci deleted file mode 100644 index b8db272..0000000 --- a/demos/declarative/flickr/common/pics/button-pressed.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 8 -border.top: 4 -border.bottom: 4 -border.right: 8 -source: button.png diff --git a/demos/declarative/flickr/common/pics/button.png b/demos/declarative/flickr/common/pics/button.png deleted file mode 100644 index 56a63ce..0000000 Binary files a/demos/declarative/flickr/common/pics/button.png and /dev/null differ diff --git a/demos/declarative/flickr/common/pics/button.sci b/demos/declarative/flickr/common/pics/button.sci deleted file mode 100644 index b8db272..0000000 --- a/demos/declarative/flickr/common/pics/button.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 8 -border.top: 4 -border.bottom: 4 -border.right: 8 -source: button.png diff --git a/demos/declarative/flickr/common/pics/ghns_star.png b/demos/declarative/flickr/common/pics/ghns_star.png deleted file mode 100644 index 4ad43cc..0000000 Binary files a/demos/declarative/flickr/common/pics/ghns_star.png and /dev/null differ diff --git a/demos/declarative/flickr/common/pics/loading.png b/demos/declarative/flickr/common/pics/loading.png deleted file mode 100644 index 47a1589..0000000 Binary files a/demos/declarative/flickr/common/pics/loading.png and /dev/null differ diff --git a/demos/declarative/flickr/common/pics/reflection.png b/demos/declarative/flickr/common/pics/reflection.png deleted file mode 100644 index c143a48..0000000 Binary files a/demos/declarative/flickr/common/pics/reflection.png and /dev/null differ diff --git a/demos/declarative/flickr/common/pics/shadow-bottom.png b/demos/declarative/flickr/common/pics/shadow-bottom.png deleted file mode 100644 index 523f6e7..0000000 Binary files a/demos/declarative/flickr/common/pics/shadow-bottom.png and /dev/null differ diff --git a/demos/declarative/flickr/common/pics/shadow-corner.png b/demos/declarative/flickr/common/pics/shadow-corner.png deleted file mode 100644 index ef8c856..0000000 Binary files a/demos/declarative/flickr/common/pics/shadow-corner.png and /dev/null differ diff --git a/demos/declarative/flickr/common/pics/shadow-right-screen.png b/demos/declarative/flickr/common/pics/shadow-right-screen.png deleted file mode 100644 index 9856c4f..0000000 Binary files a/demos/declarative/flickr/common/pics/shadow-right-screen.png and /dev/null differ diff --git a/demos/declarative/flickr/common/pics/shadow-right.png b/demos/declarative/flickr/common/pics/shadow-right.png deleted file mode 100644 index f534a35..0000000 Binary files a/demos/declarative/flickr/common/pics/shadow-right.png and /dev/null differ diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index aa550d2..ed88cf6 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -13,7 +13,6 @@ Item { Image { source: "mobile/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } Common.RssModel { id: rssModel } - Common.Loading { anchors.centerIn: parent; visible: rssModel.status == 2 } Item { id: views -- cgit v0.12 From 76670cb51e53140ccd2873e627708dc73c12d9b3 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 20 Apr 2010 16:51:18 +1000 Subject: Add declarative demos to doc. --- doc/src/declarative/examples.qdoc | 5 +++ doc/src/examples/qml-calculator.qdoc | 49 +++++++++++++++++++++++++++++ doc/src/examples/qml-flickr.qdoc | 49 +++++++++++++++++++++++++++++ doc/src/examples/qml-photoviewer.qdoc | 49 +++++++++++++++++++++++++++++ doc/src/examples/qml-samegame.qdoc | 49 +++++++++++++++++++++++++++++ doc/src/examples/qml-snake.qdoc | 49 +++++++++++++++++++++++++++++ doc/src/images/qml-calculator-example.png | Bin 0 -> 33956 bytes doc/src/images/qml-flickr-example.png | Bin 0 -> 280730 bytes doc/src/images/qml-photoviewer-example.png | Bin 0 -> 473306 bytes doc/src/images/qml-samegame-example.png | Bin 0 -> 285415 bytes doc/src/images/qml-snake-example.png | Bin 0 -> 105053 bytes 11 files changed, 250 insertions(+) create mode 100644 doc/src/examples/qml-calculator.qdoc create mode 100644 doc/src/examples/qml-flickr.qdoc create mode 100644 doc/src/examples/qml-photoviewer.qdoc create mode 100644 doc/src/examples/qml-samegame.qdoc create mode 100644 doc/src/examples/qml-snake.qdoc create mode 100644 doc/src/images/qml-calculator-example.png create mode 100644 doc/src/images/qml-flickr-example.png create mode 100644 doc/src/images/qml-photoviewer-example.png create mode 100644 doc/src/images/qml-samegame-example.png create mode 100644 doc/src/images/qml-snake-example.png diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc index 8e28e59..dc6b76c 100644 --- a/doc/src/declarative/examples.qdoc +++ b/doc/src/declarative/examples.qdoc @@ -77,7 +77,12 @@ For example, from your build directory, run: \section1 Demos \list +\o \l{demos/declarative/calculator}{Calculator} \o \l{demos/declarative/minehunt}{Minehunt} +\o \l{demos/declarative/photoviewer}{Photo Viewer} +\o \l{demos/declarative/flickr}{Flickr Mobile} +\o \l{demos/declarative/samegame}{Same Game} +\o \l{demos/declarative/snake}{Snake} \endlist */ diff --git a/doc/src/examples/qml-calculator.qdoc b/doc/src/examples/qml-calculator.qdoc new file mode 100644 index 0000000..ca05da9 --- /dev/null +++ b/doc/src/examples/qml-calculator.qdoc @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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 documentation 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$ +** +****************************************************************************/ + +/*! + \title Calculator + \example demos/declarative/calculator + + This demo shows how to write a simple calculator application in QML and JavaScript. + + \image qml-calculator-example.png +*/ diff --git a/doc/src/examples/qml-flickr.qdoc b/doc/src/examples/qml-flickr.qdoc new file mode 100644 index 0000000..ebf3250 --- /dev/null +++ b/doc/src/examples/qml-flickr.qdoc @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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 documentation 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$ +** +****************************************************************************/ + +/*! + \title Flickr Mobile + \example demos/declarative/flickr + + This demo shows how to write a mobile Flickr browser application in QML. + + \image qml-flickr-example.png +*/ diff --git a/doc/src/examples/qml-photoviewer.qdoc b/doc/src/examples/qml-photoviewer.qdoc new file mode 100644 index 0000000..d1c3da2 --- /dev/null +++ b/doc/src/examples/qml-photoviewer.qdoc @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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 documentation 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$ +** +****************************************************************************/ + +/*! + \title Photo Viewer + \example demos/declarative/photoviewer + + This demo shows how to write a Flickr photo viewer application in QML. + + \image qml-photoviewer-example.png +*/ diff --git a/doc/src/examples/qml-samegame.qdoc b/doc/src/examples/qml-samegame.qdoc new file mode 100644 index 0000000..d9a9c7c --- /dev/null +++ b/doc/src/examples/qml-samegame.qdoc @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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 documentation 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$ +** +****************************************************************************/ + +/*! + \title Same Game + \example demos/declarative/samegame + + This demo shows how to write a Same Game in QML. + + \image qml-samegame-example.png +*/ diff --git a/doc/src/examples/qml-snake.qdoc b/doc/src/examples/qml-snake.qdoc new file mode 100644 index 0000000..373ca13 --- /dev/null +++ b/doc/src/examples/qml-snake.qdoc @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** 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 documentation 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$ +** +****************************************************************************/ + +/*! + \title Snake + \example demos/declarative/snake + + This demo shows how to write a Snake game in QML. + + \image qml-snake-example.png +*/ diff --git a/doc/src/images/qml-calculator-example.png b/doc/src/images/qml-calculator-example.png new file mode 100644 index 0000000..19ce1b6 Binary files /dev/null and b/doc/src/images/qml-calculator-example.png differ diff --git a/doc/src/images/qml-flickr-example.png b/doc/src/images/qml-flickr-example.png new file mode 100644 index 0000000..71ea567 Binary files /dev/null and b/doc/src/images/qml-flickr-example.png differ diff --git a/doc/src/images/qml-photoviewer-example.png b/doc/src/images/qml-photoviewer-example.png new file mode 100644 index 0000000..be6f1bf Binary files /dev/null and b/doc/src/images/qml-photoviewer-example.png differ diff --git a/doc/src/images/qml-samegame-example.png b/doc/src/images/qml-samegame-example.png new file mode 100644 index 0000000..c17b4e0 Binary files /dev/null and b/doc/src/images/qml-samegame-example.png differ diff --git a/doc/src/images/qml-snake-example.png b/doc/src/images/qml-snake-example.png new file mode 100644 index 0000000..d3c077d Binary files /dev/null and b/doc/src/images/qml-snake-example.png differ -- cgit v0.12 From 831b27e8fb9d12345c33315b7d7c08b613e3d4bb Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 19 Apr 2010 09:08:28 +0200 Subject: Show command line help / qml runtime output in GUI Since qml is a GUI program, debugging output isn't visible by default for Windows/Mac users. Therefore provide command line help in a dialog (Windows), and runtime errors/warnings in a separate top level window. Done together with mae. Reviewed-by: mae --- tools/qml/loggerwidget.cpp | 29 ++++++++++++++++++++ tools/qml/loggerwidget.h | 21 +++++++++++++++ tools/qml/main.cpp | 67 +++++++++++++++++++++++++++++++++++++++++----- tools/qml/qml.pri | 7 ++--- tools/qml/qmlruntime.cpp | 1 - 5 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 tools/qml/loggerwidget.cpp create mode 100644 tools/qml/loggerwidget.h diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp new file mode 100644 index 0000000..df94ba0 --- /dev/null +++ b/tools/qml/loggerwidget.cpp @@ -0,0 +1,29 @@ +#include "loggerwidget.h" +#include +#include + +QT_BEGIN_NAMESPACE + +LoggerWidget::LoggerWidget(QWidget *parent) : + QPlainTextEdit(parent), + m_keepClosed(false) +{ + setAttribute(Qt::WA_QuitOnClose, false); + setWindowTitle(tr("Qt Declarative UI Viewer - Logger")); +} + +void LoggerWidget::append(QtMsgType /*type*/, const char *msg) +{ + appendPlainText(QString::fromAscii(msg)); + + if (!m_keepClosed && !isVisible()) + setVisible(true); +} + +void LoggerWidget::closeEvent(QCloseEvent *event) +{ + m_keepClosed = true; + QWidget::closeEvent(event); +} + +QT_END_NAMESPACE diff --git a/tools/qml/loggerwidget.h b/tools/qml/loggerwidget.h new file mode 100644 index 0000000..0e47f33 --- /dev/null +++ b/tools/qml/loggerwidget.h @@ -0,0 +1,21 @@ +#ifndef LOGGERWIDGET_H +#define LOGGERWIDGET_H + +#include + +QT_BEGIN_NAMESPACE + +class LoggerWidget : public QPlainTextEdit { +Q_OBJECT +public: + LoggerWidget(QWidget *parent=0); + void append(QtMsgType type, const char *msg); +protected: + void closeEvent(QCloseEvent *event); +private: + bool m_keepClosed; +}; + +QT_END_NAMESPACE + +#endif // LOGGERWIDGET_H diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 15e8f64..19f92bd 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -1,4 +1,4 @@ -/**************************************************************************** +/* ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -42,16 +42,20 @@ #include "qdeclarative.h" #include "qmlruntime.h" #include "qdeclarativeengine.h" +#include "loggerwidget.h" #include #include #include #include #include +#include #include "qdeclarativetester.h" #include "qdeclarativefolderlistmodel.h" QT_USE_NAMESPACE +QtMsgHandler systemMsgOutput; + #if defined (Q_OS_SYMBIAN) #include #include @@ -73,6 +77,35 @@ void myMessageOutput(QtMsgType type, const char *msg) abort(); } } + +#else // !defined (Q_OS_SYMBIAN) + +QWeakPointer logger; + +QString warnings; +void showWarnings() +{ + if (!warnings.isEmpty()) { + QMessageBox::warning(0, QApplication::tr("Qt Declarative UI Runtime"), warnings); + } +} + +void myMessageOutput(QtMsgType type, const char *msg) +{ + if (!logger.isNull()) { + logger.data()->append(type, msg); + } else { + warnings += msg; + warnings += QLatin1Char('\n'); + } + if (systemMsgOutput) { // Windows + systemMsgOutput(type, msg); + } else { // Unix + fprintf(stderr, "%s\n",msg); + fflush(stderr); + } +} + #endif void usage() @@ -91,6 +124,7 @@ void usage() qWarning(" -sizeviewtorootobject .................... the view resizes to the changes in the content"); qWarning(" -sizerootobjecttoview .................... the content resizes to the changes in the view"); qWarning(" -qmlbrowser .............................. use a QML-based file browser"); + qWarning(" -nolog ................................... do not show log window"); qWarning(" -recordfile ..................... set video recording file"); qWarning(" - ImageMagick 'convert' for GIF)"); qWarning(" - png file for raw frames"); @@ -137,6 +171,14 @@ int main(int argc, char ** argv) { #if defined (Q_OS_SYMBIAN) qInstallMsgHandler(myMessageOutput); +#else + systemMsgOutput = qInstallMsgHandler(myMessageOutput); +#endif + +#if defined (Q_OS_WIN) + // Debugging output is not visible by default on Windows - + // therefore show modal dialog with errors instad. + atexit(showWarnings); #endif #if defined (Q_WS_X11) @@ -186,6 +228,7 @@ int main(int argc, char ** argv) bool stayOnTop = false; bool maximized = false; bool useNativeFileBrowser = true; + bool showLogWidget = true; bool sizeToView = true; #if defined(Q_OS_SYMBIAN) @@ -237,8 +280,8 @@ int main(int argc, char ** argv) if (lastArg) usage(); app.setStartDragDistance(QString(argv[++i]).toInt()); } else if (arg == QLatin1String("-v") || arg == QLatin1String("-version")) { - fprintf(stderr, "Qt Declarative UI Viewer version %s\n", QT_VERSION_STR); - return 0; + qWarning("Qt Declarative UI Viewer version %s", QT_VERSION_STR); + exit(0); } else if (arg == "-translation") { if (lastArg) usage(); translationFile = argv[++i]; @@ -246,14 +289,16 @@ int main(int argc, char ** argv) useGL = true; } else if (arg == "-qmlbrowser") { useNativeFileBrowser = false; + } else if (arg == "-nolog") { + showLogWidget = false; } else if (arg == "-I" || arg == "-L") { if (arg == "-L") - fprintf(stderr, "-L option provided for compatibility only, use -I instead\n"); + qWarning("-L option provided for compatibility only, use -I instead"); if (lastArg) { QDeclarativeEngine tmpEngine; QString paths = tmpEngine.importPathList().join(QLatin1String(":")); - fprintf(stderr, "Current search path: %s\n", paths.toLocal8Bit().constData()); - return 0; + qWarning("Current search path: %s", paths.toLocal8Bit().constData()); + exit(0); } imports << QString(argv[++i]); } else if (arg == "-P") { @@ -294,6 +339,13 @@ int main(int argc, char ** argv) if (stayOnTop) wflags |= Qt::WindowStaysOnTopHint; +#if !defined(Q_OS_SYMBIAN) + LoggerWidget loggerWidget(0); + if (showLogWidget) { + logger = &loggerWidget; + } +#endif + QDeclarativeViewer viewer(0, wflags); if (!scriptopts.isEmpty()) { QStringList options = @@ -398,5 +450,6 @@ int main(int argc, char ** argv) } viewer.setUseGL(useGL); viewer.raise(); - return app.exec(); + + exit(app.exec()); } diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri index c48e919..d343c76 100644 --- a/tools/qml/qml.pri +++ b/tools/qml/qml.pri @@ -10,11 +10,13 @@ HEADERS += $$PWD/qmlruntime.h \ $$PWD/proxysettings.h \ $$PWD/qdeclarativetester.h \ $$PWD/deviceorientation.h \ - $$PWD/qdeclarativefolderlistmodel.h + $$PWD/qdeclarativefolderlistmodel.h \ + $$PWD/loggerwidget.h SOURCES += $$PWD/qmlruntime.cpp \ $$PWD/proxysettings.cpp \ $$PWD/qdeclarativetester.cpp \ - $$PWD/qdeclarativefolderlistmodel.cpp + $$PWD/qdeclarativefolderlistmodel.cpp \ + $$PWD/loggerwidget.cpp RESOURCES = $$PWD/qmlruntime.qrc maemo5 { @@ -26,4 +28,3 @@ FORMS = $$PWD/recopts.ui \ $$PWD/proxysettings.ui include(../shared/deviceskin/deviceskin.pri) - diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 68940c7..87a4d21 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -1000,7 +1000,6 @@ bool QDeclarativeViewer::open(const QString& file_or_url) t.start(); canvas->setSource(url); - qWarning() << "Wall startup time:" << t.elapsed(); return true; } -- cgit v0.12 From d5f5b9b5f3e21f1a75e52cc15dc8de2b1b72529f Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 21 Apr 2010 09:54:39 +1000 Subject: License headers --- tools/qml/loggerwidget.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ tools/qml/loggerwidget.h | 41 +++++++++++++++++++++++++++++++++++++++++ tools/qml/main.cpp | 2 +- 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp index df94ba0..c5548b7 100644 --- a/tools/qml/loggerwidget.cpp +++ b/tools/qml/loggerwidget.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** 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 tools applications 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 "loggerwidget.h" #include #include diff --git a/tools/qml/loggerwidget.h b/tools/qml/loggerwidget.h index 0e47f33..938431c 100644 --- a/tools/qml/loggerwidget.h +++ b/tools/qml/loggerwidget.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** 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 tools applications 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 LOGGERWIDGET_H #define LOGGERWIDGET_H diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 19f92bd..a79e1b1 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -1,4 +1,4 @@ -/* +/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -- cgit v0.12 From b65cfb07a5bdf9e4ea1ea6e652688824f7b5da15 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 20 Apr 2010 15:24:10 +1000 Subject: Visual test fix. --- .../declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml | 2 +- tools/qml/qdeclarativetester.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml index 1403d35..dd38ea5 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml @@ -6,6 +6,6 @@ VisualTest { } Frame { msec: 16 - hash: "258a7e75b491e4f51a91739c776803b3" + image: "borders.0.png" } } diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp index 11fa22f..6a6048a 100644 --- a/tools/qml/qdeclarativetester.cpp +++ b/tools/qml/qdeclarativetester.cpp @@ -251,7 +251,8 @@ void QDeclarativeTester::updateCurrentTime(int msec) m_view->render(&p); } - bool snapshot = msec == 16 && options & QDeclarativeViewer::Snapshot; + bool snapshot = msec == 16 && (options & QDeclarativeViewer::Snapshot + || (testscript && testscript->count() == 2)); FrameEvent fe; fe.msec = msec; -- cgit v0.12 From e11a5c4d1a1bb80ac03655227c833b560c7cad3c Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 20 Apr 2010 13:23:34 +1000 Subject: Make property value source examples work --- doc/src/declarative/extending.qdoc | 2 +- examples/declarative/extending/binding/example.qml | 2 +- examples/declarative/extending/valuesource/example.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index a1d8a10..d0e5f9e 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -427,7 +427,7 @@ implement the onPartyStarted signal property. \snippet examples/declarative/extending/valuesource/example.qml 0 \snippet examples/declarative/extending/valuesource/example.qml 1 -The QML snippet shown above assigns a property value to the speaker property. +The QML snippet shown above applies a property value source to the speaker property. A property value source generates a value for a property that changes over time. Property value sources are most commonly used to do animation. Rather than diff --git a/examples/declarative/extending/binding/example.qml b/examples/declarative/extending/binding/example.qml index b66bc86..b67049b 100644 --- a/examples/declarative/extending/binding/example.qml +++ b/examples/declarative/extending/binding/example.qml @@ -4,7 +4,7 @@ import People 1.0 BirthdayParty { id: theParty - speaker: HappyBirthday { name: theParty.celebrant.name } + HappyBirthday on speaker { name: theParty.celebrant.name } celebrant: Boy { name: "Bob Jones" diff --git a/examples/declarative/extending/valuesource/example.qml b/examples/declarative/extending/valuesource/example.qml index 7cdf8c0..ed4d788 100644 --- a/examples/declarative/extending/valuesource/example.qml +++ b/examples/declarative/extending/valuesource/example.qml @@ -2,7 +2,7 @@ import People 1.0 // ![0] BirthdayParty { - speaker: HappyBirthday { name: "Bob Jones" } + HappyBirthday on speaker { name: "Bob Jones" } // ![0] onPartyStarted: console.log("This party started rockin' at " + time); -- cgit v0.12 From 61f3cb6e79fea0aed80df091013c2228f64955ec Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 21 Apr 2010 10:58:02 +1000 Subject: Improve docs and examples for Extending QML in C++ --- doc/src/declarative/extending.qdoc | 385 +++++++++++---------- examples/declarative/extending/adding/example.qml | 2 +- examples/declarative/extending/adding/main.cpp | 3 +- examples/declarative/extending/adding/person.h | 12 +- .../extending/attached/birthdayparty.cpp | 10 +- .../declarative/extending/attached/birthdayparty.h | 18 +- .../declarative/extending/attached/example.qml | 10 +- examples/declarative/extending/attached/main.cpp | 6 +- examples/declarative/extending/attached/person.h | 33 +- examples/declarative/extending/binding/binding.pro | 4 +- .../extending/binding/birthdayparty.cpp | 18 +- .../declarative/extending/binding/birthdayparty.h | 26 +- examples/declarative/extending/binding/example.qml | 6 +- .../extending/binding/happybirthday.cpp | 86 ----- .../declarative/extending/binding/happybirthday.h | 76 ---- .../extending/binding/happybirthdaysong.cpp | 86 +++++ .../extending/binding/happybirthdaysong.h | 75 ++++ examples/declarative/extending/binding/main.cpp | 10 +- examples/declarative/extending/binding/person.h | 33 +- .../extending/coercion/birthdayparty.cpp | 10 +- .../declarative/extending/coercion/birthdayparty.h | 14 +- .../declarative/extending/coercion/example.qml | 4 +- examples/declarative/extending/coercion/main.cpp | 6 +- examples/declarative/extending/coercion/person.h | 20 +- .../extending/default/birthdayparty.cpp | 10 +- .../declarative/extending/default/birthdayparty.h | 16 +- examples/declarative/extending/default/example.qml | 4 +- examples/declarative/extending/default/main.cpp | 6 +- examples/declarative/extending/default/person.h | 20 +- examples/declarative/extending/extended/lineedit.h | 10 +- .../extending/grouped/birthdayparty.cpp | 10 +- .../declarative/extending/grouped/birthdayparty.h | 16 +- examples/declarative/extending/grouped/example.qml | 4 +- examples/declarative/extending/grouped/main.cpp | 6 +- examples/declarative/extending/grouped/person.h | 33 +- .../extending/properties/birthdayparty.cpp | 10 +- .../extending/properties/birthdayparty.h | 14 +- .../declarative/extending/properties/example.qml | 4 +- examples/declarative/extending/properties/main.cpp | 4 +- examples/declarative/extending/properties/person.h | 10 +- .../declarative/extending/signal/birthdayparty.cpp | 10 +- .../declarative/extending/signal/birthdayparty.h | 18 +- examples/declarative/extending/signal/example.qml | 4 +- examples/declarative/extending/signal/main.cpp | 6 +- examples/declarative/extending/signal/person.h | 33 +- .../extending/valuesource/birthdayparty.cpp | 14 +- .../extending/valuesource/birthdayparty.h | 25 +- .../declarative/extending/valuesource/example.qml | 6 +- .../extending/valuesource/happybirthday.cpp | 81 ----- .../extending/valuesource/happybirthday.h | 79 ----- .../extending/valuesource/happybirthdaysong.cpp | 81 +++++ .../extending/valuesource/happybirthdaysong.h | 80 +++++ .../declarative/extending/valuesource/main.cpp | 10 +- .../declarative/extending/valuesource/person.h | 33 +- .../extending/valuesource/valuesource.pro | 4 +- 55 files changed, 827 insertions(+), 787 deletions(-) delete mode 100644 examples/declarative/extending/binding/happybirthday.cpp delete mode 100644 examples/declarative/extending/binding/happybirthday.h create mode 100644 examples/declarative/extending/binding/happybirthdaysong.cpp create mode 100644 examples/declarative/extending/binding/happybirthdaysong.h delete mode 100644 examples/declarative/extending/valuesource/happybirthday.cpp delete mode 100644 examples/declarative/extending/valuesource/happybirthday.h create mode 100644 examples/declarative/extending/valuesource/happybirthdaysong.cpp create mode 100644 examples/declarative/extending/valuesource/happybirthdaysong.h diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index d0e5f9e..9844804 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -43,53 +43,86 @@ \page qml-extending.html \title Extending QML in C++ +The QtDeclarative module provides a set of APIs for extending QML through +C++ extensions. You can write extensions to add your own QML types, extend existing +Qt types, or call C/C++ functions that are not accessible from ordinary QML code. + The QML syntax declaratively describes how to construct an in memory object tree. In Qt, QML is mainly used to describe a visual scene graph, but it is not conceptually limited to this: the QML format is an abstract description of any object tree. All the QML element types included in Qt are implemented using -the C++ extension mechanisms describe on this page. Programmers can use these -APIs to add new types that interact with the existing Qt types, or to repurpose -QML for their own independent use. +the C++ extension mechanisms describe on this page. \tableofcontents \section1 Adding Types \target adding-types +QML can easily be extended to support new types. + +Let's create a new QML type called "Person" that has two properties, a name and a +shoe size. We will make it available in a \l {Modules}{module} called "People", with +a module version of 1.0. We want this \c Person type to be usable from QML like this: + \snippet examples/declarative/extending/adding/example.qml 0 -The QML snippet shown above instantiates one \c Person instance and sets -the name and shoeSize properties on it. Everything in QML ultimately comes down -to either instantiating an object instance, or assigning a property a value. -QML relies heavily on Qt's meta object system and can only instantiate classes -that derive from QObject. +To do this, we need a C++ class that encapsulates this \c Person type and its two +properties. Since QML relies heavily on Qt's \l{Meta-Object System}{meta object system}, +this new class must: + +\list +\o inherit from QObject +\o declare its properties using the Q_PROPERTY() macro +\endlist -The QML engine has no intrinsic knowledge of any class types. Instead the -programmer must define the C++ types, and their corresponding QML name. +Here is the \c Person class: -Custom C++ types are registered using a template function: +\snippet examples/declarative/extending/adding/person.h 0 -\quotation +Now that the \c Person type is defined, it needs to be registered with QML +to make it available to QML code. To do this, call the qmlRegisterType() +template function. For example, this registers the \c Person type as a type called +"Person", to a module named "People", with a module version of 1.0: + +\snippet examples/declarative/extending/adding/main.cpp 0 + +Types can be registered by libraries (as Qt does), application code, +or by plugins (see QDeclarativeExtensionPlugin). + +Now the \c Person type can be used from QML as shown above. When we create a +\c Person item in QML, an instance of the C++ \c Person class is created, and the +\c name and \c shoeSize properties of the \c Person class can be set. All of +the properties of a registered type that are declared with Q_PROPERTY can be used +from QML. + +QML is typesafe. Attempting to assign an invalid value to a property will +generate an error. For example, assuming the name property of the \c Person +element had a type of QString, this would cause an error: \code -template -int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) +Person { + // Will NOT work + name: 12 +} \endcode -Calling qmlRegisterType() registers the C++ type \a T with the QML system, and makes it available in QML -under the name \a qmlName in library \a uri version \a versionMajor.versionMinor. -The \a qmlName can be the same as the C++ type name. +See \l {Extending QML - Adding Types Example} for the complete code used to create +the \c Person type. + +\section2 Interfaces + +QML also supports assigning Qt interfaces. To assign to a property whose type +is a Qt interface pointer, the interface must also be registered with QML. As +they cannot be instantiated directly, registering a Qt interface is different +from registering a new QML type. Instead of registering the type with +qmlRegisterType(), use qmlRegisterInterface(). -Type \a T must be a concrete type that inherits QObject and has a default -constructor. -\endquotation -Types can be registered by libraries (such as Qt does), application code, -or by plugins (see QDeclarativeExtensionPlugin). +\section1 Supporting object and list property types -Once registered, all of the \l {Qt's Property System}{properties} of a supported -type are available for use within QML. QML has intrinsic support for properties -of these types: +When a new type is registered with QML, all of its properties declared with +Q_PROPERTY are available from QML. QML has intrinsic support for properties of +these types: \list \o bool @@ -105,60 +138,36 @@ of these types: \o QVariant \endlist -QML is typesafe. Attempting to assign an invalid value to a property will -generate an error. For example, assuming the name property of the \c Person -element had a type of QString, this would cause an error: +The \c Person type in the previous example had basic property types - a string +for \c name, and an integer for \c shoeSize. However, QML can set properties of +types that are more complex than basic intrinsics like +integers and strings. Properties can also be object pointers, Qt interface +pointers, lists of object pointers, and lists of Qt interface pointers. -\code -Person { - // Will NOT work - name: 12 -} -\endcode +Let's create a new QML type, "BirthdayParty", that has two properties +with more complex types: -\l {Extending QML - Adding Types Example} shows the complete code used to create -the \c Person type. +\list +\o A \c host property whose value is a \c Person item +\o A \c guests property whose value is a list of \c Person items +\endlist -\section1 Object and List Property Types +We want to use it from QML like this: \snippet examples/declarative/extending/properties/example.qml 0 -The QML snippet shown above assigns a \c Person object to the \c BirthdayParty's -celebrant property, and assigns three \c Person objects to the guests property. - -QML can set properties of types that are more complex than basic intrinsics like -integers and strings. Properties can also be object pointers, Qt interface -pointers, lists of object points, and lists of Qt interface pointers. As QML -is typesafe it ensures that only valid types are assigned to these properties, -just like it does for primitive types. +This will assign a \c Person object to the \c BirthdayParty's \c host property, +and assigns three other \c Person objects in a list to the \c guests property. -Properties that are pointers to objects or Qt interfaces are declared with the -Q_PROPERTY() macro, just like other properties. The celebrant property -declaration looks like this: +To do this, we define a \c BirthdayParty class with the two properties. +The \c host property stores a \c Person* pointer. It is declared like this: \snippet examples/declarative/extending/properties/birthdayparty.h 1 -As long as the property type, in this case Person, is registered with QML the -property can be assigned. - -QML also supports assigning Qt interfaces. To assign to a property whose type -is a Qt interface pointer, the interface must also be registered with QML. As -they cannot be instantiated directly, registering a Qt interface is different -from registering a new QML type. The following function is used instead: - -\quotation -\code -template -int qmlRegisterInterface(const char *typeName) -\endcode - -Registers the C++ interface \a T with the QML system as \a typeName. - -Following registration, QML can coerce objects that implement this interface -for assignment to appropriately typed properties. -\endquotation +Note the type of the property (\c Person in this case) must be registered with QML with +qmlRegisterType() or qmlRegisterInterface(). Otherwise, the property cannot be assigned in QML. -The guests property is a list of \c Person objects. Properties that are lists +The \c guests property is a list of \c Person* objects. Properties that are lists of objects or Qt interfaces are also declared with the Q_PROPERTY() macro, just like other properties. List properties must have the type \c {QDeclarativeListProperty}. As with object properties, the type \a T must be registered with QML. @@ -167,43 +176,44 @@ The guest property declaration looks like this: \snippet examples/declarative/extending/properties/birthdayparty.h 2 +So, here is the complete \c BirthdayParty class declaration: + +\snippet examples/declarative/extending/properties/birthdayparty.h 0 +\snippet examples/declarative/extending/properties/birthdayparty.h 1 +\snippet examples/declarative/extending/properties/birthdayparty.h 2 +\snippet examples/declarative/extending/properties/birthdayparty.h 3 + +The \c BirthdayClass type is also registered using qmlRegisterType() so +it can be used from QML. + \l {Extending QML - Object and List Property Types Example} shows the complete code used to create the \c BirthdayParty type. \section1 Inheritance and Coercion -\snippet examples/declarative/extending/coercion/example.qml 0 - -The QML snippet shown above assigns a \c Boy object to the \c BirthdayParty's -celebrant property, and assigns three other objects to the guests property. - QML supports C++ inheritance heirarchies and can freely coerce between known, valid object types. This enables the creation of common base classes that allow -the assignment of specialized classes to object or list properties. In the -snippet shown, both the celebrant and the guests properties retain the Person -type used in the previous section, but the assignment is valid as both the Boy -and Girl objects inherit from Person. +the assignment of specialized classes to object or list properties. -To assign to a property, the property's type must have been registered with QML. -Both the qmlRegisterType() and qmlRegisterInterface() template functions already -shown can be used to register a type with QML. Additionally, if a type that acts purely -as a base class that cannot be instantiated from QML needs to be -registered, the following function can be used: +For example, if classes \c Girl and \c Boy both inherit from \c Person, then +\c Girl and \c Boy objects can be assigned in place of \c Person objects, like this: + +\snippet examples/declarative/extending/coercion/example.qml 0 + +To assign to a property, the property's type (in this case, \c Girl and \c Boy) +must be registered with QML. +Both the qmlRegisterType() and qmlRegisterInterface() template functions previously +discussed can be used to register a type with QML. Additionally, in the case of the +\c Person class, which now acts purely as a base class and should no longer be instantiated from QML, +the following function can be used: -\quotation \code template int qmlRegisterType() \endcode -Registers the C++ type \a T with the QML system. The parameterless call to the template -function qmlRegisterType() does not define a mapping between the -C++ class and a QML element name, so the type is not instantiable from QML, but -it is available for type coercion. - -Type \a T must inherit QObject, but there are no restrictions on whether it is -concrete or the signature of its constructor. -\endquotation +Calling the parameterless qmlRegisterType() ensures the type is available +to QML for type coercion but cannot be created as a type from QML. QML will automatically coerce C++ types when assigning to either an object property, or to a list property. Only if coercion fails does an assignment @@ -214,71 +224,70 @@ code used to create the \c Boy and \c Girl types. \section1 Default Property -\snippet examples/declarative/extending/default/example.qml 0 +The \e {default property} is a syntactic convenience that allows a type designer to +specify a single property as the type's default. -The QML snippet shown above assigns a collection of objects to the -\c BirthdayParty's default property. +This QML snippet assigns a collection of objects - two \c Boy and one +\c Girl objects - to the \c BirthdayParty's default property: -The default property is a syntactic convenience that allows a type designer to -specify a single property as the type's default. The default property is -assigned to whenever no explicit property is specified. As a convenience, it is -behaviorally identical to assigning the default property explicitly by name. +\snippet examples/declarative/extending/default/example.qml 0 + +The default property is assigned to whenever no explicit property is specified. +As a convenience, it is behaviorally identical to assigning the default property +explicitly by name. From C++, type designers mark the default property using a Q_CLASSINFO() annotation: -\quotation \code -Q_CLASSINFO("DefaultProperty", "property") + Q_CLASSINFO("DefaultProperty", "property") \endcode -Mark \a property as the class's default property. \a property must be either -an object property, or a list property. +The \c property must be either an object property, or a list property. The +\c property can refer to a property declared in the class itself, or a property +inherited from a base class. A default property is optional. A derived class inherits its base class's -default property, but may override it in its own declaration. \a property can -refer to a property declared in the class itself, or a property inherited from a -base class. -\endquotation +default property, but may override it in its own declaration. \l {Extending QML - Default Property Example} shows the complete code used to specify a default property. -\section1 Grouped Properties - -\snippet examples/declarative/extending/grouped/example.qml 1 -The QML snippet shown above assigns a number properties to the \c Boy object, -including four properties using the grouped property syntax. +\section1 Grouped Properties Grouped properties collect similar properties together into a single named block. Grouped properties can be used to present a nicer API to developers, and may also simplify the implementation of common property collections across different types through implementation reuse. +This QML snippet assigns a number properties to the \c Boy object, +including four properties using the grouped property syntax: + +\snippet examples/declarative/extending/grouped/example.qml 1 + A grouped property block is implemented as a read-only object property. The shoe property shown is declared like this: \snippet examples/declarative/extending/grouped/person.h 1 -The ShoeDescription type declares the properties available to the grouped -property block - in this case the size, color, brand and price properties. +The \c ShoeDescription type declares the properties available to the grouped +property block - in this case the \c size, \c color, \c brand and \c price properties. -Grouped property blocks may declared and accessed be recusively. +Grouped property blocks may be declared and accessed recusively. \l {Extending QML - Grouped Properties Example} shows the complete code used to implement the \c shoe property grouping. \section1 Attached Properties -\snippet examples/declarative/extending/attached/example.qml 1 +Attached properties allow unrelated types to annotate other types with some +additional properties, generally for their own use. This QML snippet assigns +an \c rsvp property using the attached property syntax: -The QML snippet shown above assigns the rsvp property using the attached -property syntax. +\snippet examples/declarative/extending/attached/example.qml 1 -Attached properties allow unrelated types to annotate other types with some -additional properties, generally for their own use. Attached properties are -identified through the use of the attacher type name, in the case shown +Attached properties are identified through the use of the attacher type name; in the case shown \c BirthdayParty, as a suffix to the property name. In the example shown, \c BirthdayParty is called the attaching type, and the @@ -289,35 +298,36 @@ QObject derived type, called the attachment object. The properties on the attachment object are those that become available for use as the attached property block. -Any QML type can become an attaching type by declaring the +Any QML type can become an attaching type by declaring a \c qmlAttachedProperties() public function and declaring that the class has QML_HAS_ATTACHED_PROPERTIES: -\quotation \code -class MyType : public QObject { - Q_OBJECT -public: + class MyType : public QObject { + Q_OBJECT + public: - ... + ... - static AttachedPropertiesType *qmlAttachedProperties(QObject *object); -}; + static AttachedPropertiesType *qmlAttachedProperties(QObject *object); + }; -QML_DECLARE_TYPEINFO(MyType, QML_HAS_ATTACHED_PROPERTIES) + QML_DECLARE_TYPEINFO(MyType, QML_HAS_ATTACHED_PROPERTIES) \endcode -Return an attachment object, of type \a AttachedPropertiesType, for the + +The qmlAttachedProperties() method returns an attachment object, of type \a AttachedPropertiesType, for the attachee \a object instance. It is customary, though not strictly required, for the attachment object to be parented to \a object to prevent memory leaks. -\a AttachedPropertiesType must be a QObject derived type. The properties on +The returned \a AttachedPropertiesType must be a QObject derived type. The properties on this type will be accessible through the attached properties syntax. -This method will be called at most once for each attachee object instance. The +This method is called at most once for each attachee object instance. The QML engine will cache the returned instance pointer for subsequent attached property accesses. Consequently the attachment object may not be deleted until \a object is destroyed. -\endquotation + +\section2 Use of attached properties Conceptually, attached properties are a \e type exporting a set of additional properties that can be set on \e any other object instance. Attached properties @@ -326,15 +336,18 @@ their effect may be so limited. For example, a common usage scenario is for a type to enhance the properties available to its children in order to gather instance specific data. Here we -add a rsvp field to all the guests coming to a birthday party: +add a \c rsvp field to all the guests coming to a birthday party: + \code BirthdayParty { Boy { BirthdayParty.rsvp: "2009-06-01" } } \endcode + However, as a type cannot limit the instances to which the attachment object must attach, the following is also allowed, even though adding a birthday party rsvp in this context will have no effect. + \code GraduationParty { Boy { BirthdayParty.rsvp: "2009-06-01" } @@ -362,7 +375,7 @@ implement the rsvp attached property. \section1 Memory Management and QVariant types -It is an elements responsibility to ensure that it does not access or return +It is an element's responsibility to ensure that it does not access or return pointers to invalid objects. QML makes the following guarentees: \list @@ -393,21 +406,24 @@ this situation, but it must not crash. \section1 Signal Support -\snippet examples/declarative/extending/signal/example.qml 0 -\snippet examples/declarative/extending/signal/example.qml 1 - -The QML snippet shown above associates the evaluation of a JavaScript expression -with the emission of a Qt signal. - All Qt signals on a registered class become available as special "signal properties" within QML to which the user can assign a single JavaScript expression. The signal property's name is a transformed version of the Qt signal name: "on" is prepended, and the first letter of the signal name upper -cased. For example, the signal used in the example above has the following -C++ signature: +cased. + +For example, if the \c BirthdayParty class has a signal like this: \snippet examples/declarative/extending/signal/birthdayparty.h 0 +This signal can be connected to from QML like this: + +\snippet examples/declarative/extending/signal/example.qml 0 +\snippet examples/declarative/extending/signal/example.qml 1 + +This associates the evaluation of a JavaScript expression +with the emission of a Qt signal. + In classes with multiple signals with the same name, only the final signal is accessible as a signal property. Note that signals with the same name but different parameters cannot be distinguished. @@ -424,38 +440,35 @@ implement the onPartyStarted signal property. \section1 Property Value Sources -\snippet examples/declarative/extending/valuesource/example.qml 0 -\snippet examples/declarative/extending/valuesource/example.qml 1 - -The QML snippet shown above applies a property value source to the speaker property. -A property value source generates a value for a property that changes over time. +A property value source is an element that generates a value for a +property that changes over time. Property value sources are most commonly used to +create animations; QML's built-in \l {Behavior}{Behavior} and various +\l {QML Animation}{animation} elements are actually property value sources. -Property value sources are most commonly used to do animation. Rather than -constructing an animation object and manually setting the animation's "target" -property, a property value source can be assigned directly to a property of any -type and automatically set up this association. +The \c BirthdayParty class has an \c announcement string property +whose value is printed to the console whenever it changes. Using a property value +source called \c HappyBirthdaySong, the value of this property can be changed, +over time, to each lyric in the song "Happy Birthday". For further customization, +a \c name property allows the song lyrics to be personalized with a particular name. +The \c HappyBirthdaySong property value source would be used in QML like this: -The example shown here is rather contrived: the speaker property of the -BirthdayParty object is a string that is printed every time it is assigned and -the HappyBirthday value source generates the lyrics of the song -"Happy Birthday". - -\snippet examples/declarative/extending/valuesource/birthdayparty.h 0 +\snippet examples/declarative/extending/valuesource/example.qml 0 +\snippet examples/declarative/extending/valuesource/example.qml 1 -Normally, assigning an object to a string property would not be allowed. In +(Normally, assigning an object to a string property would not be allowed. In the case of a property value source, rather than assigning the object instance itself, the QML engine sets up an association between the value source and -the property. +the property.) Property value sources are special types that derive from the QDeclarativePropertyValueSource base class. This base class contains a single method, QDeclarativePropertyValueSource::setTarget(), that the QML engine invokes when -associating the property value source with a property. The relevant part of -the HappyBirthday type declaration looks like this: +associating the property value source with a property. Here is the relevant part of +the \c HappyBirthdaySong type declaration: -\snippet examples/declarative/extending/valuesource/happybirthday.h 0 -\snippet examples/declarative/extending/valuesource/happybirthday.h 1 -\snippet examples/declarative/extending/valuesource/happybirthday.h 2 +\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 0 +\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 1 +\snippet examples/declarative/extending/valuesource/happybirthdaysong.h 2 In all other respects, property value sources are regular QML types. They must be registered with the QML engine using the same macros as other types, and can @@ -463,20 +476,15 @@ contain properties, signals and methods just like other types. When a property value source object is assigned to a property, QML first tries to assign it normally, as though it were a regular QML type. Only if this -assignment fails does the engine call the setTarget() method. This allows +assignment fails does the engine call the +\l {QDeclarativePropertyValueSource::setTarget()}{setTarget()} method. This allows the type to also be used in contexts other than just as a value source. \l {Extending QML - Property Value Source Example} shows the complete code used -implement the HappyBirthday property value source. +implement the HappyBirthdaySong property value source. \section1 Property Binding -\snippet examples/declarative/extending/binding/example.qml 0 -\snippet examples/declarative/extending/binding/example.qml 1 - -The QML snippet shown above uses a property binding to ensure the -HappyBirthday's name property remains up to date with the celebrant. - Property binding is a core feature of QML. In addition to assigning literal values, property bindings allow the developer to assign an arbitrarily complex JavaScript expression that may include dependencies on other property values. @@ -488,15 +496,23 @@ All properties on custom types automatically support property binding. However, for binding to work correctly, QML must be able to reliably determine when a property has changed so that it knows to reevaluate any bindings that depend on the property's value. QML relies on the presence of a -\c {Qt's Property System}{NOTIFY signal} for this determination. +\l {Qt's Property System}{NOTIFY signal} for this determination. -Here is the celebrant property declaration: +For example, to enable property binding for the \c host property in \c BirthdayParty, +add a \c hostChanged signal that is emitted when the \c host value changes, and +declare the \c host property like this: \snippet examples/declarative/extending/binding/birthdayparty.h 0 -The NOTIFY attribute is followed by a signal name. It is the responsibility of -the class implementer to ensure that whenever the property's value changes, the -NOTIFY signal is emitted. The signature of the NOTIFY signal is not important to QML. +This enables the use of a property binding to ensure the \c name value of the +\c HappyBirthdaySong is updated if the \c host value changes: + +\snippet examples/declarative/extending/binding/example.qml 0 +\snippet examples/declarative/extending/binding/example.qml 1 + +It is the responsibility of the class implementer to ensure that whenever the +property's value changes, the associated NOTIFY signal is emitted. The +signature of the NOTIFY signal is not important to QML. To prevent loops or excessive evaluation, developers should ensure that the signal is only emitted whenever the property's value is actually changed. If @@ -504,6 +520,8 @@ a property, or group of properties, is infrequently used it is permitted to use the same NOTIFY signal for several properties. This should be done with care to ensure that performance doesn't suffer. +\section2 Use of notify signals + To keep QML reliable, if a property does not have a NOTIFY signal, it cannot be used in a binding expression. However, the property can still be assigned a binding as QML does not need to monitor the property for change in that @@ -543,11 +561,6 @@ include NOTIFY signals for use in binding. \section1 Extension Objects -\snippet examples/declarative/extending/extended/example.qml 0 - -The QML snippet shown above adds a new property to an existing C++ type without -modifying its source code. - When integrating existing classes and technology into QML, their APIs will often need to be tweaked to fit better into the declarative environment. Although the best results are usually obtained by modifying the original classes @@ -561,6 +574,11 @@ type definition allows the programmer to supply an additional type - known as th extension type - when registering the target class whose properties are transparently merged with the original target class when used from within QML. +Here is a QML snippet that adds a new property to an existing C++ type without +modifying its source code: + +\snippet examples/declarative/extending/extended/example.qml 0 + An extension class is a regular QObject, with a constructor that takes a QObject pointer. When needed (extension classes are delay created until the first extended property is accessed) the extension class is created and the target object is @@ -572,6 +590,7 @@ When an extended type is installed, one of the #define QML_REGISTER_EXTENDED_TYPE(URI, VMAJ, VFROM, VTO, QDeclarativeName,T, ExtendedT) #define QML_REGISTER_EXTENDED_NOCREATE_TYPE(T, ExtendedT) \endcode + macros should be used instead of the regular \c QML_REGISTER_TYPE or \c QML_REGISTER_NOCREATE_TYPE. The arguments are identical to the corresponding non-extension object macro, except for the ExtendedT parameter which is the type diff --git a/examples/declarative/extending/adding/example.qml b/examples/declarative/extending/adding/example.qml index c608f94..dc891e7 100644 --- a/examples/declarative/extending/adding/example.qml +++ b/examples/declarative/extending/adding/example.qml @@ -1,6 +1,6 @@ +// ![0] import People 1.0 -// ![0] Person { name: "Bob Jones" shoeSize: 12 diff --git a/examples/declarative/extending/adding/main.cpp b/examples/declarative/extending/adding/main.cpp index b9e5aa3..7b33895 100644 --- a/examples/declarative/extending/adding/main.cpp +++ b/examples/declarative/extending/adding/main.cpp @@ -47,8 +47,9 @@ int main(int argc, char ** argv) { QCoreApplication app(argc, argv); - +//![0] qmlRegisterType("People", 1,0, "Person"); +//![0] QDeclarativeEngine engine; QDeclarativeComponent component(&engine, ":example.qml"); diff --git a/examples/declarative/extending/adding/person.h b/examples/declarative/extending/adding/person.h index 7a9e0f0..d6de9a9 100644 --- a/examples/declarative/extending/adding/person.h +++ b/examples/declarative/extending/adding/person.h @@ -43,12 +43,11 @@ #include // ![0] -#include - -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName) -Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) public: Person(QObject *parent = 0); @@ -57,6 +56,7 @@ public: int shoeSize() const; void setShoeSize(int); + private: QString m_name; int m_shoeSize; diff --git a/examples/declarative/extending/attached/birthdayparty.cpp b/examples/declarative/extending/attached/birthdayparty.cpp index d4f2675..7fa1748 100644 --- a/examples/declarative/extending/attached/birthdayparty.cpp +++ b/examples/declarative/extending/attached/birthdayparty.cpp @@ -56,18 +56,18 @@ void BirthdayPartyAttached::setRsvp(const QDate &d) } BirthdayParty::BirthdayParty(QObject *parent) -: QObject(parent), m_celebrant(0) +: QObject(parent), m_host(0) { } -Person *BirthdayParty::celebrant() const +Person *BirthdayParty::host() const { - return m_celebrant; + return m_host; } -void BirthdayParty::setCelebrant(Person *c) +void BirthdayParty::setHost(Person *c) { - m_celebrant = c; + m_host = c; } QDeclarativeListProperty BirthdayParty::guests() diff --git a/examples/declarative/extending/attached/birthdayparty.h b/examples/declarative/extending/attached/birthdayparty.h index 7c45d21..1c66f8c 100644 --- a/examples/declarative/extending/attached/birthdayparty.h +++ b/examples/declarative/extending/attached/birthdayparty.h @@ -48,8 +48,8 @@ class BirthdayPartyAttached : public QObject { -Q_OBJECT -Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp) + Q_OBJECT + Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp) public: BirthdayPartyAttached(QObject *object); @@ -62,15 +62,15 @@ private: class BirthdayParty : public QObject { -Q_OBJECT -Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) -Q_PROPERTY(QDeclarativeListProperty guests READ guests) -Q_CLASSINFO("DefaultProperty", "guests") + Q_OBJECT + Q_PROPERTY(Person *host READ host WRITE setHost) + Q_PROPERTY(QDeclarativeListProperty guests READ guests) + Q_CLASSINFO("DefaultProperty", "guests") public: BirthdayParty(QObject *parent = 0); - Person *celebrant() const; - void setCelebrant(Person *); + Person *host() const; + void setHost(Person *); QDeclarativeListProperty guests(); int guestCount() const; @@ -78,7 +78,7 @@ public: static BirthdayPartyAttached *qmlAttachedProperties(QObject *); private: - Person *m_celebrant; + Person *m_host; QList m_guests; }; diff --git a/examples/declarative/extending/attached/example.qml b/examples/declarative/extending/attached/example.qml index 952eb93..50f0a32 100644 --- a/examples/declarative/extending/attached/example.qml +++ b/examples/declarative/extending/attached/example.qml @@ -1,16 +1,17 @@ import People 1.0 BirthdayParty { - celebrant: Boy { + host: Boy { name: "Bob Jones" shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 } } // ![1] Boy { - name: "Joan Hodges" - BirthdayParty.rsvp: "2009-07-06" + name: "Leo Hodges" shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 } + + BirthdayParty.rsvp: "2009-07-06" } // ![1] Boy { @@ -19,11 +20,12 @@ BirthdayParty { } Girl { name: "Anne Brown" - BirthdayParty.rsvp: "2009-07-01" shoe.size: 7 shoe.color: "red" shoe.brand: "Marc Jacobs" shoe.price: 699.99 + + BirthdayParty.rsvp: "2009-07-01" } } diff --git a/examples/declarative/extending/attached/main.cpp b/examples/declarative/extending/attached/main.cpp index fd2d525..f1055ae 100644 --- a/examples/declarative/extending/attached/main.cpp +++ b/examples/declarative/extending/attached/main.cpp @@ -60,10 +60,10 @@ int main(int argc, char ** argv) QDeclarativeComponent component(&engine, ":example.qml"); BirthdayParty *party = qobject_cast(component.create()); - if (party && party->celebrant()) { - qWarning() << party->celebrant()->name() << "is having a birthday!"; + if (party && party->host()) { + qWarning() << party->host()->name() << "is having a birthday!"; - if (qobject_cast(party->celebrant())) + if (qobject_cast(party->host())) qWarning() << "He is inviting:"; else qWarning() << "She is inviting:"; diff --git a/examples/declarative/extending/attached/person.h b/examples/declarative/extending/attached/person.h index 7a4b9c3..2f444c5 100644 --- a/examples/declarative/extending/attached/person.h +++ b/examples/declarative/extending/attached/person.h @@ -43,14 +43,14 @@ #include #include -#include -class ShoeDescription : public QObject { -Q_OBJECT -Q_PROPERTY(int size READ size WRITE setSize) -Q_PROPERTY(QColor color READ color WRITE setColor) -Q_PROPERTY(QString brand READ brand WRITE setBrand) -Q_PROPERTY(qreal price READ price WRITE setPrice) +class ShoeDescription : public QObject +{ + Q_OBJECT + Q_PROPERTY(int size READ size WRITE setSize) + Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QString brand READ brand WRITE setBrand) + Q_PROPERTY(qreal price READ price WRITE setPrice) public: ShoeDescription(QObject *parent = 0); @@ -72,10 +72,11 @@ private: qreal m_price; }; -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName) -Q_PROPERTY(ShoeDescription *shoe READ shoe) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(ShoeDescription *shoe READ shoe) public: Person(QObject *parent = 0); @@ -88,14 +89,16 @@ private: ShoeDescription m_shoe; }; -class Boy : public Person { -Q_OBJECT +class Boy : public Person +{ + Q_OBJECT public: Boy(QObject * parent = 0); }; -class Girl : public Person { -Q_OBJECT +class Girl : public Person +{ + Q_OBJECT public: Girl(QObject * parent = 0); }; diff --git a/examples/declarative/extending/binding/binding.pro b/examples/declarative/extending/binding/binding.pro index 903712e..896ce25 100644 --- a/examples/declarative/extending/binding/binding.pro +++ b/examples/declarative/extending/binding/binding.pro @@ -8,10 +8,10 @@ QT += declarative SOURCES += main.cpp \ person.cpp \ birthdayparty.cpp \ - happybirthday.cpp + happybirthdaysong.cpp HEADERS += person.h \ birthdayparty.h \ - happybirthday.h + happybirthdaysong.h RESOURCES += binding.qrc target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/binding sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS binding.pro diff --git a/examples/declarative/extending/binding/birthdayparty.cpp b/examples/declarative/extending/binding/birthdayparty.cpp index e5be2b9..000bb1f 100644 --- a/examples/declarative/extending/binding/birthdayparty.cpp +++ b/examples/declarative/extending/binding/birthdayparty.cpp @@ -60,20 +60,20 @@ void BirthdayPartyAttached::setRsvp(const QDate &d) BirthdayParty::BirthdayParty(QObject *parent) -: QObject(parent), m_celebrant(0) +: QObject(parent), m_host(0) { } -Person *BirthdayParty::celebrant() const +Person *BirthdayParty::host() const { - return m_celebrant; + return m_host; } -void BirthdayParty::setCelebrant(Person *c) +void BirthdayParty::setHost(Person *c) { - if (c == m_celebrant) return; - m_celebrant = c; - emit celebrantChanged(); + if (c == m_host) return; + m_host = c; + emit hostChanged(); } QDeclarativeListProperty BirthdayParty::guests() @@ -97,12 +97,12 @@ void BirthdayParty::startParty() emit partyStarted(time); } -QString BirthdayParty::speaker() const +QString BirthdayParty::announcement() const { return QString(); } -void BirthdayParty::setSpeaker(const QString &speak) +void BirthdayParty::setAnnouncement(const QString &speak) { qWarning() << qPrintable(speak); } diff --git a/examples/declarative/extending/binding/birthdayparty.h b/examples/declarative/extending/binding/birthdayparty.h index e2757bc..c3f033e 100644 --- a/examples/declarative/extending/binding/birthdayparty.h +++ b/examples/declarative/extending/binding/birthdayparty.h @@ -49,8 +49,8 @@ class BirthdayPartyAttached : public QObject { -Q_OBJECT -Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp NOTIFY rsvpChanged) + Q_OBJECT + Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp NOTIFY rsvpChanged) public: BirthdayPartyAttached(QObject *object); @@ -66,35 +66,35 @@ private: class BirthdayParty : public QObject { -Q_OBJECT + Q_OBJECT // ![0] -Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant NOTIFY celebrantChanged) + Q_PROPERTY(Person *host READ host WRITE setHost NOTIFY hostChanged) // ![0] -Q_PROPERTY(QDeclarativeListProperty guests READ guests) -Q_PROPERTY(QString speaker READ speaker WRITE setSpeaker) -Q_CLASSINFO("DefaultProperty", "guests") + Q_PROPERTY(QDeclarativeListProperty guests READ guests) + Q_PROPERTY(QString announcement READ announcement WRITE setAnnouncement) + Q_CLASSINFO("DefaultProperty", "guests") public: BirthdayParty(QObject *parent = 0); - Person *celebrant() const; - void setCelebrant(Person *); + Person *host() const; + void setHost(Person *); QDeclarativeListProperty guests(); int guestCount() const; Person *guest(int) const; - QString speaker() const; - void setSpeaker(const QString &); + QString announcement() const; + void setAnnouncement(const QString &); static BirthdayPartyAttached *qmlAttachedProperties(QObject *); void startParty(); signals: void partyStarted(const QTime &time); - void celebrantChanged(); + void hostChanged(); private: - Person *m_celebrant; + Person *m_host; QList m_guests; }; diff --git a/examples/declarative/extending/binding/example.qml b/examples/declarative/extending/binding/example.qml index b67049b..82eb3be 100644 --- a/examples/declarative/extending/binding/example.qml +++ b/examples/declarative/extending/binding/example.qml @@ -4,9 +4,9 @@ import People 1.0 BirthdayParty { id: theParty - HappyBirthday on speaker { name: theParty.celebrant.name } + HappyBirthdaySong on announcement { name: theParty.host.name } - celebrant: Boy { + host: Boy { name: "Bob Jones" shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 } } @@ -15,7 +15,7 @@ BirthdayParty { Boy { - name: "Joan Hodges" + name: "Leo Hodges" BirthdayParty.rsvp: "2009-07-06" shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 } } diff --git a/examples/declarative/extending/binding/happybirthday.cpp b/examples/declarative/extending/binding/happybirthday.cpp deleted file mode 100644 index aa5f937..0000000 --- a/examples/declarative/extending/binding/happybirthday.cpp +++ /dev/null @@ -1,86 +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 examples 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 "happybirthday.h" -#include - -HappyBirthday::HappyBirthday(QObject *parent) -: QObject(parent), m_line(-1) -{ - setName(QString()); - QTimer *timer = new QTimer(this); - QObject::connect(timer, SIGNAL(timeout()), this, SLOT(advance())); - timer->start(1000); -} - -void HappyBirthday::setTarget(const QDeclarativeProperty &p) -{ - m_target = p; -} - -QString HappyBirthday::name() const -{ - return m_name; -} - -void HappyBirthday::setName(const QString &name) -{ - if (m_name == name) - return; - - m_name = name; - - m_lyrics.clear(); - m_lyrics << "Happy birthday to you,"; - m_lyrics << "Happy birthday to you,"; - m_lyrics << "Happy birthday dear " + m_name + ","; - m_lyrics << "Happy birthday to you!"; - m_lyrics << ""; - - emit nameChanged(); -} - -void HappyBirthday::advance() -{ - m_line = (m_line + 1) % m_lyrics.count(); - - m_target.write(m_lyrics.at(m_line)); -} - diff --git a/examples/declarative/extending/binding/happybirthday.h b/examples/declarative/extending/binding/happybirthday.h deleted file mode 100644 index 0e5a90a..0000000 --- a/examples/declarative/extending/binding/happybirthday.h +++ /dev/null @@ -1,76 +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 examples 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 HAPPYBIRTHDAY_H -#define HAPPYBIRTHDAY_H - -#include -#include -#include - -#include - -class HappyBirthday : public QObject, public QDeclarativePropertyValueSource -{ -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) -Q_INTERFACES(QDeclarativePropertyValueSource) -public: - HappyBirthday(QObject *parent = 0); - - virtual void setTarget(const QDeclarativeProperty &); - - QString name() const; - void setName(const QString &); - -private slots: - void advance(); - -signals: - void nameChanged(); -private: - int m_line; - QStringList m_lyrics; - QDeclarativeProperty m_target; - QString m_name; -}; - -#endif // HAPPYBIRTHDAY_H - diff --git a/examples/declarative/extending/binding/happybirthdaysong.cpp b/examples/declarative/extending/binding/happybirthdaysong.cpp new file mode 100644 index 0000000..a40e7fb --- /dev/null +++ b/examples/declarative/extending/binding/happybirthdaysong.cpp @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** 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 examples 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 "happybirthdaysong.h" +#include + +HappyBirthdaySong::HappyBirthdaySong(QObject *parent) +: QObject(parent), m_line(-1) +{ + setName(QString()); + QTimer *timer = new QTimer(this); + QObject::connect(timer, SIGNAL(timeout()), this, SLOT(advance())); + timer->start(1000); +} + +void HappyBirthdaySong::setTarget(const QDeclarativeProperty &p) +{ + m_target = p; +} + +QString HappyBirthdaySong::name() const +{ + return m_name; +} + +void HappyBirthdaySong::setName(const QString &name) +{ + if (m_name == name) + return; + + m_name = name; + + m_lyrics.clear(); + m_lyrics << "Happy birthday to you,"; + m_lyrics << "Happy birthday to you,"; + m_lyrics << "Happy birthday dear " + m_name + ","; + m_lyrics << "Happy birthday to you!"; + m_lyrics << ""; + + emit nameChanged(); +} + +void HappyBirthdaySong::advance() +{ + m_line = (m_line + 1) % m_lyrics.count(); + + m_target.write(m_lyrics.at(m_line)); +} + diff --git a/examples/declarative/extending/binding/happybirthdaysong.h b/examples/declarative/extending/binding/happybirthdaysong.h new file mode 100644 index 0000000..e825b86 --- /dev/null +++ b/examples/declarative/extending/binding/happybirthdaysong.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** 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 examples 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 HAPPYBIRTHDAYSONG_H +#define HAPPYBIRTHDAYSONG_H + +#include +#include + +#include + +class HappyBirthdaySong : public QObject, public QDeclarativePropertyValueSource +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) + Q_INTERFACES(QDeclarativePropertyValueSource) +public: + HappyBirthdaySong(QObject *parent = 0); + + virtual void setTarget(const QDeclarativeProperty &); + + QString name() const; + void setName(const QString &); + +private slots: + void advance(); + +signals: + void nameChanged(); +private: + int m_line; + QStringList m_lyrics; + QDeclarativeProperty m_target; + QString m_name; +}; + +#endif // HAPPYBIRTHDAYSONG_H + diff --git a/examples/declarative/extending/binding/main.cpp b/examples/declarative/extending/binding/main.cpp index ce6c50d..2495676 100644 --- a/examples/declarative/extending/binding/main.cpp +++ b/examples/declarative/extending/binding/main.cpp @@ -43,7 +43,7 @@ #include #include #include "birthdayparty.h" -#include "happybirthday.h" +#include "happybirthdaysong.h" #include "person.h" int main(int argc, char ** argv) @@ -51,7 +51,7 @@ int main(int argc, char ** argv) QCoreApplication app(argc, argv); qmlRegisterType(); qmlRegisterType("People", 1,0, "BirthdayParty"); - qmlRegisterType("People", 1,0, "HappyBirthday"); + qmlRegisterType("People", 1,0, "HappyBirthdaySong"); qmlRegisterType(); qmlRegisterType(); qmlRegisterType("People", 1,0, "Boy"); @@ -61,10 +61,10 @@ int main(int argc, char ** argv) QDeclarativeComponent component(&engine, ":example.qml"); BirthdayParty *party = qobject_cast(component.create()); - if (party && party->celebrant()) { - qWarning() << party->celebrant()->name() << "is having a birthday!"; + if (party && party->host()) { + qWarning() << party->host()->name() << "is having a birthday!"; - if (qobject_cast(party->celebrant())) + if (qobject_cast(party->host())) qWarning() << "He is inviting:"; else qWarning() << "She is inviting:"; diff --git a/examples/declarative/extending/binding/person.h b/examples/declarative/extending/binding/person.h index 0edfcdd..2a68da0 100644 --- a/examples/declarative/extending/binding/person.h +++ b/examples/declarative/extending/binding/person.h @@ -43,14 +43,14 @@ #include #include -#include -class ShoeDescription : public QObject { -Q_OBJECT -Q_PROPERTY(int size READ size WRITE setSize NOTIFY shoeChanged) -Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY shoeChanged) -Q_PROPERTY(QString brand READ brand WRITE setBrand NOTIFY shoeChanged) -Q_PROPERTY(qreal price READ price WRITE setPrice NOTIFY shoeChanged) +class ShoeDescription : public QObject +{ + Q_OBJECT + Q_PROPERTY(int size READ size WRITE setSize NOTIFY shoeChanged) + Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY shoeChanged) + Q_PROPERTY(QString brand READ brand WRITE setBrand NOTIFY shoeChanged) + Q_PROPERTY(qreal price READ price WRITE setPrice NOTIFY shoeChanged) public: ShoeDescription(QObject *parent = 0); @@ -75,11 +75,12 @@ private: qreal m_price; }; -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) // ![0] -Q_PROPERTY(ShoeDescription *shoe READ shoe CONSTANT) + Q_PROPERTY(ShoeDescription *shoe READ shoe CONSTANT) // ![0] public: Person(QObject *parent = 0); @@ -96,14 +97,16 @@ private: ShoeDescription m_shoe; }; -class Boy : public Person { -Q_OBJECT +class Boy : public Person +{ + Q_OBJECT public: Boy(QObject * parent = 0); }; -class Girl : public Person { -Q_OBJECT +class Girl : public Person +{ + Q_OBJECT public: Girl(QObject * parent = 0); }; diff --git a/examples/declarative/extending/coercion/birthdayparty.cpp b/examples/declarative/extending/coercion/birthdayparty.cpp index 523a42d..4f415a3 100644 --- a/examples/declarative/extending/coercion/birthdayparty.cpp +++ b/examples/declarative/extending/coercion/birthdayparty.cpp @@ -41,18 +41,18 @@ #include "birthdayparty.h" BirthdayParty::BirthdayParty(QObject *parent) -: QObject(parent), m_celebrant(0) +: QObject(parent), m_host(0) { } -Person *BirthdayParty::celebrant() const +Person *BirthdayParty::host() const { - return m_celebrant; + return m_host; } -void BirthdayParty::setCelebrant(Person *c) +void BirthdayParty::setHost(Person *c) { - m_celebrant = c; + m_host = c; } QDeclarativeListProperty BirthdayParty::guests() diff --git a/examples/declarative/extending/coercion/birthdayparty.h b/examples/declarative/extending/coercion/birthdayparty.h index a5d14f9..ee77e9a 100644 --- a/examples/declarative/extending/coercion/birthdayparty.h +++ b/examples/declarative/extending/coercion/birthdayparty.h @@ -42,28 +42,28 @@ #define BIRTHDAYPARTY_H #include -#include +#include #include "person.h" class BirthdayParty : public QObject { -Q_OBJECT + Q_OBJECT // ![0] -Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) -Q_PROPERTY(QDeclarativeListProperty guests READ guests) + Q_PROPERTY(Person *host READ host WRITE setHost) + Q_PROPERTY(QDeclarativeListProperty guests READ guests) // ![0] public: BirthdayParty(QObject *parent = 0); - Person *celebrant() const; - void setCelebrant(Person *); + Person *host() const; + void setHost(Person *); QDeclarativeListProperty guests(); int guestCount() const; Person *guest(int) const; private: - Person *m_celebrant; + Person *m_host; QList m_guests; }; diff --git a/examples/declarative/extending/coercion/example.qml b/examples/declarative/extending/coercion/example.qml index 64d26b0..7b45950 100644 --- a/examples/declarative/extending/coercion/example.qml +++ b/examples/declarative/extending/coercion/example.qml @@ -2,12 +2,12 @@ import People 1.0 // ![0] BirthdayParty { - celebrant: Boy { + host: Boy { name: "Bob Jones" shoeSize: 12 } guests: [ - Boy { name: "Joan Hodges" }, + Boy { name: "Leo Hodges" }, Boy { name: "Jack Smith" }, Girl { name: "Anne Brown" } ] diff --git a/examples/declarative/extending/coercion/main.cpp b/examples/declarative/extending/coercion/main.cpp index 312aff9..2c7b545 100644 --- a/examples/declarative/extending/coercion/main.cpp +++ b/examples/declarative/extending/coercion/main.cpp @@ -60,10 +60,10 @@ int main(int argc, char ** argv) QDeclarativeComponent component(&engine, ":example.qml"); BirthdayParty *party = qobject_cast(component.create()); - if (party && party->celebrant()) { - qWarning() << party->celebrant()->name() << "is having a birthday!"; + if (party && party->host()) { + qWarning() << party->host()->name() << "is having a birthday!"; - if (qobject_cast(party->celebrant())) + if (qobject_cast(party->host())) qWarning() << "He is inviting:"; else qWarning() << "She is inviting:"; diff --git a/examples/declarative/extending/coercion/person.h b/examples/declarative/extending/coercion/person.h index 861f135..1c95da7 100644 --- a/examples/declarative/extending/coercion/person.h +++ b/examples/declarative/extending/coercion/person.h @@ -42,12 +42,12 @@ #define PERSON_H #include -#include -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName) -Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) public: Person(QObject *parent = 0); @@ -63,15 +63,17 @@ private: // ![0] -class Boy : public Person { -Q_OBJECT +class Boy : public Person +{ + Q_OBJECT public: Boy(QObject * parent = 0); }; -class Girl : public Person { -Q_OBJECT +class Girl : public Person +{ + Q_OBJECT public: Girl(QObject * parent = 0); }; diff --git a/examples/declarative/extending/default/birthdayparty.cpp b/examples/declarative/extending/default/birthdayparty.cpp index 523a42d..4f415a3 100644 --- a/examples/declarative/extending/default/birthdayparty.cpp +++ b/examples/declarative/extending/default/birthdayparty.cpp @@ -41,18 +41,18 @@ #include "birthdayparty.h" BirthdayParty::BirthdayParty(QObject *parent) -: QObject(parent), m_celebrant(0) +: QObject(parent), m_host(0) { } -Person *BirthdayParty::celebrant() const +Person *BirthdayParty::host() const { - return m_celebrant; + return m_host; } -void BirthdayParty::setCelebrant(Person *c) +void BirthdayParty::setHost(Person *c) { - m_celebrant = c; + m_host = c; } QDeclarativeListProperty BirthdayParty::guests() diff --git a/examples/declarative/extending/default/birthdayparty.h b/examples/declarative/extending/default/birthdayparty.h index c0cb0a4..9741040 100644 --- a/examples/declarative/extending/default/birthdayparty.h +++ b/examples/declarative/extending/default/birthdayparty.h @@ -42,28 +42,28 @@ #define BIRTHDAYPARTY_H #include -#include +#include #include "person.h" // ![0] class BirthdayParty : public QObject { -Q_OBJECT -Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) -Q_PROPERTY(QDeclarativeListProperty guests READ guests) -Q_CLASSINFO("DefaultProperty", "guests") + Q_OBJECT + Q_PROPERTY(Person *host READ host WRITE setHost) + Q_PROPERTY(QDeclarativeListProperty guests READ guests) + Q_CLASSINFO("DefaultProperty", "guests") public: BirthdayParty(QObject *parent = 0); - Person *celebrant() const; - void setCelebrant(Person *); + Person *host() const; + void setHost(Person *); QDeclarativeListProperty guests(); int guestCount() const; Person *guest(int) const; private: - Person *m_celebrant; + Person *m_host; QList m_guests; }; // ![0] diff --git a/examples/declarative/extending/default/example.qml b/examples/declarative/extending/default/example.qml index 58035f9..c0f3cbb 100644 --- a/examples/declarative/extending/default/example.qml +++ b/examples/declarative/extending/default/example.qml @@ -2,12 +2,12 @@ import People 1.0 // ![0] BirthdayParty { - celebrant: Boy { + host: Boy { name: "Bob Jones" shoeSize: 12 } - Boy { name: "Joan Hodges" } + Boy { name: "Leo Hodges" } Boy { name: "Jack Smith" } Girl { name: "Anne Brown" } } diff --git a/examples/declarative/extending/default/main.cpp b/examples/declarative/extending/default/main.cpp index 06282ad..2ffd180 100644 --- a/examples/declarative/extending/default/main.cpp +++ b/examples/declarative/extending/default/main.cpp @@ -58,10 +58,10 @@ int main(int argc, char ** argv) QDeclarativeComponent component(&engine, ":example.qml"); BirthdayParty *party = qobject_cast(component.create()); - if (party && party->celebrant()) { - qWarning() << party->celebrant()->name() << "is having a birthday!"; + if (party && party->host()) { + qWarning() << party->host()->name() << "is having a birthday!"; - if (qobject_cast(party->celebrant())) + if (qobject_cast(party->host())) qWarning() << "He is inviting:"; else qWarning() << "She is inviting:"; diff --git a/examples/declarative/extending/default/person.h b/examples/declarative/extending/default/person.h index 832bf11..3e56860 100644 --- a/examples/declarative/extending/default/person.h +++ b/examples/declarative/extending/default/person.h @@ -42,12 +42,12 @@ #define PERSON_H #include -#include -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName) -Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) public: Person(QObject *parent = 0); @@ -61,14 +61,16 @@ private: int m_shoeSize; }; -class Boy : public Person { -Q_OBJECT +class Boy : public Person +{ + Q_OBJECT public: Boy(QObject * parent = 0); }; -class Girl : public Person { -Q_OBJECT +class Girl : public Person +{ + Q_OBJECT public: Girl(QObject * parent = 0); }; diff --git a/examples/declarative/extending/extended/lineedit.h b/examples/declarative/extending/extended/lineedit.h index 9730b91..3a464b0 100644 --- a/examples/declarative/extending/extended/lineedit.h +++ b/examples/declarative/extending/extended/lineedit.h @@ -45,11 +45,11 @@ class LineEditExtension : public QObject { -Q_OBJECT -Q_PROPERTY(int leftMargin READ leftMargin WRITE setLeftMargin NOTIFY marginsChanged) -Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin NOTIFY marginsChanged) -Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin NOTIFY marginsChanged) -Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY marginsChanged) + Q_OBJECT + Q_PROPERTY(int leftMargin READ leftMargin WRITE setLeftMargin NOTIFY marginsChanged) + Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin NOTIFY marginsChanged) + Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin NOTIFY marginsChanged) + Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY marginsChanged) public: LineEditExtension(QObject *); diff --git a/examples/declarative/extending/grouped/birthdayparty.cpp b/examples/declarative/extending/grouped/birthdayparty.cpp index 523a42d..4f415a3 100644 --- a/examples/declarative/extending/grouped/birthdayparty.cpp +++ b/examples/declarative/extending/grouped/birthdayparty.cpp @@ -41,18 +41,18 @@ #include "birthdayparty.h" BirthdayParty::BirthdayParty(QObject *parent) -: QObject(parent), m_celebrant(0) +: QObject(parent), m_host(0) { } -Person *BirthdayParty::celebrant() const +Person *BirthdayParty::host() const { - return m_celebrant; + return m_host; } -void BirthdayParty::setCelebrant(Person *c) +void BirthdayParty::setHost(Person *c) { - m_celebrant = c; + m_host = c; } QDeclarativeListProperty BirthdayParty::guests() diff --git a/examples/declarative/extending/grouped/birthdayparty.h b/examples/declarative/extending/grouped/birthdayparty.h index 4ac5602..31d21b2 100644 --- a/examples/declarative/extending/grouped/birthdayparty.h +++ b/examples/declarative/extending/grouped/birthdayparty.h @@ -42,27 +42,27 @@ #define BIRTHDAYPARTY_H #include -#include +#include #include "person.h" class BirthdayParty : public QObject { -Q_OBJECT -Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) -Q_PROPERTY(QDeclarativeListProperty guests READ guests) -Q_CLASSINFO("DefaultProperty", "guests") + Q_OBJECT + Q_PROPERTY(Person *host READ host WRITE setHost) + Q_PROPERTY(QDeclarativeListProperty guests READ guests) + Q_CLASSINFO("DefaultProperty", "guests") public: BirthdayParty(QObject *parent = 0); - Person *celebrant() const; - void setCelebrant(Person *); + Person *host() const; + void setHost(Person *); QDeclarativeListProperty guests(); int guestCount() const; Person *guest(int) const; private: - Person *m_celebrant; + Person *m_host; QList m_guests; }; diff --git a/examples/declarative/extending/grouped/example.qml b/examples/declarative/extending/grouped/example.qml index 55912ed..91b7a06 100644 --- a/examples/declarative/extending/grouped/example.qml +++ b/examples/declarative/extending/grouped/example.qml @@ -2,13 +2,13 @@ import People 1.0 // ![0] BirthdayParty { - celebrant: Boy { + host: Boy { name: "Bob Jones" shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 } } Boy { - name: "Joan Hodges" + name: "Leo Hodges" shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 } } // ![1] diff --git a/examples/declarative/extending/grouped/main.cpp b/examples/declarative/extending/grouped/main.cpp index b383a8b..baf32cf 100644 --- a/examples/declarative/extending/grouped/main.cpp +++ b/examples/declarative/extending/grouped/main.cpp @@ -59,10 +59,10 @@ int main(int argc, char ** argv) QDeclarativeComponent component(&engine, ":example.qml"); BirthdayParty *party = qobject_cast(component.create()); - if (party && party->celebrant()) { - qWarning() << party->celebrant()->name() << "is having a birthday!"; + if (party && party->host()) { + qWarning() << party->host()->name() << "is having a birthday!"; - if (qobject_cast(party->celebrant())) + if (qobject_cast(party->host())) qWarning() << "He is inviting:"; else qWarning() << "She is inviting:"; diff --git a/examples/declarative/extending/grouped/person.h b/examples/declarative/extending/grouped/person.h index 216c015..a031e69 100644 --- a/examples/declarative/extending/grouped/person.h +++ b/examples/declarative/extending/grouped/person.h @@ -43,14 +43,14 @@ #include #include -#include -class ShoeDescription : public QObject { -Q_OBJECT -Q_PROPERTY(int size READ size WRITE setSize) -Q_PROPERTY(QColor color READ color WRITE setColor) -Q_PROPERTY(QString brand READ brand WRITE setBrand) -Q_PROPERTY(qreal price READ price WRITE setPrice) +class ShoeDescription : public QObject +{ + Q_OBJECT + Q_PROPERTY(int size READ size WRITE setSize) + Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QString brand READ brand WRITE setBrand) + Q_PROPERTY(qreal price READ price WRITE setPrice) public: ShoeDescription(QObject *parent = 0); @@ -72,11 +72,12 @@ private: qreal m_price; }; -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName) // ![1] -Q_PROPERTY(ShoeDescription *shoe READ shoe) + Q_PROPERTY(ShoeDescription *shoe READ shoe) // ![1] public: Person(QObject *parent = 0); @@ -90,14 +91,16 @@ private: ShoeDescription m_shoe; }; -class Boy : public Person { -Q_OBJECT +class Boy : public Person +{ + Q_OBJECT public: Boy(QObject * parent = 0); }; -class Girl : public Person { -Q_OBJECT +class Girl : public Person +{ + Q_OBJECT public: Girl(QObject * parent = 0); }; diff --git a/examples/declarative/extending/properties/birthdayparty.cpp b/examples/declarative/extending/properties/birthdayparty.cpp index 14fd6a3..27d17a1 100644 --- a/examples/declarative/extending/properties/birthdayparty.cpp +++ b/examples/declarative/extending/properties/birthdayparty.cpp @@ -41,19 +41,19 @@ #include "birthdayparty.h" BirthdayParty::BirthdayParty(QObject *parent) -: QObject(parent), m_celebrant(0) +: QObject(parent), m_host(0) { } // ![0] -Person *BirthdayParty::celebrant() const +Person *BirthdayParty::host() const { - return m_celebrant; + return m_host; } -void BirthdayParty::setCelebrant(Person *c) +void BirthdayParty::setHost(Person *c) { - m_celebrant = c; + m_host = c; } QDeclarativeListProperty BirthdayParty::guests() diff --git a/examples/declarative/extending/properties/birthdayparty.h b/examples/declarative/extending/properties/birthdayparty.h index dd01562..39ce9ba 100644 --- a/examples/declarative/extending/properties/birthdayparty.h +++ b/examples/declarative/extending/properties/birthdayparty.h @@ -42,33 +42,33 @@ #define BIRTHDAYPARTY_H #include -#include +#include #include "person.h" // ![0] class BirthdayParty : public QObject { -Q_OBJECT + Q_OBJECT // ![0] // ![1] -Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) + Q_PROPERTY(Person *host READ host WRITE setHost) // ![1] // ![2] -Q_PROPERTY(QDeclarativeListProperty guests READ guests) + Q_PROPERTY(QDeclarativeListProperty guests READ guests) // ![2] // ![3] public: BirthdayParty(QObject *parent = 0); - Person *celebrant() const; - void setCelebrant(Person *); + Person *host() const; + void setHost(Person *); QDeclarativeListProperty guests(); int guestCount() const; Person *guest(int) const; private: - Person *m_celebrant; + Person *m_host; QList m_guests; }; // ![3] diff --git a/examples/declarative/extending/properties/example.qml b/examples/declarative/extending/properties/example.qml index 9594a84..35abdd6 100644 --- a/examples/declarative/extending/properties/example.qml +++ b/examples/declarative/extending/properties/example.qml @@ -2,12 +2,12 @@ import People 1.0 // ![0] BirthdayParty { - celebrant: Person { + host: Person { name: "Bob Jones" shoeSize: 12 } guests: [ - Person { name: "Joan Hodges" }, + Person { name: "Leo Hodges" }, Person { name: "Jack Smith" }, Person { name: "Anne Brown" } ] diff --git a/examples/declarative/extending/properties/main.cpp b/examples/declarative/extending/properties/main.cpp index 350f8bd..85e9584 100644 --- a/examples/declarative/extending/properties/main.cpp +++ b/examples/declarative/extending/properties/main.cpp @@ -56,8 +56,8 @@ int main(int argc, char ** argv) QDeclarativeComponent component(&engine, ":example.qml"); BirthdayParty *party = qobject_cast(component.create()); - if (party && party->celebrant()) { - qWarning() << party->celebrant()->name() << "is having a birthday!"; + if (party && party->host()) { + qWarning() << party->host()->name() << "is having a birthday!"; qWarning() << "They are inviting:"; for (int ii = 0; ii < party->guestCount(); ++ii) qWarning() << " " << party->guest(ii)->name(); diff --git a/examples/declarative/extending/properties/person.h b/examples/declarative/extending/properties/person.h index 7504d18..0029b09 100644 --- a/examples/declarative/extending/properties/person.h +++ b/examples/declarative/extending/properties/person.h @@ -42,12 +42,12 @@ #define PERSON_H #include -#include -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName) -Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) public: Person(QObject *parent = 0); diff --git a/examples/declarative/extending/signal/birthdayparty.cpp b/examples/declarative/extending/signal/birthdayparty.cpp index 65ff530..740c8c9 100644 --- a/examples/declarative/extending/signal/birthdayparty.cpp +++ b/examples/declarative/extending/signal/birthdayparty.cpp @@ -57,18 +57,18 @@ void BirthdayPartyAttached::setRsvp(const QDate &d) BirthdayParty::BirthdayParty(QObject *parent) -: QObject(parent), m_celebrant(0) +: QObject(parent), m_host(0) { } -Person *BirthdayParty::celebrant() const +Person *BirthdayParty::host() const { - return m_celebrant; + return m_host; } -void BirthdayParty::setCelebrant(Person *c) +void BirthdayParty::setHost(Person *c) { - m_celebrant = c; + m_host = c; } QDeclarativeListProperty BirthdayParty::guests() diff --git a/examples/declarative/extending/signal/birthdayparty.h b/examples/declarative/extending/signal/birthdayparty.h index a2b35cd..ae4dd39 100644 --- a/examples/declarative/extending/signal/birthdayparty.h +++ b/examples/declarative/extending/signal/birthdayparty.h @@ -48,8 +48,8 @@ class BirthdayPartyAttached : public QObject { -Q_OBJECT -Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp) + Q_OBJECT + Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp) public: BirthdayPartyAttached(QObject *object); @@ -62,15 +62,15 @@ private: class BirthdayParty : public QObject { -Q_OBJECT -Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) -Q_PROPERTY(QDeclarativeListProperty guests READ guests) -Q_CLASSINFO("DefaultProperty", "guests") + Q_OBJECT + Q_PROPERTY(Person *host READ host WRITE setHost) + Q_PROPERTY(QDeclarativeListProperty guests READ guests) + Q_CLASSINFO("DefaultProperty", "guests") public: BirthdayParty(QObject *parent = 0); - Person *celebrant() const; - void setCelebrant(Person *); + Person *host() const; + void setHost(Person *); QDeclarativeListProperty guests(); int guestCount() const; @@ -85,7 +85,7 @@ signals: // ![0] private: - Person *m_celebrant; + Person *m_host; QList m_guests; }; QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES) diff --git a/examples/declarative/extending/signal/example.qml b/examples/declarative/extending/signal/example.qml index c7d4792..83d6a23 100644 --- a/examples/declarative/extending/signal/example.qml +++ b/examples/declarative/extending/signal/example.qml @@ -5,13 +5,13 @@ BirthdayParty { onPartyStarted: console.log("This party started rockin' at " + time); // ![0] - celebrant: Boy { + host: Boy { name: "Bob Jones" shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 } } Boy { - name: "Joan Hodges" + name: "Leo Hodges" BirthdayParty.rsvp: "2009-07-06" shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 } } diff --git a/examples/declarative/extending/signal/main.cpp b/examples/declarative/extending/signal/main.cpp index 1b23a46..453f688 100644 --- a/examples/declarative/extending/signal/main.cpp +++ b/examples/declarative/extending/signal/main.cpp @@ -60,10 +60,10 @@ int main(int argc, char ** argv) QDeclarativeComponent component(&engine, ":example.qml"); BirthdayParty *party = qobject_cast(component.create()); - if (party && party->celebrant()) { - qWarning() << party->celebrant()->name() << "is having a birthday!"; + if (party && party->host()) { + qWarning() << party->host()->name() << "is having a birthday!"; - if (qobject_cast(party->celebrant())) + if (qobject_cast(party->host())) qWarning() << "He is inviting:"; else qWarning() << "She is inviting:"; diff --git a/examples/declarative/extending/signal/person.h b/examples/declarative/extending/signal/person.h index 7a4b9c3..2f444c5 100644 --- a/examples/declarative/extending/signal/person.h +++ b/examples/declarative/extending/signal/person.h @@ -43,14 +43,14 @@ #include #include -#include -class ShoeDescription : public QObject { -Q_OBJECT -Q_PROPERTY(int size READ size WRITE setSize) -Q_PROPERTY(QColor color READ color WRITE setColor) -Q_PROPERTY(QString brand READ brand WRITE setBrand) -Q_PROPERTY(qreal price READ price WRITE setPrice) +class ShoeDescription : public QObject +{ + Q_OBJECT + Q_PROPERTY(int size READ size WRITE setSize) + Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QString brand READ brand WRITE setBrand) + Q_PROPERTY(qreal price READ price WRITE setPrice) public: ShoeDescription(QObject *parent = 0); @@ -72,10 +72,11 @@ private: qreal m_price; }; -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName) -Q_PROPERTY(ShoeDescription *shoe READ shoe) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(ShoeDescription *shoe READ shoe) public: Person(QObject *parent = 0); @@ -88,14 +89,16 @@ private: ShoeDescription m_shoe; }; -class Boy : public Person { -Q_OBJECT +class Boy : public Person +{ + Q_OBJECT public: Boy(QObject * parent = 0); }; -class Girl : public Person { -Q_OBJECT +class Girl : public Person +{ + Q_OBJECT public: Girl(QObject * parent = 0); }; diff --git a/examples/declarative/extending/valuesource/birthdayparty.cpp b/examples/declarative/extending/valuesource/birthdayparty.cpp index 99d98be..b915f4f 100644 --- a/examples/declarative/extending/valuesource/birthdayparty.cpp +++ b/examples/declarative/extending/valuesource/birthdayparty.cpp @@ -57,18 +57,18 @@ void BirthdayPartyAttached::setRsvp(const QDate &d) BirthdayParty::BirthdayParty(QObject *parent) -: QObject(parent), m_celebrant(0) +: QObject(parent), m_host(0) { } -Person *BirthdayParty::celebrant() const +Person *BirthdayParty::host() const { - return m_celebrant; + return m_host; } -void BirthdayParty::setCelebrant(Person *c) +void BirthdayParty::setHost(Person *c) { - m_celebrant = c; + m_host = c; } QDeclarativeListProperty BirthdayParty::guests() @@ -92,12 +92,12 @@ void BirthdayParty::startParty() emit partyStarted(time); } -QString BirthdayParty::speaker() const +QString BirthdayParty::announcement() const { return QString(); } -void BirthdayParty::setSpeaker(const QString &speak) +void BirthdayParty::setAnnouncement(const QString &speak) { qWarning() << qPrintable(speak); } diff --git a/examples/declarative/extending/valuesource/birthdayparty.h b/examples/declarative/extending/valuesource/birthdayparty.h index a9b3102..5f25781 100644 --- a/examples/declarative/extending/valuesource/birthdayparty.h +++ b/examples/declarative/extending/valuesource/birthdayparty.h @@ -49,8 +49,8 @@ class BirthdayPartyAttached : public QObject { -Q_OBJECT -Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp) + Q_OBJECT + Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp) public: BirthdayPartyAttached(QObject *object); @@ -63,26 +63,25 @@ private: class BirthdayParty : public QObject { -Q_OBJECT -Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) -Q_PROPERTY(QDeclarativeListProperty guests READ guests) + Q_OBJECT + Q_PROPERTY(Person *host READ host WRITE setHost) + Q_PROPERTY(QDeclarativeListProperty guests READ guests) // ![0] -Q_PROPERTY(QString speaker READ speaker WRITE setSpeaker) + Q_PROPERTY(QString announcement READ announcement WRITE setAnnouncement) // ![0] -Q_CLASSINFO("DefaultProperty", "guests") + Q_CLASSINFO("DefaultProperty", "guests") public: BirthdayParty(QObject *parent = 0); - Person *celebrant() const; - void setCelebrant(Person *); + Person *host() const; + void setHost(Person *); QDeclarativeListProperty guests(); int guestCount() const; Person *guest(int) const; - - QString speaker() const; - void setSpeaker(const QString &); + QString announcement() const; + void setAnnouncement(const QString &); static BirthdayPartyAttached *qmlAttachedProperties(QObject *); @@ -91,7 +90,7 @@ signals: void partyStarted(const QTime &time); private: - Person *m_celebrant; + Person *m_host; QList m_guests; }; QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES) diff --git a/examples/declarative/extending/valuesource/example.qml b/examples/declarative/extending/valuesource/example.qml index ed4d788..5b8c8af 100644 --- a/examples/declarative/extending/valuesource/example.qml +++ b/examples/declarative/extending/valuesource/example.qml @@ -2,19 +2,19 @@ import People 1.0 // ![0] BirthdayParty { - HappyBirthday on speaker { name: "Bob Jones" } + HappyBirthdaySong on announcement { name: "Bob Jones" } // ![0] onPartyStarted: console.log("This party started rockin' at " + time); - celebrant: Boy { + host: Boy { name: "Bob Jones" shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 } } Boy { - name: "Joan Hodges" + name: "Leo Hodges" BirthdayParty.rsvp: "2009-07-06" shoe { size: 10; color: "black"; brand: "Reebok"; price: 59.95 } } diff --git a/examples/declarative/extending/valuesource/happybirthday.cpp b/examples/declarative/extending/valuesource/happybirthday.cpp deleted file mode 100644 index 0dbbd6e..0000000 --- a/examples/declarative/extending/valuesource/happybirthday.cpp +++ /dev/null @@ -1,81 +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 examples 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 "happybirthday.h" -#include - -HappyBirthday::HappyBirthday(QObject *parent) -: QObject(parent), m_line(-1) -{ - setName(QString()); - QTimer *timer = new QTimer(this); - QObject::connect(timer, SIGNAL(timeout()), this, SLOT(advance())); - timer->start(1000); -} - -void HappyBirthday::setTarget(const QDeclarativeProperty &p) -{ - m_target = p; -} - -QString HappyBirthday::name() const -{ - return m_name; -} - -void HappyBirthday::setName(const QString &name) -{ - m_name = name; - - m_lyrics.clear(); - m_lyrics << "Happy birthday to you,"; - m_lyrics << "Happy birthday to you,"; - m_lyrics << "Happy birthday dear " + m_name + ","; - m_lyrics << "Happy birthday to you!"; - m_lyrics << ""; -} - -void HappyBirthday::advance() -{ - m_line = (m_line + 1) % m_lyrics.count(); - - m_target.write(m_lyrics.at(m_line)); -} - diff --git a/examples/declarative/extending/valuesource/happybirthday.h b/examples/declarative/extending/valuesource/happybirthday.h deleted file mode 100644 index 8548eb8..0000000 --- a/examples/declarative/extending/valuesource/happybirthday.h +++ /dev/null @@ -1,79 +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 examples 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 HAPPYBIRTHDAY_H -#define HAPPYBIRTHDAY_H - -#include -#include -#include - -#include - -// ![0] -class HappyBirthday : public QObject, public QDeclarativePropertyValueSource -{ -Q_OBJECT -// ![0] -Q_PROPERTY(QString name READ name WRITE setName) -// ![1] -public: - HappyBirthday(QObject *parent = 0); - - virtual void setTarget(const QDeclarativeProperty &); -// ![1] - - QString name() const; - void setName(const QString &); - -private slots: - void advance(); - -private: - int m_line; - QStringList m_lyrics; - QDeclarativeProperty m_target; - QString m_name; -// ![2] -}; -// ![2] - -#endif // HAPPYBIRTHDAY_H - diff --git a/examples/declarative/extending/valuesource/happybirthdaysong.cpp b/examples/declarative/extending/valuesource/happybirthdaysong.cpp new file mode 100644 index 0000000..8ea5c2b --- /dev/null +++ b/examples/declarative/extending/valuesource/happybirthdaysong.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** 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 examples 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 "happybirthdaysong.h" +#include + +HappyBirthdaySong::HappyBirthdaySong(QObject *parent) +: QObject(parent), m_line(-1) +{ + setName(QString()); + QTimer *timer = new QTimer(this); + QObject::connect(timer, SIGNAL(timeout()), this, SLOT(advance())); + timer->start(1000); +} + +void HappyBirthdaySong::setTarget(const QDeclarativeProperty &p) +{ + m_target = p; +} + +QString HappyBirthdaySong::name() const +{ + return m_name; +} + +void HappyBirthdaySong::setName(const QString &name) +{ + m_name = name; + + m_lyrics.clear(); + m_lyrics << "Happy birthday to you,"; + m_lyrics << "Happy birthday to you,"; + m_lyrics << "Happy birthday dear " + m_name + ","; + m_lyrics << "Happy birthday to you!"; + m_lyrics << ""; +} + +void HappyBirthdaySong::advance() +{ + m_line = (m_line + 1) % m_lyrics.count(); + + m_target.write(m_lyrics.at(m_line)); +} + diff --git a/examples/declarative/extending/valuesource/happybirthdaysong.h b/examples/declarative/extending/valuesource/happybirthdaysong.h new file mode 100644 index 0000000..3d07909 --- /dev/null +++ b/examples/declarative/extending/valuesource/happybirthdaysong.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** 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 examples 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 HAPPYBIRTHDAYSONG_H +#define HAPPYBIRTHDAYSONG_H + +#include +#include +#include + +#include + +// ![0] +class HappyBirthdaySong : public QObject, public QDeclarativePropertyValueSource +{ + Q_OBJECT + Q_INTERFACES(QDeclarativePropertyValueSource) +// ![0] + Q_PROPERTY(QString name READ name WRITE setName) +// ![1] +public: + HappyBirthdaySong(QObject *parent = 0); + + virtual void setTarget(const QDeclarativeProperty &); +// ![1] + + QString name() const; + void setName(const QString &); + +private slots: + void advance(); + +private: + int m_line; + QStringList m_lyrics; + QDeclarativeProperty m_target; + QString m_name; +// ![2] +}; +// ![2] + +#endif // HAPPYBIRTHDAYSONG_H + diff --git a/examples/declarative/extending/valuesource/main.cpp b/examples/declarative/extending/valuesource/main.cpp index 2574917..00840ee 100644 --- a/examples/declarative/extending/valuesource/main.cpp +++ b/examples/declarative/extending/valuesource/main.cpp @@ -43,7 +43,7 @@ #include #include #include "birthdayparty.h" -#include "happybirthday.h" +#include "happybirthdaysong.h" #include "person.h" int main(int argc, char ** argv) @@ -52,7 +52,7 @@ int main(int argc, char ** argv) qmlRegisterType(); qmlRegisterType("People", 1,0, "BirthdayParty"); - qmlRegisterType("People", 1,0, "HappyBirthday"); + qmlRegisterType("People", 1,0, "HappyBirthdaySong"); qmlRegisterType(); qmlRegisterType(); qmlRegisterType("People", 1,0, "Boy"); @@ -62,10 +62,10 @@ int main(int argc, char ** argv) QDeclarativeComponent component(&engine, ":example.qml"); BirthdayParty *party = qobject_cast(component.create()); - if (party && party->celebrant()) { - qWarning() << party->celebrant()->name() << "is having a birthday!"; + if (party && party->host()) { + qWarning() << party->host()->name() << "is having a birthday!"; - if (qobject_cast(party->celebrant())) + if (qobject_cast(party->host())) qWarning() << "He is inviting:"; else qWarning() << "She is inviting:"; diff --git a/examples/declarative/extending/valuesource/person.h b/examples/declarative/extending/valuesource/person.h index 7a4b9c3..2f444c5 100644 --- a/examples/declarative/extending/valuesource/person.h +++ b/examples/declarative/extending/valuesource/person.h @@ -43,14 +43,14 @@ #include #include -#include -class ShoeDescription : public QObject { -Q_OBJECT -Q_PROPERTY(int size READ size WRITE setSize) -Q_PROPERTY(QColor color READ color WRITE setColor) -Q_PROPERTY(QString brand READ brand WRITE setBrand) -Q_PROPERTY(qreal price READ price WRITE setPrice) +class ShoeDescription : public QObject +{ + Q_OBJECT + Q_PROPERTY(int size READ size WRITE setSize) + Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QString brand READ brand WRITE setBrand) + Q_PROPERTY(qreal price READ price WRITE setPrice) public: ShoeDescription(QObject *parent = 0); @@ -72,10 +72,11 @@ private: qreal m_price; }; -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName) -Q_PROPERTY(ShoeDescription *shoe READ shoe) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(ShoeDescription *shoe READ shoe) public: Person(QObject *parent = 0); @@ -88,14 +89,16 @@ private: ShoeDescription m_shoe; }; -class Boy : public Person { -Q_OBJECT +class Boy : public Person +{ + Q_OBJECT public: Boy(QObject * parent = 0); }; -class Girl : public Person { -Q_OBJECT +class Girl : public Person +{ + Q_OBJECT public: Girl(QObject * parent = 0); }; diff --git a/examples/declarative/extending/valuesource/valuesource.pro b/examples/declarative/extending/valuesource/valuesource.pro index d3409b6..0626c98 100644 --- a/examples/declarative/extending/valuesource/valuesource.pro +++ b/examples/declarative/extending/valuesource/valuesource.pro @@ -8,10 +8,10 @@ QT += declarative SOURCES += main.cpp \ person.cpp \ birthdayparty.cpp \ - happybirthday.cpp + happybirthdaysong.cpp HEADERS += person.h \ birthdayparty.h \ - happybirthday.h + happybirthdaysong.h RESOURCES += valuesource.qrc target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/valuesource sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS valuesource.pro -- cgit v0.12 From e79202be457298c48b13eef4f8c35df186216aea Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 21 Apr 2010 11:19:00 +1000 Subject: Use different ports to avoid clashes in parallel testing. --- .../qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp | 4 ++-- .../qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index fb17f90..102b2be 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -74,11 +74,11 @@ private slots: void tst_QDeclarativeDebugClient::initTestCase() { - qputenv("QML_DEBUG_SERVER_PORT", "3768"); + qputenv("QML_DEBUG_SERVER_PORT", "3770"); new QDeclarativeEngine(this); m_conn = new QDeclarativeDebugConnection(this); - m_conn->connectToHost("127.0.0.1", 3768); + m_conn->connectToHost("127.0.0.1", 3770); bool ok = m_conn->waitForConnected(); Q_ASSERT(ok); diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index 80d7f76..5da3359 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -76,11 +76,11 @@ private slots: void tst_QDeclarativeDebugService::initTestCase() { - qputenv("QML_DEBUG_SERVER_PORT", "3768"); + qputenv("QML_DEBUG_SERVER_PORT", "3769"); new QDeclarativeEngine(this); m_conn = new QDeclarativeDebugConnection(this); - m_conn->connectToHost("127.0.0.1", 3768); + m_conn->connectToHost("127.0.0.1", 3769); bool ok = m_conn->waitForConnected(); Q_ASSERT(ok); @@ -151,7 +151,7 @@ void tst_QDeclarativeDebugService::idForObject() int idB = QDeclarativeDebugService::idForObject(objB); QVERIFY(idB != idA); QCOMPARE(QDeclarativeDebugService::objectForId(idB), objB); - + delete objA; delete objB; } -- cgit v0.12 From cff7d95a782c6a5c1a0e5cc0f3f1840ea683a216 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 21 Apr 2010 11:40:47 +1000 Subject: Ignore warnings Task-number: QTBUG-10035 --- tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp | 4 +++- .../qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp | 4 ++++ .../qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp | 3 +++ .../declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp | 6 ++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp index 49d430e..e2d3ee4 100644 --- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp +++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp @@ -276,6 +276,7 @@ void tst_QDeclarativeDebug::initTestCase() { qRegisterMetaType(); + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Waiting for connection on port 3768..."); qputenv("QML_DEBUG_SERVER_PORT", "3768"); m_engine = new QDeclarativeEngine(this); @@ -301,13 +302,14 @@ void tst_QDeclarativeDebug::initTestCase() } m_rootItem = qobject_cast(m_components.first()); - // add an extra context to test for multiple contexts QDeclarativeContext *context = new QDeclarativeContext(m_engine->rootContext(), this); context->setObjectName("tst_QDeclarativeDebug_childContext"); m_conn = new QDeclarativeDebugConnection(this); m_conn->connectToHost("127.0.0.1", 3768); + + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established"); bool ok = m_conn->waitForConnected(); Q_ASSERT(ok); QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient()); diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index fb17f90..aee8ef1 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -74,11 +74,15 @@ private slots: void tst_QDeclarativeDebugClient::initTestCase() { + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Waiting for connection on port 3768..."); + qputenv("QML_DEBUG_SERVER_PORT", "3768"); new QDeclarativeEngine(this); m_conn = new QDeclarativeDebugConnection(this); m_conn->connectToHost("127.0.0.1", 3768); + + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established"); bool ok = m_conn->waitForConnected(); Q_ASSERT(ok); diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index 80d7f76..f07f0ca 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -76,11 +76,14 @@ private slots: void tst_QDeclarativeDebugService::initTestCase() { + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Waiting for connection on port 3768..."); qputenv("QML_DEBUG_SERVER_PORT", "3768"); new QDeclarativeEngine(this); m_conn = new QDeclarativeDebugConnection(this); m_conn->connectToHost("127.0.0.1", 3768); + + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established"); bool ok = m_conn->waitForConnected(); Q_ASSERT(ok); diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index bbea98a..e4c296f 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -326,6 +326,12 @@ void tst_qdeclarativelistmodel::dynamic_worker() if (QByteArray(QTest::currentDataTag()).startsWith("nested")) QTest::ignoreMessage(QtWarningMsg, ": QML ListModel: Cannot add nested list values when modifying or after modification from a worker script"); + if (QByteArray(QTest::currentDataTag()).startsWith("nested-append")) { + int callsToGet = script.count(QLatin1String(";get(")); + for (int i=0; i: QML ListModel: get: index 0 out of range"); + } + QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker", Q_ARG(QVariant, operations.mid(0, operations.length()-1)))); waitForWorker(item); -- cgit v0.12 From 84c0fb3a16a36704631738e98cac3f1a90330647 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Wed, 21 Apr 2010 11:31:35 +1000 Subject: Gstreamer media backend: preserve playback rate after seeks and media changes. Reviewed-by: Andrew den Exter --- .../gstreamer/mediaplayer/qgstreamerplayersession.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp index 724a595..6a44aa1 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -182,7 +182,7 @@ void QGstreamerPlayerSession::setPlaybackRate(qreal rate) m_playbackRate = rate; if (m_playbin) { gst_element_seek(m_playbin, rate, GST_FORMAT_TIME, - GstSeekFlags(GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SEGMENT), + GstSeekFlags(GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH), GST_SEEK_TYPE_NONE,0, GST_SEEK_TYPE_NONE,0 ); } @@ -464,8 +464,16 @@ bool QGstreamerPlayerSession::seek(qint64 ms) { //seek locks when the video output sink is changing and pad is blocked if (m_playbin && !m_pendingVideoSink && m_state != QMediaPlayer::StoppedState) { + gint64 position = qMax(ms,qint64(0)) * 1000000; - return gst_element_seek_simple(m_playbin, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, position); + return gst_element_seek(m_playbin, + m_playbackRate, + GST_FORMAT_TIME, + GstSeekFlags(GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH), + GST_SEEK_TYPE_SET, + position, + GST_SEEK_TYPE_NONE, + 0); } return false; @@ -666,8 +674,11 @@ void QGstreamerPlayerSession::busMessage(const QGstreamerMessage &message) setSeekable(true); - if (!qFuzzyCompare(m_playbackRate, qreal(1.0))) - setPlaybackRate(m_playbackRate); + if (!qFuzzyCompare(m_playbackRate, qreal(1.0))) { + qreal rate = m_playbackRate; + m_playbackRate = 1.0; + setPlaybackRate(rate); + } if (m_renderer) m_renderer->precessNewStream(); -- cgit v0.12 From f92518f6de1a13b591fb2c2037714b213bdcff89 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 21 Apr 2010 12:02:20 +1000 Subject: Make logger widget thread safe. --- tools/qml/loggerwidget.cpp | 4 ++-- tools/qml/loggerwidget.h | 3 ++- tools/qml/main.cpp | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp index c5548b7..015d1b0 100644 --- a/tools/qml/loggerwidget.cpp +++ b/tools/qml/loggerwidget.cpp @@ -53,9 +53,9 @@ LoggerWidget::LoggerWidget(QWidget *parent) : setWindowTitle(tr("Qt Declarative UI Viewer - Logger")); } -void LoggerWidget::append(QtMsgType /*type*/, const char *msg) +void LoggerWidget::append(const QString &msg) { - appendPlainText(QString::fromAscii(msg)); + appendPlainText(msg); if (!m_keepClosed && !isVisible()) setVisible(true); diff --git a/tools/qml/loggerwidget.h b/tools/qml/loggerwidget.h index 938431c..5c4a701 100644 --- a/tools/qml/loggerwidget.h +++ b/tools/qml/loggerwidget.h @@ -50,7 +50,8 @@ class LoggerWidget : public QPlainTextEdit { Q_OBJECT public: LoggerWidget(QWidget *parent=0); - void append(QtMsgType type, const char *msg); +public slots: + void append(const QString &msg); protected: void closeEvent(QCloseEvent *event); private: diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index a79e1b1..e90d729 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -93,7 +93,8 @@ void showWarnings() void myMessageOutput(QtMsgType type, const char *msg) { if (!logger.isNull()) { - logger.data()->append(type, msg); + QString strMsg = QString::fromAscii(msg); + QMetaObject::invokeMethod(logger.data(), "append", Q_ARG(QString, strMsg)); } else { warnings += msg; warnings += QLatin1Char('\n'); -- cgit v0.12 From 4819ac8dd5b8699e09fd783ba4795746a0a44839 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Wed, 21 Apr 2010 12:03:49 +1000 Subject: Player demo: load not only local files but playlists and urls passed as command line arguments. Reviewed-by: Andrew den Exter --- demos/multimedia/player/player.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/demos/multimedia/player/player.cpp b/demos/multimedia/player/player.cpp index 6ba19fd..bf314ee 100644 --- a/demos/multimedia/player/player.cpp +++ b/demos/multimedia/player/player.cpp @@ -171,11 +171,22 @@ Player::Player(QWidget *parent) metaDataChanged(); - QStringList fileNames = qApp->arguments(); - fileNames.removeAt(0); - foreach (QString const &fileName, fileNames) { - if (QFileInfo(fileName).exists()) - playlist->addMedia(QUrl::fromLocalFile(fileName)); + QStringList arguments = qApp->arguments(); + arguments.removeAt(0); + foreach (QString const &argument, arguments) { + QFileInfo fileInfo(argument); + if (fileInfo.exists()) { + QUrl url = QUrl::fromLocalFile(fileInfo.absoluteFilePath()); + if (fileInfo.suffix().toLower() == QLatin1String("m3u")) { + playlist->load(url); + } else + playlist->addMedia(url); + } else { + QUrl url(argument); + if (url.isValid()) { + playlist->addMedia(url); + } + } } } -- cgit v0.12 From 1bb41fca81e268f3b471cd634651e99357ff6925 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 21 Apr 2010 12:08:03 +1000 Subject: Fix doc links --- doc/src/declarative/advtutorial.qdoc | 6 +++--- doc/src/declarative/codingconventions.qdoc | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 751bf00..0ae52c2 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -67,7 +67,7 @@ Tutorial chapters: \list 1 \o \l {QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks}{Creating the Game Canvas and Blocks} -\o \l {QML Advanced Tutorial 2 - Populating the Game Canvas}{Populating the Game Canvas}} +\o \l {QML Advanced Tutorial 2 - Populating the Game Canvas}{Populating the Game Canvas} \o \l {QML Advanced Tutorial 3 - Implementing the Game Logic}{Implementing the Game Logic} \o \l {QML Advanced Tutorial 4 - Finishing Touches}{Finishing Touches} \endlist @@ -109,7 +109,7 @@ is the \l SystemPalette item. This provides access to the Qt system palette and is used to give the button a more native look-and-feel. Notice the anchors for the \c Item, \c Button and \c Text elements are set using -\l {Grouped Properties}{group notation} for readability. +\l {codingconventions.html#Grouped-properties}{group notation} for readability. \section2 Adding \c Button and \c Block components @@ -432,7 +432,7 @@ If the player enters a name, we send the data to the service using this code in \snippet declarative/tutorials/samegame/samegame4/content/samegame.js 1 -The \c XMLHttpRequest in this code is the same \c XMLHttpRequest() as you'll find in standard browser JavaScript, and can be used in the same way to dynamically get XML +The \l XMLHttpRequest in this code is the same as the \c XMLHttpRequest() as you'll find in standard browser JavaScript, and can be used in the same way to dynamically get XML or QML from the web service to display the high scores. We don't worry about the response in this case - we just post the high score data to the web server. If it had returned a QML file (or a URL to a QML file) you could instantiate it in much the same way as you did with the blocks. diff --git a/doc/src/declarative/codingconventions.qdoc b/doc/src/declarative/codingconventions.qdoc index 7ae5cbd..7ca206b 100644 --- a/doc/src/declarative/codingconventions.qdoc +++ b/doc/src/declarative/codingconventions.qdoc @@ -72,6 +72,7 @@ For example, a hypothetical \e photo QML object would look like this: \snippet doc/src/snippets/declarative/codingconventions/photo.qml 0 +\target Grouped properties \section1 Grouped properties If using multiple properties from a group of properties, -- cgit v0.12 From 3844612ee34076d24822ad0fe4115b7d5936d8f5 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 21 Apr 2010 12:12:06 +1000 Subject: Fix following qdoc changes --- doc/src/declarative/advtutorial.qdoc | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 0ae52c2..c465da4 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -83,10 +83,6 @@ directory. \previouspage QML Advanced Tutorial \nextpage QML Advanced Tutorial 2 - Populating the Game Canvas -In this chapter: - -\tableofcontents - The files referenced on this page can be found in \c $QTDIR\examples\tutorials\samegame\samegame1. \section2 Creating the application screen @@ -152,10 +148,6 @@ elements to get started. Next, we will populate the game canvas with some blocks \previouspage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks \nextpage QML Advanced Tutorial 3 - Implementing the Game Logic -In this chapter: - -\tableofcontents - The files referenced on this page can be found in \c $QTDIR\examples\tutorials\samegame\samegame2. @@ -224,10 +216,6 @@ Now, we have a screen of blocks, and we can begin to add the game mechanics. \previouspage QML Advanced Tutorial 2 - Populating the Game Canvas \nextpage QML Advanced Tutorial 4 - Finishing Touches -In this chapter: - -\tableofcontents - The files referenced on this page can be found in \c $QTDIR\examples\tutorials\samegame\samegame3. \section2 Making a playable game @@ -313,10 +301,6 @@ until the next chapter - where your application becomes alive! \contentspage QML Advanced Tutorial \previouspage QML Advanced Tutorial 3 - Implementing the Game Logic -In this chapter: - -\tableofcontents - The files referenced on this page can be found in \c $QTDIR\examples\tutorials\samegame\samegame4. \section2 Adding some flair -- cgit v0.12 From eae458702a1201c450190e4d2dc79be9c68cdca0 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 21 Apr 2010 12:36:49 +1000 Subject: Revert structural changes to extending.qdoc made in 61f3cb6e79fea0aed80df091013c2228f64955ec. A separate, more tutorial-like page for this topic will be created and this can be kept as a reference-type page. --- doc/src/declarative/extending.qdoc | 375 ++++++++++++++++++------------------- 1 file changed, 178 insertions(+), 197 deletions(-) diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 9844804..c27d091 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -43,86 +43,53 @@ \page qml-extending.html \title Extending QML in C++ -The QtDeclarative module provides a set of APIs for extending QML through -C++ extensions. You can write extensions to add your own QML types, extend existing -Qt types, or call C/C++ functions that are not accessible from ordinary QML code. - The QML syntax declaratively describes how to construct an in memory object tree. In Qt, QML is mainly used to describe a visual scene graph, but it is not conceptually limited to this: the QML format is an abstract description of any object tree. All the QML element types included in Qt are implemented using -the C++ extension mechanisms describe on this page. +the C++ extension mechanisms describe on this page. Programmers can use these +APIs to add new types that interact with the existing Qt types, or to repurpose +QML for their own independent use. \tableofcontents \section1 Adding Types \target adding-types -QML can easily be extended to support new types. - -Let's create a new QML type called "Person" that has two properties, a name and a -shoe size. We will make it available in a \l {Modules}{module} called "People", with -a module version of 1.0. We want this \c Person type to be usable from QML like this: - \snippet examples/declarative/extending/adding/example.qml 0 -To do this, we need a C++ class that encapsulates this \c Person type and its two -properties. Since QML relies heavily on Qt's \l{Meta-Object System}{meta object system}, -this new class must: - -\list -\o inherit from QObject -\o declare its properties using the Q_PROPERTY() macro -\endlist - -Here is the \c Person class: - -\snippet examples/declarative/extending/adding/person.h 0 +The QML snippet shown above instantiates one \c Person instance and sets +the \c name and \c shoeSize properties on it. Everything in QML ultimately comes down +to either instantiating an object instance, or assigning a property a value. +QML relies heavily on Qt's meta object system and can only instantiate classes +that derive from QObject. -Now that the \c Person type is defined, it needs to be registered with QML -to make it available to QML code. To do this, call the qmlRegisterType() -template function. For example, this registers the \c Person type as a type called -"Person", to a module named "People", with a module version of 1.0: +The QML engine has no intrinsic knowledge of any class types. Instead the +programmer must define the C++ types, and their corresponding QML name. -\snippet examples/declarative/extending/adding/main.cpp 0 +Custom C++ types are registered using a template function: -Types can be registered by libraries (as Qt does), application code, -or by plugins (see QDeclarativeExtensionPlugin). - -Now the \c Person type can be used from QML as shown above. When we create a -\c Person item in QML, an instance of the C++ \c Person class is created, and the -\c name and \c shoeSize properties of the \c Person class can be set. All of -the properties of a registered type that are declared with Q_PROPERTY can be used -from QML. - -QML is typesafe. Attempting to assign an invalid value to a property will -generate an error. For example, assuming the name property of the \c Person -element had a type of QString, this would cause an error: +\quotation \code -Person { - // Will NOT work - name: 12 -} +template +int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName) \endcode -See \l {Extending QML - Adding Types Example} for the complete code used to create -the \c Person type. - -\section2 Interfaces - -QML also supports assigning Qt interfaces. To assign to a property whose type -is a Qt interface pointer, the interface must also be registered with QML. As -they cannot be instantiated directly, registering a Qt interface is different -from registering a new QML type. Instead of registering the type with -qmlRegisterType(), use qmlRegisterInterface(). +Calling qmlRegisterType() registers the C++ type \a T with the QML system, and makes it available in QML +under the name \a qmlName in library \a uri version \a versionMajor.versionMinor. +The \a qmlName can be the same as the C++ type name. +Type \a T must be a concrete type that inherits QObject and has a default +constructor. +\endquotation -\section1 Supporting object and list property types +Types can be registered by libraries (such as Qt does), application code, +or by plugins (see QDeclarativeExtensionPlugin). -When a new type is registered with QML, all of its properties declared with -Q_PROPERTY are available from QML. QML has intrinsic support for properties of -these types: +Once registered, all of the \l {Qt's Property System}{properties} of a supported +type are available for use within QML. QML has intrinsic support for properties +of these types: \list \o bool @@ -138,82 +105,105 @@ these types: \o QVariant \endlist -The \c Person type in the previous example had basic property types - a string -for \c name, and an integer for \c shoeSize. However, QML can set properties of -types that are more complex than basic intrinsics like -integers and strings. Properties can also be object pointers, Qt interface -pointers, lists of object pointers, and lists of Qt interface pointers. +QML is typesafe. Attempting to assign an invalid value to a property will +generate an error. For example, assuming the name property of the \c Person +element had a type of QString, this would cause an error: -Let's create a new QML type, "BirthdayParty", that has two properties -with more complex types: +\code +Person { + // Will NOT work + name: 12 +} +\endcode -\list -\o A \c host property whose value is a \c Person item -\o A \c guests property whose value is a list of \c Person items -\endlist +\l {Extending QML - Adding Types Example} shows the complete code used to create +the \c Person type. -We want to use it from QML like this: +\section1 Object and List Property Types \snippet examples/declarative/extending/properties/example.qml 0 -This will assign a \c Person object to the \c BirthdayParty's \c host property, -and assigns three other \c Person objects in a list to the \c guests property. +The QML snippet shown above assigns a \c Person object to the \c BirthdayParty's +\c host property, and assigns three \c Person objects to the guests property. + +QML can set properties of types that are more complex than basic intrinsics like +integers and strings. Properties can also be object pointers, Qt interface +pointers, lists of object points, and lists of Qt interface pointers. As QML +is typesafe it ensures that only valid types are assigned to these properties, +just like it does for primitive types. -To do this, we define a \c BirthdayParty class with the two properties. -The \c host property stores a \c Person* pointer. It is declared like this: +Properties that are pointers to objects or Qt interfaces are declared with the +Q_PROPERTY() macro, just like other properties. The \c host property +declaration looks like this: \snippet examples/declarative/extending/properties/birthdayparty.h 1 -Note the type of the property (\c Person in this case) must be registered with QML with -qmlRegisterType() or qmlRegisterInterface(). Otherwise, the property cannot be assigned in QML. +As long as the property type, in this case \c Person, is registered with QML the +property can be assigned. + +QML also supports assigning Qt interfaces. To assign to a property whose type +is a Qt interface pointer, the interface must also be registered with QML. As +they cannot be instantiated directly, registering a Qt interface is different +from registering a new QML type. The following function is used instead: + +\quotation +\code +template +int qmlRegisterInterface(const char *typeName) +\endcode + +Registers the C++ interface \a T with the QML system as \a typeName. + +Following registration, QML can coerce objects that implement this interface +for assignment to appropriately typed properties. +\endquotation -The \c guests property is a list of \c Person* objects. Properties that are lists +The \c guests property is a list of \c Person objects. Properties that are lists of objects or Qt interfaces are also declared with the Q_PROPERTY() macro, just like other properties. List properties must have the type \c {QDeclarativeListProperty}. As with object properties, the type \a T must be registered with QML. -The guest property declaration looks like this: - -\snippet examples/declarative/extending/properties/birthdayparty.h 2 - -So, here is the complete \c BirthdayParty class declaration: +The \c guest property declaration looks like this: -\snippet examples/declarative/extending/properties/birthdayparty.h 0 -\snippet examples/declarative/extending/properties/birthdayparty.h 1 \snippet examples/declarative/extending/properties/birthdayparty.h 2 -\snippet examples/declarative/extending/properties/birthdayparty.h 3 - -The \c BirthdayClass type is also registered using qmlRegisterType() so -it can be used from QML. \l {Extending QML - Object and List Property Types Example} shows the complete code used to create the \c BirthdayParty type. \section1 Inheritance and Coercion -QML supports C++ inheritance heirarchies and can freely coerce between known, -valid object types. This enables the creation of common base classes that allow -the assignment of specialized classes to object or list properties. +\snippet examples/declarative/extending/coercion/example.qml 0 -For example, if classes \c Girl and \c Boy both inherit from \c Person, then -\c Girl and \c Boy objects can be assigned in place of \c Person objects, like this: +The QML snippet shown above assigns a \c Boy object to the \c BirthdayParty's +\c host property, and assigns three other objects to the \c guests property. -\snippet examples/declarative/extending/coercion/example.qml 0 +QML supports C++ inheritance hierarchies and can freely coerce between known, +valid object types. This enables the creation of common base classes that allow +the assignment of specialized classes to object or list properties. In the +snippet shown, both the \c host and the \c guests properties retain the \c Person +type used in the previous section, but the assignment is valid as both the \c Boy +and \c Girl objects inherit from \c Person. -To assign to a property, the property's type (in this case, \c Girl and \c Boy) -must be registered with QML. -Both the qmlRegisterType() and qmlRegisterInterface() template functions previously -discussed can be used to register a type with QML. Additionally, in the case of the -\c Person class, which now acts purely as a base class and should no longer be instantiated from QML, -the following function can be used: +To assign to a property, the property's type must have been registered with QML. +Both the qmlRegisterType() and qmlRegisterInterface() template functions already +shown can be used to register a type with QML. Additionally, if a type that acts purely +as a base class that cannot be instantiated from QML needs to be +registered, the following function can be used: +\quotation \code template int qmlRegisterType() \endcode -Calling the parameterless qmlRegisterType() ensures the type is available -to QML for type coercion but cannot be created as a type from QML. +Registers the C++ type \a T with the QML system. The parameterless call to the template +function qmlRegisterType() does not define a mapping between the +C++ class and a QML element name, so the type is not instantiable from QML, but +it is available for type coercion. + +Type \a T must inherit QObject, but there are no restrictions on whether it is +concrete or the signature of its constructor. +\endquotation QML will automatically coerce C++ types when assigning to either an object property, or to a list property. Only if coercion fails does an assignment @@ -224,110 +214,110 @@ code used to create the \c Boy and \c Girl types. \section1 Default Property -The \e {default property} is a syntactic convenience that allows a type designer to -specify a single property as the type's default. - -This QML snippet assigns a collection of objects - two \c Boy and one -\c Girl objects - to the \c BirthdayParty's default property: - \snippet examples/declarative/extending/default/example.qml 0 -The default property is assigned to whenever no explicit property is specified. -As a convenience, it is behaviorally identical to assigning the default property -explicitly by name. +The QML snippet shown above assigns a collection of objects to the +\c BirthdayParty's default property. + +The \e {default property} is a syntactic convenience that allows a type designer to +specify a single property as the type's default. The default property is +assigned to whenever no explicit property is specified. As a convenience, it is +behaviorally identical to assigning the default property explicitly by name. From C++, type designers mark the default property using a Q_CLASSINFO() annotation: +\quotation \code - Q_CLASSINFO("DefaultProperty", "property") +Q_CLASSINFO("DefaultProperty", "property") \endcode -The \c property must be either an object property, or a list property. The -\c property can refer to a property declared in the class itself, or a property -inherited from a base class. +Mark \a property as the class's default property. \a property must be either +an object property, or a list property. A default property is optional. A derived class inherits its base class's -default property, but may override it in its own declaration. +default property, but may override it in its own declaration. \a property can +refer to a property declared in the class itself, or a property inherited from a +base class. +\endquotation \l {Extending QML - Default Property Example} shows the complete code used to specify a default property. - \section1 Grouped Properties +\snippet examples/declarative/extending/grouped/example.qml 1 + +The QML snippet shown above assigns a number properties to the \c Boy object, +including four properties using the grouped property syntax. + Grouped properties collect similar properties together into a single named block. Grouped properties can be used to present a nicer API to developers, and may also simplify the implementation of common property collections across different types through implementation reuse. -This QML snippet assigns a number properties to the \c Boy object, -including four properties using the grouped property syntax: - -\snippet examples/declarative/extending/grouped/example.qml 1 - A grouped property block is implemented as a read-only object property. The -shoe property shown is declared like this: +\c shoe property shown is declared like this: \snippet examples/declarative/extending/grouped/person.h 1 The \c ShoeDescription type declares the properties available to the grouped property block - in this case the \c size, \c color, \c brand and \c price properties. -Grouped property blocks may be declared and accessed recusively. +Grouped property blocks may declared and accessed be recusively. \l {Extending QML - Grouped Properties Example} shows the complete code used to implement the \c shoe property grouping. \section1 Attached Properties -Attached properties allow unrelated types to annotate other types with some -additional properties, generally for their own use. This QML snippet assigns -an \c rsvp property using the attached property syntax: - \snippet examples/declarative/extending/attached/example.qml 1 -Attached properties are identified through the use of the attacher type name; in the case shown +The QML snippet shown above assigns the \c rsvp property using the attached +property syntax. + +Attached properties allow unrelated types to annotate other types with some +additional properties, generally for their own use. Attached properties are +identified through the use of the attacher type name, in the case shown \c BirthdayParty, as a suffix to the property name. In the example shown, \c BirthdayParty is called the attaching type, and the -Boy instance the attachee object instance. +\c Boy instance the attachee object instance. For the attaching type, an attached property block is implemented as a new QObject derived type, called the attachment object. The properties on the attachment object are those that become available for use as the attached property block. -Any QML type can become an attaching type by declaring a +Any QML type can become an attaching type by declaring the \c qmlAttachedProperties() public function and declaring that the class has QML_HAS_ATTACHED_PROPERTIES: +\quotation \code - class MyType : public QObject { - Q_OBJECT - public: +class MyType : public QObject { + Q_OBJECT +public: - ... + ... - static AttachedPropertiesType *qmlAttachedProperties(QObject *object); - }; + static AttachedPropertiesType *qmlAttachedProperties(QObject *object); +}; - QML_DECLARE_TYPEINFO(MyType, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPEINFO(MyType, QML_HAS_ATTACHED_PROPERTIES) \endcode - -The qmlAttachedProperties() method returns an attachment object, of type \a AttachedPropertiesType, for the +Return an attachment object, of type \a AttachedPropertiesType, for the attachee \a object instance. It is customary, though not strictly required, for the attachment object to be parented to \a object to prevent memory leaks. -The returned \a AttachedPropertiesType must be a QObject derived type. The properties on +\a AttachedPropertiesType must be a QObject derived type. The properties on this type will be accessible through the attached properties syntax. -This method is called at most once for each attachee object instance. The +This method will be called at most once for each attachee object instance. The QML engine will cache the returned instance pointer for subsequent attached property accesses. Consequently the attachment object may not be deleted until \a object is destroyed. - -\section2 Use of attached properties +\endquotation Conceptually, attached properties are a \e type exporting a set of additional properties that can be set on \e any other object instance. Attached properties @@ -337,17 +327,14 @@ their effect may be so limited. For example, a common usage scenario is for a type to enhance the properties available to its children in order to gather instance specific data. Here we add a \c rsvp field to all the guests coming to a birthday party: - \code BirthdayParty { Boy { BirthdayParty.rsvp: "2009-06-01" } } \endcode - However, as a type cannot limit the instances to which the attachment object must attach, the following is also allowed, even though adding a birthday party rsvp in this context will have no effect. - \code GraduationParty { Boy { BirthdayParty.rsvp: "2009-06-01" } @@ -406,24 +393,21 @@ this situation, but it must not crash. \section1 Signal Support +\snippet examples/declarative/extending/signal/example.qml 0 +\snippet examples/declarative/extending/signal/example.qml 1 + +The QML snippet shown above associates the evaluation of a JavaScript expression +with the emission of a Qt signal. + All Qt signals on a registered class become available as special "signal properties" within QML to which the user can assign a single JavaScript expression. The signal property's name is a transformed version of the Qt signal name: "on" is prepended, and the first letter of the signal name upper -cased. - -For example, if the \c BirthdayParty class has a signal like this: +cased. For example, the signal used in the example above has the following +C++ signature: \snippet examples/declarative/extending/signal/birthdayparty.h 0 -This signal can be connected to from QML like this: - -\snippet examples/declarative/extending/signal/example.qml 0 -\snippet examples/declarative/extending/signal/example.qml 1 - -This associates the evaluation of a JavaScript expression -with the emission of a Qt signal. - In classes with multiple signals with the same name, only the final signal is accessible as a signal property. Note that signals with the same name but different parameters cannot be distinguished. @@ -440,31 +424,34 @@ implement the onPartyStarted signal property. \section1 Property Value Sources -A property value source is an element that generates a value for a -property that changes over time. Property value sources are most commonly used to -create animations; QML's built-in \l {Behavior}{Behavior} and various -\l {QML Animation}{animation} elements are actually property value sources. - -The \c BirthdayParty class has an \c announcement string property -whose value is printed to the console whenever it changes. Using a property value -source called \c HappyBirthdaySong, the value of this property can be changed, -over time, to each lyric in the song "Happy Birthday". For further customization, -a \c name property allows the song lyrics to be personalized with a particular name. -The \c HappyBirthdaySong property value source would be used in QML like this: - \snippet examples/declarative/extending/valuesource/example.qml 0 \snippet examples/declarative/extending/valuesource/example.qml 1 -(Normally, assigning an object to a string property would not be allowed. In +The QML snippet shown above applies a property value source to the \c announcment property. +A property value source generates a value for a property that changes over time. + +Property value sources are most commonly used to do animation. Rather than +constructing an animation object and manually setting the animation's "target" +property, a property value source can be assigned directly to a property of any +type and automatically set up this association. + +The example shown here is rather contrived: the \c announcment property of the +\c BirthdayParty object is a string that is printed every time it is assigned and +the \c HappyBirthdaySong value source generates the lyrics of the song +"Happy Birthday". + +\snippet examples/declarative/extending/valuesource/birthdayparty.h 0 + +Normally, assigning an object to a string property would not be allowed. In the case of a property value source, rather than assigning the object instance itself, the QML engine sets up an association between the value source and -the property.) +the property. Property value sources are special types that derive from the QDeclarativePropertyValueSource base class. This base class contains a single method, QDeclarativePropertyValueSource::setTarget(), that the QML engine invokes when -associating the property value source with a property. Here is the relevant part of -the \c HappyBirthdaySong type declaration: +associating the property value source with a property. The relevant part of +the \c HappyBirthdaySong type declaration looks like this: \snippet examples/declarative/extending/valuesource/happybirthdaysong.h 0 \snippet examples/declarative/extending/valuesource/happybirthdaysong.h 1 @@ -476,15 +463,20 @@ contain properties, signals and methods just like other types. When a property value source object is assigned to a property, QML first tries to assign it normally, as though it were a regular QML type. Only if this -assignment fails does the engine call the -\l {QDeclarativePropertyValueSource::setTarget()}{setTarget()} method. This allows +assignment fails does the engine call the \l {QDeclarativePropertyValueSource::}{setTarget()} method. This allows the type to also be used in contexts other than just as a value source. \l {Extending QML - Property Value Source Example} shows the complete code used -implement the HappyBirthdaySong property value source. +implement the \c HappyBirthdaySong property value source. \section1 Property Binding +\snippet examples/declarative/extending/binding/example.qml 0 +\snippet examples/declarative/extending/binding/example.qml 1 + +The QML snippet shown above uses a property binding to ensure the +\c HappyBirthdaySong's \c name property remains up to date with the \c host. + Property binding is a core feature of QML. In addition to assigning literal values, property bindings allow the developer to assign an arbitrarily complex JavaScript expression that may include dependencies on other property values. @@ -498,21 +490,13 @@ property has changed so that it knows to reevaluate any bindings that depend on the property's value. QML relies on the presence of a \l {Qt's Property System}{NOTIFY signal} for this determination. -For example, to enable property binding for the \c host property in \c BirthdayParty, -add a \c hostChanged signal that is emitted when the \c host value changes, and -declare the \c host property like this: +Here is the \c host property declaration: \snippet examples/declarative/extending/binding/birthdayparty.h 0 -This enables the use of a property binding to ensure the \c name value of the -\c HappyBirthdaySong is updated if the \c host value changes: - -\snippet examples/declarative/extending/binding/example.qml 0 -\snippet examples/declarative/extending/binding/example.qml 1 - -It is the responsibility of the class implementer to ensure that whenever the -property's value changes, the associated NOTIFY signal is emitted. The -signature of the NOTIFY signal is not important to QML. +The NOTIFY attribute is followed by a signal name. It is the responsibility of +the class implementer to ensure that whenever the property's value changes, the +NOTIFY signal is emitted. The signature of the NOTIFY signal is not important to QML. To prevent loops or excessive evaluation, developers should ensure that the signal is only emitted whenever the property's value is actually changed. If @@ -520,8 +504,6 @@ a property, or group of properties, is infrequently used it is permitted to use the same NOTIFY signal for several properties. This should be done with care to ensure that performance doesn't suffer. -\section2 Use of notify signals - To keep QML reliable, if a property does not have a NOTIFY signal, it cannot be used in a binding expression. However, the property can still be assigned a binding as QML does not need to monitor the property for change in that @@ -561,6 +543,11 @@ include NOTIFY signals for use in binding. \section1 Extension Objects +\snippet examples/declarative/extending/extended/example.qml 0 + +The QML snippet shown above adds a new property to an existing C++ type without +modifying its source code. + When integrating existing classes and technology into QML, their APIs will often need to be tweaked to fit better into the declarative environment. Although the best results are usually obtained by modifying the original classes @@ -574,11 +561,6 @@ type definition allows the programmer to supply an additional type - known as th extension type - when registering the target class whose properties are transparently merged with the original target class when used from within QML. -Here is a QML snippet that adds a new property to an existing C++ type without -modifying its source code: - -\snippet examples/declarative/extending/extended/example.qml 0 - An extension class is a regular QObject, with a constructor that takes a QObject pointer. When needed (extension classes are delay created until the first extended property is accessed) the extension class is created and the target object is @@ -590,7 +572,6 @@ When an extended type is installed, one of the #define QML_REGISTER_EXTENDED_TYPE(URI, VMAJ, VFROM, VTO, QDeclarativeName,T, ExtendedT) #define QML_REGISTER_EXTENDED_NOCREATE_TYPE(T, ExtendedT) \endcode - macros should be used instead of the regular \c QML_REGISTER_TYPE or \c QML_REGISTER_NOCREATE_TYPE. The arguments are identical to the corresponding non-extension object macro, except for the ExtendedT parameter which is the type -- cgit v0.12 From 3db4e4467a30086881a030afa0c45a4ed87ad41d Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Wed, 21 Apr 2010 12:53:21 +1000 Subject: Multimedia causes build failure when Qt is configured with -embedded -qconfig minimal Task-number:QTBUG-9960 Reviewed-by:Dmytro Poplavskiy --- .../multimedia/audio/qaudiodevicefactory.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp index 4f45110..74add64 100644 --- a/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp +++ b/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp @@ -67,9 +67,10 @@ QT_BEGIN_NAMESPACE +#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QAudioEngineFactoryInterface_iid, QLatin1String("/audio"), Qt::CaseInsensitive)) - +#endif class QNullDeviceInfo : public QAbstractAudioDeviceInfo { @@ -137,6 +138,8 @@ QList QAudioDeviceFactory::availableDevices(QAudio::Mode mode) devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode); #endif #endif + +#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) QFactoryLoader* l = loader(); foreach (QString const& key, l->keys()) { @@ -148,12 +151,14 @@ QList QAudioDeviceFactory::availableDevices(QAudio::Mode mode) delete plugin; } +#endif return devices; } QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice() { +#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) QAudioEngineFactoryInterface* plugin = qobject_cast(loader()->instance(QLatin1String("default"))); if (plugin) { @@ -161,6 +166,8 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice() if (list.size() > 0) return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput); } +#endif + #ifndef QT_NO_AUDIO_BACKEND #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput); @@ -171,6 +178,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice() QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice() { +#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) QAudioEngineFactoryInterface* plugin = qobject_cast(loader()->instance(QLatin1String("default"))); if (plugin) { @@ -178,6 +186,8 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice() if (list.size() > 0) return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput); } +#endif + #ifndef QT_NO_AUDIO_BACKEND #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN)) return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput); @@ -196,11 +206,14 @@ QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &re return new QAudioDeviceInfoInternal(handle, mode); #endif #endif + +#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) QAudioEngineFactoryInterface* plugin = qobject_cast(loader()->instance(realm)); if (plugin) rc = plugin->createDeviceInfo(handle, mode); +#endif return rc == 0 ? new QNullDeviceInfo() : rc; } @@ -225,11 +238,13 @@ QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo con return new QAudioInputPrivate(deviceInfo.handle(), format); #endif #endif +#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) QAudioEngineFactoryInterface* plugin = qobject_cast(loader()->instance(deviceInfo.realm())); if (plugin) return plugin->createInput(deviceInfo.handle(), format); +#endif return new QNullInputDevice(); } @@ -244,11 +259,14 @@ QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo c return new QAudioOutputPrivate(deviceInfo.handle(), format); #endif #endif + +#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) QAudioEngineFactoryInterface* plugin = qobject_cast(loader()->instance(deviceInfo.realm())); if (plugin) return plugin->createOutput(deviceInfo.handle(), format); +#endif return new QNullOutputDevice(); } -- cgit v0.12 From ce5bd348dffdb38213eeaff9a48db7d677b9bb49 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 21 Apr 2010 12:59:09 +1000 Subject: Fix highlight position with StrictlyEnforceRange and range greater than item size. Task-number: QTBUG-9901 --- .../graphicsitems/qdeclarativeflickable.cpp | 4 +- .../graphicsitems/qdeclarativegridview.cpp | 65 ++++++++---- .../graphicsitems/qdeclarativegridview_p.h | 1 + .../graphicsitems/qdeclarativelistview.cpp | 111 +++++++++++++-------- 4 files changed, 118 insertions(+), 63 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index a76d88e..7b9b5e0 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -655,7 +655,7 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent rejectY = true; } if (!rejectY && stealMouse) { - vData.move.setValue(newY); + vData.move.setValue(qRound(newY)); moved = true; } if (qAbs(dy) > QApplication::startDragDistance()) @@ -682,7 +682,7 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent rejectX = true; } if (!rejectX && stealMouse) { - hData.move.setValue(newX); + hData.move.setValue(qRound(newX)); moved = true; } diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 23140fa..f6666f2 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -347,6 +347,7 @@ public: void QDeclarativeGridViewPrivate::init() { Q_Q(QDeclarativeGridView); + QObject::connect(q, SIGNAL(movementEnded()), q, SLOT(animStopped())); q->setFlag(QGraphicsItem::ItemIsFocusScope); q->setFlickDirection(QDeclarativeFlickable::VerticalFlick); addItemChangeListener(this, Geometry); @@ -747,18 +748,31 @@ void QDeclarativeGridViewPrivate::fixupPosition() void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent) { Q_Q(QDeclarativeGridView); + if ((flow == QDeclarativeGridView::TopToBottom && &data == &vData) + || (flow == QDeclarativeGridView::LeftToRight && &data == &hData)) + return; + int oldDuration = fixupDuration; fixupDuration = moveReason == Mouse ? fixupDuration : 0; if (haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) { - if (currentItem && currentItem->rowPos() - position() != highlightRangeStart) { - qreal pos = currentItem->rowPos() - highlightRangeStart; + if (currentItem) { + updateHighlight(); + qreal pos = currentItem->rowPos(); + qreal viewPos = position(); + if (viewPos < pos + rowSize() - highlightRangeEnd) + viewPos = pos + rowSize() - highlightRangeEnd; + if (viewPos > pos - highlightRangeStart) + viewPos = pos - highlightRangeStart; + timeline.reset(data.move); - if (fixupDuration) { - timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - } else { - data.move.setValue(-pos); - q->viewportMoved(); + if (viewPos != position()) { + if (fixupDuration) { + timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); + } else { + data.move.setValue(-viewPos); + q->viewportMoved(); + } } vTime = timeline.time(); } @@ -803,7 +817,7 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m maxDistance = qAbs(minExtent - data.move.value()); } } - if (snapMode != QDeclarativeGridView::SnapToRow && highlightRange != QDeclarativeGridView::StrictlyEnforceRange) + if (snapMode == QDeclarativeGridView::NoSnap && highlightRange != QDeclarativeGridView::StrictlyEnforceRange) data.flickTarget = minExtent; } else { if (data.move.value() > maxExtent) { @@ -814,7 +828,7 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m maxDistance = qAbs(maxExtent - data.move.value()); } } - if (snapMode != QDeclarativeGridView::SnapToRow && highlightRange != QDeclarativeGridView::StrictlyEnforceRange) + if (snapMode == QDeclarativeGridView::NoSnap && highlightRange != QDeclarativeGridView::StrictlyEnforceRange) data.flickTarget = maxExtent; } if (maxDistance > 0 || overShoot) { @@ -1510,12 +1524,12 @@ void QDeclarativeGridView::viewportMoved() if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) { // reposition highlight qreal pos = d->highlight->rowPos(); - qreal viewPos = qRound(d->position()); - if (pos > viewPos + d->highlightRangeEnd - 1 - d->rowSize()) - pos = viewPos + d->highlightRangeEnd - 1 - d->rowSize(); + qreal viewPos = d->position(); + if (pos > viewPos + d->highlightRangeEnd - d->rowSize()) + pos = viewPos + d->highlightRangeEnd - d->rowSize(); if (pos < viewPos + d->highlightRangeStart) pos = viewPos + d->highlightRangeStart; - d->highlight->setPosition(d->highlight->colPos(), pos); + d->highlight->setPosition(d->highlight->colPos(), qRound(pos)); // update current index int idx = d->snapIndex(); @@ -1538,8 +1552,10 @@ qreal QDeclarativeGridView::minYExtent() const if (d->flow == QDeclarativeGridView::TopToBottom) return QDeclarativeFlickable::minYExtent(); qreal extent = -d->startPosition(); - if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) + if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) { extent += d->highlightRangeStart; + extent = qMax(extent, -(d->rowPosAt(0) + d->rowSize() - d->highlightRangeEnd)); + } return extent; } @@ -1550,8 +1566,9 @@ qreal QDeclarativeGridView::maxYExtent() const return QDeclarativeFlickable::maxYExtent(); qreal extent; if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) { - extent = -(d->endPosition() - d->highlightRangeEnd); - extent = qMax(extent, -(d->rowPosAt(d->model->count()-1) - d->highlightRangeStart)); + extent = -(d->rowPosAt(d->model->count()-1) - d->highlightRangeStart); + if (d->highlightRangeEnd != d->highlightRangeStart) + extent = qMin(extent, -(d->endPosition() - d->highlightRangeEnd + 1)); } else { extent = -(d->endPosition() - height()); } @@ -1567,8 +1584,10 @@ qreal QDeclarativeGridView::minXExtent() const if (d->flow == QDeclarativeGridView::LeftToRight) return QDeclarativeFlickable::minXExtent(); qreal extent = -d->startPosition(); - if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) + if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) { extent += d->highlightRangeStart; + extent = qMax(extent, -(d->rowPosAt(0) + d->rowSize() - d->highlightRangeEnd)); + } return extent; } @@ -1579,8 +1598,9 @@ qreal QDeclarativeGridView::maxXExtent() const return QDeclarativeFlickable::maxXExtent(); qreal extent; if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) { - extent = -(d->endPosition() - d->highlightRangeEnd); - extent = qMax(extent, -(d->rowPosAt(d->model->count()-1) - d->highlightRangeStart)); + extent = -(d->rowPosAt(d->model->count()-1) - d->highlightRangeStart); + if (d->highlightRangeEnd != d->highlightRangeStart) + extent = qMin(extent, -(d->endPosition() - d->highlightRangeEnd + 1)); } else { extent = -(d->endPosition() - height()); } @@ -2250,6 +2270,13 @@ void QDeclarativeGridView::destroyingItem(QDeclarativeItem *item) d->unrequestedItems.remove(item); } +void QDeclarativeGridView::animStopped() +{ + Q_D(QDeclarativeGridView); + d->bufferMode = QDeclarativeGridViewPrivate::NoBuffer; + if (d->haveHighlightRange && d->highlightRange == QDeclarativeGridView::StrictlyEnforceRange) + d->updateHighlight(); +} void QDeclarativeGridView::refill() { diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h index 5baa1dd..c06879e 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview_p.h +++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h @@ -192,6 +192,7 @@ private Q_SLOTS: void destroyRemoved(); void createdItem(int index, QDeclarativeItem *item); void destroyingItem(QDeclarativeItem *item); + void animStopped(); private: void refill(); diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 672f723..a4ca651 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -271,6 +271,28 @@ public: return 0; } + qreal endPositionAt(int modelIndex) const { + if (FxListItem *item = visibleItem(modelIndex)) + return item->endPosition(); + if (!visibleItems.isEmpty()) { + if (modelIndex < visibleIndex) { + int count = visibleIndex - modelIndex; + return (*visibleItems.constBegin())->position() - (count - 1) * (averageSize + spacing) - spacing - 1; + } else { + int idx = visibleItems.count() - 1; + while (idx >= 0 && visibleItems.at(idx)->index == -1) + --idx; + if (idx < 0) + idx = visibleIndex; + else + idx = visibleItems.at(idx)->index; + int count = modelIndex - idx - 1; + return (*(--visibleItems.constEnd()))->endPosition() + count * (averageSize + spacing); + } + } + return 0; + } + QString sectionAt(int modelIndex) { if (FxListItem *item = visibleItem(modelIndex)) return item->attached->section(); @@ -396,13 +418,16 @@ public: } void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) { + Q_Q(QDeclarativeListView); QDeclarativeFlickablePrivate::itemGeometryChanged(item, newGeometry, oldGeometry); - if (item != viewport) { + if (item != viewport && (!highlight || item != highlight->item)) { if ((orient == QDeclarativeListView::Vertical && newGeometry.height() != oldGeometry.height()) || (orient == QDeclarativeListView::Horizontal && newGeometry.width() != oldGeometry.width())) { scheduleLayout(); } } + if (trackedItem && trackedItem->item == item) + q->trackedPositionChanged(); } // for debugging only @@ -567,13 +592,8 @@ void QDeclarativeListViewPrivate::releaseItem(FxListItem *item) Q_Q(QDeclarativeListView); if (!item || !model) return; - if (trackedItem == item) { - const char *notifier1 = orient == QDeclarativeListView::Vertical ? SIGNAL(yChanged()) : SIGNAL(xChanged()); - const char *notifier2 = orient == QDeclarativeListView::Vertical ? SIGNAL(heightChanged()) : SIGNAL(widthChanged()); - QObject::disconnect(trackedItem->item, notifier1, q, SLOT(trackedPositionChanged())); - QObject::disconnect(trackedItem->item, notifier2, q, SLOT(trackedPositionChanged())); + if (trackedItem == item) trackedItem = 0; - } QDeclarativeItemPrivate *itemPrivate = static_cast(QGraphicsItemPrivate::get(item->item)); itemPrivate->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry); if (model->release(item->item) == 0) { @@ -770,21 +790,7 @@ void QDeclarativeListViewPrivate::updateTrackedItem() FxListItem *item = currentItem; if (highlight) item = highlight; - - const char *notifier1 = orient == QDeclarativeListView::Vertical ? SIGNAL(yChanged()) : SIGNAL(xChanged()); - const char *notifier2 = orient == QDeclarativeListView::Vertical ? SIGNAL(heightChanged()) : SIGNAL(widthChanged()); - - if (trackedItem && item != trackedItem) { - QObject::disconnect(trackedItem->item, notifier1, q, SLOT(trackedPositionChanged())); - QObject::disconnect(trackedItem->item, notifier2, q, SLOT(trackedPositionChanged())); - trackedItem = 0; - } - - if (!trackedItem && item) { - trackedItem = item; - QObject::connect(trackedItem->item, notifier1, q, SLOT(trackedPositionChanged())); - QObject::connect(trackedItem->item, notifier2, q, SLOT(trackedPositionChanged())); - } + trackedItem = item; if (trackedItem) q->trackedPositionChanged(); } @@ -833,6 +839,8 @@ void QDeclarativeListViewPrivate::createHighlight() highlight->item->setWidth(currentItem->item->width()); } } + QDeclarativeItemPrivate *itemPrivate = static_cast(QGraphicsItemPrivate::get(item)); + itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry); const QLatin1String posProp(orient == QDeclarativeListView::Vertical ? "y" : "x"); highlightPosAnimator = new QSmoothedAnimation(q); highlightPosAnimator->target = QDeclarativeProperty(highlight->item, posProp); @@ -1106,14 +1114,23 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m fixupDuration = moveReason == Mouse ? fixupDuration : 0; if (haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) { - if (currentItem && currentItem->position() - position() != highlightRangeStart) { - qreal pos = currentItem->position() - highlightRangeStart; + if (currentItem) { + updateHighlight(); + qreal pos = currentItem->position(); + qreal viewPos = position(); + if (viewPos < pos + currentItem->size() - highlightRangeEnd) + viewPos = pos + currentItem->size() - highlightRangeEnd; + if (viewPos > pos - highlightRangeStart) + viewPos = pos - highlightRangeStart; + timeline.reset(data.move); - if (fixupDuration) { - timeline.move(data.move, -pos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); - } else { - data.move.setValue(-pos); - q->viewportMoved(); + if (viewPos != position()) { + if (fixupDuration) { + timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2); + } else { + data.move.setValue(-viewPos); + q->viewportMoved(); + } } vTime = timeline.time(); } @@ -2066,12 +2083,12 @@ void QDeclarativeListView::viewportMoved() if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) { // reposition highlight qreal pos = d->highlight->position(); - qreal viewPos = qRound(d->position()); - if (pos > viewPos + d->highlightRangeEnd - 1 - d->highlight->size()) - pos = viewPos + d->highlightRangeEnd - 1 - d->highlight->size(); + qreal viewPos = d->position(); + if (pos > viewPos + d->highlightRangeEnd - d->highlight->size()) + pos = viewPos + d->highlightRangeEnd - d->highlight->size(); if (pos < viewPos + d->highlightRangeStart) pos = viewPos + d->highlightRangeStart; - d->highlight->setPosition(pos); + d->highlight->setPosition(qRound(pos)); // update current index int idx = d->snapIndex(); @@ -2128,8 +2145,10 @@ qreal QDeclarativeListView::minYExtent() const d->minExtent = -d->startPosition(); if (d->header && d->visibleItems.count()) d->minExtent += d->header->size(); - if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) + if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) { d->minExtent += d->highlightRangeStart; + d->minExtent = qMax(d->minExtent, -(d->endPositionAt(0) - d->highlightRangeEnd + 1)); + } d->minExtentDirty = false; } @@ -2143,10 +2162,12 @@ qreal QDeclarativeListView::maxYExtent() const return height(); if (d->maxExtentDirty) { if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) { - d->maxExtent = -(d->endPosition() - d->highlightRangeEnd); - d->maxExtent = qMax(d->maxExtent, -(d->positionAt(d->model->count()-1) - d->highlightRangeStart)); - } else + d->maxExtent = -(d->positionAt(d->model->count()-1) - d->highlightRangeStart); + if (d->highlightRangeEnd != d->highlightRangeStart) + d->maxExtent = qMin(d->maxExtent, -(d->endPosition() - d->highlightRangeEnd + 1)); + } else { d->maxExtent = -(d->endPosition() - height() + 1); + } if (d->footer) d->maxExtent -= d->footer->size(); qreal minY = minYExtent(); @@ -2166,8 +2187,10 @@ qreal QDeclarativeListView::minXExtent() const d->minExtent = -d->startPosition(); if (d->header) d->minExtent += d->header->size(); - if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) + if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) { d->minExtent += d->highlightRangeStart; + d->minExtent = qMax(d->minExtent, -(d->endPositionAt(0) - d->highlightRangeEnd + 1)); + } d->minExtentDirty = false; } @@ -2181,10 +2204,12 @@ qreal QDeclarativeListView::maxXExtent() const return width(); if (d->maxExtentDirty) { if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange) { - d->maxExtent = -(d->endPosition() - d->highlightRangeEnd); - d->maxExtent = qMax(d->maxExtent, -(d->positionAt(d->model->count()-1) - d->highlightRangeStart)); - } else + d->maxExtent = -(d->positionAt(d->model->count()-1) - d->highlightRangeStart); + if (d->highlightRangeEnd != d->highlightRangeStart) + d->maxExtent = qMin(d->maxExtent, -(d->endPosition() - d->highlightRangeEnd + 1)); + } else { d->maxExtent = -(d->endPosition() - width() + 1); + } if (d->footer) d->maxExtent -= d->footer->size(); qreal minX = minXExtent(); @@ -2393,7 +2418,7 @@ void QDeclarativeListView::trackedPositionChanged() if (!d->trackedItem || !d->currentItem) return; if (!isFlicking() && !d->moving && d->moveReason == QDeclarativeListViewPrivate::SetIndex) { - const qreal trackedPos = d->trackedItem->position(); + const qreal trackedPos = qCeil(d->trackedItem->position()); const qreal viewPos = d->position(); if (d->haveHighlightRange) { if (d->highlightRange == StrictlyEnforceRange) { @@ -2827,6 +2852,8 @@ void QDeclarativeListView::animStopped() { Q_D(QDeclarativeListView); d->bufferMode = QDeclarativeListViewPrivate::NoBuffer; + if (d->haveHighlightRange && d->highlightRange == QDeclarativeListView::StrictlyEnforceRange) + d->updateHighlight(); } QDeclarativeListViewAttached *QDeclarativeListView::qmlAttachedProperties(QObject *obj) -- cgit v0.12 From 943a05c9f4d6520a6cbfabbe0d06bb42c339844f Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 21 Apr 2010 13:11:41 +1000 Subject: Remove \internal from QDeclarativePropertyValueSource. It should be public according to the docs. --- src/declarative/qml/qdeclarativepropertyvaluesource.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp index b106d4f..a0ed78f 100644 --- a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp +++ b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp @@ -47,8 +47,10 @@ QT_BEGIN_NAMESPACE /*! \class QDeclarativePropertyValueSource - \brief The QDeclarativePropertyValueSource class is inherited by property value sources such as animations and bindings. - \internal + \brief The QDeclarativePropertyValueSource class is an interface for property value sources such as animations and bindings. + + See \l{Property Value Sources} for information on writing custom property + value sources. */ /*! -- cgit v0.12 From 81a3f8e7c11c69b2390582c768f1020e233d14cf Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 21 Apr 2010 13:15:36 +1000 Subject: delete the viewer before calling exit(). Ensures correct cleanup. --- tools/qml/main.cpp | 54 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index e90d729..cba5650 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -347,7 +347,7 @@ int main(int argc, char ** argv) } #endif - QDeclarativeViewer viewer(0, wflags); + QDeclarativeViewer *viewer = new QDeclarativeViewer(0, wflags); if (!scriptopts.isEmpty()) { QStringList options = scriptopts.split(QLatin1Char(','), QString::SkipEmptyParts); @@ -383,45 +383,45 @@ int main(int argc, char ** argv) if (!(scriptOptions & QDeclarativeViewer::Record) && !(scriptOptions & QDeclarativeViewer::Play)) scriptOptsUsage(); - viewer.setScriptOptions(scriptOptions); - viewer.setScript(script); + viewer->setScriptOptions(scriptOptions); + viewer->setScript(script); } else if (!script.isEmpty()) { usage(); } - viewer.addLibraryPath(QCoreApplication::applicationDirPath()); + viewer->addLibraryPath(QCoreApplication::applicationDirPath()); foreach (QString lib, imports) - viewer.addLibraryPath(lib); + viewer->addLibraryPath(lib); foreach (QString plugin, plugins) - viewer.addPluginPath(plugin); + viewer->addPluginPath(plugin); - viewer.setNetworkCacheSize(cache); - viewer.setRecordFile(recordfile); - viewer.setSizeToView(sizeToView); + viewer->setNetworkCacheSize(cache); + viewer->setRecordFile(recordfile); + viewer->setSizeToView(sizeToView); if (resizeview) - viewer.setScaleView(); + viewer->setScaleView(); if (fps>0) - viewer.setRecordRate(fps); + viewer->setRecordRate(fps); if (autorecord_to) - viewer.setAutoRecord(autorecord_from,autorecord_to); + viewer->setAutoRecord(autorecord_from,autorecord_to); if (!skin.isEmpty()) { if (skin == "list") { - foreach (QString s, viewer.builtinSkins()) + foreach (QString s, viewer->builtinSkins()) qWarning() << qPrintable(s); exit(0); } else { - viewer.setSkin(skin); + viewer->setSkin(skin); } } if (devkeys) - viewer.setDeviceKeys(true); - viewer.setRecordDither(dither); + viewer->setDeviceKeys(true); + viewer->setRecordDither(dither); if (recordargs.count()) - viewer.setRecordArgs(recordargs); + viewer->setRecordArgs(recordargs); - viewer.setUseNativeFileBrowser(useNativeFileBrowser); + viewer->setUseNativeFileBrowser(useNativeFileBrowser); if (fullScreen && maximized) qWarning() << "Both -fullscreen and -maximized specified. Using -fullscreen."; @@ -440,17 +440,19 @@ int main(int argc, char ** argv) } if (!fileName.isEmpty()) { - viewer.open(fileName); - fullScreen ? viewer.showFullScreen() : maximized ? viewer.showMaximized() : viewer.show(); + viewer->open(fileName); + fullScreen ? viewer->showFullScreen() : maximized ? viewer->showMaximized() : viewer->show(); } else { if (!useNativeFileBrowser) - viewer.openFile(); - fullScreen ? viewer.showFullScreen() : maximized ? viewer.showMaximized() : viewer.show(); + viewer->openFile(); + fullScreen ? viewer->showFullScreen() : maximized ? viewer->showMaximized() : viewer->show(); if (useNativeFileBrowser) - viewer.openFile(); + viewer->openFile(); } - viewer.setUseGL(useGL); - viewer.raise(); + viewer->setUseGL(useGL); + viewer->raise(); - exit(app.exec()); + int rv = app.exec(); + delete viewer; + exit(rv); } -- cgit v0.12 From 893cc249e6752a72b27ad60e4f7eaea56ae7909c Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Wed, 21 Apr 2010 13:11:58 +1000 Subject: Fix qmlvisual/animation/parentAnimation autotest The transformOriginPoint was not up tp date when used in ParentChange after this commit: 575f0064bd91e26daa75805c142c10a04a32c2fd. Reviewed-by: Michael Brasser --- src/declarative/util/qdeclarativestateoperations.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 8f22de5..0aad498 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -124,6 +124,10 @@ void QDeclarativeParentChangePrivate::doChange(QDeclarativeItem *targetParent, Q const QPointF &point = transform.map(QPointF(target->x(),target->y())); qreal x = point.x(); qreal y = point.y(); + + // setParentItem will update the transformOriginPoint if needed + target->setParentItem(targetParent); + if (ok && target->transformOrigin() != QDeclarativeItem::TopLeft) { qreal tempxt = target->transformOriginPoint().x(); qreal tempyt = target->transformOriginPoint().y(); @@ -137,7 +141,6 @@ void QDeclarativeParentChangePrivate::doChange(QDeclarativeItem *targetParent, Q y += offset.y(); } - target->setParentItem(targetParent); if (ok) { //qDebug() << x << y << rotation << scale; target->setX(x); -- cgit v0.12 From f24df625d4bdf9ff96853a4f0a5426a12d0be94c Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 21 Apr 2010 14:11:39 +1000 Subject: Fix crash. Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarativebinding.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index 95520da..d44e7fb 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -361,8 +361,10 @@ void QDeclarativeAbstractBinding::removeFromObject() void QDeclarativeAbstractBinding::clear() { - if (m_mePtr) + if (m_mePtr) { *m_mePtr = 0; + m_mePtr = 0; + } } QString QDeclarativeAbstractBinding::expression() const -- cgit v0.12 From 146eb30c23f55c714afdde887ea6bb4df104e057 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 21 Apr 2010 14:38:17 +1000 Subject: Ignore message in QDeclarativeLoader test. --- tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp index a5f75bd..7cdadb4 100644 --- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp +++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp @@ -538,9 +538,8 @@ void tst_QDeclarativeLoader::nonItem() void tst_QDeclarativeLoader::vmeErrors() { QDeclarativeComponent component(&engine, TEST_FILE("vmeErrors.qml")); - //ignore message for now - //QString err = QUrl::fromLocalFile(SRCDIR "/data/VmeError.qml:6: Cannot assign object type QObject with no default method\n onSomethingHappened: QtObject {}) "); - //QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData()); + QString err = QUrl::fromLocalFile(SRCDIR).toString() + "/data/VmeError.qml:6: Cannot assign object type QObject with no default method"; + QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData()); QDeclarativeLoader *loader = qobject_cast(component.create()); QVERIFY(loader); QVERIFY(loader->item() == 0); -- cgit v0.12 From 6b30ee9d2219308605e0d1b15ea1c74dc5cb67fe Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Wed, 21 Apr 2010 14:12:06 +1000 Subject: Only add qvideowidget test once. Reviewed-by: Andrew den Exter --- tests/auto/multimedia.pro | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/auto/multimedia.pro b/tests/auto/multimedia.pro index 876b932..0a89f53 100644 --- a/tests/auto/multimedia.pro +++ b/tests/auto/multimedia.pro @@ -7,6 +7,5 @@ SUBDIRS=\ qaudioinput \ qaudiooutput \ qvideoframe \ - qvideosurfaceformat \ - qvideowidget + qvideosurfaceformat -- cgit v0.12 From d363b2ed7517dbbc8a54c02d8b606f4b52b54047 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 21 Apr 2010 14:51:19 +1000 Subject: Fix crash when QDeclarativeInfo objects are copied --- src/declarative/qml/qdeclarativeinfo.cpp | 133 ++++++++++++++++--------------- src/declarative/qml/qdeclarativeinfo.h | 26 +++--- 2 files changed, 78 insertions(+), 81 deletions(-) diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp index f6560a6..ffed14e 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/declarative/qml/qdeclarativeinfo.cpp @@ -80,92 +80,97 @@ QT_BEGIN_NAMESPACE struct QDeclarativeInfoPrivate { + QDeclarativeInfoPrivate() : ref (1), object(0) {} + + int ref; const QObject *object; - QString *buffer; + QString buffer; QList errors; }; -QDeclarativeInfo::QDeclarativeInfo(const QObject *object) -: QDebug((*(QString **)&d) = new QString) +QDeclarativeInfo::QDeclarativeInfo(QDeclarativeInfoPrivate *p) +: QDebug(&p->buffer), d(p) { - QDeclarativeInfoPrivate *p = new QDeclarativeInfoPrivate; - p->buffer = (QString *)d; - d = p; - - d->object = object; nospace(); } -QDeclarativeInfo::QDeclarativeInfo(const QObject *object, const QList &errors) -: QDebug((*(QString **)&d) = new QString) +QDeclarativeInfo::QDeclarativeInfo(const QDeclarativeInfo &other) +: QDebug(other), d(other.d) { - QDeclarativeInfoPrivate *p = new QDeclarativeInfoPrivate; - p->buffer = (QString *)d; - d = p; - - d->object = object; - d->errors = errors; - nospace(); -} - -QDeclarativeInfo::QDeclarativeInfo(const QObject *object, const QDeclarativeError &error) -: QDebug((*(QString **)&d) = new QString) -{ - QDeclarativeInfoPrivate *p = new QDeclarativeInfoPrivate; - p->buffer = (QString *)d; - d = p; - - d->object = object; - d->errors << error; - nospace(); + d->ref++; } QDeclarativeInfo::~QDeclarativeInfo() { - QList errors = d->errors; - - QDeclarativeEngine *engine = 0; - - if (!d->buffer->isEmpty()) { - QDeclarativeError error; - - QObject *object = const_cast(d->object); - - if (object) { - engine = qmlEngine(d->object); - QString typeName; - QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject()); - if (type) { - typeName = QLatin1String(type->qmlTypeName()); - int lastSlash = typeName.lastIndexOf(QLatin1Char('/')); - if (lastSlash != -1) - typeName = typeName.mid(lastSlash+1); - } else { - typeName = QString::fromUtf8(object->metaObject()->className()); - int marker = typeName.indexOf(QLatin1String("_QMLTYPE_")); - if (marker != -1) - typeName = typeName.left(marker); + if (0 == --d->ref) { + QList errors = d->errors; + + QDeclarativeEngine *engine = 0; + + if (!d->buffer.isEmpty()) { + QDeclarativeError error; + + QObject *object = const_cast(d->object); + + if (object) { + engine = qmlEngine(d->object); + QString typeName; + QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject()); + if (type) { + typeName = QLatin1String(type->qmlTypeName()); + int lastSlash = typeName.lastIndexOf(QLatin1Char('/')); + if (lastSlash != -1) + typeName = typeName.mid(lastSlash+1); + } else { + typeName = QString::fromUtf8(object->metaObject()->className()); + int marker = typeName.indexOf(QLatin1String("_QMLTYPE_")); + if (marker != -1) + typeName = typeName.left(marker); + } + + d->buffer.prepend(QLatin1String("QML ") + typeName + QLatin1String(": ")); + + QDeclarativeData *ddata = QDeclarativeData::get(object, false); + if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) { + error.setUrl(ddata->outerContext->url); + error.setLine(ddata->lineNumber); + error.setColumn(ddata->columnNumber); + } } - d->buffer->prepend(QLatin1String("QML ") + typeName + QLatin1String(": ")); + error.setDescription(d->buffer); - QDeclarativeData *ddata = QDeclarativeData::get(object, false); - if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) { - error.setUrl(ddata->outerContext->url); - error.setLine(ddata->lineNumber); - error.setColumn(ddata->columnNumber); - } + errors.prepend(error); } - error.setDescription(*d->buffer); + QDeclarativeEnginePrivate::warning(engine, errors); - errors.prepend(error); + delete d; } +} - QDeclarativeEnginePrivate::warning(engine, errors); +QDeclarativeInfo qmlInfo(const QObject *me) +{ + QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate; + d->object = me; + return QDeclarativeInfo(d); +} - delete d->buffer; - delete d; +QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error) +{ + QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate; + d->object = me; + d->errors << error; + return QDeclarativeInfo(d); } +QDeclarativeInfo qmlInfo(const QObject *me, const QList &errors) +{ + QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate; + d->object = me; + d->errors = errors; + return QDeclarativeInfo(d); +} + + QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h index 3d5a111..82f44f2 100644 --- a/src/declarative/qml/qdeclarativeinfo.h +++ b/src/declarative/qml/qdeclarativeinfo.h @@ -56,9 +56,7 @@ class QDeclarativeInfoPrivate; class Q_DECLARATIVE_EXPORT QDeclarativeInfo : public QDebug { public: - QDeclarativeInfo(const QObject *); - QDeclarativeInfo(const QObject *, const QDeclarativeError &); - QDeclarativeInfo(const QObject *, const QList &); + QDeclarativeInfo(const QDeclarativeInfo &); ~QDeclarativeInfo(); inline QDeclarativeInfo &operator<<(QChar t) { QDebug::operator<<(t); return *this; } @@ -86,23 +84,17 @@ public: inline QDeclarativeInfo &operator<<(const QUrl &t) { static_cast(*this) << t; return *this; } private: + friend QDeclarativeInfo qmlInfo(const QObject *me); + friend QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error); + friend QDeclarativeInfo qmlInfo(const QObject *me, const QList &errors); + + QDeclarativeInfo(QDeclarativeInfoPrivate *); QDeclarativeInfoPrivate *d; }; -Q_DECLARATIVE_EXPORT inline QDeclarativeInfo qmlInfo(const QObject *me) -{ - return QDeclarativeInfo(me); -} - -Q_DECLARATIVE_EXPORT inline QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error) -{ - return QDeclarativeInfo(me, error); -} - -Q_DECLARATIVE_EXPORT inline QDeclarativeInfo qmlInfo(const QObject *me, const QList &errors) -{ - return QDeclarativeInfo(me, errors); -} +Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me); +Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error); +Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QList &errors); QT_END_NAMESPACE -- cgit v0.12 From 5beddba73a7b2890f775d45aeb2f21407f8c3d0d Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 21 Apr 2010 15:33:07 +1000 Subject: Don't allow properties in Component elements QTBUG-10082 --- src/declarative/qml/qdeclarativecompiler.cpp | 7 +++++++ .../declarative/qdeclarativelanguage/data/component.7.errors.txt | 1 + tests/auto/declarative/qdeclarativelanguage/data/component.7.qml | 7 +++++++ .../declarative/qdeclarativelanguage/data/component.8.errors.txt | 1 + tests/auto/declarative/qdeclarativelanguage/data/component.8.qml | 7 +++++++ .../declarative/qdeclarativelanguage/data/component.9.errors.txt | 1 + tests/auto/declarative/qdeclarativelanguage/data/component.9.qml | 7 +++++++ .../declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 3 +++ 8 files changed, 34 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.7.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.7.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.8.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.8.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.9.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.9.qml diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 10e4746..10cd886 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1191,6 +1191,13 @@ bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj, (obj->defaultProperty->values.count() == 1 && !obj->defaultProperty->values.first()->object))) COMPILE_EXCEPTION(obj, tr("Invalid component body specification")); + if (!obj->dynamicProperties.isEmpty()) + COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new properties.")); + if (!obj->dynamicSignals.isEmpty()) + COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new signals.")); + if (!obj->dynamicSlots.isEmpty()) + COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new functions.")); + Object *root = 0; if (obj->defaultProperty && obj->defaultProperty->values.count()) root = obj->defaultProperty->values.first()->object; diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.7.errors.txt new file mode 100644 index 0000000..b144814 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.7.errors.txt @@ -0,0 +1 @@ +3:1:Component objects cannot declare new properties. diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml new file mode 100644 index 0000000..ad708fe --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml @@ -0,0 +1,7 @@ +import Qt 4.6 + +Component { + property int a + QtObject {} +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.8.errors.txt new file mode 100644 index 0000000..6f2d0d2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.8.errors.txt @@ -0,0 +1 @@ +3:1:Component objects cannot declare new signals. diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml new file mode 100644 index 0000000..67b1b89 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml @@ -0,0 +1,7 @@ +import Qt 4.6 + +Component { + signal a + QtObject {} +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/component.9.errors.txt new file mode 100644 index 0000000..92f1456 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.9.errors.txt @@ -0,0 +1 @@ +3:1:Component objects cannot declare new functions. diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml new file mode 100644 index 0000000..a4dbae0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml @@ -0,0 +1,7 @@ +import Qt 4.6 + +Component { + function a() {} + QtObject {} +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 3d56d1f..d1c83e1 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -296,6 +296,9 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("Component.4") << "component.4.qml" << "component.4.errors.txt" << false; QTest::newRow("Component.5") << "component.5.qml" << "component.5.errors.txt" << false; QTest::newRow("Component.6") << "component.6.qml" << "component.6.errors.txt" << false; + QTest::newRow("Component.7") << "component.7.qml" << "component.7.errors.txt" << false; + QTest::newRow("Component.8") << "component.8.qml" << "component.8.errors.txt" << false; + QTest::newRow("Component.9") << "component.9.qml" << "component.9.errors.txt" << false; QTest::newRow("MultiSet.1") << "multiSet.1.qml" << "multiSet.1.errors.txt" << false; QTest::newRow("MultiSet.2") << "multiSet.2.qml" << "multiSet.2.errors.txt" << false; -- cgit v0.12 From 62d40d166f77de67072eced7eac4f3c38697af52 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 21 Apr 2010 15:34:51 +1000 Subject: Add forceFocus method to QDeclarativeItem. Reviewed-by: Aaron Kennedy --- src/declarative/graphicsitems/qdeclarativeitem.cpp | 21 +++++- src/declarative/graphicsitems/qdeclarativeitem.h | 1 + .../qdeclarativefocusscope/data/forcefocus.qml | 81 ++++++++++++++++++++++ .../qdeclarativefocusscope/data/test.qml | 2 +- .../qdeclarativefocusscope/data/test4.qml | 2 +- .../qdeclarativefocusscope/data/test5.qml | 2 +- .../tst_qdeclarativefocusscope.cpp | 57 +++++++++++++++ 7 files changed, 161 insertions(+), 5 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index d19967a..bdd24b6 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -1595,10 +1595,10 @@ void QDeclarativeItemPrivate::transform_clear(QDeclarativeListProperty(o); - if (e) + if (e) e->connect(&item->d_func()->parentNotifier); *((QDeclarativeItem **)rv) = item->parentItem(); } @@ -2280,6 +2280,23 @@ QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, qreal x, qrea return sv; } +/*! + \qmlmethod Item::forceFocus() + + Force the focus on the item. + This method sets the focus on the item and makes sure that all the focus scopes higher in the object hierarchy are given focus. +*/ +void QDeclarativeItem::forceFocus() +{ + setFocus(true); + QGraphicsItem *parent = parentItem(); + while (parent) { + if (parent->flags() & QGraphicsItem::ItemIsFocusScope) + parent->setFocus(Qt::OtherFocusReason); + parent = parent->parentItem(); + } +} + void QDeclarativeItemPrivate::focusChanged(bool flag) { Q_Q(QDeclarativeItem); diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h index 51889f6..da5a36e 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.h +++ b/src/declarative/graphicsitems/qdeclarativeitem.h @@ -157,6 +157,7 @@ public: Q_INVOKABLE QScriptValue mapFromItem(const QScriptValue &item, qreal x, qreal y) const; Q_INVOKABLE QScriptValue mapToItem(const QScriptValue &item, qreal x, qreal y) const; + Q_INVOKABLE void forceFocus(); QDeclarativeAnchorLine left() const; QDeclarativeAnchorLine right() const; diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml new file mode 100644 index 0000000..adde522 --- /dev/null +++ b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml @@ -0,0 +1,81 @@ +import Qt 4.6 + +Rectangle { + width: 800; height: 600 + + FocusScope { + focus: true + + FocusScope { + id: firstScope + focus: true + + Rectangle { + objectName: "item0" + height: 120; width: 420 + + color: "transparent" + border.width: 5; border.color: firstScope.wantsFocus?"blue":"black" + + Rectangle { + id: item1; objectName: "item1" + x: 10; y: 10; width: 100; height: 100; color: "green" + border.width: 5; border.color: wantsFocus?"blue":"black" + focus: true + + Rectangle { + width: 50; height: 50; anchors.centerIn: parent + color: parent.focus?"red":"transparent" + } + } + + Rectangle { + id: item2; objectName: "item2" + x: 310; y: 10; width: 100; height: 100; color: "green" + border.width: 5; border.color: wantsFocus?"blue":"black" + + Rectangle { + width: 50; height: 50; anchors.centerIn: parent + color: parent.focus?"red":"transparent" + } + } + } + } + + FocusScope { + id: secondScope + + Rectangle { + objectName: "item3" + y: 160; height: 120; width: 420 + + color: "transparent" + border.width: 5; border.color: secondScope.wantsFocus?"blue":"black" + + Rectangle { + id: item4; objectName: "item4" + x: 10; y: 10; width: 100; height: 100; color: "green" + border.width: 5; border.color: wantsFocus?"blue":"black" + + Rectangle { + width: 50; height: 50; anchors.centerIn: parent + color: parent.focus?"red":"transparent" + } + } + + Rectangle { + id: item5; objectName: "item5" + x: 310; y: 10; width: 100; height: 100; color: "green" + border.width: 5; border.color: wantsFocus?"blue":"black" + + Rectangle { + width: 50; height: 50; anchors.centerIn: parent + color: parent.focus?"red":"transparent" + } + } + } + } + } + Keys.onDigit4Pressed: item4.focus = true + Keys.onDigit5Pressed: item5.forceFocus() +} diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml index 647e5bf..f060bdc 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml +++ b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml @@ -20,7 +20,7 @@ Rectangle { color: "transparent" border.width: 5 - //border.color: myScope.wantsFocus?"blue":"black" + border.color: myScope.wantsFocus?"blue":"black" Rectangle { id: item1; objectName: "item1" diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml index d8bd390..e41c6b8 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml +++ b/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml @@ -19,7 +19,7 @@ Rectangle { color: "transparent" border.width: 5 - //border.color: myScope.wantsFocus?"blue":"black" + border.color: myScope.wantsFocus?"blue":"black" Rectangle { id: item1; objectName: "item1" diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml index da452cf..838e557 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml +++ b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml @@ -20,7 +20,7 @@ Rectangle { color: "transparent" border.width: 5 - //border.color: myScope.wantsFocus?"blue":"black" + border.color: myScope.wantsFocus?"blue":"black" Rectangle { x: 10; y: 10 diff --git a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp index 1bd8331..04bb1c5 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp +++ b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp @@ -63,6 +63,7 @@ private slots: void nested(); void noFocus(); void textEdit(); + void forceFocus(); }; /* @@ -273,6 +274,62 @@ void tst_qdeclarativefocusscope::textEdit() delete view; } +void tst_qdeclarativefocusscope::forceFocus() +{ + QDeclarativeView *view = new QDeclarativeView; + view->setSource(QUrl::fromLocalFile(SRCDIR "/data/forcefocus.qml")); + + QDeclarativeRectangle *item0 = findItem(view->rootObject(), QLatin1String("item0")); + QDeclarativeRectangle *item1 = findItem(view->rootObject(), QLatin1String("item1")); + QDeclarativeRectangle *item2 = findItem(view->rootObject(), QLatin1String("item2")); + QDeclarativeRectangle *item3 = findItem(view->rootObject(), QLatin1String("item3")); + QDeclarativeRectangle *item4 = findItem(view->rootObject(), QLatin1String("item4")); + QDeclarativeRectangle *item5 = findItem(view->rootObject(), QLatin1String("item5")); + QVERIFY(item0 != 0); + QVERIFY(item1 != 0); + QVERIFY(item2 != 0); + QVERIFY(item3 != 0); + QVERIFY(item4 != 0); + QVERIFY(item5 != 0); + + view->show(); + qApp->setActiveWindow(view); + qApp->processEvents(); + +#ifdef Q_WS_X11 + // to be safe and avoid failing setFocus with window managers + qt_x11_wait_for_window_manager(view); +#endif + + QVERIFY(view->hasFocus()); + QVERIFY(view->scene()->hasFocus()); + QVERIFY(item0->wantsFocus() == true); + QVERIFY(item1->hasFocus() == true); + QVERIFY(item2->hasFocus() == false); + QVERIFY(item3->wantsFocus() == false); + QVERIFY(item4->hasFocus() == false); + QVERIFY(item5->hasFocus() == false); + + QTest::keyClick(view, Qt::Key_4); + QVERIFY(item0->wantsFocus() == true); + QVERIFY(item1->hasFocus() == true); + QVERIFY(item2->hasFocus() == false); + QVERIFY(item3->wantsFocus() == false); + QVERIFY(item4->hasFocus() == false); + QVERIFY(item5->hasFocus() == false); + + QTest::keyClick(view, Qt::Key_5); + QVERIFY(item0->wantsFocus() == false); + QVERIFY(item1->hasFocus() == false); + QVERIFY(item2->hasFocus() == false); + QVERIFY(item3->wantsFocus() == true); + QVERIFY(item4->hasFocus() == false); + QVERIFY(item5->hasFocus() == true); + + delete view; +} + + QTEST_MAIN(tst_qdeclarativefocusscope) #include "tst_qdeclarativefocusscope.moc" -- cgit v0.12 From f2a7506e71125676303042388bdeca94b2677292 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 21 Apr 2010 15:39:13 +1000 Subject: Cleanup declarative focus example. --- examples/declarative/focus/Core/GridMenu.qml | 4 +--- examples/declarative/focus/Core/ListViewDelegate.qml | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/examples/declarative/focus/Core/GridMenu.qml b/examples/declarative/focus/Core/GridMenu.qml index c37b17a..3f727fd 100644 --- a/examples/declarative/focus/Core/GridMenu.qml +++ b/examples/declarative/focus/Core/GridMenu.qml @@ -43,9 +43,7 @@ FocusScope { onClicked: { GridView.view.currentIndex = index - container.focus = true - gridMenu.focus = true - mainView.focus = true + container.forceFocus() } } diff --git a/examples/declarative/focus/Core/ListViewDelegate.qml b/examples/declarative/focus/Core/ListViewDelegate.qml index 96324d7..8f4763e 100644 --- a/examples/declarative/focus/Core/ListViewDelegate.qml +++ b/examples/declarative/focus/Core/ListViewDelegate.qml @@ -26,10 +26,7 @@ Component { onClicked: { ListView.view.currentIndex = index - container.focus = true - ListView.view.focus = true - listViews.focus = true - mainView.focus = true + container.forceFocus() } } -- cgit v0.12 From 2a4dfac81f866a30d294dc12659c153265317076 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 21 Apr 2010 15:44:36 +1000 Subject: Autotest --- .../data/invalidAttachedProperty.12.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAttachedProperty.12.qml | 6 ++++++ .../data/invalidAttachedProperty.13.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAttachedProperty.13.qml | 8 ++++++++ .../declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 2 ++ 5 files changed, 18 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.errors.txt new file mode 100644 index 0000000..189a795 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.errors.txt @@ -0,0 +1 @@ +4:13:Attached properties cannot be used here diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.qml new file mode 100644 index 0000000..7de503e --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + grouped.MyQmlObject.value: 10 +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.errors.txt new file mode 100644 index 0000000..46d7be2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.errors.txt @@ -0,0 +1 @@ +5:9:Attached properties cannot be used here diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.qml new file mode 100644 index 0000000..986ab85 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.qml @@ -0,0 +1,8 @@ +import Test 1.0 + +MyTypeObject { + grouped { + MyQmlObject.value: 10 + } +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index d1c83e1..b78a186 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -322,6 +322,8 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("invalidAttachedProperty.9") << "invalidAttachedProperty.9.qml" << "invalidAttachedProperty.9.errors.txt" << false; QTest::newRow("invalidAttachedProperty.10") << "invalidAttachedProperty.10.qml" << "invalidAttachedProperty.10.errors.txt" << false; QTest::newRow("invalidAttachedProperty.11") << "invalidAttachedProperty.11.qml" << "invalidAttachedProperty.11.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.12") << "invalidAttachedProperty.12.qml" << "invalidAttachedProperty.12.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.13") << "invalidAttachedProperty.13.qml" << "invalidAttachedProperty.13.errors.txt" << false; QTest::newRow("emptySignal") << "emptySignal.qml" << "emptySignal.errors.txt" << false; QTest::newRow("emptySignal.2") << "emptySignal.2.qml" << "emptySignal.2.errors.txt" << false; -- cgit v0.12 From 6abe7f1ef6021a1174d88d1a2811c58241a96707 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 21 Apr 2010 15:45:24 +1000 Subject: Balance grid items for larger displays. Task-number: QTBUG-8406 --- demos/declarative/flickr/flickr.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index ed88cf6..8b73beb 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -21,8 +21,9 @@ Item { Mobile.GridDelegate { id: gridDelegate } GridView { + x: (width/4-79)/2; y: x id: photoGridView; model: rssModel; delegate: gridDelegate; cacheBuffer: 100 - cellWidth: 79; cellHeight: 79; width: parent.width; height: parent.height - 1; z: 6 + cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height - 1; z: 6 } Mobile.ListDelegate { id: listDelegate } -- cgit v0.12 From ccd9efbe06825f25eebefbfa72bc065d15d190ad Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Wed, 21 Apr 2010 15:41:43 +1000 Subject: Emit released and hoveredChanged in MouseArea when a UngrabMouse is received The unbgrab mouse happens when the mouse area is inside a flickable and the flickables takes control over the mouse handling. In this case, the UngrabMouse will behave similarly to a MouseRelease, emitting released, pressedChanged and hoveredChanged. Visual autotest added to mousearea in qmlvisual. Reviewed-by: Michael Brasser --- .../graphicsitems/qdeclarativemousearea.cpp | 4 +- .../data/mousearea-flickable.0.png | Bin 0 -> 1701 bytes .../data/mousearea-flickable.1.png | Bin 0 -> 1701 bytes .../data/mousearea-flickable.10.png | Bin 0 -> 1721 bytes .../data/mousearea-flickable.11.png | Bin 0 -> 1705 bytes .../data/mousearea-flickable.12.png | Bin 0 -> 1705 bytes .../data/mousearea-flickable.13.png | Bin 0 -> 1701 bytes .../data/mousearea-flickable.2.png | Bin 0 -> 1704 bytes .../data/mousearea-flickable.3.png | Bin 0 -> 1704 bytes .../data/mousearea-flickable.4.png | Bin 0 -> 1705 bytes .../data/mousearea-flickable.5.png | Bin 0 -> 1705 bytes .../data/mousearea-flickable.6.png | Bin 0 -> 1701 bytes .../data/mousearea-flickable.7.png | Bin 0 -> 1701 bytes .../data/mousearea-flickable.8.png | Bin 0 -> 1705 bytes .../data/mousearea-flickable.9.png | Bin 0 -> 1701 bytes .../data/mousearea-flickable.qml | 5127 ++++++++++++++++++++ .../qdeclarativemousearea/mousearea-flickable.qml | 52 + tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp | 3 + 18 files changed, 5185 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.0.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.1.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.10.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.11.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.12.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.13.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.2.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.3.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.4.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.5.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.6.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.7.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.8.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.9.png create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml create mode 100644 tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 969c60e..126d041 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -564,8 +564,10 @@ bool QDeclarativeMouseArea::sceneEvent(QEvent *event) // state d->pressed = false; setKeepMouseGrab(false); + QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, false); + emit released(&me); emit pressedChanged(); - //emit hoveredChanged(); + setHovered(false); } } return rv; diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.0.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.0.png new file mode 100644 index 0000000..993610f Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.0.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.1.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.1.png new file mode 100644 index 0000000..993610f Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.1.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.10.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.10.png new file mode 100644 index 0000000..12c6cf5 Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.10.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.11.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.11.png new file mode 100644 index 0000000..ccb9fdd Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.11.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.12.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.12.png new file mode 100644 index 0000000..ace0752 Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.12.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.13.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.13.png new file mode 100644 index 0000000..993610f Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.13.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.2.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.2.png new file mode 100644 index 0000000..e58c68b Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.2.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.3.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.3.png new file mode 100644 index 0000000..e58c68b Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.3.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.4.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.4.png new file mode 100644 index 0000000..cb6d2f8 Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.4.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.5.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.5.png new file mode 100644 index 0000000..db6bea2 Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.5.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.6.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.6.png new file mode 100644 index 0000000..c18bb34 Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.6.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.7.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.7.png new file mode 100644 index 0000000..c18bb34 Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.7.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.8.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.8.png new file mode 100644 index 0000000..3b56301 Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.8.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.9.png b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.9.png new file mode 100644 index 0000000..993610f Binary files /dev/null and b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.9.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml new file mode 100644 index 0000000..e6a09bf --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml @@ -0,0 +1,5127 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 32 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 48 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 64 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 80 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 96 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 112 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 128 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 144 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 160 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 176 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 192 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 208 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 224 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 240 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 256 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 272 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 288 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 304 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 320 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 336 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 352 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 368 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 384 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 400 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 416 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 432 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 448 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 464 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 480 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 496 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 512 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 528 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 544 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 560 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 576 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 592 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 608 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 624 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 640 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 656 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 672 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 688 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 704 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 720 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 736 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 752 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 768 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 784 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 800 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 816 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 832 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 848 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 864 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 880 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 896 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 912 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 928 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 944 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 960 + image: "mousearea-flickable.0.png" + } + Frame { + msec: 976 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 992 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1008 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1024 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1040 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1056 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1072 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1088 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1104 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1120 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1136 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1152 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1168 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1184 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1200 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1216 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1232 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1248 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1264 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1280 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1296 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1312 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1328 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1344 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1360 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1376 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1392 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1408 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1424 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1440 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1456 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1472 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1488 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1504 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1520 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1536 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1552 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1568 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1584 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1600 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1616 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1632 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1648 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1664 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1680 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1696 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1712 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1728 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1744 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1760 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1776 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1792 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1808 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1824 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1840 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1856 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1872 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1888 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1904 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1920 + image: "mousearea-flickable.1.png" + } + Frame { + msec: 1936 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1952 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1968 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 1984 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2000 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2016 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2032 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2048 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2064 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2080 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2096 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2112 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2128 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2144 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2160 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2176 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2192 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2208 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2224 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2240 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2256 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2272 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2288 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2304 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2320 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2336 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2352 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2368 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2384 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2400 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2416 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2432 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2448 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2464 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2480 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2496 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2512 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2528 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2544 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2560 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2576 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2592 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 2608 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 188; y: 41 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2624 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2640 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2656 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2672 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2688 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2704 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2720 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2736 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2752 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2768 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2784 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2800 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2816 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2832 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2848 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2864 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2880 + image: "mousearea-flickable.2.png" + } + Frame { + msec: 2896 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2912 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2928 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2944 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2960 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2976 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 2992 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3008 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3024 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3040 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3056 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3072 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3088 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3104 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3120 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3136 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3152 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3168 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3184 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3200 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3216 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3232 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3248 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3264 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3280 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3296 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3312 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3328 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3344 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3360 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3376 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3392 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3408 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3424 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3440 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3456 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3472 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3488 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3504 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3520 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3536 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3552 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3568 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3584 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3600 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3616 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3632 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3648 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3664 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3680 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3696 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3712 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3728 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3744 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3760 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3776 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3792 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3808 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3824 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3840 + image: "mousearea-flickable.3.png" + } + Frame { + msec: 3856 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3872 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3888 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3904 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3920 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3936 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3952 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3968 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 3984 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4000 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4016 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4032 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4048 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4064 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4080 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4096 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4112 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4128 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4144 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4160 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4176 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4192 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4208 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4224 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4240 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4256 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4272 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4288 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4304 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4320 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4336 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4352 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4368 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4384 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4400 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4416 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4432 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4448 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4464 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4480 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4496 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Frame { + msec: 4512 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 189; y: 42 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4528 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 189; y: 44 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4544 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 190; y: 45 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 190; y: 47 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4560 + hash: "4a60ab820ca66548384b2257b21de8ec" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 190; y: 48 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 190; y: 50 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4576 + hash: "86b32befe0dada5bdce82a7dd14777ce" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 191; y: 51 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 191; y: 53 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4592 + hash: "7a5f69a1eecb5de0fc2295cd287eb449" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 191; y: 54 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 56 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4608 + hash: "144eeb7c2a32cedb6ebba063501c9176" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 57 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 59 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4624 + hash: "11120d6de575ffa639b6abb3af4afef7" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 193; y: 61 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 193; y: 62 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4640 + hash: "ab4c936a81299adf080f3b14f7e6be49" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 193; y: 64 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 66 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4656 + hash: "6602009ffe3c0f3072640ebc8749b76f" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 68 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 70 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4672 + hash: "8517007d5102af238935e93a3b38087f" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 195; y: 72 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 195; y: 75 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4688 + hash: "4e129ebba85d1f3717d09f71eb5a1a7d" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 77 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 79 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4704 + hash: "82f54d7e254edcf499ea12a63118e8a7" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 82 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 197; y: 84 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4720 + hash: "572cb62d69ccb973ea18d3b0eaff571b" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 197; y: 86 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 197; y: 88 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4736 + hash: "79650397b868019909b931a32a115823" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 198; y: 90 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 198; y: 92 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4752 + hash: "43e50f4d4d37373e26af0a5d3cb64c4c" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 198; y: 94 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 198; y: 97 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4768 + hash: "a0f8eb8a796f67c368b0a479e8d14681" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 199; y: 99 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 199; y: 101 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4784 + hash: "01bf03313a0229e810a24e2adbbe9775" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 199; y: 106 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4800 + image: "mousearea-flickable.4.png" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 200; y: 111 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4816 + hash: "aafb12a520eb443ee1348282f2c54e4a" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 200; y: 113 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 200; y: 116 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4832 + hash: "806d22bc3533c729cd10dc889c36902d" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 201; y: 121 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4848 + hash: "05b3013c9e42ed9ced7009d2e2999357" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 201; y: 124 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 130 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4864 + hash: "cb49adcd2c8afe27fd5926bd622added" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 133 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 135 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4880 + hash: "d0b4215b43403c97d83250add6d2b6db" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 138 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 146 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4896 + hash: "ee0523fe6a33b59871ad3b311ca0cbeb" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 149 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 152 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4912 + hash: "29ca97cc573d3a1fde65320b61678c60" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 207; y: 161 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4928 + hash: "021bda841eaefa76ce5e1c97150af6f6" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 207; y: 164 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 208; y: 166 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4944 + hash: "80edf52cc9e64a29f677bc2203220ba9" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 208; y: 172 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4960 + hash: "c09f4002ed9d41f62bb1aaff95723cce" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 208; y: 175 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 177 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4976 + hash: "7bb17b13db811b02c86a24a0051336d9" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 180 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 182 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4992 + hash: "da5c33ee9e9e1d9aaa7d5efa83b8bf69" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 187 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5008 + hash: "3ca9742356b6ff833fd287a95520174a" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 189 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 192 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5024 + hash: "d1372239a681d1fccc25257b4a02fb39" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 194 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 196 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5040 + hash: "1f37473ab2fb0643e11e4a41a2ee4561" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 198 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 200 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5056 + hash: "1533c6ff17e79a47a5d3510aa85bcf8a" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 202 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 204 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5072 + hash: "4cad3c6caf8d3009f63923df897c4723" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 205 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 207 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5088 + hash: "b81183233961b34c2a3f21a249b0fbfb" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 209 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 210 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5104 + hash: "9f876eb93a16c24843dd6a5acd303ab3" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 211 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 213 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5120 + hash: "237dd62011f4253970b946b335e3fb71" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 215 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5136 + hash: "6206ad3e633b6b1b068304caa4efe48a" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 217 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5152 + hash: "1eb5f0e1aa014a38e6ca66ddfc2a076b" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 211; y: 218 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5168 + hash: "d9e953d132330f8a58a190d61aec6ec3" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 219 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 220 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5184 + hash: "c1570ad4cb688ea51818e0a09e349daa" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 222 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5200 + hash: "11853dcbad9d1d9a8b7d8a4e6fcca140" + } + Frame { + msec: 5216 + hash: "11853dcbad9d1d9a8b7d8a4e6fcca140" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 223 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5232 + hash: "11853dcbad9d1d9a8b7d8a4e6fcca140" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 224 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5248 + hash: "c6a81be579382f25ac583734897c2570" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 225 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5264 + hash: "c6a81be579382f25ac583734897c2570" + } + Frame { + msec: 5280 + hash: "c6a81be579382f25ac583734897c2570" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 226 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5296 + hash: "8cbeb925f039bde9846d37a5ec6cd3f9" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 227 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5312 + hash: "8cbeb925f039bde9846d37a5ec6cd3f9" + } + Frame { + msec: 5328 + hash: "8cbeb925f039bde9846d37a5ec6cd3f9" + } + Frame { + msec: 5344 + hash: "8cbeb925f039bde9846d37a5ec6cd3f9" + } + Frame { + msec: 5360 + hash: "8cbeb925f039bde9846d37a5ec6cd3f9" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 209; y: 227 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5376 + hash: "8cbeb925f039bde9846d37a5ec6cd3f9" + } + Frame { + msec: 5392 + hash: "c6a81be579382f25ac583734897c2570" + } + Frame { + msec: 5408 + hash: "11853dcbad9d1d9a8b7d8a4e6fcca140" + } + Frame { + msec: 5424 + hash: "1eb5f0e1aa014a38e6ca66ddfc2a076b" + } + Frame { + msec: 5440 + hash: "9f876eb93a16c24843dd6a5acd303ab3" + } + Frame { + msec: 5456 + hash: "1533c6ff17e79a47a5d3510aa85bcf8a" + } + Frame { + msec: 5472 + hash: "9a9d1e0b1d7b9291480b3ec641f354ce" + } + Frame { + msec: 5488 + hash: "ee40862a59f14667c89fa62f380c10fb" + } + Frame { + msec: 5504 + hash: "95b57cd3dac3bce56674f2c4143f42d4" + } + Frame { + msec: 5520 + hash: "52d45e8dde81fef5ee93bbd5a40d4851" + } + Frame { + msec: 5536 + hash: "05b3013c9e42ed9ced7009d2e2999357" + } + Frame { + msec: 5552 + hash: "7d03030f5a672d87aeabefdf4f3a39a4" + } + Frame { + msec: 5568 + hash: "79650397b868019909b931a32a115823" + } + Frame { + msec: 5584 + hash: "82f54d7e254edcf499ea12a63118e8a7" + } + Frame { + msec: 5600 + hash: "8517007d5102af238935e93a3b38087f" + } + Frame { + msec: 5616 + hash: "dc272fc8fc98d822a154da1d495d4f7e" + } + Frame { + msec: 5632 + hash: "11120d6de575ffa639b6abb3af4afef7" + } + Frame { + msec: 5648 + hash: "70e522f64236dfa4e1613ffc29b4b23e" + } + Frame { + msec: 5664 + hash: "7a5f69a1eecb5de0fc2295cd287eb449" + } + Frame { + msec: 5680 + hash: "a569789b082296415321ba11c859abe5" + } + Frame { + msec: 5696 + hash: "9f9f85d5f879b0e52ebc751d6668cfb8" + } + Frame { + msec: 5712 + hash: "9f9f85d5f879b0e52ebc751d6668cfb8" + } + Frame { + msec: 5728 + hash: "43fc85bb3b1501f5e12f1fedaaa14c64" + } + Frame { + msec: 5744 + hash: "43fc85bb3b1501f5e12f1fedaaa14c64" + } + Frame { + msec: 5760 + image: "mousearea-flickable.5.png" + } + Frame { + msec: 5776 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 5792 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 5808 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 5824 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5840 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5856 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5872 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5888 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5904 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5920 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5936 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5952 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5968 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 5984 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6000 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6016 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6032 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6048 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6064 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6080 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6096 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6112 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6128 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6144 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6160 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6176 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6192 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6208 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6224 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6240 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6256 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6272 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6288 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6304 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6320 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6336 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6352 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 6368 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 188; y: 180 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 6384 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6400 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6416 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6432 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6448 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6464 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6480 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6496 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6512 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6528 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6544 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6560 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6576 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6592 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6608 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6624 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6640 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6656 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6672 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6688 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6704 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6720 + image: "mousearea-flickable.6.png" + } + Frame { + msec: 6736 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6752 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6768 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6784 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6800 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6816 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6832 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6848 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6864 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6880 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6896 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6912 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6928 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6944 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6960 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6976 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 6992 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7008 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7024 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7040 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7056 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7072 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7088 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7104 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7120 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7136 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7152 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7168 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7184 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7200 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7216 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7232 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7248 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7264 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7280 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7296 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7312 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7328 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7344 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7360 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7376 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7392 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7408 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7424 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7440 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7456 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7472 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7488 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7504 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7520 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7536 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7552 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7568 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7584 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7600 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7616 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7632 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7648 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7664 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7680 + image: "mousearea-flickable.7.png" + } + Frame { + msec: 7696 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7712 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7728 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7744 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7760 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7776 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7792 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7808 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7824 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7840 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7856 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7872 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7888 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7904 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7920 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7936 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7952 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7968 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 7984 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8000 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8016 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8032 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8048 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8064 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8080 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8096 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8112 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8128 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8144 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8160 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8176 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Frame { + msec: 8192 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 188; y: 182 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8208 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 188; y: 183 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8224 + hash: "037386eb30a5e8d53a20a11258ee0f60" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 189; y: 185 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 189; y: 186 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8240 + hash: "9f9f85d5f879b0e52ebc751d6668cfb8" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 191; y: 194 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8256 + hash: "70e522f64236dfa4e1613ffc29b4b23e" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 191; y: 196 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 198 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8272 + hash: "11120d6de575ffa639b6abb3af4afef7" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 201 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 203 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8288 + hash: "dc272fc8fc98d822a154da1d495d4f7e" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 211 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 214 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8304 + hash: "4e129ebba85d1f3717d09f71eb5a1a7d" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 219 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8320 + hash: "837deeb2a92648d830acf29e829ebb53" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 225 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8336 + hash: "7d2606d432858288dac019e0002ff85a" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 231 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 234 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8352 + hash: "c37507a29e3a6d80446ad68f2d92f266" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 240 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8368 + hash: "01bf03313a0229e810a24e2adbbe9775" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 245 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8384 + hash: "8ffbbed46737837e55383833b96d2624" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 248 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 251 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8400 + hash: "6d49fc41fb6d74643c7613df7e417833" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 257 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8416 + hash: "1978cda418856b542d7c5a155b74f09c" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 259 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 262 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8432 + hash: "cc6619c7cd6e4e274df4729aad6cca46" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 265 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 267 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8448 + hash: "0b16e524cd5253d07aa9b5855967fa71" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 270 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 272 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8464 + hash: "0121c18897c37481fddbac57db636a60" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 275 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 192; y: 278 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8480 + hash: "091d1ad7aba4b662cba98214c98a4707" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 193; y: 283 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8496 + hash: "f334bfcc3af89bf1405762a215c54ea6" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 193; y: 285 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 193; y: 288 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8512 + hash: "66f71641c7a607152f140428ab9621d6" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 290 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 293 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8528 + hash: "7b41d651ad46341859d0188db341ae10" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 298 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8544 + hash: "95b57cd3dac3bce56674f2c4143f42d4" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 194; y: 299 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 305 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8560 + hash: "80edf52cc9e64a29f677bc2203220ba9" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 306 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 308 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8576 + hash: "68c8c95edb8cce11320715266bd62628" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 310 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 312 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8592 + hash: "c09f4002ed9d41f62bb1aaff95723cce" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 316 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8608 + hash: "7bb17b13db811b02c86a24a0051336d9" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 318 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 320 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8624 + hash: "6d6cec95a6a2445d88b015ff76af032e" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 322 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 324 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8640 + image: "mousearea-flickable.8.png" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 328 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8656 + hash: "9a9d1e0b1d7b9291480b3ec641f354ce" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 330 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 332 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8672 + hash: "d1372239a681d1fccc25257b4a02fb39" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 335 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 338 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8688 + hash: "2010f6f0c34e59f505bbe1aab262b646" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 196; y: 341 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 198; y: 347 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8704 + hash: "2dc2def0c748ac94d33d90d4a3610136" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 198; y: 350 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 200; y: 356 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8720 + hash: "1eb5f0e1aa014a38e6ca66ddfc2a076b" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 200; y: 358 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 200; y: 360 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8736 + hash: "c1570ad4cb688ea51818e0a09e349daa" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 201; y: 364 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8752 + hash: "c6a81be579382f25ac583734897c2570" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 201; y: 366 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8768 + hash: "8cbeb925f039bde9846d37a5ec6cd3f9" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 202; y: 368 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8784 + hash: "b34a796f25ad62f952101b296f9c2bac" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 202; y: 369 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8800 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8816 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8832 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8848 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8864 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8880 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8896 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8912 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8928 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8944 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8960 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 8976 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 202; y: 369 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8992 + hash: "a0814b5ba881e5da8a1ecae8d714b4ce" + } + Frame { + msec: 9008 + hash: "b34a796f25ad62f952101b296f9c2bac" + } + Frame { + msec: 9024 + hash: "8cbeb925f039bde9846d37a5ec6cd3f9" + } + Frame { + msec: 9040 + hash: "c1570ad4cb688ea51818e0a09e349daa" + } + Frame { + msec: 9056 + hash: "237dd62011f4253970b946b335e3fb71" + } + Frame { + msec: 9072 + hash: "c5980322acf00a04efbd5e1b92aa0e98" + } + Frame { + msec: 9088 + hash: "d1372239a681d1fccc25257b4a02fb39" + } + Frame { + msec: 9104 + hash: "524db6ce45674c777d72f9206415be2f" + } + Frame { + msec: 9120 + hash: "021bda841eaefa76ce5e1c97150af6f6" + } + Frame { + msec: 9136 + hash: "ce673b66f695f5b002515a5416bbf913" + } + Frame { + msec: 9152 + hash: "cc6619c7cd6e4e274df4729aad6cca46" + } + Frame { + msec: 9168 + hash: "7fb0ed99b7d751d1f335afd7c0de2f2c" + } + Frame { + msec: 9184 + hash: "3d75735eefbf95f37e2a8605b9167ba1" + } + Frame { + msec: 9200 + hash: "82f54d7e254edcf499ea12a63118e8a7" + } + Frame { + msec: 9216 + hash: "8517007d5102af238935e93a3b38087f" + } + Frame { + msec: 9232 + hash: "dc272fc8fc98d822a154da1d495d4f7e" + } + Frame { + msec: 9248 + hash: "11120d6de575ffa639b6abb3af4afef7" + } + Frame { + msec: 9264 + hash: "70e522f64236dfa4e1613ffc29b4b23e" + } + Frame { + msec: 9280 + hash: "7a5f69a1eecb5de0fc2295cd287eb449" + } + Frame { + msec: 9296 + hash: "a569789b082296415321ba11c859abe5" + } + Frame { + msec: 9312 + hash: "9f9f85d5f879b0e52ebc751d6668cfb8" + } + Frame { + msec: 9328 + hash: "9f9f85d5f879b0e52ebc751d6668cfb8" + } + Frame { + msec: 9344 + hash: "43fc85bb3b1501f5e12f1fedaaa14c64" + } + Frame { + msec: 9360 + hash: "43fc85bb3b1501f5e12f1fedaaa14c64" + } + Frame { + msec: 9376 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 9392 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 9408 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 9424 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 9440 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9456 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9472 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9488 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9504 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9520 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9536 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9552 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9568 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9584 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9600 + image: "mousearea-flickable.9.png" + } + Frame { + msec: 9616 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9632 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9648 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9664 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9680 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9696 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9712 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9728 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 9744 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 205; y: 307 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 9760 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9776 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9792 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9808 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9824 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9840 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9856 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9872 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9888 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9904 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9920 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9936 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9952 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9968 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 9984 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10000 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10016 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10032 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10048 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10064 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10080 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10096 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10112 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10128 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10144 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10160 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10176 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10192 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10208 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10224 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10240 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10256 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10272 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10288 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10304 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10320 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10336 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10352 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10368 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10384 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10400 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10416 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10432 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10448 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10464 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10480 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10496 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10512 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10528 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10544 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10560 + image: "mousearea-flickable.10.png" + } + Frame { + msec: 10576 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10592 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10608 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10624 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10640 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10656 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10672 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10688 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10704 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10720 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10736 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10752 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10768 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10784 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10800 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10816 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10832 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10848 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10864 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10880 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10896 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10912 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10928 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10944 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10960 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10976 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 10992 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11008 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11024 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11040 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11056 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11072 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11088 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 308 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11104 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11120 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11136 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 309 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11152 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11168 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Frame { + msec: 11184 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 310 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11200 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 311 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11216 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 312 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11232 + hash: "90cdfe8920f115fd55cde6fdbd95e867" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 313 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 314 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11248 + hash: "a569789b082296415321ba11c859abe5" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 316 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 317 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11264 + hash: "86b32befe0dada5bdce82a7dd14777ce" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 319 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 321 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11280 + hash: "70e522f64236dfa4e1613ffc29b4b23e" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 324 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11296 + hash: "11120d6de575ffa639b6abb3af4afef7" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 326 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 327 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11312 + hash: "8e05207e0d0d9d15a61a0d21d985a83a" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 330 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 332 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11328 + hash: "6602009ffe3c0f3072640ebc8749b76f" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 335 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 337 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11344 + hash: "8517007d5102af238935e93a3b38087f" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 343 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 345 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11360 + hash: "82f54d7e254edcf499ea12a63118e8a7" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 348 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 350 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11376 + hash: "572cb62d69ccb973ea18d3b0eaff571b" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 352 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 355 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11392 + hash: "79650397b868019909b931a32a115823" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 357 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 359 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11408 + hash: "43e50f4d4d37373e26af0a5d3cb64c4c" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 361 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 363 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11424 + hash: "a0f8eb8a796f67c368b0a479e8d14681" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 365 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 367 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11440 + hash: "01bf03313a0229e810a24e2adbbe9775" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 369 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 371 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11456 + hash: "7fb0ed99b7d751d1f335afd7c0de2f2c" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 373 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 375 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11472 + hash: "363eca81f97f20f14e8d480f83d2bc7d" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 379 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11488 + hash: "6d49fc41fb6d74643c7613df7e417833" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 381 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 383 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11504 + hash: "806d22bc3533c729cd10dc889c36902d" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 385 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 387 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11520 + image: "mousearea-flickable.11.png" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 389 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 392 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11536 + hash: "929bf28dcb97e8c93dae5dbe23beecc8" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 203; y: 394 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 396 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11552 + hash: "cb49adcd2c8afe27fd5926bd622added" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 398 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 204; y: 399 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11568 + hash: "0121c18897c37481fddbac57db636a60" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 402 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11584 + hash: "c0a569ee064d844835dddab11eadcd33" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 404 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 406 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11600 + hash: "52d45e8dde81fef5ee93bbd5a40d4851" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 205; y: 407 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 409 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11616 + hash: "ce673b66f695f5b002515a5416bbf913" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 410 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11632 + hash: "f334bfcc3af89bf1405762a215c54ea6" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 411 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 206; y: 412 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11648 + hash: "ee0523fe6a33b59871ad3b311ca0cbeb" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 207; y: 414 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11664 + hash: "66f71641c7a607152f140428ab9621d6" + } + Frame { + msec: 11680 + hash: "66f71641c7a607152f140428ab9621d6" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 207; y: 415 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11696 + hash: "66f71641c7a607152f140428ab9621d6" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 207; y: 416 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11712 + hash: "ddd3d8cb82e238358cdb16c1df7d27b7" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 207; y: 417 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11728 + hash: "ddd3d8cb82e238358cdb16c1df7d27b7" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 208; y: 418 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11744 + hash: "29ca97cc573d3a1fde65320b61678c60" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 208; y: 419 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11760 + hash: "29ca97cc573d3a1fde65320b61678c60" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 208; y: 421 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11776 + hash: "7b41d651ad46341859d0188db341ae10" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 208; y: 423 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11792 + hash: "6b236864b7d95bf9f76b8afd6ba78613" + } + Frame { + msec: 11808 + hash: "6b236864b7d95bf9f76b8afd6ba78613" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 208; y: 424 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11824 + hash: "95b57cd3dac3bce56674f2c4143f42d4" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 208; y: 425 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11840 + hash: "95b57cd3dac3bce56674f2c4143f42d4" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 426 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11856 + hash: "021bda841eaefa76ce5e1c97150af6f6" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 428 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11872 + hash: "b1ea82b880a2fc35bf1ed117d8ab21b0" + } + Frame { + msec: 11888 + hash: "b1ea82b880a2fc35bf1ed117d8ab21b0" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 429 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11904 + hash: "b1ea82b880a2fc35bf1ed117d8ab21b0" + } + Frame { + msec: 11920 + hash: "b1ea82b880a2fc35bf1ed117d8ab21b0" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 430 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11936 + hash: "1709dda08ce7494ff6d082cc5d93f0d2" + } + Frame { + msec: 11952 + hash: "1709dda08ce7494ff6d082cc5d93f0d2" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 431 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 11968 + hash: "1709dda08ce7494ff6d082cc5d93f0d2" + } + Frame { + msec: 11984 + hash: "1709dda08ce7494ff6d082cc5d93f0d2" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 432 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 12000 + hash: "80edf52cc9e64a29f677bc2203220ba9" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 209; y: 433 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 12016 + hash: "80edf52cc9e64a29f677bc2203220ba9" + } + Frame { + msec: 12032 + hash: "80edf52cc9e64a29f677bc2203220ba9" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 434 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 12048 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12064 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12080 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12096 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12112 + hash: "68c8c95edb8cce11320715266bd62628" + } + Mouse { + type: 5 + button: 0 + buttons: 1 + x: 210; y: 435 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 12128 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12144 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12160 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12176 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12192 + hash: "68c8c95edb8cce11320715266bd62628" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 210; y: 435 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 12208 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12224 + hash: "68c8c95edb8cce11320715266bd62628" + } + Frame { + msec: 12240 + hash: "80edf52cc9e64a29f677bc2203220ba9" + } + Frame { + msec: 12256 + hash: "b1ea82b880a2fc35bf1ed117d8ab21b0" + } + Frame { + msec: 12272 + hash: "6b236864b7d95bf9f76b8afd6ba78613" + } + Frame { + msec: 12288 + hash: "ddd3d8cb82e238358cdb16c1df7d27b7" + } + Frame { + msec: 12304 + hash: "ce673b66f695f5b002515a5416bbf913" + } + Frame { + msec: 12320 + hash: "0121c18897c37481fddbac57db636a60" + } + Frame { + msec: 12336 + hash: "cc6619c7cd6e4e274df4729aad6cca46" + } + Frame { + msec: 12352 + hash: "aafb12a520eb443ee1348282f2c54e4a" + } + Frame { + msec: 12368 + hash: "c37507a29e3a6d80446ad68f2d92f266" + } + Frame { + msec: 12384 + hash: "6ef4abc294d928381346e8ff9b012475" + } + Frame { + msec: 12400 + hash: "4e129ebba85d1f3717d09f71eb5a1a7d" + } + Frame { + msec: 12416 + hash: "6602009ffe3c0f3072640ebc8749b76f" + } + Frame { + msec: 12432 + hash: "8e05207e0d0d9d15a61a0d21d985a83a" + } + Frame { + msec: 12448 + hash: "144eeb7c2a32cedb6ebba063501c9176" + } + Frame { + msec: 12464 + hash: "7a5f69a1eecb5de0fc2295cd287eb449" + } + Frame { + msec: 12480 + image: "mousearea-flickable.12.png" + } + Frame { + msec: 12496 + hash: "a569789b082296415321ba11c859abe5" + } + Frame { + msec: 12512 + hash: "9f9f85d5f879b0e52ebc751d6668cfb8" + } + Frame { + msec: 12528 + hash: "43fc85bb3b1501f5e12f1fedaaa14c64" + } + Frame { + msec: 12544 + hash: "43fc85bb3b1501f5e12f1fedaaa14c64" + } + Frame { + msec: 12560 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 12576 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 12592 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 12608 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 12624 + hash: "d75a43305e2884759ca41d7b1cbadf52" + } + Frame { + msec: 12640 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12656 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12672 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12688 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12704 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12720 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12736 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12752 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12768 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12784 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12800 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12816 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12832 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12848 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12864 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12880 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12896 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12912 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12928 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12944 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12960 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12976 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 12992 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13008 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13024 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13040 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13056 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13072 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13088 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13104 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13120 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13136 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13152 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13168 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13184 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13200 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13216 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13232 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13248 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13264 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13280 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13296 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13312 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13328 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13344 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13360 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Key { + type: 6 + key: 16777251 + modifiers: 134217728 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 13376 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13392 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13408 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13424 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13440 + image: "mousearea-flickable.13.png" + } + Frame { + msec: 13456 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13472 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13488 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } + Frame { + msec: 13504 + hash: "cc1fd2f4c3be318052254a9b6be7a57b" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml new file mode 100644 index 0000000..a0b787f --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-flickable.qml @@ -0,0 +1,52 @@ +import Qt 4.7 + +Rectangle { + width: 400; height: 480 + color: "white" + + Flickable { + anchors.fill: parent + contentHeight: 100 + + Rectangle { + id: yellow + width: 400; height: 120 + color: "yellow" + MouseArea { + anchors.fill: parent + onPressedChanged: pressed ? yellow.color = "lightyellow": yellow.color = "yellow" + } + } + Rectangle { + id: blue + width: 400; height: 120 + y: 120 + color: "steelblue" + MouseArea { + anchors.fill: parent + onPressed: blue.color = "lightsteelblue" + onReleased: blue.color = "steelblue" + } + } + Rectangle { + id: red + y: 240 + width: 400; height: 120 + color: "red" + MouseArea { + anchors.fill: parent + onEntered: { red.color = "darkred"; tooltip.opacity = 1 } + onExited: { red.color = "red"; tooltip.opacity = 0 } + } + Rectangle { + id: tooltip + x: 10; y: 20 + width: 100; height: 50 + color: "green" + opacity: 0 + } + } + + } + +} diff --git a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp index 681b530..5f25882 100644 --- a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp +++ b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp @@ -117,6 +117,9 @@ void tst_qmlvisual::visual_data() files << QT_TEST_SOURCE_DIR "/qdeclarativemousearea/drag.qml"; files << QT_TEST_SOURCE_DIR "/fillmode/fillmode.qml"; + // new tests + files << QT_TEST_SOURCE_DIR "/qdeclarativemousearea/mousearea-flickable.qml"; + //these reliably fail in CI, for unknown reasons //files << QT_TEST_SOURCE_DIR "/animation/easing/easing.qml"; //files << QT_TEST_SOURCE_DIR "/animation/pauseAnimation/pauseAnimation-visual.qml"; -- cgit v0.12 From 6a61351ae264efb4df17794f97642f63dd0c3690 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 21 Apr 2010 16:12:31 +1000 Subject: Add hasModelChildren property to delegates with QAbstractItemModel model type. Also add some helper function to VisualDataModel: - VisualDataModel::modelIndex(int) returns a QModelIndex which can be assigned to VisualDataModel::rootIndex - VisualDataModel::parentModelIndex() returns a QModelIndex which can be assigned to VisualDataModel::rootIndex --- doc/src/declarative/qdeclarativemodels.qdoc | 12 ++- .../graphicsitems/qdeclarativevisualitemmodel.cpp | 101 ++++++++++++------- .../graphicsitems/qdeclarativevisualitemmodel_p.h | 9 +- tests/auto/declarative/declarative.pro | 1 + .../data/visualdatamodel.qml | 11 ++ .../qdeclarativevisualdatamodel.pro | 11 ++ .../tst_qdeclarativevisualdatamodel.cpp | 111 +++++++++++++++++++++ 7 files changed, 215 insertions(+), 41 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml create mode 100644 tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro create mode 100644 tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index d8b2a5d..eecc117 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -206,8 +206,16 @@ The default role names set by Qt are: \endtable QAbstractItemModel presents a heirachy of tables. Views currently provided by QML -can only display list data. In order to display child lists of a heirachical model -use the VisualDataModel element with \e rootIndex set to a parent node. +can only display list data. +In order to display child lists of a heirachical model +the VisualDataModel element provides several properties and functions for use +with models of type QAbstractItemModel: +\list +\o \e hasModelChildren role property to determine whether a node has child nodes. +\o \l VisualDataModel::rootIndex allows the root node to be specifed +\o \l VisualDataModel::modelIndex() returns a QModelIndex which can be assigned to VisualDataModel::rootIndex +\o \l VisualDataModel::parentModelIndex() returns a QModelIndex which can be assigned to VisualDataModel::rootIndex +\endlist \section2 QStringList diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 207232d..7fa8cc4 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -262,6 +262,7 @@ public: } if (m_roles.count() == 1) m_roleNames.insert("modelData", m_roles.at(0)); + m_roleNames.insert("hasModelChildren", 0); } else if (m_listAccessor) { m_roleNames.insert("modelData", 0); if (m_listAccessor->type() == QDeclarativeListAccessor::Instance) { @@ -473,11 +474,16 @@ QVariant QDeclarativeVisualDataModelDataMetaObject::initialValue(int propId) } } else if (model->m_abstractItemModel) { model->ensureRoles(); - QHash::const_iterator it = model->m_roleNames.find(propName); - if (it != model->m_roleNames.end()) { - roleToProp.insert(*it, propId); + if (propName == "hasModelChildren") { QModelIndex index = model->m_abstractItemModel->index(data->m_index, 0, model->m_root); - return model->m_abstractItemModel->data(index, *it); + return model->m_abstractItemModel->hasChildren(index); + } else { + QHash::const_iterator it = model->m_roleNames.find(propName); + if (it != model->m_roleNames.end()) { + roleToProp.insert(*it, propId); + QModelIndex index = model->m_abstractItemModel->index(data->m_index, 0, model->m_root); + return model->m_abstractItemModel->data(index, *it); + } } } Q_ASSERT(!"Can never be reached"); @@ -784,34 +790,13 @@ void QDeclarativeVisualDataModel::setDelegate(QDeclarativeComponent *delegate) \qmlproperty QModelIndex VisualDataModel::rootIndex QAbstractItemModel provides a heirachical tree of data, whereas - QML only operates on list data. rootIndex allows the children of + QML only operates on list data. \c rootIndex allows the children of any node in a QAbstractItemModel to be provided by this model. This property only affects models of type QAbstractItemModel. \code // main.cpp - Q_DECLARE_METATYPE(QModelIndex) - - class MyModel : public QDirModel - { - Q_OBJECT - public: - MyModel(QDeclarativeContext *ctxt) : QDirModel(), context(ctxt) { - QHash roles = roleNames(); - roles.insert(FilePathRole, "path"); - setRoleNames(roles); - context->setContextProperty("myModel", this); - context->setContextProperty("myRoot", QVariant::fromValue(index(0,0,QModelIndex()))); - } - - Q_INVOKABLE void setRoot(const QString &path) { - QModelIndex root = index(path); - context->setContextProperty("myRoot", QVariant::fromValue(root)); - } - - QDeclarativeContext *context; - }; int main(int argc, char ** argv) { @@ -819,7 +804,8 @@ void QDeclarativeVisualDataModel::setDelegate(QDeclarativeComponent *delegate) QDeclarativeView view; - MyModel model(view.rootContext()); + QDirModel model; + view.rootContext()->setContextProperty("myModel", &model); view.setSource(QUrl("qrc:view.qml")); view.show(); @@ -835,18 +821,18 @@ void QDeclarativeVisualDataModel::setDelegate(QDeclarativeComponent *delegate) import Qt 4.7 ListView { + id: view width: 200 height: 200 model: VisualDataModel { model: myModel - rootIndex: myRoot delegate: Component { Rectangle { - height: 25; width: 100 - Text { text: path } + height: 25; width: 200 + Text { text: filePath } MouseArea { anchors.fill: parent; - onClicked: myModel.setRoot(path) + onClicked: if (hasModelChildren) view.model.rootIndex = view.model.modelIndex(index) } } } @@ -854,19 +840,21 @@ void QDeclarativeVisualDataModel::setDelegate(QDeclarativeComponent *delegate) } \endcode + \sa modelIndex(), parentModelIndex() */ -QModelIndex QDeclarativeVisualDataModel::rootIndex() const +QVariant QDeclarativeVisualDataModel::rootIndex() const { Q_D(const QDeclarativeVisualDataModel); - return d->m_root; + return QVariant::fromValue(d->m_root); } -void QDeclarativeVisualDataModel::setRootIndex(const QModelIndex &root) +void QDeclarativeVisualDataModel::setRootIndex(const QVariant &root) { Q_D(QDeclarativeVisualDataModel); - if (d->m_root != root) { + QModelIndex modelIndex = qvariant_cast(root); + if (d->m_root != modelIndex) { int oldCount = d->modelCount(); - d->m_root = root; + d->m_root = modelIndex; int newCount = d->modelCount(); if (d->m_delegate && oldCount) emit itemsRemoved(0, oldCount); @@ -878,6 +866,47 @@ void QDeclarativeVisualDataModel::setRootIndex(const QModelIndex &root) } } + +/*! + \qmlmethod QModelIndex VisualDataModel::modelIndex(int index) + + QAbstractItemModel provides a heirachical tree of data, whereas + QML only operates on list data. This function assists in using + tree models in QML. + + Returns a QModelIndex for the specified index. + This value can be assigned to rootIndex. + + \sa rootIndex +*/ +QVariant QDeclarativeVisualDataModel::modelIndex(int idx) const +{ + Q_D(const QDeclarativeVisualDataModel); + if (d->m_abstractItemModel) + return QVariant::fromValue(d->m_abstractItemModel->index(idx, 0, d->m_root)); + return QVariant::fromValue(QModelIndex()); +} + +/*! + \qmlmethod QModelIndex VisualDataModel::parentModelIndex() + + QAbstractItemModel provides a heirachical tree of data, whereas + QML only operates on list data. This function assists in using + tree models in QML. + + Returns a QModelIndex for the parent of the current rootIndex. + This value can be assigned to rootIndex. + + \sa rootIndex +*/ +QVariant QDeclarativeVisualDataModel::parentModelIndex() const +{ + Q_D(const QDeclarativeVisualDataModel); + if (d->m_abstractItemModel) + return QVariant::fromValue(d->m_abstractItemModel->parent(d->m_root)); + return QVariant::fromValue(QModelIndex()); +} + QString QDeclarativeVisualDataModel::part() const { Q_D(const QDeclarativeVisualDataModel); diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h index d34bcaf..0a9173f 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h @@ -150,7 +150,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeVisualDataModel : public QDeclarativeVisu Q_PROPERTY(QDeclarativeComponent *delegate READ delegate WRITE setDelegate) Q_PROPERTY(QString part READ part WRITE setPart) Q_PROPERTY(QObject *parts READ parts CONSTANT) - Q_PROPERTY(QModelIndex rootIndex READ rootIndex WRITE setRootIndex NOTIFY rootIndexChanged) + Q_PROPERTY(QVariant rootIndex READ rootIndex WRITE setRootIndex NOTIFY rootIndexChanged) Q_CLASSINFO("DefaultProperty", "delegate") public: QDeclarativeVisualDataModel(); @@ -163,8 +163,11 @@ public: QDeclarativeComponent *delegate() const; void setDelegate(QDeclarativeComponent *); - QModelIndex rootIndex() const; - void setRootIndex(const QModelIndex &root); + QVariant rootIndex() const; + void setRootIndex(const QVariant &root); + + Q_INVOKABLE QVariant modelIndex(int idx) const; + Q_INVOKABLE QVariant parentModelIndex() const; QString part() const; void setPart(const QString &); diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 58371c1..9b3b3d0 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -64,6 +64,7 @@ SUBDIRS += \ qdeclarativeimageprovider \ # Cover qdeclarativestyledtext \ # Cover qdeclarativesqldatabase \ # Cover + qdeclarativevisualdatamodel \ # Cover qmlvisual # Cover contains(QT_CONFIG, webkit) { diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml new file mode 100644 index 0000000..d70f82b --- /dev/null +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/visualdatamodel.qml @@ -0,0 +1,11 @@ +import Qt 4.7 + +VisualDataModel { + function setRoot() { + rootIndex = modelIndex(0); + } + function setRootToParent() { + rootIndex = parentModelIndex(); + } + model: myModel +} diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro new file mode 100644 index 0000000..d76b582 --- /dev/null +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro @@ -0,0 +1,11 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qdeclarativevisualdatamodel.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" + +CONFIG += parallel_test + diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp new file mode 100644 index 0000000..7de15a3 --- /dev/null +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** 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 test suite 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 +#include +#include +#include +#include +#include + +static void initStandardTreeModel(QStandardItemModel *model) +{ + QStandardItem *item; + item = new QStandardItem(QLatin1String("Row 1 Item")); + model->insertRow(0, item); + + item = new QStandardItem(QLatin1String("Row 2 Item")); + item->setCheckable(true); + model->insertRow(1, item); + + QStandardItem *childItem = new QStandardItem(QLatin1String("Row 2 Child Item")); + item->setChild(0, childItem); + + item = new QStandardItem(QLatin1String("Row 3 Item")); + item->setIcon(QIcon()); + model->insertRow(2, item); +} + +class tst_qdeclarativevisualdatamodel : public QObject +{ + Q_OBJECT +public: + tst_qdeclarativevisualdatamodel(); + +private slots: + void rootIndex(); + +private: + QDeclarativeEngine engine; +}; + +tst_qdeclarativevisualdatamodel::tst_qdeclarativevisualdatamodel() +{ +} + +void tst_qdeclarativevisualdatamodel::rootIndex() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/visualdatamodel.qml")); + + QStandardItemModel model; + initStandardTreeModel(&model); + + engine.rootContext()->setContextProperty("myModel", &model); + + QDeclarativeVisualDataModel *obj = qobject_cast(c.create()); + QVERIFY(obj != 0); + + QMetaObject::invokeMethod(obj, "setRoot"); + QVERIFY(qvariant_cast(obj->rootIndex()) == model.index(0,0)); + + QMetaObject::invokeMethod(obj, "setRootToParent"); + QVERIFY(qvariant_cast(obj->rootIndex()) == QModelIndex()); + + delete obj; +} + + +QTEST_MAIN(tst_qdeclarativevisualdatamodel) + +#include "tst_qdeclarativevisualdatamodel.moc" -- cgit v0.12 From 52b516d51bc817e8b7a36955365d2c5cd90c2196 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 21 Apr 2010 16:41:05 +1000 Subject: Autotests --- .../data/assignToNamespace.errors.txt | 1 + .../data/assignToNamespace.qml | 5 +++++ .../data/dynamicMeta.1.errors.txt | 1 + .../qdeclarativelanguage/data/dynamicMeta.1.qml | 6 ++++++ .../data/dynamicMeta.2.errors.txt | 1 + .../qdeclarativelanguage/data/dynamicMeta.2.qml | 6 ++++++ .../data/dynamicMeta.3.errors.txt | 1 + .../qdeclarativelanguage/data/dynamicMeta.3.qml | 6 ++++++ .../data/dynamicMeta.4.errors.txt | 1 + .../qdeclarativelanguage/data/dynamicMeta.4.qml | 6 ++++++ .../data/dynamicMeta.5.errors.txt | 1 + .../qdeclarativelanguage/data/dynamicMeta.5.qml | 5 +++++ .../data/invalidAlias.1.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAlias.1.qml | 5 +++++ .../data/invalidAlias.2.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAlias.2.qml | 6 ++++++ .../data/invalidAlias.3.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAlias.3.qml | 6 ++++++ .../data/invalidAlias.4.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAlias.4.qml | 7 +++++++ .../data/invalidAlias.5.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAlias.5.qml | 7 +++++++ .../data/invalidAlias.6.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAlias.6.qml | 7 +++++++ .../qdeclarativelanguage/data/invalidOn.errors.txt | 1 + .../qdeclarativelanguage/data/invalidOn.qml | 4 ++++ .../data/listAssignment.1.errors.txt | 1 + .../qdeclarativelanguage/data/listAssignment.1.qml | 6 ++++++ .../data/multiSet.11.errors.txt | 1 + .../qdeclarativelanguage/data/multiSet.11.qml | 6 ++++++ .../data/readOnly.4.errors.txt | 1 + .../qdeclarativelanguage/data/readOnly.4.qml | 4 ++++ .../data/readOnly.5.errors.txt | 1 + .../qdeclarativelanguage/data/readOnly.5.qml | 4 ++++ .../data/scriptString.1.errors.txt | 1 + .../qdeclarativelanguage/data/scriptString.1.qml | 5 +++++ .../data/scriptString.2.errors.txt | 1 + .../qdeclarativelanguage/data/scriptString.2.qml | 6 ++++++ .../data/wrongType.16.errors.txt | 1 + .../qdeclarativelanguage/data/wrongType.16.qml | 5 +++++ .../declarative/qdeclarativelanguage/testtypes.h | 8 ++++++++ .../tst_qdeclarativelanguage.cpp | 23 ++++++++++++++++++++++ 42 files changed, 163 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidOn.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidOn.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.errors.txt new file mode 100644 index 0000000..78aa471 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.errors.txt @@ -0,0 +1 @@ +4:5:Invalid use of namespace diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml new file mode 100644 index 0000000..4681879 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml @@ -0,0 +1,5 @@ +import Qt 4.6 as Qt + +Qt.QtObject { + Qt: 10 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.errors.txt new file mode 100644 index 0000000..1f9f916 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.errors.txt @@ -0,0 +1 @@ +5:5:Duplicate default property diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml new file mode 100644 index 0000000..1efe791 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +QtObject { + default property QtObject a + default property QtObject b +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.errors.txt new file mode 100644 index 0000000..7a4f63b --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.errors.txt @@ -0,0 +1 @@ +5:5:Duplicate property name diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml new file mode 100644 index 0000000..4e7b5ae --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +QtObject { + property int a + property bool a +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.errors.txt new file mode 100644 index 0000000..c5860a2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.errors.txt @@ -0,0 +1 @@ +3:1:Duplicate signal name diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml new file mode 100644 index 0000000..573c1ba --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +QtObject { + signal a + signal a +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.errors.txt new file mode 100644 index 0000000..b293c86 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.errors.txt @@ -0,0 +1 @@ +3:1:Duplicate method name diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml new file mode 100644 index 0000000..51dd834 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +QtObject { + function a() {} + function a() {} +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.errors.txt new file mode 100644 index 0000000..015d55b --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.errors.txt @@ -0,0 +1 @@ +3:1:UnknownType is not a type diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml new file mode 100644 index 0000000..6b93e00 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +QtObject { + property UnknownType a +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.errors.txt new file mode 100644 index 0000000..9848e48 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.errors.txt @@ -0,0 +1 @@ +3:1:No property alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml new file mode 100644 index 0000000..985fb94 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml @@ -0,0 +1,5 @@ +import Qt 4.7 + +QtObject { + property alias a +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.errors.txt new file mode 100644 index 0000000..3e15628 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.errors.txt @@ -0,0 +1 @@ +4:23:Invalid alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml new file mode 100644 index 0000000..a2ac91c --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml @@ -0,0 +1,6 @@ +import Qt 4.7 + +QtObject { + property alias a: 10 +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt new file mode 100644 index 0000000..7260be4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias reference. An alias reference must be specified as or . diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml new file mode 100644 index 0000000..cc71753 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: root.rectProperty.x +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt new file mode 100644 index 0000000..7260be4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias reference. An alias reference must be specified as or . diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.qml new file mode 100644 index 0000000..cfdfca0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.qml @@ -0,0 +1,7 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: print("Hello!") +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.errors.txt new file mode 100644 index 0000000..6f78e59 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias reference. Unable to find id "otherroot" diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.qml new file mode 100644 index 0000000..0c1d5d7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.qml @@ -0,0 +1,7 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: otherroot +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.errors.txt new file mode 100644 index 0000000..93652a7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.qml new file mode 100644 index 0000000..edfdb24 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.qml @@ -0,0 +1,7 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: root.foobar +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.errors.txt new file mode 100644 index 0000000..b4210a1 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.errors.txt @@ -0,0 +1 @@ +3:5:"MyQmlObject" cannot operate on "value" diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.qml new file mode 100644 index 0000000..d748bf4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidOn.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + MyQmlObject on value {} +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.errors.txt new file mode 100644 index 0000000..35d2d35 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.errors.txt @@ -0,0 +1 @@ +4:24:Cannot assign object to list diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml new file mode 100644 index 0000000..6c628e4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml @@ -0,0 +1,6 @@ +import Test 1.0 +import Qt 4.7 +MyContainer { + containerChildren: QtObject {} +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.errors.txt new file mode 100644 index 0000000..e1f7ec5 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.errors.txt @@ -0,0 +1 @@ +5:5:Property value set multiple times diff --git a/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.qml new file mode 100644 index 0000000..7d03139 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + rectProperty.x: 10 + rectProperty.x: 11 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.errors.txt new file mode 100644 index 0000000..d857a04 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.errors.txt @@ -0,0 +1 @@ +3:5:Invalid property assignment: "readOnlyString" is a read-only property diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.qml new file mode 100644 index 0000000..5338ac7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyQmlObject { + MyPropertyValueSource on readOnlyString {} +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt new file mode 100644 index 0000000..baf4766 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt @@ -0,0 +1 @@ +3:27:Invalid property assignment: "readOnlyEnumProperty" is a read-only property diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.qml new file mode 100644 index 0000000..422d13d --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyTypeObject { + readOnlyEnumProperty: MyTypeObject.EnumValue1 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.errors.txt new file mode 100644 index 0000000..14463e0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.errors.txt @@ -0,0 +1 @@ +4:21:Invalid property assignment: script expected diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.qml new file mode 100644 index 0000000..f07d223 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + scriptProperty: MyTypeObject {} +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.errors.txt new file mode 100644 index 0000000..f8a776f --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.errors.txt @@ -0,0 +1 @@ +4:40:Cannot assign multiple values to a script property diff --git a/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.qml new file mode 100644 index 0000000..dc825c7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + scriptProperty: [ MyTypeObject {}, MyTypeObject {} ] +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.errors.txt new file mode 100644 index 0000000..77cf210 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.errors.txt @@ -0,0 +1 @@ +4:24:Cannot assign object to property diff --git a/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml new file mode 100644 index 0000000..1ddccc0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml @@ -0,0 +1,5 @@ +import Test 1.0 +import Qt 4.7 +MyQmlObject { + qmlobjectProperty: QtObject {} +} diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h index 951cea0..89f99c8 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h @@ -200,6 +200,7 @@ class MyTypeObject : public QObject Q_PROPERTY(QDeclarativeComponent *componentProperty READ componentProperty WRITE setComponentProperty) Q_PROPERTY(MyFlags flagProperty READ flagProperty WRITE setFlagProperty) Q_PROPERTY(MyEnum enumProperty READ enumProperty WRITE setEnumProperty) + Q_PROPERTY(MyEnum readOnlyEnumProperty READ readOnlyEnumProperty) Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty) Q_PROPERTY(uint uintProperty READ uintProperty WRITE setUintProperty) Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty) @@ -273,6 +274,10 @@ public: enumPropertyValue = v; } + MyEnum readOnlyEnumProperty() const { + return EnumVal1; + } + QString stringPropertyValue; QString stringProperty() const { return stringPropertyValue; @@ -467,16 +472,19 @@ class MyContainer : public QObject { Q_OBJECT Q_PROPERTY(QDeclarativeListProperty children READ children) + Q_PROPERTY(QDeclarativeListProperty containerChildren READ containerChildren) Q_PROPERTY(QDeclarativeListProperty qlistInterfaces READ qlistInterfaces) Q_CLASSINFO("DefaultProperty", "children") public: MyContainer() {} QDeclarativeListProperty children() { return QDeclarativeListProperty(this, m_children); } + QDeclarativeListProperty containerChildren() { return QDeclarativeListProperty(this, m_containerChildren); } QList *getChildren() { return &m_children; } QDeclarativeListProperty qlistInterfaces() { return QDeclarativeListProperty(this, m_interfaces); } QList *getQListInterfaces() { return &m_interfaces; } + QList m_containerChildren; QList m_children; QList m_interfaces; }; diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index b78a186..c1397de 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -225,11 +225,15 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("wrongType (number string for int)") << "wrongType.13.qml" << "wrongType.13.errors.txt" << false; QTest::newRow("wrongType (int for string)") << "wrongType.14.qml" << "wrongType.14.errors.txt" << false; QTest::newRow("wrongType (int for url)") << "wrongType.15.qml" << "wrongType.15.errors.txt" << false; + QTest::newRow("wrongType (invalid object)") << "wrongType.16.qml" << "wrongType.16.errors.txt" << false; QTest::newRow("readOnly.1") << "readOnly.1.qml" << "readOnly.1.errors.txt" << false; QTest::newRow("readOnly.2") << "readOnly.2.qml" << "readOnly.2.errors.txt" << false; QTest::newRow("readOnly.3") << "readOnly.3.qml" << "readOnly.3.errors.txt" << false; + QTest::newRow("readOnly.4") << "readOnly.4.qml" << "readOnly.4.errors.txt" << false; + QTest::newRow("readOnly.5") << "readOnly.5.qml" << "readOnly.5.errors.txt" << false; + QTest::newRow("listAssignment.1") << "listAssignment.1.qml" << "listAssignment.1.errors.txt" << false; QTest::newRow("listAssignment.2") << "listAssignment.2.qml" << "listAssignment.2.errors.txt" << false; QTest::newRow("listAssignment.3") << "listAssignment.3.qml" << "listAssignment.3.errors.txt" << false; @@ -243,6 +247,9 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("invalidID.8") << "invalidID.8.qml" << "invalidID.8.errors.txt" << false; QTest::newRow("invalidID.9") << "invalidID.9.qml" << "invalidID.9.errors.txt" << false; + QTest::newRow("scriptString.1") << "scriptString.1.qml" << "scriptString.1.errors.txt" << false; + QTest::newRow("scriptString.2") << "scriptString.2.qml" << "scriptString.2.errors.txt" << false; + QTest::newRow("unsupportedProperty") << "unsupportedProperty.qml" << "unsupportedProperty.errors.txt" << false; QTest::newRow("nullDotProperty") << "nullDotProperty.qml" << "nullDotProperty.errors.txt" << true; QTest::newRow("fakeDotProperty") << "fakeDotProperty.qml" << "fakeDotProperty.errors.txt" << false; @@ -310,6 +317,20 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("MultiSet.8") << "multiSet.8.qml" << "multiSet.8.errors.txt" << false; QTest::newRow("MultiSet.9") << "multiSet.9.qml" << "multiSet.9.errors.txt" << false; QTest::newRow("MultiSet.10") << "multiSet.10.qml" << "multiSet.10.errors.txt" << false; + QTest::newRow("MultiSet.11") << "multiSet.11.qml" << "multiSet.11.errors.txt" << false; + + QTest::newRow("dynamicMeta.1") << "dynamicMeta.1.qml" << "dynamicMeta.1.errors.txt" << false; + QTest::newRow("dynamicMeta.2") << "dynamicMeta.2.qml" << "dynamicMeta.2.errors.txt" << false; + QTest::newRow("dynamicMeta.3") << "dynamicMeta.3.qml" << "dynamicMeta.3.errors.txt" << false; + QTest::newRow("dynamicMeta.4") << "dynamicMeta.4.qml" << "dynamicMeta.4.errors.txt" << false; + QTest::newRow("dynamicMeta.5") << "dynamicMeta.5.qml" << "dynamicMeta.5.errors.txt" << false; + + QTest::newRow("invalidAlias.1") << "invalidAlias.1.qml" << "invalidAlias.1.errors.txt" << false; + QTest::newRow("invalidAlias.2") << "invalidAlias.2.qml" << "invalidAlias.2.errors.txt" << false; + QTest::newRow("invalidAlias.3") << "invalidAlias.3.qml" << "invalidAlias.3.errors.txt" << false; + QTest::newRow("invalidAlias.4") << "invalidAlias.4.qml" << "invalidAlias.4.errors.txt" << false; + QTest::newRow("invalidAlias.5") << "invalidAlias.5.qml" << "invalidAlias.5.errors.txt" << false; + QTest::newRow("invalidAlias.6") << "invalidAlias.6.qml" << "invalidAlias.6.errors.txt" << false; QTest::newRow("invalidAttachedProperty.1") << "invalidAttachedProperty.1.qml" << "invalidAttachedProperty.1.errors.txt" << false; QTest::newRow("invalidAttachedProperty.2") << "invalidAttachedProperty.2.qml" << "invalidAttachedProperty.2.errors.txt" << false; @@ -337,6 +358,8 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("enumTypes") << "enumTypes.qml" << "enumTypes.errors.txt" << false; QTest::newRow("noCreation") << "noCreation.qml" << "noCreation.errors.txt" << false; QTest::newRow("destroyedSignal") << "destroyedSignal.qml" << "destroyedSignal.errors.txt" << false; + QTest::newRow("assignToNamespace") << "assignToNamespace.qml" << "assignToNamespace.errors.txt" << false; + QTest::newRow("invalidOn") << "invalidOn.qml" << "invalidOn.errors.txt" << false; } -- cgit v0.12 From b72f9dacb352aa4be888c5f7f1a482dbcba1f456 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 21 Apr 2010 16:55:23 +1000 Subject: More focus example cleanup. --- .../declarative/focus/Core/ListViewDelegate.qml | 58 +++++++++++----------- examples/declarative/focus/Core/ListViews.qml | 6 +-- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/examples/declarative/focus/Core/ListViewDelegate.qml b/examples/declarative/focus/Core/ListViewDelegate.qml index 8f4763e..14e2548 100644 --- a/examples/declarative/focus/Core/ListViewDelegate.qml +++ b/examples/declarative/focus/Core/ListViewDelegate.qml @@ -1,42 +1,40 @@ import Qt 4.7 -Component { - Item { - id: container - x: 5; width: ListView.view.width - 10; height: 60 +Item { + id: container + x: 5; width: ListView.view.width - 10; height: 60 - Rectangle { - id: content - anchors.centerIn: parent; width: container.width - 40; height: container.height - 10 - color: "transparent" - smooth: true - radius: 10 + Rectangle { + id: content + anchors.centerIn: parent; width: container.width - 40; height: container.height - 10 + color: "transparent" + smooth: true + radius: 10 - Rectangle { color: "#91AA9D"; x: 3; y: 3; width: parent.width - 6; height: parent.height - 6; radius: 8 } - Text { - text: "List element " + (index + 1); color: "#193441"; font.bold: false; anchors.centerIn: parent - font.pixelSize: 14 - } + Rectangle { color: "#91AA9D"; x: 3; y: 3; width: parent.width - 6; height: parent.height - 6; radius: 8 } + Text { + text: "List element " + (index + 1); color: "#193441"; font.bold: false; anchors.centerIn: parent + font.pixelSize: 14 } + } - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true - onClicked: { - ListView.view.currentIndex = index - container.forceFocus() - } + onClicked: { + ListView.view.currentIndex = index + container.forceFocus() } + } - states: State { - name: "active"; when: container.focus == true - PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 } - } + states: State { + name: "active"; when: container.focus == true + PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 } + } - transitions: Transition { - NumberAnimation { properties: "scale"; duration: 100 } - } + transitions: Transition { + NumberAnimation { properties: "scale"; duration: 100 } } } diff --git a/examples/declarative/focus/Core/ListViews.qml b/examples/declarative/focus/Core/ListViews.qml index f4384c8..089f821 100644 --- a/examples/declarative/focus/Core/ListViews.qml +++ b/examples/declarative/focus/Core/ListViews.qml @@ -10,7 +10,7 @@ FocusScope { y: wantsFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20 focus: true KeyNavigation.up: gridMenu; KeyNavigation.left: contextMenu; KeyNavigation.right: list2 - model: 10 + model: 10; cacheBuffer: 200 delegate: ListViewDelegate {} Behavior on y { @@ -22,7 +22,7 @@ FocusScope { id: list2 y: wantsFocus ? 10 : 40; x: parent.width / 3; width: parent.width / 3; height: parent.height - 20 KeyNavigation.up: gridMenu; KeyNavigation.left: list1; KeyNavigation.right: list3 - model: 10 + model: 10; cacheBuffer: 200 delegate: ListViewDelegate {} Behavior on y { @@ -34,7 +34,7 @@ FocusScope { id: list3 y: wantsFocus ? 10 : 40; x: 2 * parent.width / 3; width: parent.width / 3; height: parent.height - 20 KeyNavigation.up: gridMenu; KeyNavigation.left: list2 - model: 10 + model: 10; cacheBuffer: 200 delegate: ListViewDelegate {} Behavior on y { -- cgit v0.12 From 202af3021362d3c8066bc479a95e7aad889bd928 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 19 Apr 2010 21:42:49 +1000 Subject: Make the dynamic creation functions on the Qt object Also updated examples to still work, and the dynamic example now uses exceptions a little, to demonstrate that it can be done. Exceptions are also now filled out with the QML error data. Task-number: QT-2801 Reviewed-by: Aaron Kennedy --- .../declarative/samegame/SamegameCore/samegame.js | 2 +- demos/declarative/snake/content/snake.js | 4 +- doc/src/declarative/globalobject.qdoc | 9 +++- examples/declarative/dynamic/dynamic.qml | 37 +++++++++++++++- examples/declarative/dynamic/qml/itemCreation.js | 2 +- .../tutorials/samegame/samegame2/samegame.js | 2 +- .../tutorials/samegame/samegame3/samegame.js | 2 +- .../samegame/samegame4/content/samegame.js | 2 +- src/declarative/QmlChanges.txt | 2 + src/declarative/qml/qdeclarativeengine.cpp | 50 ++++++++++++++++------ .../qdeclarativeqt/data/createComponent.qml | 10 ++--- .../qdeclarativeqt/data/createQmlObject.qml | 18 ++++---- .../qdeclarativeqt/tst_qdeclarativeqt.cpp | 6 +-- 13 files changed, 106 insertions(+), 40 deletions(-) diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js index 3888381..aafbfdf 100755 --- a/demos/declarative/samegame/SamegameCore/samegame.js +++ b/demos/declarative/samegame/SamegameCore/samegame.js @@ -8,7 +8,7 @@ var blockSrc = "SamegameCore/BoomBlock.qml"; var scoresURL = "http://qtfx-nokia.trolltech.com.au/samegame/scores.php"; var scoresURL = ""; var gameDuration; -var component = createComponent(blockSrc); +var component = Qt.createComponent(blockSrc); //Index function used instead of a 2D array function index(column,row) { diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js index 12176c7..2457fbd 100644 --- a/demos/declarative/snake/content/snake.js +++ b/demos/declarative/snake/content/snake.js @@ -5,8 +5,8 @@ var links = new Array; var scheduledDirections = new Array; var numRows = 1; var numColumns = 1; -var linkComponent = createComponent("content/Link.qml"); // XXX should resolve relative to script, not component -var cookieComponent = createComponent("content/Cookie.qml"); +var linkComponent = Qt.createComponent("content/Link.qml"); // XXX should resolve relative to script, not component +var cookieComponent = Qt.createComponent("content/Cookie.qml"); var cookie; var linksToGrow = 0; var linksToDie = 0; diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index 97f5d91..e2152b3 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -258,6 +258,11 @@ of their use. } \endcode + The methods and properties of the Component element are defined in its own + page, but when using it dynamically only two methods are usually used. + Component.createObject() returns the created object or null if there is an error. + If there is an error, Component.errorsString() describes what the error was. + If you want to just create an arbitrary string of QML, instead of loading a QML file, consider the createQmlObject() function. @@ -277,7 +282,9 @@ of their use. similarly to eval, but for creating QML elements. Returns the created object, or null if there is an error. In the case of an - error, details of the error are output using qWarning(). + error, a QtScript Error object is thrown. This object has the additional property, + qmlErrors, which is an array of all the errors encountered when trying to execute the + QML. Each object in the array has the members: lineNumber, columnNumber, fileName and message. Note that this function returns immediately, and therefore may not work if the QML loads new components. If you are trying to load a new component, diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml index eea528f..0e6e197 100644 --- a/examples/declarative/dynamic/dynamic.qml +++ b/examples/declarative/dynamic/dynamic.qml @@ -7,6 +7,34 @@ Item { //This is a desktop-sized example width: 1024; height: 512 property int activeSuns: 0 + + //This is the message that pops up when there's an error + Rectangle{ + id: dialog + opacity: 0 + anchors.centerIn: parent + width: dialogText.width + 6 + height: dialogText.height + 6 + border.color: 'black' + color: 'lightsteelblue' + z: 65535 //Arbitrary number chosen to be above all the items, including the scaled perspective ones. + function show(str){ + dialogText.text = str; + dialogAnim.start(); + } + Text{ + id: dialogText + x:3 + y:3 + font.pixelSize: 14 + } + SequentialAnimation{ + id: dialogAnim + NumberAnimation{target: dialog; property:"opacity"; to: 1; duration: 1000} + PauseAnimation{duration: 5000} + NumberAnimation{target: dialog; property:"opacity"; to: 0; duration: 1000} + } + } // sky Rectangle { id: sky @@ -114,7 +142,14 @@ Item { } Button { text: "Create" - onClicked: createQmlObject(qmlText.text, window, 'CustomObject'); + function makeCustom() { + try{ + Qt.createQmlObject(qmlText.text, window, 'CustomObject'); + }catch(err){ + dialog.show('Error on line ' + err.qmlErrors[0].lineNumber + '\n' + err.qmlErrors[0].message ); + } + } + onClicked: makeCustom(); } } } diff --git a/examples/declarative/dynamic/qml/itemCreation.js b/examples/declarative/dynamic/qml/itemCreation.js index ccc03aa..4fa0d9f 100644 --- a/examples/declarative/dynamic/qml/itemCreation.js +++ b/examples/declarative/dynamic/qml/itemCreation.js @@ -31,7 +31,7 @@ function loadComponent() { if (itemComponent != null) //Already loaded the component createItem(); - itemComponent = createComponent(itemButton.file); + itemComponent = Qt.createComponent(itemButton.file); //print(itemButton.file) if(itemComponent.isLoading){ component.statusChanged.connect(finishCreation); diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.js b/examples/declarative/tutorials/samegame/samegame2/samegame.js index 9809c1d..81da31b 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.js @@ -35,7 +35,7 @@ function startNewGame() { function createBlock(column, row) { if (component == null) - component = createComponent("Block.qml"); + component = Qt.createComponent("Block.qml"); // Note that if Block.qml was not a local file, component.isReady would be // false and we should wait for the component's statusChanged() signal to diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.js b/examples/declarative/tutorials/samegame/samegame3/samegame.js index c12def7..eaf47d9 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.js @@ -32,7 +32,7 @@ function startNewGame() { function createBlock(column, row) { if (component == null) - component = createComponent("Block.qml"); + component = Qt.createComponent("Block.qml"); // Note that if Block.qml was not a local file, component.isReady would be // false and we should wait for the component's statusChanged() signal to diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js index 7800b6e..c527f66 100755 --- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js @@ -43,7 +43,7 @@ function startNewGame() { function createBlock(column, row) { if (component == null) - component = createComponent("content/BoomBlock.qml"); + component = Qt.createComponent("content/BoomBlock.qml"); // Note that if Block.qml was not a local file, component.isReady would be // false and we should wait for the component's statusChanged() signal to diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index d5910e3..2cae293 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -19,6 +19,8 @@ Animation: replace repeat with loops (loops: Animation.Infinite gives the old re AnchorChanges: use natural form to specify anchors (anchors.left instead of left) AnchorChanges: removed reset property. (reset: "left" should now be anchors.left: undefined) PathView: snapPosition replaced by preferredHighlightBegin, preferredHighlightEnd +createQmlObject: Moved to the Qt object, now use Qt.createQmlObject() +createComponent: Moved to the Qt object, now use Qt.createComponent() C++ API ------- diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 9cd6b3c..53d830b 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -254,19 +254,19 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr qtObject.setProperty(QLatin1String("quit"), newFunction(QDeclarativeEnginePrivate::quit, 0)); qtObject.setProperty(QLatin1String("resolvedUrl"),newFunction(QDeclarativeScriptEngine::resolvedUrl, 1)); + if (mainthread) { + qtObject.setProperty(QLatin1String("createQmlObject"), + newFunction(QDeclarativeEnginePrivate::createQmlObject, 1)); + qtObject.setProperty(QLatin1String("createComponent"), + newFunction(QDeclarativeEnginePrivate::createComponent, 1)); + } + //firebug/webkit compat QScriptValue consoleObject = newObject(); consoleObject.setProperty(QLatin1String("log"),newFunction(QDeclarativeEnginePrivate::consoleLog, 1)); consoleObject.setProperty(QLatin1String("debug"),newFunction(QDeclarativeEnginePrivate::consoleLog, 1)); globalObject().setProperty(QLatin1String("console"), consoleObject); - if (mainthread) { - globalObject().setProperty(QLatin1String("createQmlObject"), - newFunction(QDeclarativeEnginePrivate::createQmlObject, 1)); - globalObject().setProperty(QLatin1String("createComponent"), - newFunction(QDeclarativeEnginePrivate::createComponent, 1)); - } - // translation functions need to be installed // before the global script class is constructed (QTBUG-6437) installTranslatorFunctions(); @@ -1019,7 +1019,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS url = context->resolvedUrl(url); QObject *parentArg = activeEnginePriv->objectClass->toQObject(ctxt->argument(1)); - if(!parentArg) + if(!parentArg) return ctxt->throwError(QDeclarativeEngine::tr("parent object not found")); QDeclarativeComponent component(activeEngine); @@ -1027,10 +1027,21 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS if(component.isError()) { QList errors = component.errors(); - QString errstr = QLatin1String("Qt.createQmlObject(): "); - foreach (const QDeclarativeError &error, errors) + QString errstr = QLatin1String("Qt.createQmlObject() failed to create object: "); + QScriptValue arr = ctxt->engine()->newArray(errors.length()); + int i = 0; + foreach (const QDeclarativeError &error, errors){ errstr += QLatin1String(" ") + error.toString() + QLatin1String("\n"); - return ctxt->throwError(errstr); + QScriptValue qmlErrObject = ctxt->engine()->newObject(); + qmlErrObject.setProperty("lineNumber", QScriptValue(error.line())); + qmlErrObject.setProperty("columnNumber", QScriptValue(error.column())); + qmlErrObject.setProperty("fileName", QScriptValue(error.url())); + qmlErrObject.setProperty("message", QScriptValue(error.description())); + arr.setProperty(i++, qmlErrObject); + } + QScriptValue err = ctxt->throwError(errstr); + err.setProperty("qmlErrors",arr); + return err; } if (!component.isReady()) @@ -1040,10 +1051,21 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS if(component.isError()) { QList errors = component.errors(); - QString errstr = QLatin1String("Qt.createQmlObject(): "); - foreach (const QDeclarativeError &error, errors) + QString errstr = QLatin1String("Qt.createQmlObject() failed to create object: "); + QScriptValue arr = ctxt->engine()->newArray(errors.length()); + int i = 0; + foreach (const QDeclarativeError &error, errors){ errstr += QLatin1String(" ") + error.toString() + QLatin1String("\n"); - return ctxt->throwError(errstr); + QScriptValue qmlErrObject = ctxt->engine()->newObject(); + qmlErrObject.setProperty("lineNumber", QScriptValue(error.line())); + qmlErrObject.setProperty("columnNumber", QScriptValue(error.column())); + qmlErrObject.setProperty("fileName", QScriptValue(error.url())); + qmlErrObject.setProperty("message", QScriptValue(error.description())); + arr.setProperty(i++, qmlErrObject); + } + QScriptValue err = ctxt->throwError(errstr); + err.setProperty("qmlErrors",arr); + return err; } Q_ASSERT(obj); diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml index 412c467..253a4e3 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml @@ -6,15 +6,15 @@ QtObject { property string relativeUrl property string absoluteUrl - property QtObject incorectArgCount1: createComponent() - property QtObject incorectArgCount2: createComponent("main.qml", 10) + property QtObject incorectArgCount1: Qt.createComponent() + property QtObject incorectArgCount2: Qt.createComponent("main.qml", 10) Component.onCompleted: { - emptyArg = (createComponent("") == null); - var r = createComponent("createComponentData.qml"); + emptyArg = (Qt.createComponent("") == null); + var r = Qt.createComponent("createComponentData.qml"); relativeUrl = r.url; - var a = createComponent("http://www.example.com/test.qml"); + var a = Qt.createComponent("http://www.example.com/test.qml"); absoluteUrl = a.url; } } diff --git a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml index 8e6c58e..9fe169d 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml @@ -4,11 +4,11 @@ Item { id: root // errors resulting in exceptions - property QtObject incorrectArgCount1: createQmlObject() - property QtObject incorrectArgCount2: createQmlObject("import Qt 4.6\nQtObject{}", root, "main.qml", 10) - property QtObject noParent: createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13}", 0) - property QtObject notAvailable: createQmlObject("import Qt 4.6\nQtObject{Blah{}}", root) - property QtObject errors: createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml") + property QtObject incorrectArgCount1: Qt.createQmlObject() + property QtObject incorrectArgCount2: Qt.createQmlObject("import Qt 4.6\nQtObject{}", root, "main.qml", 10) + property QtObject noParent: Qt.createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13}", 0) + property QtObject notAvailable: Qt.createQmlObject("import Qt 4.6\nQtObject{Blah{}}", root) + property QtObject errors: Qt.createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml") property bool emptyArg: false @@ -16,16 +16,16 @@ Item { Component.onCompleted: { // errors resulting in nulls - emptyArg = (createQmlObject("", root) == null); + emptyArg = (Qt.createQmlObject("", root) == null); try { - createQmlObject("import Qt 4.6\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root) + Qt.createQmlObject("import Qt 4.6\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root) } catch (error) { console.log("RunTimeError: ",error.message); } - var o = createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\n}", root); + var o = Qt.createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\n}", root); success = (o.test == 13); - createQmlObject("import Qt 4.6\nItem {}\n", root); + Qt.createQmlObject("import Qt 4.6\nItem {}\n", root); } } diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index 4d22b0a..24fad14 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -354,11 +354,11 @@ void tst_qdeclarativeqt::createQmlObject() QDeclarativeComponent component(&engine, TEST_FILE("createQmlObject.qml")); QString warning1 = component.url().toString() + ":7: Error: expected 2 or 3 parameters"; - QString warning2 = component.url().toString()+ ":10: Error: Qt.createQmlObject(): " + TEST_FILE("inline").toString() + ":2:10: Blah is not a type\n"; - QString warning3 = component.url().toString()+ ":11: Error: Qt.createQmlObject(): " + TEST_FILE("main.qml").toString() + ":4:1: Duplicate property name\n"; + QString warning2 = component.url().toString()+ ":10: Error: Qt.createQmlObject() failed to create object : " + TEST_FILE("inline").toString() + ":2:10: Blah is not a type\n"; + QString warning3 = component.url().toString()+ ":11: Error: Qt.createQmlObject() failed to create object : " + TEST_FILE("main.qml").toString() + ":4:1: Duplicate property name\n"; QString warning4 = component.url().toString()+ ":9: Error: parent object not found"; QString warning5 = component.url().toString()+ ":8: Error: expected 2 or 3 parameters"; - QString warning6 = "RunTimeError: Qt.createQmlObject(): " + TEST_FILE("inline").toString() + ":3: Cannot assign object type QObject with no default method\n"; + QString warning6 = "RunTimeError: Qt.createQmlObject() failed to create object: " + TEST_FILE("inline").toString() + ":3: Cannot assign object type QObject with no default method\n"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); -- cgit v0.12 From f1c883a98b8afd084522505f84c512eabe61f7f5 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 21 Apr 2010 17:21:00 +1000 Subject: remove debugs --- examples/declarative/listmodel-threaded/dataloader.js | 5 ----- examples/declarative/listmodel-threaded/timedisplay.qml | 3 --- 2 files changed, 8 deletions(-) diff --git a/examples/declarative/listmodel-threaded/dataloader.js b/examples/declarative/listmodel-threaded/dataloader.js index eac7478..d720f09 100644 --- a/examples/declarative/listmodel-threaded/dataloader.js +++ b/examples/declarative/listmodel-threaded/dataloader.js @@ -1,14 +1,9 @@ // ![0] WorkerScript.onMessage = function(msg) { - console.log("Worker told to", msg.action); - if (msg.action == 'appendCurrentTime') { var data = {'time': new Date().toTimeString()}; msg.model.append(data); msg.model.sync(); // updates the changes to the list - - var msgToSend = {'msg': 'Model updated!'}; - WorkerScript.sendMessage(msgToSend); } } // ![0] diff --git a/examples/declarative/listmodel-threaded/timedisplay.qml b/examples/declarative/listmodel-threaded/timedisplay.qml index 80ac9fa..bad7010 100644 --- a/examples/declarative/listmodel-threaded/timedisplay.qml +++ b/examples/declarative/listmodel-threaded/timedisplay.qml @@ -15,9 +15,6 @@ ListView { WorkerScript { id: worker source: "dataloader.js" - onMessage: { - console.log("Worker said", messageObject.msg); - } } Timer { -- cgit v0.12 From e39958e76340698cc2b0ac88a03167a016b9c07b Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 21 Apr 2010 17:23:31 +1000 Subject: Update strings in test --- tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index 24fad14..727d74c 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -354,8 +354,8 @@ void tst_qdeclarativeqt::createQmlObject() QDeclarativeComponent component(&engine, TEST_FILE("createQmlObject.qml")); QString warning1 = component.url().toString() + ":7: Error: expected 2 or 3 parameters"; - QString warning2 = component.url().toString()+ ":10: Error: Qt.createQmlObject() failed to create object : " + TEST_FILE("inline").toString() + ":2:10: Blah is not a type\n"; - QString warning3 = component.url().toString()+ ":11: Error: Qt.createQmlObject() failed to create object : " + TEST_FILE("main.qml").toString() + ":4:1: Duplicate property name\n"; + QString warning2 = component.url().toString()+ ":10: Error: Qt.createQmlObject() failed to create object: " + TEST_FILE("inline").toString() + ":2:10: Blah is not a type\n"; + QString warning3 = component.url().toString()+ ":11: Error: Qt.createQmlObject() failed to create object: " + TEST_FILE("main.qml").toString() + ":4:1: Duplicate property name\n"; QString warning4 = component.url().toString()+ ":9: Error: parent object not found"; QString warning5 = component.url().toString()+ ":8: Error: expected 2 or 3 parameters"; QString warning6 = "RunTimeError: Qt.createQmlObject() failed to create object: " + TEST_FILE("inline").toString() + ":3: Cannot assign object type QObject with no default method\n"; -- cgit v0.12 From cffe02d1c7aa5f087558fcbabdab890b979ae5cc Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 21 Apr 2010 17:23:57 +1000 Subject: Ensure workerscript.qml works (autotested). --- doc/src/snippets/declarative/script.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/src/snippets/declarative/script.js diff --git a/doc/src/snippets/declarative/script.js b/doc/src/snippets/declarative/script.js new file mode 100644 index 0000000..cd67311 --- /dev/null +++ b/doc/src/snippets/declarative/script.js @@ -0,0 +1 @@ +# Just here so that workerscript.qml succeeds. -- cgit v0.12 From 85cd533284175c1c83d538d3bb2f0d02dc2bbf7a Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 21 Apr 2010 17:32:52 +1000 Subject: Compile without Qt3 support. --- src/declarative/qml/qdeclarativeengine.cpp | 50 +++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 0dd9368..a41eaa9 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -152,10 +152,10 @@ void QDeclarativeEnginePrivate::defineModule() } QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e) -: captureProperties(false), rootContext(0), currentExpression(0), isDebugging(false), - outputWarningsToStdErr(true), contextClass(0), sharedContext(0), sharedScope(0), - objectClass(0), valueTypeClass(0), globalClass(0), cleanup(0), erroredBindings(0), - inProgressCreations(0), scriptEngine(this), workerScriptEngine(0), componentAttached(0), +: captureProperties(false), rootContext(0), currentExpression(0), isDebugging(false), + outputWarningsToStdErr(true), contextClass(0), sharedContext(0), sharedScope(0), + objectClass(0), valueTypeClass(0), globalClass(0), cleanup(0), erroredBindings(0), + inProgressCreations(0), scriptEngine(this), workerScriptEngine(0), componentAttached(0), inBeginCreate(false), networkAccessManager(0), networkAccessManagerFactory(0), typeManager(e), uniqueId(1) { @@ -353,7 +353,7 @@ void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *o) QObjectPrivate *p = QObjectPrivate::get(o); Q_ASSERT(p->declarativeData); QDeclarativeData *d = static_cast(p->declarativeData); - if (d->ownContext) + if (d->ownContext) d->context->destroy(); } @@ -394,7 +394,7 @@ void QDeclarativeEnginePrivate::init() QDeclarativeWorkerScriptEngine *QDeclarativeEnginePrivate::getWorkerScriptEngine() { Q_Q(QDeclarativeEngine); - if (!workerScriptEngine) + if (!workerScriptEngine) workerScriptEngine = new QDeclarativeWorkerScriptEngine(q); return workerScriptEngine; } @@ -419,7 +419,7 @@ QDeclarativeWorkerScriptEngine *QDeclarativeEnginePrivate::getWorkerScriptEngine QDeclarativeComponent component(&engine); component.setData("import Qt 4.7\nText { text: \"Hello world!\" }", QUrl()); QDeclarativeItem *item = qobject_cast(component.create()); - + //add item to view, etc ... \endcode @@ -648,7 +648,7 @@ void QDeclarativeEngine::setBaseUrl(const QUrl &url) { Q_D(QDeclarativeEngine); d->baseUrl = url; -} +} /*! Returns true if warning messages will be output to stderr in addition @@ -667,7 +667,7 @@ bool QDeclarativeEngine::outputWarningsToStandardError() const If \a enabled is true, any warning messages generated by QML will be output to stderr and emitted by the warnings() signal. If \a enabled - is false, on the warnings() signal will be emitted. This allows + is false, on the warnings() signal will be emitted. This allows applications to handle warning output themselves. The default value is true. @@ -781,7 +781,7 @@ void QDeclarativeEngine::setObjectOwnership(QObject *object, ObjectOwnership own QDeclarativeEngine::ObjectOwnership QDeclarativeEngine::objectOwnership(QObject *object) { QDeclarativeData *ddata = QDeclarativeData::get(object, false); - if (!ddata) + if (!ddata) return CppOwnership; else return ddata->indestructible?CppOwnership:JavaScriptOwnership; @@ -803,7 +803,7 @@ void qmlExecuteDeferred(QObject *object) QDeclarativeComponentPrivate::complete(ep, &state); - if (!state.errors.isEmpty()) + if (!state.errors.isEmpty()) ep->warning(state.errors); } } @@ -844,7 +844,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre return rv; } -QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object, +QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object, const QMetaObject *attachedMetaObject, bool create) { if (*idCache == -1) @@ -863,7 +863,7 @@ void QDeclarativeData::destroyed(QObject *object) if (attachedProperties) delete attachedProperties; - if (nextContextObject) + if (nextContextObject) nextContextObject->prevContextObject = prevContextObject; if (prevContextObject) *prevContextObject = nextContextObject; @@ -910,7 +910,7 @@ void QDeclarativeData::parentChanged(QObject *, QObject *parent) bool QDeclarativeData::hasBindingBit(int bit) const { - if (bindingBitsSize > bit) + if (bindingBitsSize > bit) return bindingBits[bit / 32] & (1 << (bit % 32)); else return false; @@ -918,7 +918,7 @@ bool QDeclarativeData::hasBindingBit(int bit) const void QDeclarativeData::clearBindingBit(int bit) { - if (bindingBitsSize > bit) + if (bindingBitsSize > bit) bindingBits[bit / 32] &= ~(1 << (bit % 32)); } @@ -931,10 +931,10 @@ void QDeclarativeData::setBindingBit(QObject *obj, int bit) int arraySize = (props + 31) / 32; int oldArraySize = bindingBitsSize / 32; - bindingBits = (quint32 *)realloc(bindingBits, + bindingBits = (quint32 *)realloc(bindingBits, arraySize * sizeof(quint32)); - memset(bindingBits + oldArraySize, + memset(bindingBits + oldArraySize, 0x00, sizeof(quint32) * (arraySize - oldArraySize)); @@ -1035,7 +1035,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS QScriptValue qmlErrObject = ctxt->engine()->newObject(); qmlErrObject.setProperty("lineNumber", QScriptValue(error.line())); qmlErrObject.setProperty("columnNumber", QScriptValue(error.column())); - qmlErrObject.setProperty("fileName", QScriptValue(error.url())); + qmlErrObject.setProperty("fileName", QScriptValue(error.url().toString())); qmlErrObject.setProperty("message", QScriptValue(error.description())); arr.setProperty(i++, qmlErrObject); } @@ -1059,7 +1059,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS QScriptValue qmlErrObject = ctxt->engine()->newObject(); qmlErrObject.setProperty("lineNumber", QScriptValue(error.line())); qmlErrObject.setProperty("columnNumber", QScriptValue(error.column())); - qmlErrObject.setProperty("fileName", QScriptValue(error.url())); + qmlErrObject.setProperty("fileName", QScriptValue(error.url().toString())); qmlErrObject.setProperty("message", QScriptValue(error.description())); arr.setProperty(i++, qmlErrObject); } @@ -1365,7 +1365,7 @@ void QDeclarativeEnginePrivate::warning(const QList &errors) { Q_Q(QDeclarativeEngine); q->warnings(errors); - if (outputWarningsToStdErr) + if (outputWarningsToStdErr) dumpwarning(errors); } @@ -1461,7 +1461,7 @@ QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::scriptValueFromVariant(const QVariant &val) { if (val.userType() == qMetaTypeId()) { - QDeclarativeListReferencePrivate *p = + QDeclarativeListReferencePrivate *p = QDeclarativeListReferencePrivate::get((QDeclarativeListReference*)val.constData()); if (p->object) { return listClass->newList(p->property, p->propertyType); @@ -1494,7 +1494,7 @@ QVariant QDeclarativeEnginePrivate::scriptValueToVariant(const QScriptValue &val QScriptDeclarativeClass *dc = QScriptDeclarativeClass::scriptClass(val); if (dc == objectClass) return QVariant::fromValue(objectClass->toQObject(val)); - else if (dc == valueTypeClass) + else if (dc == valueTypeClass) return valueTypeClass->toVariant(val); else if (dc == contextClass) return QVariant(); @@ -1705,7 +1705,7 @@ public: if (importType == QDeclarativeScriptParser::Import::Library) { url.replace(QLatin1Char('.'), QLatin1Char('/')); bool found = false; - QString dir; + QString dir; foreach (const QString &p, @@ -1883,8 +1883,8 @@ static QDeclarativeTypeNameCache *cacheForNamespace(QDeclarativeEngine *engine, int minor = set.minversions.at(ii); foreach (QDeclarativeType *type, types) { - if (type->qmlTypeName().startsWith(base) && - type->qmlTypeName().lastIndexOf('/') == (base.length() - 1) && + if (type->qmlTypeName().startsWith(base) && + type->qmlTypeName().lastIndexOf('/') == (base.length() - 1) && type->availableInVersion(major,minor)) { QString name = QString::fromUtf8(type->qmlTypeName().mid(base.length())); -- cgit v0.12 From c2a551b280546d6c94362b40486fab7a6a5b17a3 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 21 Apr 2010 17:42:54 +1000 Subject: Update test files to new syntax --- .../declarative/qdeclarativeecmascript/data/dynamicCreation.qml | 8 ++++---- .../declarative/qdeclarativeecmascript/data/dynamicDeletion.qml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml index 2fef03a..3047e9b 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml @@ -5,23 +5,23 @@ MyQmlObject{ objectName: "obj" function createOne() { - obj.objectProperty = createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"objectOne"}', obj); + obj.objectProperty = Qt.createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"objectOne"}', obj); } function createTwo() { - var component = createComponent('dynamicCreation.helper.qml'); + var component = Qt.createComponent('dynamicCreation.helper.qml'); obj.objectProperty = component.createObject(); } function createThree() { - obj.objectProperty = createQmlObject('TypeForDynamicCreation{}', obj); + obj.objectProperty = Qt.createQmlObject('TypeForDynamicCreation{}', obj); } function dontCrash() { - var component = createComponent('file-doesnt-exist.qml'); + var component = Qt.createComponent('file-doesnt-exist.qml'); obj.objectProperty = component.createObject(); } } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml index 0855b29..f41e526 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml @@ -5,7 +5,7 @@ MyQmlObject{ objectName: "obj" function create() { - obj.objectProperty = createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"emptyObject"}', obj); + obj.objectProperty = Qt.createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"emptyObject"}', obj); } function killOther() -- cgit v0.12 From fe33a6fd873ca874e63038b1e055c5bc506f7fff Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 21 Apr 2010 11:49:11 +0200 Subject: Fill out QGraphicsLayout bindings The QGraphicsLayout API is too imperative for good bindings, but now it is at least possible to initialize values in QML. Task-number: QTBUG-5760 --- src/imports/widgets/graphicslayouts.cpp | 112 ++++++++++++++++++++- src/imports/widgets/graphicslayouts_p.h | 78 ++++++++++++++ .../graphicswidgets/data/graphicswidgets.qml | 5 +- 3 files changed, 191 insertions(+), 4 deletions(-) diff --git a/src/imports/widgets/graphicslayouts.cpp b/src/imports/widgets/graphicslayouts.cpp index fc15ad2..25cf994 100644 --- a/src/imports/widgets/graphicslayouts.cpp +++ b/src/imports/widgets/graphicslayouts.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE LinearLayoutAttached::LinearLayoutAttached(QObject *parent) -: QObject(parent), _stretch(1), _alignment(Qt::AlignCenter) +: QObject(parent), _stretch(1), _alignment(Qt::AlignCenter), _spacing(0) { } @@ -60,6 +60,15 @@ void LinearLayoutAttached::setStretchFactor(int f) emit stretchChanged(reinterpret_cast(parent()), _stretch); } +void LinearLayoutAttached::setSpacing(int s) +{ + if (_spacing == s) + return; + + _spacing = s; + emit spacingChanged(reinterpret_cast(parent()), _spacing); +} + void LinearLayoutAttached::setAlignment(Qt::Alignment a) { if (_alignment == a) @@ -99,10 +108,13 @@ insertItem(index, item); if (LinearLayoutAttached *obj = attachedProperties.value(item)) { setStretchFactor(item, obj->stretchFactor()); setAlignment(item, obj->alignment()); + updateSpacing(item, obj->spacing()); QObject::connect(obj, SIGNAL(stretchChanged(QGraphicsLayoutItem*,int)), this, SLOT(updateStretch(QGraphicsLayoutItem*,int))); QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment)), this, SLOT(updateAlignment(QGraphicsLayoutItem*,Qt::Alignment))); + QObject::connect(obj, SIGNAL(spacingChanged(QGraphicsLayoutItem*,int)), + this, SLOT(updateSpacing(QGraphicsLayoutItem*,int))); //### need to disconnect when widget is removed? } } @@ -114,11 +126,35 @@ for (int i = 0; i < count(); ++i) removeAt(i); } +qreal QGraphicsLinearLayoutObject::contentsMargin() const +{ + qreal a,b,c,d; + getContentsMargins(&a, &b, &c, &d); + if(a==b && a==c && a==d) + return a; + return -1; +} + +void QGraphicsLinearLayoutObject::setContentsMargin(qreal m) +{ + setContentsMargins(m,m,m,m); +} + void QGraphicsLinearLayoutObject::updateStretch(QGraphicsLayoutItem *item, int stretch) { QGraphicsLinearLayout::setStretchFactor(item, stretch); } +void QGraphicsLinearLayoutObject::updateSpacing(QGraphicsLayoutItem* item, int spacing) +{ + for(int i=0; i < count(); i++){ + if(itemAt(i) == item){ //I do not see the reverse function, which is why we must loop over all items + QGraphicsLinearLayout::setItemSpacing(i, spacing); + return; + } + } +} + void QGraphicsLinearLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) { QGraphicsLinearLayout::setAlignment(item, alignment); @@ -139,7 +175,9 @@ return rv; // QGraphicsGridLayout-related classes ////////////////////////////////////////////////////////////////////////////////////////////////////// GridLayoutAttached::GridLayoutAttached(QObject *parent) -: QObject(parent), _row(-1), _column(-1), _rowspan(1), _colspan(1), _alignment(-1) +: QObject(parent), _row(-1), _column(-1), _rowspan(1), _colspan(1), _alignment(-1), _rowstretch(-1), + _colstretch(-1), _rowspacing(-1), _colspacing(-1), _rowprefheight(-1), _rowmaxheight(-1), _rowminheight(-1), + _rowfixheight(-1), _colprefwidth(-1), _colmaxwidth(-1), _colminwidth(-1), _colfixwidth(-1) { } @@ -185,9 +223,30 @@ void GridLayoutAttached::setAlignment(Qt::Alignment a) return; _alignment = a; - //emit alignmentChanged(reinterpret_cast(parent()), _alignment); + emit alignmentChanged(reinterpret_cast(parent()), _alignment); +} + +void GridLayoutAttached::setRowStretchFactor(int f) +{ + _rowstretch = f; +} + +void GridLayoutAttached::setColumnStretchFactor(int f) +{ + _colstretch = f; +} + +void GridLayoutAttached::setRowSpacing(int s) +{ + _rowspacing = s; } +void GridLayoutAttached::setColumnSpacing(int s) +{ + _colspacing = s; +} + + QGraphicsGridLayoutObject::QGraphicsGridLayoutObject(QObject *parent) : QObject(parent) { @@ -226,9 +285,36 @@ if (GridLayoutAttached *obj = attachedProperties.value(item)) { qWarning() << "Must set row and column for an item in a grid layout"; return; } + if(obj->rowSpacing() != -1) + setRowSpacing(row, obj->rowSpacing()); + if(obj->columnSpacing() != -1) + setColumnSpacing(column, obj->columnSpacing()); + if(obj->rowStretchFactor() != -1) + setRowStretchFactor(row, obj->rowStretchFactor()); + if(obj->columnStretchFactor() != -1) + setColumnStretchFactor(column, obj->columnStretchFactor()); + if(obj->rowPreferredHeight() != -1) + setRowPreferredHeight(row, obj->rowPreferredHeight()); + if(obj->rowMaximumHeight() != -1) + setRowMaximumHeight(row, obj->rowMaximumHeight()); + if(obj->rowMinimumHeight() != -1) + setRowMinimumHeight(row, obj->rowMinimumHeight()); + if(obj->rowFixedHeight() != -1) + setRowFixedHeight(row, obj->rowFixedHeight()); + if(obj->columnPreferredWidth() != -1) + setColumnPreferredWidth(row, obj->columnPreferredWidth()); + if(obj->columnMaximumWidth() != -1) + setColumnMaximumWidth(row, obj->columnMaximumWidth()); + if(obj->columnMinimumWidth() != -1) + setColumnMinimumWidth(row, obj->columnMinimumWidth()); + if(obj->columnFixedWidth() != -1) + setColumnFixedWidth(row, obj->columnFixedWidth()); addItem(item, row, column, rowSpan, columnSpan); if (alignment != -1) setAlignment(item,alignment); + QObject::connect(obj, SIGNAL(alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment)), + this, SLOT(updateAlignment(QGraphicsLayoutItem*,Qt::Alignment))); + //### need to disconnect when widget is removed? } } @@ -246,6 +332,26 @@ if (verticalSpacing() == horizontalSpacing()) return -1; //### } +qreal QGraphicsGridLayoutObject::contentsMargin() const +{ + qreal a,b,c,d; + getContentsMargins(&a, &b, &c, &d); + if(a==b && a==c && a==d) + return a; + return -1; +} + +void QGraphicsGridLayoutObject::setContentsMargin(qreal m) +{ + setContentsMargins(m,m,m,m); +} + + +void QGraphicsGridLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) +{ +QGraphicsGridLayout::setAlignment(item, alignment); +} + QHash QGraphicsGridLayoutObject::attachedProperties; GridLayoutAttached *QGraphicsGridLayoutObject::qmlAttachedProperties(QObject *obj) { diff --git a/src/imports/widgets/graphicslayouts_p.h b/src/imports/widgets/graphicslayouts_p.h index 1c3dfe5..ea9c614 100644 --- a/src/imports/widgets/graphicslayouts_p.h +++ b/src/imports/widgets/graphicslayouts_p.h @@ -71,6 +71,7 @@ class QGraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout Q_PROPERTY(QDeclarativeListProperty children READ children) Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) + Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin) Q_CLASSINFO("DefaultProperty", "children") public: QGraphicsLinearLayoutObject(QObject * = 0); @@ -80,8 +81,12 @@ public: static LinearLayoutAttached *qmlAttachedProperties(QObject *); + qreal contentsMargin() const; + void setContentsMargin(qreal); + private Q_SLOTS: void updateStretch(QGraphicsLayoutItem*,int); + void updateSpacing(QGraphicsLayoutItem*,int); void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); private: @@ -115,6 +120,7 @@ class QGraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout Q_PROPERTY(QDeclarativeListProperty children READ children) Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) + Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin) Q_PROPERTY(qreal verticalSpacing READ verticalSpacing WRITE setVerticalSpacing) Q_PROPERTY(qreal horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing) Q_CLASSINFO("DefaultProperty", "children") @@ -125,9 +131,14 @@ public: QDeclarativeListProperty children() { return QDeclarativeListProperty(this, 0, children_append, children_count, children_at, children_clear); } qreal spacing() const; + qreal contentsMargin() const; + void setContentsMargin(qreal); static GridLayoutAttached *qmlAttachedProperties(QObject *); +private Q_SLOTS: + void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); + private: friend class GraphicsLayoutAttached; void addWidget(QGraphicsWidget *); @@ -158,6 +169,7 @@ class LinearLayoutAttached : public QObject Q_PROPERTY(int stretchFactor READ stretchFactor WRITE setStretchFactor NOTIFY stretchChanged) Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) + Q_PROPERTY(int spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) public: LinearLayoutAttached(QObject *parent); @@ -165,14 +177,18 @@ public: void setStretchFactor(int f); Qt::Alignment alignment() const { return _alignment; } void setAlignment(Qt::Alignment a); + int spacing() const { return _spacing; } + void setSpacing(int s); Q_SIGNALS: void stretchChanged(QGraphicsLayoutItem*,int); void alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment); + void spacingChanged(QGraphicsLayoutItem*,int); private: int _stretch; Qt::Alignment _alignment; + int _spacing; }; class GridLayoutAttached : public QObject @@ -184,6 +200,19 @@ class GridLayoutAttached : public QObject Q_PROPERTY(int rowSpan READ rowSpan WRITE setRowSpan) Q_PROPERTY(int columnSpan READ columnSpan WRITE setColumnSpan) Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) + Q_PROPERTY(int rowStretchFactor READ rowStretchFactor WRITE setRowStretchFactor) + Q_PROPERTY(int columnStretchFactor READ columnStretchFactor WRITE setColumnStretchFactor) + Q_PROPERTY(int rowSpacing READ rowSpacing WRITE setRowSpacing) + Q_PROPERTY(int columnSpacing READ columnSpacing WRITE setColumnSpacing) + Q_PROPERTY(int rowPreferredHeight READ rowPreferredHeight WRITE setRowPreferredHeight) + Q_PROPERTY(int rowMinimumHeight READ rowMinimumHeight WRITE setRowMinimumHeight) + Q_PROPERTY(int rowMaximumHeight READ rowMaximumHeight WRITE setRowMaximumHeight) + Q_PROPERTY(int rowFixedHeight READ rowFixedHeight WRITE setRowFixedHeight) + Q_PROPERTY(int columnPreferredWidth READ columnPreferredWidth WRITE setColumnPreferredWidth) + Q_PROPERTY(int columnMaximumWidth READ columnMaximumWidth WRITE setColumnMaximumWidth) + Q_PROPERTY(int columnMinimumWidth READ columnMinimumWidth WRITE setColumnMinimumWidth) + Q_PROPERTY(int columnFixedWidth READ columnFixedWidth WRITE setColumnFixedWidth) + public: GridLayoutAttached(QObject *parent); @@ -202,12 +231,61 @@ public: Qt::Alignment alignment() const { return _alignment; } void setAlignment(Qt::Alignment a); + int rowStretchFactor() const { return _rowstretch; } + void setRowStretchFactor(int f); + int columnStretchFactor() const { return _colstretch; } + void setColumnStretchFactor(int f); + + int rowSpacing() const { return _rowspacing; } + void setRowSpacing(int s); + int columnSpacing() const { return _colspacing; } + void setColumnSpacing(int s); + + int rowPreferredHeight() const { return _rowprefheight; } + void setRowPreferredHeight(int s) { _rowprefheight = s; } + + int rowMaximumHeight() const { return _rowmaxheight; } + void setRowMaximumHeight(int s) { _rowmaxheight = s; } + + int rowMinimumHeight() const { return _rowminheight; } + void setRowMinimumHeight(int s) { _rowminheight = s; } + + int rowFixedHeight() const { return _rowfixheight; } + void setRowFixedHeight(int s) { _rowfixheight = s; } + + int columnPreferredWidth() const { return _colprefwidth; } + void setColumnPreferredWidth(int s) { _colprefwidth = s; } + + int columnMaximumWidth() const { return _colmaxwidth; } + void setColumnMaximumWidth(int s) { _colmaxwidth = s; } + + int columnMinimumWidth() const { return _colminwidth; } + void setColumnMinimumWidth(int s) { _colminwidth = s; } + + int columnFixedWidth() const { return _colfixwidth; } + void setColumnFixedWidth(int s) { _colfixwidth = s; } + +Q_SIGNALS: + void alignmentChanged(QGraphicsLayoutItem*,Qt::Alignment); + private: int _row; int _column; int _rowspan; int _colspan; Qt::Alignment _alignment; + int _rowstretch; + int _colstretch; + int _rowspacing; + int _colspacing; + int _rowprefheight; + int _rowmaxheight; + int _rowminheight; + int _rowfixheight; + int _colprefwidth; + int _colmaxwidth; + int _colminwidth; + int _colfixwidth; }; QT_END_NAMESPACE diff --git a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml index 714ae7c..f45a78c 100644 --- a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml +++ b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml @@ -2,6 +2,7 @@ import Qt 4.6 import Qt.widgets 4.6 QGraphicsWidget { + geometry: "20,0,600x400" layout: QGraphicsLinearLayout { orientation: Qt.Horizontal QGraphicsWidget { @@ -9,6 +10,7 @@ QGraphicsWidget { spacing: 10; orientation: Qt.Vertical LayoutItem { QGraphicsLinearLayout.stretchFactor: 1 + QGraphicsLinearLayout.spacing: 1 objectName: "left" minimumSize: "100x100" maximumSize: "300x300" @@ -17,6 +19,7 @@ QGraphicsWidget { } LayoutItem { QGraphicsLinearLayout.stretchFactor: 10 + QGraphicsLinearLayout.spacing: 10 objectName: "left" minimumSize: "100x100" maximumSize: "300x300" @@ -27,7 +30,7 @@ QGraphicsWidget { } QGraphicsWidget { layout: QGraphicsLinearLayout { - spacing: 10; orientation: Qt.Vertical + spacing: 10; orientation: Qt.Horizontal; contentsMargin: 10 LayoutItem { objectName: "left" minimumSize: "100x100" -- cgit v0.12 From cd601ef53385962c4affdb2020cfcb415d117bc1 Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Wed, 3 Mar 2010 18:18:09 +0100 Subject: Add support for MSBuild, which is the project format for MSVC 2010 Reviewed-by: Marius SO --- examples/script/qstetrix/qstetrix.pro | 1 - examples/xmlpatterns/recipes/recipes.qrc | 1 - qmake/Makefile.win32 | 14 +- qmake/generators/metamakefile.cpp | 7 + qmake/generators/win32/msbuild_objectmodel.cpp | 3317 ++++++++++++++++++++++++ qmake/generators/win32/msbuild_objectmodel.h | 708 +++++ qmake/generators/win32/msvc_objectmodel.cpp | 1 + qmake/generators/win32/msvc_objectmodel.h | 5 +- qmake/generators/win32/msvc_vcproj.cpp | 15 +- qmake/generators/win32/msvc_vcproj.h | 5 +- qmake/generators/win32/msvc_vcxproj.cpp | 851 ++++++ qmake/generators/win32/msvc_vcxproj.h | 100 + qmake/generators/xmloutput.cpp | 42 +- qmake/generators/xmloutput.h | 34 + qmake/qmake.pro | 3 +- tools/configure/configureapp.cpp | 5 +- tools/configure/environment.cpp | 4 + tools/configure/environment.h | 3 +- 18 files changed, 5099 insertions(+), 17 deletions(-) create mode 100644 qmake/generators/win32/msbuild_objectmodel.cpp create mode 100644 qmake/generators/win32/msbuild_objectmodel.h create mode 100644 qmake/generators/win32/msvc_vcxproj.cpp create mode 100644 qmake/generators/win32/msvc_vcxproj.h diff --git a/examples/script/qstetrix/qstetrix.pro b/examples/script/qstetrix/qstetrix.pro index 3db66ab..65d5a67 100644 --- a/examples/script/qstetrix/qstetrix.pro +++ b/examples/script/qstetrix/qstetrix.pro @@ -5,7 +5,6 @@ HEADERS = tetrixboard.h SOURCES = main.cpp \ tetrixboard.cpp -FORMS = tetrixwindow.ui RESOURCES = tetrix.qrc contains(QT_CONFIG, scripttools): QT += scripttools diff --git a/examples/xmlpatterns/recipes/recipes.qrc b/examples/xmlpatterns/recipes/recipes.qrc index 2f375ee..65b6615 100644 --- a/examples/xmlpatterns/recipes/recipes.qrc +++ b/examples/xmlpatterns/recipes/recipes.qrc @@ -1,6 +1,5 @@ - forms/querywidget.ui files/cookbook.xml files/allRecipes.xq files/liquidIngredientsInSoup.xq diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 63156b3..956fa9c 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -1,4 +1,4 @@ -!IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-icc" +!IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-icc" !if "$(SOURCE_PATH)" == "" SOURCE_PATH = .. @@ -75,8 +75,8 @@ ADDCLEAN = qmake.tds OBJS = project.obj main.obj makefile.obj unixmake.obj unixmake2.obj mingw_make.obj \ option.obj winmakefile.obj projectgenerator.obj property.obj meta.obj \ makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \ - borland_bmake.obj msvc_nmake.obj msvc_vcproj.obj \ - msvc_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \ + borland_bmake.obj msvc_nmake.obj msvc_vcproj.obj msvc_vcxproj.obj \ + msvc_objectmodel.obj msbuild_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \ symmake_abld.obj symmake_sbsv2.obj symbiancommon.obj registry.obj epocroot.obj !IFDEF QMAKE_OPENSOURCE_EDITION @@ -194,7 +194,9 @@ clean:: -del borland_bmake.obj -del msvc_nmake.obj -del msvc_vcproj.obj + -del msvc_vcxproj.obj -del msvc_objectmodel.obj + -del msbuild_objectmodel.obj -del symmake.obj -del symmake_abld.obj -del symmake_sbsv2.obj @@ -383,9 +385,15 @@ msvc_nmake.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_nmake.cpp msvc_vcproj.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp $(CXX) $(CXXFLAGS) generators/win32/msvc_vcproj.cpp +msvc_vcxproj.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcxproj.cpp + $(CXX) $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp + msvc_objectmodel.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp $(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp +msbuild_objectmodel.obj: $(SOURCE_PATH)/qmake/generators/win32/msbuild_objectmodel.cpp + $(CXX) $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp + symmake.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index c42a837..f42a489 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -443,6 +443,7 @@ QT_BEGIN_INCLUDE_NAMESPACE #include "msvc_nmake.h" #include "borland_bmake.h" #include "msvc_vcproj.h" +#include "msvc_vcxproj.h" #include "symmake_abld.h" #include "symmake_sbsv2.h" #include "symbian_makefile.h" @@ -473,6 +474,12 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO) mkfile = new VcprojGenerator; else mkfile = new NmakeMakefileGenerator; + } else if(gen == "MSBUILD") { + // Visual Studio >= v11.0 + if(proj->first("TEMPLATE").indexOf(QRegExp("^vc.*")) != -1 || proj->first("TEMPLATE").indexOf(QRegExp("^ce.*")) != -1) + mkfile = new VcxprojGenerator; + else + mkfile = new NmakeMakefileGenerator; } else if(gen == "BMAKE") { mkfile = new BorlandMakefileGenerator; } else if(gen == "SYMBIAN_ABLD") { diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp new file mode 100644 index 0000000..f459885 --- /dev/null +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -0,0 +1,3317 @@ +/**************************************************************************** +** +** 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 qmake application 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 "msvc_objectmodel.h" +#include "msbuild_objectmodel.h" +#include "msvc_vcproj.h" +#include "msvc_vcxproj.h" +#include +#include + +QT_BEGIN_NAMESPACE + +// XML Tags --------------------------------------------------------- +const char _CLCompile[] = "ClCompile"; +const char _Configuration[] = "Configuration"; +const char _Configurations[] = "Configurations"; +const char q_File[] = "File"; +const char _FileConfiguration[] = "FileConfiguration"; +const char q_Files[] = "Files"; +const char _Filter[] = "Filter"; +const char _Globals[] = "Globals"; +const char _ItemGroup[] = "ItemGroup"; +const char _Link[] = "Link"; +const char _Midl[] = "Midl"; +const char _Platform[] = "Platform"; +const char _Platforms[] = "Platforms"; +const char _ResourceCompile[] = "ResourceCompile"; +const char _Tool[] = "Tool"; +const char _VisualStudioProject[] = "VisualStudioProject"; + +// XML Properties --------------------------------------------------- +const char _AddModuleNamesToAssembly[] = "AddModuleNamesToAssembly"; +const char _AdditionalDependencies[] = "AdditionalDependencies"; +const char _AdditionalFiles[] = "AdditionalFiles"; +const char _AdditionalIncludeDirectories[] = "AdditionalIncludeDirectories"; +const char _AdditionalLibraryDirectories[] = "AdditionalLibraryDirectories"; +const char _AdditionalManifestDependencies[] = "AdditionalManifestDependencies"; +const char _AdditionalOptions[] = "AdditionalOptions"; +const char _AdditionalUsingDirectories[] = "AdditionalUsingDirectories"; +const char _AllowIsolation[] = "AllowIsolation"; +const char _AlwaysAppend[] = "AlwaysAppend"; +const char _ApplicationConfigurationMode[] = "ApplicationConfigurationMode"; +const char _AssemblerListingLocation[] = "AssemblerListingLocation"; +const char _AssemblerOutput[] = "AssemblerOutput"; +const char _AssemblyDebug[] = "AssemblyDebug"; +const char _AssemblyLinkResource[] = "AssemblyLinkResource"; +const char _ATLMinimizesCRunTimeLibraryUsage[] = "ATLMinimizesCRunTimeLibraryUsage"; +const char _BaseAddress[] = "BaseAddress"; +const char _BasicRuntimeChecks[] = "BasicRuntimeChecks"; +const char _BrowseInformation[] = "BrowseInformation"; +const char _BrowseInformationFile[] = "BrowseInformationFile"; +const char _BufferSecurityCheck[] = "BufferSecurityCheck"; +const char _BuildBrowserInformation[] = "BuildBrowserInformation"; +const char _CallingConvention[] = "CallingConvention"; +const char _CharacterSet[] = "CharacterSet"; +const char _ClientStubFile[] = "ClientStubFile"; +const char _CLRImageType[] = "CLRImageType"; +const char _CLRSupportLastError[] = "CLRSupportLastError"; +const char _CLRThreadAttribute[] = "CLRThreadAttribute"; +const char _CLRUnmanagedCodeCheck[] = "CLRUnmanagedCodeCheck"; +const char _Command[] = "Command"; +const char _CommandLine[] = "CommandLine"; +const char _CompileAs[] = "CompileAs"; +const char _CompileAsManaged[] = "CompileAsManaged"; +const char _CompileForArchitecture[] = "CompileForArchitecture"; +const char _CompileOnly[] = "CompileOnly"; +const char _ConfigurationType[] = "ConfigurationType"; +const char _CPreprocessOptions[] = "CPreprocessOptions"; +const char _CreateHotpatchableImage[] = "CreateHotpatchableImage"; +const char _CreateHotPatchableImage[] = "CreateHotPatchableImage"; +const char _Culture[] = "Culture"; +const char _DataExecutionPrevention[] = "DataExecutionPrevention"; +const char _DebugInformationFormat[] = "DebugInformationFormat"; +const char _DefaultCharIsUnsigned[] = "DefaultCharIsUnsigned"; +const char _DefaultCharType[] = "DefaultCharType"; +const char _DelayLoadDLLs[] = "DelayLoadDLLs"; +const char _DelaySign[] = "DelaySign"; +const char _DeleteExtensionsOnClean[] = "DeleteExtensionsOnClean"; +const char _Description[] = "Description"; +const char _Detect64BitPortabilityProblems[] = "Detect64BitPortabilityProblems"; +const char _DisableLanguageExtensions[] = "DisableLanguageExtensions"; +const char _DisableSpecificWarnings[] = "DisableSpecificWarnings"; +const char _DisplayLibrary[] = "DisplayLibrary"; +const char _DLLDataFileName[] = "DLLDataFileName"; +const char _Driver[] = "Driver"; +const char _EmbedManagedResourceFile[] = "EmbedManagedResourceFile"; +const char _EnableCOMDATFolding[] = "EnableCOMDATFolding"; +const char _EnableUAC[] = "EnableUAC"; +const char _EnableErrorChecks[] = "EnableErrorChecks"; +const char _EnableEnhancedInstructionSet[] = "EnableEnhancedInstructionSet"; +const char _EnableFiberSafeOptimizations[] = "EnableFiberSafeOptimizations"; +const char _EnableFunctionLevelLinking[] = "EnableFunctionLevelLinking"; +const char _EnableIntrinsicFunctions[] = "EnableIntrinsicFunctions"; +const char _EnablePREfast[] = "EnablePREfast"; +const char _EntryPointSymbol[] = "EntryPointSymbol"; +const char _ErrorCheckAllocations[] = "ErrorCheckAllocations"; +const char _ErrorCheckBounds[] = "ErrorCheckBounds"; +const char _ErrorCheckEnumRange[] = "ErrorCheckEnumRange"; +const char _ErrorCheckRefPointers[] = "ErrorCheckRefPointers"; +const char _ErrorCheckStubData[] = "ErrorCheckStubData"; +const char _ErrorReporting[] = "ErrorReporting"; +const char _ExceptionHandling[] = "ExceptionHandling"; +const char _ExcludedFromBuild[] = "ExcludedFromBuild"; +const char _ExpandAttributedSource[] = "ExpandAttributedSource"; +const char _ExportNamedFunctions[] = "ExportNamedFunctions"; +const char _FavorSizeOrSpeed[] = "FavorSizeOrSpeed"; +const char _FixedBaseAddress[] = "FixedBaseAddress"; +const char _FloatingPointModel[] = "FloatingPointModel"; +const char _FloatingPointExceptions[] = "FloatingPointExceptions"; +const char _ForceConformanceInForLoopScope[] = "ForceConformanceInForLoopScope"; +const char _ForceFileOutput[] = "ForceFileOutput"; +const char _ForceSymbolReferences[] = "ForceSymbolReferences"; +const char _ForcedIncludeFiles[] = "ForcedIncludeFiles"; +const char _ForcedUsingFiles[] = "ForcedUsingFiles"; +const char _FullIncludePath[] = "FullIncludePath"; +const char _FunctionLevelLinking[] = "FunctionLevelLinking"; +const char _FunctionOrder[] = "FunctionOrder"; +const char _GenerateClientFiles[] = "GenerateClientFiles"; +const char _GenerateDebugInformation[] = "GenerateDebugInformation"; +const char _GenerateManifest[] = "GenerateManifest"; +const char _GenerateMapFile[] = "GenerateMapFile"; +const char _GeneratePreprocessedFile[] = "GeneratePreprocessedFile"; +const char _GenerateServerFiles[] = "GenerateServerFiles"; +const char _GenerateStublessProxies[] = "GenerateStublessProxies"; +const char _GenerateTypeLibrary[] = "GenerateTypeLibrary"; +const char _GenerateXMLDocumentationFiles[] = "GenerateXMLDocumentationFiles"; +const char _GlobalOptimizations[] = "GlobalOptimizations"; +const char _HeaderFileName[] = "HeaderFileName"; +const char _HeapCommitSize[] = "HeapCommitSize"; +const char _HeapReserveSize[] = "HeapReserveSize"; +const char _IgnoreAllDefaultLibraries[] = "IgnoreAllDefaultLibraries"; +const char _IgnoreDefaultLibraryNames[] = "IgnoreDefaultLibraryNames"; +const char _IgnoreEmbeddedIDL[] = "IgnoreEmbeddedIDL"; +const char _IgnoreImportLibrary[] = "IgnoreImportLibrary"; +const char _IgnoreSpecificDefaultLibraries[] = "IgnoreSpecificDefaultLibraries"; +const char _IgnoreStandardIncludePath[] = "IgnoreStandardIncludePath"; +const char _ImageHasSafeExceptionHandlers[] = "ImageHasSafeExceptionHandlers"; +const char _ImportLibrary[] = "ImportLibrary"; +const char _ImproveFloatingPointConsistency[] = "ImproveFloatingPointConsistency"; +const char _InlineFunctionExpansion[] = "InlineFunctionExpansion"; +const char _IntrinsicFunctions[] = "IntrinsicFunctions"; +const char _InterfaceIdentifierFileName[] = "InterfaceIdentifierFileName"; +const char _IntermediateDirectory[] = "IntermediateDirectory"; +const char _InterworkCalls[] = "InterworkCalls"; +const char _KeyContainer[] = "KeyContainer"; +const char _KeyFile[] = "KeyFile"; +const char _Keyword[] = "Keyword"; +const char _KeepComments[] = "KeepComments"; +const char _LargeAddressAware[] = "LargeAddressAware"; +const char _LinkDLL[] = "LinkDLL"; +const char _LinkErrorReporting[] = "LinkErrorReporting"; +const char _LinkIncremental[] = "LinkIncremental"; +const char _LinkStatus[] = "LinkStatus"; +const char _LinkTimeCodeGeneration[] = "LinkTimeCodeGeneration"; +const char _LinkToManagedResourceFile[] = "LinkToManagedResourceFile"; +const char _LocaleID[] = "LocaleID"; +const char _ManifestFile[] = "ManifestFile"; +const char _MapExports[] = "MapExports"; +const char _MapFileName[] = "MapFileName"; +const char _MapLines[] = "MapLines "; +const char _MergedIDLBaseFileName[] = "MergedIDLBaseFileName"; +const char _MergeSections[] = "MergeSections"; +const char _Message[] = "Message"; +const char _MidlCommandFile[] = "MidlCommandFile"; +const char _MinimalRebuild[] = "MinimalRebuild"; +const char _MkTypLibCompatible[] = "MkTypLibCompatible"; +const char _ModuleDefinitionFile[] = "ModuleDefinitionFile"; +const char _MSDOSStubFileName[] = "MSDOSStubFileName"; +const char _MultiProcessorCompilation[] = "MultiProcessorCompilation"; +const char _Name[] = "Name"; +const char _NoEntryPoint[] = "NoEntryPoint"; +const char _NullTerminateStrings[] = "NullTerminateStrings"; +const char _ObjectFile[] = "ObjectFile"; +const char _ObjectFiles[] = "ObjectFiles"; +const char _ObjectFileName[] = "ObjectFileName"; +const char _OmitDefaultLibName[] = "OmitDefaultLibName"; +const char _OmitFramePointers[] = "OmitFramePointers"; +const char _OpenMP[] = "OpenMP"; +const char _OpenMPSupport[] = "OpenMPSupport"; +const char _Optimization[] = "Optimization"; +const char _OptimizeForProcessor[] = "OptimizeForProcessor"; +const char _OptimizeForWindows98[] = "OptimizeForWindows98"; +const char _OptimizeForWindowsApplication[] = "OptimizeForWindowsApplication"; +const char _OptimizeReferences[] = "OptimizeReferences"; +const char _OutputDirectory[] = "OutputDirectory"; +const char _OutputFile[] = "OutputFile"; +const char _Outputs[] = "Outputs"; +const char _ParseFiles[] = "ParseFiles"; +const char _Path[] = "Path"; +const char _PrecompiledHeader[] = "PrecompiledHeader"; +const char _PrecompiledHeaderFile[] = "PrecompiledHeaderFile"; +const char _PrecompiledHeaderOutputFile[] = "PrecompiledHeaderOutputFile"; +const char _PrecompiledHeaderThrough[] = "PrecompiledHeaderThrough"; +const char _PreprocessorDefinitions[] = "PreprocessorDefinitions"; +const char _PreprocessKeepComments[] = "PreprocessKeepComments"; +const char _PreprocessOutputPath[] = "PreprocessOutputPath"; +const char _PreprocessSuppressLineNumbers[] = "PreprocessSuppressLineNumbers"; +const char _PreprocessToFile[] = "PreprocessToFile"; +const char _PreventDllBinding[] = "PreventDllBinding"; +const char _PrimaryOutput[] = "PrimaryOutput"; +const char _Profile[] = "Profile"; +const char _ProfileGuidedDatabase[] = "ProfileGuidedDatabase"; +const char _ProjectGUID[] = "ProjectGUID"; +const char _ProcessorNumber[] = "ProcessorNumber"; +const char _ProjectType[] = "ProjectType"; +const char _ProgramDatabase[] = "ProgramDatabase"; +const char _ProgramDataBaseFileName[] = "ProgramDataBaseFileName"; +const char _ProgramDatabaseFile[] = "ProgramDatabaseFile"; +const char _ProxyFileName[] = "ProxyFileName"; +const char _RandomizedBaseAddress[] = "RandomizedBaseAddress"; +const char _RedirectOutputAndErrors[] = "RedirectOutputAndErrors"; +const char _RegisterOutput[] = "RegisterOutput"; +const char _RelativePath[] = "RelativePath"; +const char _RemoteDirectory[] = "RemoteDirectory"; +const char _RemoveObjects[] = "RemoveObjects"; +const char _ResourceOnlyDLL[] = "ResourceOnlyDLL"; +const char _ResourceOutputFileName[] = "ResourceOutputFileName"; +const char _RuntimeLibrary[] = "RuntimeLibrary"; +const char _RuntimeTypeInfo[] = "RuntimeTypeInfo"; +const char _SccProjectName[] = "SccProjectName"; +const char _SccLocalPath[] = "SccLocalPath"; +const char _SectionAlignment[] = "SectionAlignment"; +const char _ServerStubFile[] = "ServerStubFile"; +const char _SetChecksum[] = "SetChecksum"; +const char _ShowIncludes[] = "ShowIncludes"; +const char _ShowProgress[] = "ShowProgress"; +const char _SmallerTypeCheck[] = "SmallerTypeCheck"; +const char _SpecifySectionAttributes[] = "SpecifySectionAttributes"; +const char _StackCommitSize[] = "StackCommitSize"; +const char _StackReserveSize[] = "StackReserveSize"; +const char _StringPooling[] = "StringPooling"; +const char _StripPrivateSymbols[] = "StripPrivateSymbols"; +const char _StructMemberAlignment[] = "StructMemberAlignment"; +const char _SubSystem[] = "SubSystem"; +const char _SupportNobindOfDelayLoadedDLL[] = "SupportNobindOfDelayLoadedDLL"; +const char _SupportUnloadOfDelayLoadedDLL[] = "SupportUnloadOfDelayLoadedDLL"; +const char _SuppressCompilerWarnings[] = "SuppressCompilerWarnings"; +const char _SuppressStartupBanner[] = "SuppressStartupBanner"; +const char _SwapRunFromCD[] = "SwapRunFromCD"; +const char _SwapRunFromNet[] = "SwapRunFromNet"; +const char _TargetEnvironment[] = "TargetEnvironment"; +const char _TargetMachine[] = "TargetMachine"; +const char _TerminalServerAware[] = "TerminalServerAware"; +const char _TrackerLogDirectory[] = "TrackerLogDirectory"; +const char _TreatLibWarningAsErrors[] = "TreatLibWarningAsErrors"; +const char _TreatLinkerWarningAsErrors[] = "TreatLinkerWarningAsErrors"; +const char _TreatSpecificWarningsAsErrors[] = "TreatSpecificWarningsAsErrors"; +const char _TreatWarningAsError[] = "TreatWarningAsError"; +const char _TreatWChar_tAsBuiltInType[] = "TreatWChar_tAsBuiltInType"; +const char _TurnOffAssemblyGeneration[] = "TurnOffAssemblyGeneration"; +const char _TypeLibFormat[] = "TypeLibFormat"; +const char _TypeLibraryFile[] = "TypeLibraryFile"; +const char _TypeLibraryName[] = "TypeLibraryName"; +const char _TypeLibraryResourceID[] = "TypeLibraryResourceID"; +const char _UACExecutionLevel[] = "UACExecutionLevel"; +const char _UACUIAccess[] = "UACUIAccess"; +const char _UndefineAllPreprocessorDefinitions[]= "UndefineAllPreprocessorDefinitions"; +const char _UndefinePreprocessorDefinitions[] = "UndefinePreprocessorDefinitions"; +const char _UniqueIdentifier[] = "UniqueIdentifier"; +const char _UseFullPaths[] = "UseFullPaths"; +const char _UseOfATL[] = "UseOfATL"; +const char _UseOfMfc[] = "UseOfMfc"; +const char _UsePrecompiledHeader[] = "UsePrecompiledHeader"; +const char _UseUnicodeForAssemblerListing[] = "UseUnicodeForAssemblerListing"; +const char _ValidateAllParameters[] = "ValidateAllParameters"; +const char _VCCLCompilerTool[] = "VCCLCompilerTool"; +const char _VCLibrarianTool[] = "VCLibrarianTool"; +const char _VCLinkerTool[] = "VCLinkerTool"; +const char _VCCustomBuildTool[] = "VCCustomBuildTool"; +const char _VCResourceCompilerTool[] = "VCResourceCompilerTool"; +const char _VCMIDLTool[] = "VCMIDLTool"; +const char _Verbose[] = "Verbose"; +const char _Version[] = "Version"; +const char _WarnAsError[] = "WarnAsError"; +const char _WarningLevel[] = "WarningLevel"; +const char _WholeProgramOptimization[] = "WholeProgramOptimization"; +const char _XMLDocumentationFileName[] = "XMLDocumentationFileName"; + + +// XmlOutput stream functions ------------------------------ +inline XmlOutput::xml_output attrTagT(const char *name, const triState v) +{ + if(v == unset) + return noxml(); + return tagValue(name, (v == _True ? "true" : "false")); +} + +inline XmlOutput::xml_output attrTagL(const char *name, qint64 v) +{ + return tagValue(name, QString::number(v)); +} + +/*ifNot version*/ +inline XmlOutput::xml_output attrTagL(const char *name, qint64 v, qint64 ifn) +{ + if (v == ifn) + return noxml(); + return tagValue(name, QString::number(v)); +} + +inline XmlOutput::xml_output attrTagS(const char *name, const QString &v) +{ + if(v.isEmpty()) + return noxml(); + return tagValue(name, v); +} + + +inline XmlOutput::xml_output attrTagX(const char *name, const QStringList &v, const char *s = ",") +{ + if(v.isEmpty()) + return noxml(); + QStringList temp = v; + temp.append(QString("%(%1)").arg(name)); + return tagValue(name, temp.join(s)); +} + +inline XmlOutput::xml_output valueTagX(const QStringList &v, const char *s = " ") +{ + if(v.isEmpty()) + return noxml(); + return valueTag(v.join(s)); +} + +inline XmlOutput::xml_output valueTagDefX(const QStringList &v, const QString &tagName, const char *s = " ") +{ + if(v.isEmpty()) + return noxml(); + QStringList temp = v; + temp.append(QString("%(%1)").arg(tagName)); + return valueTag(temp.join(s)); +} + +inline XmlOutput::xml_output valueTagT( const triState v) +{ + if(v == unset) + return noxml(); + return valueTag(v == _True ? "true" : "false"); +} + + +// VCXCLCompilerTool ------------------------------------------------- +VCXCLCompilerTool::VCXCLCompilerTool() + : BrowseInformation(_False), + BufferSecurityCheck(_False), + CreateHotpatchableImage(unset), + DisableLanguageExtensions(unset), + EnableFiberSafeOptimizations(unset), + EnablePREfast(unset), + ExpandAttributedSource(unset), + FloatingPointExceptions(unset), + ForceConformanceInForLoopScope(unset), + FunctionLevelLinking(unset), + GenerateXMLDocumentationFiles(unset), + IgnoreStandardIncludePath(unset), + IntrinsicFunctions(unset), + MinimalRebuild(unset), + MultiProcessorCompilation(unset), + OmitDefaultLibName(unset), + OmitFramePointers(unset), + OpenMPSupport(unset), + PreprocessKeepComments(unset), + PreprocessSuppressLineNumbers(unset), + RuntimeTypeInfo(unset), + ShowIncludes(unset), + SmallerTypeCheck(unset), + StringPooling(unset), + SuppressStartupBanner(unset), + TreatWarningAsError(unset), + TreatWChar_tAsBuiltInType(unset), + UndefineAllPreprocessorDefinitions(unset), + UseFullPaths(unset), + UseUnicodeForAssemblerListing(unset), + WholeProgramOptimization(unset) +{ +} + +XmlOutput &operator<<(XmlOutput &xml, const VCXCLCompilerTool &tool) +{ + return xml + << tag(_CLCompile) + << attrTagX(_AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories, ";") + << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") + << attrTagX(_AdditionalUsingDirectories, tool.AdditionalUsingDirectories, ";") + << attrTagS(_AlwaysAppend, tool.AlwaysAppend) + << attrTagS(_AssemblerListingLocation, tool.AssemblerListingLocation) + << attrTagS(_AssemblerOutput, tool.AssemblerOutput) + << attrTagS(_BasicRuntimeChecks, tool.BasicRuntimeChecks) + << attrTagT(_BrowseInformation, tool.BrowseInformation) + << attrTagS(_BrowseInformationFile, tool.BrowseInformationFile) + << attrTagT(_BufferSecurityCheck, tool.BufferSecurityCheck) + << attrTagS(_CallingConvention, tool.CallingConvention) + << attrTagS(_CompileAs, tool.CompileAs) + << attrTagS(_CompileAsManaged, tool.CompileAsManaged) + << attrTagT(_CreateHotpatchableImage, tool.CreateHotpatchableImage) + << attrTagS(_DebugInformationFormat, tool.DebugInformationFormat) + << attrTagT(_DisableLanguageExtensions, tool.DisableLanguageExtensions) + << attrTagX(_DisableSpecificWarnings, tool.DisableSpecificWarnings, ";") + << attrTagS(_EnableEnhancedInstructionSet, tool.EnableEnhancedInstructionSet) + << attrTagT(_EnableFiberSafeOptimizations, tool.EnableFiberSafeOptimizations) + << attrTagT(_EnablePREfast, tool.EnablePREfast) + << attrTagS(_ErrorReporting, tool.ErrorReporting) + << attrTagS(_ExceptionHandling, tool.ExceptionHandling) + << attrTagT(_ExpandAttributedSource, tool.ExpandAttributedSource) + << attrTagS(_FavorSizeOrSpeed, tool.FavorSizeOrSpeed) + << attrTagT(_FloatingPointExceptions, tool.FloatingPointExceptions) + << attrTagS(_FloatingPointModel, tool.FloatingPointModel) + << attrTagT(_ForceConformanceInForLoopScope, tool.ForceConformanceInForLoopScope) + << attrTagX(_ForcedIncludeFiles, tool.ForcedIncludeFiles, ";") + << attrTagX(_ForcedUsingFiles, tool.ForcedUsingFiles, ";") + << attrTagT(_FunctionLevelLinking, tool.FunctionLevelLinking) + << attrTagT(_GenerateXMLDocumentationFiles, tool.GenerateXMLDocumentationFiles) + << attrTagT(_IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath) + << attrTagS(_InlineFunctionExpansion, tool.InlineFunctionExpansion) + << attrTagT(_IntrinsicFunctions, tool.IntrinsicFunctions) + << attrTagT(_MinimalRebuild, tool.MinimalRebuild) + << attrTagT(_MultiProcessorCompilation, tool.MultiProcessorCompilation) + << attrTagS(_ObjectFileName, tool.ObjectFileName) + << attrTagX(_ObjectFiles, tool.ObjectFiles, ";") + << attrTagT(_OmitDefaultLibName, tool.OmitDefaultLibName) + << attrTagT(_OmitFramePointers, tool.OmitFramePointers) + << attrTagT(_OpenMPSupport, tool.OpenMPSupport) + << attrTagS(_Optimization, tool.Optimization) + << attrTagS(_PrecompiledHeader, tool.PrecompiledHeader) + << attrTagS(_PrecompiledHeaderFile, tool.PrecompiledHeaderFile) + << attrTagS(_PrecompiledHeaderOutputFile, tool.PrecompiledHeaderOutputFile) + << attrTagT(_PreprocessKeepComments, tool.PreprocessKeepComments) + << attrTagX(_PreprocessorDefinitions, tool.PreprocessorDefinitions, ";") + << attrTagS(_PreprocessOutputPath, tool.PreprocessOutputPath) + << attrTagT(_PreprocessSuppressLineNumbers, tool.PreprocessSuppressLineNumbers) + << attrTagT(_PreprocessToFile, tool.PreprocessToFile) + << attrTagS(_ProgramDataBaseFileName, tool.ProgramDataBaseFileName) + << attrTagS(_ProcessorNumber, tool.ProcessorNumber) + << attrTagS(_RuntimeLibrary, tool.RuntimeLibrary) + << attrTagT(_RuntimeTypeInfo, tool.RuntimeTypeInfo) + << attrTagT(_ShowIncludes, tool.ShowIncludes) + << attrTagT(_SmallerTypeCheck, tool.SmallerTypeCheck) + << attrTagT(_StringPooling, tool.StringPooling) + << attrTagS(_StructMemberAlignment, tool.StructMemberAlignment) + << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) + << attrTagS(_TreatSpecificWarningsAsErrors, tool.TreatSpecificWarningsAsErrors) + << attrTagT(_TreatWarningAsError, tool.TreatWarningAsError) + << attrTagT(_TreatWChar_tAsBuiltInType, tool.TreatWChar_tAsBuiltInType) + << attrTagT(_UndefineAllPreprocessorDefinitions, tool.UndefineAllPreprocessorDefinitions) + << attrTagX(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions, ";") + << attrTagT(_UseFullPaths, tool.UseFullPaths) + << attrTagT(_UseUnicodeForAssemblerListing, tool.UseUnicodeForAssemblerListing) + << attrTagS(_WarningLevel, tool.WarningLevel) + << attrTagT(_WholeProgramOptimization, tool.WholeProgramOptimization) + << attrTagS(_XMLDocumentationFileName, tool.XMLDocumentationFileName) + << closetag(_CLCompile); +} + +bool VCXCLCompilerTool::parseOption(const char* option) +{ + // skip index 0 ('/' or '-') + char first = option[1]; + char second = option[2]; + char third = option[3]; + char fourth = option[4]; + bool found = true; + + switch (first) { + case '?': + qWarning("Generator: Option '/?' : MSVC.NET projects do not support outputting help info"); + found = false; + break; + case '@': + qWarning("Generator: Option '/@': MSVC.NET projects do not support the use of a response file"); + found = false; + break; + case 'l': + qWarning("Generator: Option '/link': qmake generator does not support passing link options through the compiler tool"); + found = false; + break; + case 'A': + if(second != 'I') { + found = false; + break; + } + AdditionalUsingDirectories += option+3; + break; + case 'C': + PreprocessKeepComments = _True; + break; + case 'D': + PreprocessorDefinitions += option+2; + break; + case 'E': + if(second == 'H') { + QString opt(option); + if (opt.endsWith("EHa")) + ExceptionHandling = "Async"; + else if (opt.endsWith("EHsc")) + ExceptionHandling = "Sync"; + else if (opt.endsWith("EHs")) + ExceptionHandling = "SyncCThrow"; + else { + ExceptionHandling = "false"; + } + break; + }else if(second == 'P') { + PreprocessSuppressLineNumbers = _True; + } + found = false; + break; + case 'F': + if(second <= '9' && second >= '0') { + AdditionalOptions += option; + break; + } else { + switch (second) { + case 'A': + if(third == 'c') { + AssemblerOutput = "AssemblyAndMachineCode"; + if(fourth == 's') + AssemblerOutput = "All"; + } else if(third == 's') { + AssemblerOutput = "AssemblyAndSourceCode"; + } else if(third == 'u') { + UseUnicodeForAssemblerListing = _True; + } else { + AssemblerOutput = "AssemblyCode"; + } + break; + case 'a': + AssemblerListingLocation = option+3; + break; + case 'C': + UseFullPaths = _True; + break; + case 'd': + ProgramDataBaseFileName += option+3; + case 'I': + ForcedIncludeFiles += option+3; + break; + case 'i': + PreprocessOutputPath += option+3; + break; + case 'm': + AdditionalOptions += option; + break; + case 'R': + BrowseInformation = _True; + BrowseInformationFile = option+3; + break; + case 'r': + BrowseInformation = _True; + BrowseInformationFile = option+3; + break; + case 'U': + ForcedUsingFiles += option+3; + break; + case 'o': + ObjectFileName = option+3; + break; + case 'p': + PrecompiledHeaderOutputFile = option+3; + break; + case 'x': + ExpandAttributedSource = _True; + break; + default: + found = false; + break; + } + } + break; + case 'G': + switch (second) { + case 'F': + StringPooling = _True; + break; + case 'L': + WholeProgramOptimization = _True; + if(third == '-') + WholeProgramOptimization = _False; + break; + case 'R': + RuntimeTypeInfo = _True; + if(third == '-') + RuntimeTypeInfo = _False; + break; + case 'S': + BufferSecurityCheck = _True; + if(third == '-') + BufferSecurityCheck = _False; + break; + case 'T': + EnableFiberSafeOptimizations = _True; + break; + case 'd': + CallingConvention = "Cdecl"; + break; + case 'm': + MinimalRebuild = _True; + if(third == '-') + MinimalRebuild = _False; + break; + case 'r': + CallingConvention = "FastCall"; + break; + case 'y': + FunctionLevelLinking = _True; + break; + case 'z': + CallingConvention = "StdCall"; + break; + default: + found = false; + break; + } + break; + case 'H': + AdditionalOptions += option; + break; + case 'I': + AdditionalIncludeDirectories += option+2; + break; + case 'L': + if(second == 'D') { + AdditionalOptions += option; + break; + } + found = false; + break; + case 'M': + if(second == 'D') { + RuntimeLibrary = "MultiThreadedDLL"; + if(third == 'd') + RuntimeLibrary = "MultiThreadedDebugDLL"; + break; + } else if(second == 'P') { + MultiProcessorCompilation = _True; + ProcessorNumber = option+3; + break; + } else if(second == 'T') { + RuntimeLibrary = "MultiThreaded"; + if(third == 'd') + RuntimeLibrary = "MultiThreadedDebug"; + break; + } + found = false; + break; + case 'O': + switch (second) { + case '1': + Optimization = "MinSpace"; + break; + case '2': + Optimization = "MaxSpeed"; + break; + case 'b': + if(third == '0') + InlineFunctionExpansion = "Disabled"; + else if(third == '1') + InlineFunctionExpansion = "OnlyExplicitInline"; + else if(third == '2') + InlineFunctionExpansion = "AnySuitable"; + else + found = false; + break; + case 'd': + Optimization = "Disabled"; + break; + case 'i': + IntrinsicFunctions = _True; + break; + case 'p': + if(third == 'e') + OpenMPSupport = _True; + else + found = false; + break; + case 's': + FavorSizeOrSpeed = "Size"; + break; + case 't': + FavorSizeOrSpeed = "Speed"; + break; + case 'x': + Optimization = "Full"; + break; + case 'y': + OmitFramePointers = _True; + if(third == '-') + OmitFramePointers = _False; + break; + default: + found = false; + break; + } + break; + case 'P': + PreprocessToFile = _True; + break; + case 'Q': + if(second == 'I') { + AdditionalOptions += option; + break; + } + found = false; + break; + case 'R': + if(second == 'T' && third == 'C') { + if(fourth == '1') + BasicRuntimeChecks = "EnableFastChecks"; + else if(fourth == 'c') + SmallerTypeCheck = _True; + else if(fourth == 's') + BasicRuntimeChecks = "StackFrameRuntimeCheck"; + else if(fourth == 'u') + BasicRuntimeChecks = "UninitializedLocalUsageCheck"; + else + found = false; break; + } + break; + case 'T': + if(second == 'C') { + CompileAs = "CompileAsC"; + } else if(second == 'P') { + CompileAs = "CompileAsCpp"; + } else { + qWarning("Generator: Options '/Tp' and '/Tc' are not supported by qmake"); + found = false; break; + } + break; + case 'U': + UndefinePreprocessorDefinitions += option+2; + break; + case 'V': + AdditionalOptions += option; + break; + case 'W': + switch (second) { + case 'a': + WarningLevel = "EnableAllWarnings"; + break; + case '4': + WarningLevel = "Level4"; + break; + case '3': + WarningLevel = "Level3"; + break; + case '2': + WarningLevel = "Level2"; + break; + case '1': + WarningLevel = "Level1"; + break; + case '0': + WarningLevel = "TurnOffAllWarnings"; + break; + case 'L': + AdditionalOptions += option; + break; + case 'X': + TreatWarningAsError = _True; + break; + case 'p': + if(third == '6' && fourth == '4') { + // Deprecated for VS2010 but can be used under Additional Options. + AdditionalOptions += option; + break; + } + // Fallthrough + default: + found = false; break; + } + break; + case 'X': + IgnoreStandardIncludePath = _True; + break; + case 'Y': + switch (second) { + case '\0': + case '-': + AdditionalOptions += option; + break; + case 'c': + PrecompiledHeader = "Create"; + PrecompiledHeaderFile = option+3; + break; + case 'd': + case 'l': + AdditionalOptions += option; + break; + case 'u': + PrecompiledHeader = "Use"; + PrecompiledHeaderFile = option+3; + break; + default: + found = false; break; + } + break; + case 'Z': + switch (second) { + case '7': + DebugInformationFormat = "OldStyle"; + break; + case 'I': + DebugInformationFormat = "EditAndContinue"; + break; + case 'i': + DebugInformationFormat = "ProgramDatabase"; + break; + case 'l': + OmitDefaultLibName = _True; + break; + case 'a': + DisableLanguageExtensions = _True; + break; + case 'e': + DisableLanguageExtensions = _False; + break; + case 'c': + if(third == ':') { + const char *c = option + 4; + // Go to the end of the option + while ( *c != '\0' && *c != ' ' && *c != '-') + ++c; + if(fourth == 'f') + ForceConformanceInForLoopScope = ((*c) == '-' ? _False : _True); + else if(fourth == 'w') + TreatWChar_tAsBuiltInType = ((*c) == '-' ? _False : _True); + else + found = false; + } else { + found = false; break; + } + break; + case 'g': + case 'm': + case 's': + AdditionalOptions += option; + break; + case 'p': + switch (third) + { + case '\0': + case '1': + StructMemberAlignment = "1Byte"; + if(fourth == '6') + StructMemberAlignment = "16Bytes"; + break; + case '2': + StructMemberAlignment = "2Bytes"; + break; + case '4': + StructMemberAlignment = "4Bytes"; + break; + case '8': + StructMemberAlignment = "8Bytes"; + break; + default: + found = false; break; + } + break; + default: + found = false; break; + } + break; + case 'a': + if (second == 'r' && third == 'c' && fourth == 'h') { + if (option[5] == ':') { + const char *o = option; + if (o[6] == 'S' && o[7] == 'S' && o[8] == 'E') { + EnableEnhancedInstructionSet = o[9] == '2' ? "StreamingSIMDExtensions2" : "StreamingSIMDExtensions"; + break; + } + } + } else if (second == 'n' && third == 'a' && fourth == 'l') { + EnablePREfast = _True; + break; + } + found = false; + break; + case 'b': // see http://msdn.microsoft.com/en-us/library/fwkeyyhe%28VS.100%29.aspx + if (second == 'i' && third == 'g' && fourth == 'o') { + const char *o = option; + if (o[5] == 'b' && o[6] == 'j') { + AdditionalOptions += option; + break; + } + } + found = false; + break; + case 'c': + if(second == 'l') { + if(*(option+5) == 'p') { + CompileAsManaged = "Pure"; + } else if(*(option+5) == 's') { + CompileAsManaged = "Safe"; + } else if(*(option+5) == 'o') { + CompileAsManaged = "OldSyntax"; + } else { + CompileAsManaged = "true"; + } + } else { + found = false; + break; + } + break; + case 'd': + if(second != 'o' && third == 'c') { + GenerateXMLDocumentationFiles = _True; + XMLDocumentationFileName += option+4; + break; + } + found = false; + break; + case 'e': + if (second == 'r' && third == 'r' && fourth == 'o') { + if (option[12] == ':') { + if ( option[13] == 'n') { + ErrorReporting = "None"; + } else if (option[13] == 'p') { + ErrorReporting = "Prompt"; + } else if (option[13] == 'q') { + ErrorReporting = "Queue"; + } else if (option[13] == 's') { + ErrorReporting = "Send"; + } else { + found = false; + } + break; + } + } + found = false; + break; + case 'f': + if(second == 'p' && third == ':') { + // Go to the end of the option + const char *c = option + 4; + while (*c != '\0' && *c != ' ' && *c != '-') + ++c; + switch (fourth) { + case 'e': + FloatingPointExceptions = ((*c) == '-' ? _False : _True); + break; + case 'f': + FloatingPointModel = "Fast"; + break; + case 'p': + FloatingPointModel = "Precise"; + break; + case 's': + FloatingPointModel = "Strict"; + break; + default: + found = false; + break; + } + } + break; + case 'h': + if(second == 'o' && third == 't' && fourth == 'p') { + CreateHotpatchableImage = _True; + break; + } + qWarning("Generator: Option '/help': MSVC.NET projects do not support outputting help info"); + found = false; + break; + case 'n': + if(second == 'o' && third == 'l' && fourth == 'o') { + SuppressStartupBanner = _True; + break; + } + found = false; + break; + case 'o': + if (second == 'p' && third == 'e' && fourth == 'n') { + OpenMPSupport = _True; + break; + } + found = false; + break; + case 's': + if(second == 'h' && third == 'o' && fourth == 'w') { + ShowIncludes = _True; + break; + } + found = false; + break; + case 'u': + UndefineAllPreprocessorDefinitions = _True; + break; + case 'v': + if(second == 'd' || second == 'm') { + AdditionalOptions += option; + break; + } + found = false; + break; + case 'w': + switch (second) { + case 'd': + DisableSpecificWarnings += option+3; + break; + case 'e': + TreatSpecificWarningsAsErrors = option+3; + break; + default: + AdditionalOptions += option; + } + break; + default: + AdditionalOptions += option; + break; + } + if(!found) { + warn_msg(WarnLogic, "Could not parse Compiler option: %s, added as AdditionalOption", option); + AdditionalOptions += option; + } + return true; +} + +// VCLinkerTool ----------------------------------------------------- +VCXLinkerTool::VCXLinkerTool() + : AllowIsolation(unset), + AssemblyDebug(unset), + DataExecutionPrevention(unset), + DelaySign(unset), + EnableCOMDATFolding(unset), + EnableUAC(unset), + FixedBaseAddress(unset), + GenerateDebugInformation(unset), + GenerateManifest(unset), + GenerateMapFile(unset), + HeapCommitSize(-1), + HeapReserveSize(-1), + IgnoreAllDefaultLibraries(unset), + IgnoreEmbeddedIDL(unset), + IgnoreImportLibrary(_True), + ImageHasSafeExceptionHandlers(unset), + LargeAddressAware(unset), + LinkDLL(unset), + LinkIncremental(unset), + LinkStatus(unset), + MapExports(unset), + NoEntryPoint(unset), + OptimizeReferences(unset), + PreventDllBinding(unset), + RandomizedBaseAddress(unset), + RegisterOutput(unset), + SectionAlignment(-1), + SetChecksum(unset), + //StackCommitSize(-1), + //StackReserveSize(-1), + SupportNobindOfDelayLoadedDLL(unset), + SupportUnloadOfDelayLoadedDLL(unset), + SuppressStartupBanner(unset), + SwapRunFromCD(unset), + SwapRunFromNet(unset), + TerminalServerAware(unset), + TreatLinkerWarningAsErrors(unset), + TurnOffAssemblyGeneration(unset), + TypeLibraryResourceID(0), + UACUIAccess(unset) +{ +} + +XmlOutput &operator<<(XmlOutput &xml, const VCXLinkerTool &tool) +{ + return xml + << tag(_Link) + << attrTagX(_AdditionalDependencies, tool.AdditionalDependencies, ";") + << attrTagX(_AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories, ";") + << attrTagX(_AdditionalManifestDependencies, tool.AdditionalManifestDependencies, ";") + << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") + << attrTagX(_AddModuleNamesToAssembly, tool.AddModuleNamesToAssembly, ";") + << attrTagT(_AllowIsolation, tool.AllowIsolation) + << attrTagT(_AssemblyDebug, tool.AssemblyDebug) + << attrTagX(_AssemblyLinkResource, tool.AssemblyLinkResource, ";") + << attrTagS(_BaseAddress, tool.BaseAddress) + << attrTagS(_CLRImageType, tool.CLRImageType) + << attrTagS(_CLRSupportLastError, tool.CLRSupportLastError) + << attrTagS(_CLRThreadAttribute, tool.CLRThreadAttribute) + << attrTagS(_CLRUnmanagedCodeCheck, tool.CLRUnmanagedCodeCheck) + << attrTagS(_CreateHotPatchableImage, tool.CreateHotPatchableImage) + << attrTagT(_DataExecutionPrevention, tool.DataExecutionPrevention) + << attrTagX(_DelayLoadDLLs, tool.DelayLoadDLLs, ";") + << attrTagT(_DelaySign, tool.DelaySign) + << attrTagS(_Driver, tool.Driver) + << attrTagX(_EmbedManagedResourceFile, tool.EmbedManagedResourceFile, ";") + << attrTagT(_EnableCOMDATFolding, tool.EnableCOMDATFolding) + << attrTagT(_EnableUAC, tool.EnableUAC) + << attrTagS(_EntryPointSymbol, tool.EntryPointSymbol) + << attrTagT(_FixedBaseAddress, tool.FixedBaseAddress) + << attrTagS(_ForceFileOutput, tool.ForceFileOutput) + << attrTagX(_ForceSymbolReferences, tool.ForceSymbolReferences, ";") + << attrTagS(_FunctionOrder, tool.FunctionOrder) + << attrTagT(_GenerateDebugInformation, tool.GenerateDebugInformation) + << attrTagT(_GenerateManifest, tool.GenerateManifest) + << attrTagT(_GenerateMapFile, tool.GenerateMapFile) + << attrTagL(_HeapCommitSize, tool.HeapCommitSize, /*ifNot*/ -1) + << attrTagL(_HeapReserveSize, tool.HeapReserveSize, /*ifNot*/ -1) + << attrTagT(_IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries) + << attrTagT(_IgnoreEmbeddedIDL, tool.IgnoreEmbeddedIDL) + << attrTagT(_IgnoreImportLibrary, tool.IgnoreImportLibrary) + << attrTagX(_IgnoreSpecificDefaultLibraries, tool.IgnoreSpecificDefaultLibraries, ";") + << attrTagT(_ImageHasSafeExceptionHandlers, tool.ImageHasSafeExceptionHandlers) + << attrTagS(_ImportLibrary, tool.ImportLibrary) + << attrTagS(_KeyContainer, tool.KeyContainer) + << attrTagS(_KeyFile, tool.KeyFile) + << attrTagT(_LargeAddressAware, tool.LargeAddressAware) + << attrTagT(_LinkDLL, tool.LinkDLL) + << attrTagS(_LinkErrorReporting, tool.LinkErrorReporting) + << attrTagT(_LinkIncremental, tool.LinkIncremental) + << attrTagT(_LinkStatus, tool.LinkStatus) + << attrTagS(_LinkTimeCodeGeneration, tool.LinkTimeCodeGeneration) + << attrTagS(_ManifestFile, tool.ManifestFile) + << attrTagT(_MapExports, tool.MapExports) + << attrTagS(_MapFileName, tool.MapFileName) + << attrTagS(_MergedIDLBaseFileName, tool.MergedIDLBaseFileName) + << attrTagS(_MergeSections, tool.MergeSections) + << attrTagS(_MidlCommandFile, tool.MidlCommandFile) + << attrTagS(_ModuleDefinitionFile, tool.ModuleDefinitionFile) + << attrTagS(_MSDOSStubFileName, tool.MSDOSStubFileName) + << attrTagT(_NoEntryPoint, tool.NoEntryPoint) + << attrTagT(_OptimizeReferences, tool.OptimizeReferences) + << attrTagS(_OutputFile, tool.OutputFile) + << attrTagT(_PreventDllBinding, tool.PreventDllBinding) + << attrTagS(_Profile, tool.Profile) + << attrTagS(_ProfileGuidedDatabase, tool.ProfileGuidedDatabase) + << attrTagS(_ProgramDatabaseFile, tool.ProgramDatabaseFile) + << attrTagT(_RandomizedBaseAddress, tool.RandomizedBaseAddress) + << attrTagT(_RegisterOutput, tool.RegisterOutput) + << attrTagL(_SectionAlignment, tool.SectionAlignment, /*ifNot*/ -1) + << attrTagT(_SetChecksum, tool.SetChecksum) + << attrTagS(_ShowProgress, tool.ShowProgress) + << attrTagS(_SpecifySectionAttributes, tool.SpecifySectionAttributes) + << attrTagS(_StackCommitSize, tool.StackCommitSize) + << attrTagS(_StackReserveSize, tool.StackReserveSize) + << attrTagS(_StripPrivateSymbols, tool.StripPrivateSymbols) + << attrTagS(_SubSystem, tool.SubSystem) + << attrTagT(_SupportNobindOfDelayLoadedDLL, tool.SupportNobindOfDelayLoadedDLL) + << attrTagT(_SupportUnloadOfDelayLoadedDLL, tool.SupportUnloadOfDelayLoadedDLL) + << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) + << attrTagT(_SwapRunFromCD, tool.SwapRunFromCD) + << attrTagT(_SwapRunFromNet, tool.SwapRunFromNet) + << attrTagS(_TargetMachine, tool.TargetMachine) + << attrTagT(_TerminalServerAware, tool.TerminalServerAware) + << attrTagT(_TreatLinkerWarningAsErrors, tool.TreatLinkerWarningAsErrors) + << attrTagT(_TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration) + << attrTagS(_TypeLibraryFile, tool.TypeLibraryFile) + << attrTagL(_TypeLibraryResourceID, tool.TypeLibraryResourceID, /*ifNot*/ 0) + << attrTagS(_UACExecutionLevel, tool.UACExecutionLevel) + << attrTagT(_UACUIAccess, tool.UACUIAccess) + << attrTagS(_Version, tool.Version) + << closetag(_Link); +} + +// Hashing routine to do fast option lookups ---- +// Slightly rewritten to stop on ':' ',' and '\0' +// Original routine in qtranslator.cpp ---------- +static uint elfHash(const char* name) +{ + const uchar *k; + uint h = 0; + uint g; + + if(name) { + k = (const uchar *) name; + while((*k) && + (*k)!= ':' && + (*k)!=',' && + (*k)!=' ') { + h = (h << 4) + *k++; + if((g = (h & 0xf0000000)) != 0) + h ^= g >> 24; + h &= ~g; + } + } + if(!h) + h = 1; + return h; +} + +//#define USE_DISPLAY_HASH +#ifdef USE_DISPLAY_HASH +static void displayHash(const char* str) +{ + printf("case 0x%07x: // %s\n break;\n", elfHash(str), str); +} +#endif + +bool VCXLinkerTool::parseOption(const char* option) +{ +#ifdef USE_DISPLAY_HASH + // Main options + displayHash("/ALIGN"); displayHash("/ALLOWBIND"); displayHash("/ASSEMBLYMODULE"); + displayHash("/ASSEMBLYRESOURCE"); displayHash("/BASE"); displayHash("/DEBUG"); + displayHash("/DEF"); displayHash("/DEFAULTLIB"); displayHash("/DELAY"); + displayHash("/DELAYLOAD"); displayHash("/DLL"); displayHash("/DRIVER"); + displayHash("/ENTRY"); displayHash("/EXETYPE"); displayHash("/EXPORT"); + displayHash("/FIXED"); displayHash("/FORCE"); displayHash("/HEAP"); + displayHash("/IDLOUT"); displayHash("/IGNORE"); displayHash("/IGNOREIDL"); displayHash("/IMPLIB"); + displayHash("/INCLUDE"); displayHash("/INCREMENTAL"); displayHash("/LARGEADDRESSAWARE"); + displayHash("/LIBPATH"); displayHash("/LTCG"); displayHash("/MACHINE"); + displayHash("/MAP"); displayHash("/MAPINFO"); displayHash("/MERGE"); + displayHash("/MIDL"); displayHash("/NOASSEMBLY"); displayHash("/NODEFAULTLIB"); + displayHash("/NOENTRY"); displayHash("/NOLOGO"); displayHash("/OPT"); + displayHash("/ORDER"); displayHash("/OUT"); displayHash("/PDB"); + displayHash("/PDBSTRIPPED"); displayHash("/RELEASE"); displayHash("/SECTION"); + displayHash("/STACK"); displayHash("/STUB"); displayHash("/SUBSYSTEM"); + displayHash("/SWAPRUN"); displayHash("/TLBID"); displayHash("/TLBOUT"); + displayHash("/TSAWARE"); displayHash("/VERBOSE"); displayHash("/VERSION"); + displayHash("/VXD"); displayHash("/WS "); displayHash("/libpath"); + +#endif +#ifdef USE_DISPLAY_HASH + // Sub options + displayHash("UNLOAD"); displayHash("NOBIND"); displayHash("no"); displayHash("NOSTATUS"); displayHash("STATUS"); + displayHash("AM33"); displayHash("ARM"); displayHash("CEE"); displayHash("EBC"); displayHash("IA64"); displayHash("X86"); displayHash("X64"); displayHash("M32R"); + displayHash("MIPS"); displayHash("MIPS16"); displayHash("MIPSFPU"); displayHash("MIPSFPU16"); displayHash("MIPSR41XX"); displayHash("PPC"); + displayHash("SH3"); displayHash("SH3DSP"); displayHash("SH4"); displayHash("SH5"); displayHash("THUMB"); displayHash("TRICORE"); displayHash("EXPORTS"); + displayHash("LINES"); displayHash("REF"); displayHash("NOREF"); displayHash("ICF"); displayHash("WIN98"); displayHash("NOWIN98"); + displayHash("CONSOLE"); displayHash("EFI_APPLICATION"); displayHash("EFI_BOOT_SERVICE_DRIVER"); displayHash("EFI_ROM"); displayHash("EFI_RUNTIME_DRIVER"); displayHash("NATIVE"); + displayHash("POSIX"); displayHash("WINDOWS"); displayHash("WINDOWSCE"); displayHash("NET"); displayHash("CD"); displayHash("NO"); +#endif + bool found = true; + switch (elfHash(option)) { + case 0x6b21972: // /DEFAULTLIB:library + case 0xaca9d75: // /EXETYPE[:DYNAMIC | :DEV386] + case 0x3ad5444: // /EXPORT:entryname[,@ordinal[,NONAME]][,DATA] + case 0x3dc3455: // /IGNORE:number,number,number,number ### NOTE: This one is undocumented, but it is even used by Microsoft. + // In recent versions of the Microsoft linker they have disabled this undocumented feature. + case 0x0034bc4: // /VXD + AdditionalOptions += option; + break; + case 0x3360dbe: // /ALIGN[:number] + SectionAlignment = QString(option+7).toLongLong(); + break; + case 0x1485c34: // /ALLOWBIND[:NO] + if(*(option+10) == ':' && (*(option+11) == 'n' || *(option+11) == 'N')) + PreventDllBinding = _False; + else + PreventDllBinding = _True; + break; + case 0x312011e: // /ALLOWISOLATION[:NO] + if(*(option+15) == ':' && (*(option+16) == 'n' || *(option+16) == 'N')) + AllowIsolation = _False; + else + AllowIsolation = _True; + break; + case 0x679c075: // /ASSEMBLYMODULE:filename + AddModuleNamesToAssembly += option+15; + break; + case 0x75f35f7: // /ASSEMBLYDEBUG[:DISABLE] + if(*(option+14) == ':' && (*(option+15) == 'D')) + AssemblyDebug = _False; + else + AssemblyDebug = _True; + break; + case 0x43294a5: // /ASSEMBLYLINKRESOURCE:filename + AssemblyLinkResource += option+22; + break; + case 0x062d065: // /ASSEMBLYRESOURCE:filename + EmbedManagedResourceFile += option+18; + break; + case 0x0336675: // /BASE:{address | @filename,key} + // Do we need to do a manual lookup when '@filename,key'? + // Seems BaseAddress only can contain the location... + // We don't use it in Qt, so keep it simple for now + BaseAddress = option+6; + break; + case 0x63bf065: // /CLRIMAGETYPE:{IJW|PURE|SAFE} + if(*(option+14) == 'I') + CLRImageType = "ForceIJWImage"; + else if(*(option+14) == 'P') + CLRImageType = "ForcePureILImage"; + else if(*(option+14) == 'S') + CLRImageType = "ForceSafeILImage"; + break; + case 0x5f2a6a2: // /CLRSUPPORTLASTERROR{:NO | SYSTEMDLL} + if(*(option+20) == ':') { + if(*(option+21) == 'N') { + CLRSupportLastError = "Disabled"; + } else if(*(option+21) == 'S') { + CLRSupportLastError = "SystemDlls"; + } + } else { + CLRSupportLastError = "Enabled"; + } + break; + case 0xc7984f5: // /CLRTHREADATTRIBUTE:{STA|MTA|NONE} + if(*(option+20) == 'N') + CLRThreadAttribute = "DefaultThreadingAttribute"; + else if(*(option+20) == 'M') + CLRThreadAttribute = "MTAThreadingAttribute"; + else if(*(option+20) == 'S') + CLRThreadAttribute = "STAThreadingAttribute"; + break; + case 0xa8c637b: // /CLRUNMANAGEDCODECHECK[:NO] + if(*(option+23) == 'N') + CLRUnmanagedCodeCheck = _False; + else + CLRUnmanagedCodeCheck = _True; + break; + case 0x3389797: // /DEBUG + GenerateDebugInformation = _True; + break; + case 0x0033896: // /DEF:filename + ModuleDefinitionFile = option+5; + break; + case 0x338a069: // /DELAY:{UNLOAD | NOBIND} + if(*(option+7) == 'U') + SupportNobindOfDelayLoadedDLL = _True; + else if(*(option+7) == 'N') + SupportUnloadOfDelayLoadedDLL = _True; + break; + case 0x06f4bf4: // /DELAYLOAD:dllname + DelayLoadDLLs += option+11; + break; + case 0x06d451e: // /DELAYSIGN[:NO] + if(*(option+10) == ':' && (*(option+11) == 'n' || *(option+11) == 'N')) + DelaySign = _False; + else + DelaySign = _True; + break; + case 0x003390c: // /DLL + LinkDLL = _True; + break; + case 0x396ea92: // /DRIVER[:UPONLY | :WDM] + if((*(option+7) == ':') && (*(option+8) == 'U')) + Driver = "UpOnly"; + else if((*(option+7) == ':') && (*(option+8) == 'W')) + Driver = "WDM"; + else + Driver = "Driver"; + break; + case 0x2ee8415: // /DYNAMICBASE[:NO] + if(*(option+12) == ':' && (*(option+13) == 'n' || *(option+13) == 'N')) + RandomizedBaseAddress = _False; + else + RandomizedBaseAddress = _True; + break; + case 0x33a3979: // /ENTRY:function + EntryPointSymbol = option+7; + break; + case 0x4504334: // /ERRORREPORT:[ NONE | PROMPT | QUEUE | SEND ] + if(*(option+12) == ':' ) { + if(*(option+13) == 'N') + LinkErrorReporting = "NoErrorReport"; + else if(*(option+13) == 'P') + LinkErrorReporting = "PromptImmediately"; + else if(*(option+13) == 'Q') + LinkErrorReporting = "QueueForNextLogin"; + else if(*(option+13) == 'S') + LinkErrorReporting = "SendErrorReport"; + } + break; + case 0x33aec94: // /FIXED[:NO] + if(*(option+6) == ':' && (*(option+7) == 'n' || *(option+7) == 'N')) + FixedBaseAddress = _False; + else + FixedBaseAddress = _True; + break; + case 0x33b4675: // /FORCE:[MULTIPLE|UNRESOLVED] + if(*(option+6) == ':' && *(option+7) == 'M' ) + ForceFileOutput = "MultiplyDefinedSymbolOnly"; + else if(*(option+6) == ':' && *(option+7) == 'U' ) + ForceFileOutput = "UndefinedSymbolOnly"; + else + ForceFileOutput = "Enabled"; + break; + case 0x96d4e4e: // /FUNCTIONPADMIN[:space] + if(*(option+15) == ':') { + if(*(option+16) == '5') + CreateHotPatchableImage = "X86Image"; + else if(*(option+16) == '6') + CreateHotPatchableImage = "X64Image"; + else if((*(option+16) == '1') && (*(option+17) == '6')) + CreateHotPatchableImage = "ItaniumImage"; + } else { + CreateHotPatchableImage = "Enabled"; + } + break; + case 0x033c960: // /HEAP:reserve[,commit] + { + QStringList both = QString(option+6).split(","); + HeapReserveSize = both[0].toLongLong(); + if(both.count() == 2) + HeapCommitSize = both[1].toLongLong(); + } + break; + case 0x3d91494: // /IDLOUT:[path\]filename + MergedIDLBaseFileName = option+8; + break; + case 0x345a04c: // /IGNOREIDL + IgnoreEmbeddedIDL = _True; + break; + case 0x3e250e2: // /IMPLIB:filename + ImportLibrary = option+8; + break; + case 0xe281ab5: // /INCLUDE:symbol + ForceSymbolReferences += option+9; + break; + case 0xb28103c: // /INCREMENTAL[:no] + if(*(option+12) == ':' && + (*(option+13) == 'n' || *(option+13) == 'N')) + LinkIncremental = _False; + else + LinkIncremental = _True; + break; + case 0x07f1ab2: // /KEYCONTAINER:name + KeyContainer = option+14; + break; + case 0xfadaf35: // /KEYFILE:filename + KeyFile = option+9; + break; + case 0x26e4675: // /LARGEADDRESSAWARE[:no] + if(*(option+18) == ':' && + *(option+19) == 'n') + LargeAddressAware = _False; + else + LargeAddressAware = _True; + break; + case 0x2f96bc8: // /libpath:dir + case 0x0d745c8: // /LIBPATH:dir + AdditionalLibraryDirectories += option+9; + break; + case 0x0341877: // /LTCG[:NOSTATUS|:STATUS] + config->WholeProgramOptimization = _True; + LinkTimeCodeGeneration = "UseLinkTimeCodeGeneration"; + if(*(option+5) == ':') { + const char* str = option+6; + if (*str == 'S') + LinkStatus = _True; + else if (*str == 'N') + LinkStatus = _False; +#ifndef Q_OS_WIN + else if (strncasecmp(str, "pginstrument", 12)) + LinkTimeCodeGeneration = "PGInstrument"; + else if (strncasecmp(str, "pgoptimize", 10)) + LinkTimeCodeGeneration = "PGOptimization"; + else if (strncasecmp(str, "pgupdate", 8 )) + LinkTimeCodeGeneration = "PGUpdate"; +#else + + else if (_stricmp(str, "pginstrument")) + LinkTimeCodeGeneration = "PGInstrument"; + else if (_stricmp(str, "pgoptimize")) + LinkTimeCodeGeneration = "PGOptimization"; + else if (_stricmp(str, "pgupdate")) + LinkTimeCodeGeneration = "PGUpdate"; +#endif + } + break; + case 0x379ED25: + case 0x157cf65: // /MACHINE:{AM33|ARM|CEE|IA64|X86|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|PPC|SH3|SH4|SH5|THUMB|TRICORE} + switch (elfHash(option+9)) { + case 0x0005bb6: // X86 + TargetMachine = "MachineX86"; + break; + case 0x0005b94: // X64 + TargetMachine = "MachineX64"; + break; + case 0x000466d: // ARM + TargetMachine = "MachineARM"; + break; + case 0x0004963: // EBC + TargetMachine = "MachineEBC"; + break; + case 0x004d494: // IA64 + TargetMachine = "MachineIA64"; + break; + case 0x0051e53: // MIPS + TargetMachine = "MachineMIPS"; + break; + case 0x51e5646: // MIPS16 + TargetMachine = "MachineMIPS16"; + break; + case 0x1e57b05: // MIPSFPU + TargetMachine = "MachineMIPSFPU"; + break; + case 0x57b09a6: // MIPSFPU16 + TargetMachine = "MachineMIPSFPU16"; + break; + case 0x00057b4: // SH4 + TargetMachine = "MachineSH4"; + break; + case 0x058da12: // THUMB + TargetMachine = "MachineTHUMB"; + break; + // put the others in AdditionalOptions... + case 0x0046063: // AM33 + case 0x0004795: // CEE + case 0x0050672: // M32R + case 0x5852738: // MIPSR41XX + case 0x0005543: // PPC + case 0x00057b3: // SH3 + case 0x57b7980: // SH3DSP + case 0x00057b5: // SH5 + case 0x96d8435: // TRICORE + default: + AdditionalOptions += option; + break; + } + break; + case 0x62d9e94: // /MANIFEST[:NO] + if ((*(option+9) == ':' && (*(option+10) == 'N' || *(option+10) == 'n'))) + GenerateManifest = _False; + else + GenerateManifest = _True; + break; + case 0x8b64559: // /MANIFESTDEPENDENCY:manifest_dependency + AdditionalManifestDependencies += option+20; + break; + case 0xe9e8195: // /MANIFESTFILE:filename + ManifestFile = option+14; + break; + case 0x9e9fb83: // /MANIFESTUAC http://msdn.microsoft.com/en-us/library/bb384691%28VS.100%29.aspx + if ((*(option+12) == ':' && (*(option+13) == 'N' || *(option+13) == 'n'))) + EnableUAC = _False; + else if((*(option+12) == ':' && (*(option+13) == 'l' || *(option+14) == 'e'))) { // level + if(*(option+20) == 'a') + UACExecutionLevel = "AsInvoker"; + else if(*(option+20) == 'h') + UACExecutionLevel = "HighestAvailable"; + else if(*(option+20) == 'r') + UACExecutionLevel = "RequireAdministrator"; + } else if((*(option+12) == ':' && (*(option+13) == 'u' || *(option+14) == 'i'))) { // uiAccess + if(*(option+22) == 't') + UACUIAccess = _True; + else + UACUIAccess = _False; + } else if((*(option+12) == ':' && (*(option+13) == 'f' || *(option+14) == 'r'))) { // fragment + AdditionalOptions += option; + }else + EnableUAC = _True; + break; + case 0x0034160: // /MAP[:filename] + GenerateMapFile = _True; + MapFileName = option+5; + break; + case 0x164e1ef: // /MAPINFO:{EXPORTS} + if(*(option+9) == 'E') + MapExports = _True; + break; + case 0x341a6b5: // /MERGE:from=to + MergeSections = option+7; + break; + case 0x0341d8c: // /MIDL:@file + MidlCommandFile = option+7; + break; + case 0x84e2679: // /NOASSEMBLY + TurnOffAssemblyGeneration = _True; + break; + case 0x2b21942: // /NODEFAULTLIB[:library] + if(*(option+13) == '\0') + IgnoreAllDefaultLibraries = _True; + else + IgnoreSpecificDefaultLibraries += option+14; + break; + case 0x33a3a39: // /NOENTRY + NoEntryPoint = _True; + break; + case 0x434138f: // /NOLOGO + SuppressStartupBanner = _True; + break; + case 0xc841054: // /NXCOMPAT[:NO] + if ((*(option+9) == ':' && (*(option+10) == 'N' || *(option+10) == 'n'))) + DataExecutionPrevention = _False; + else + DataExecutionPrevention = _True; + break; + case 0x0034454: // /OPT:{REF | NOREF | ICF[=iterations] | NOICF | WIN98 | NOWIN98} + { + char third = *(option+7); + switch (third) { + case 'F': // REF + if(*(option+5) == 'R') { + OptimizeReferences = _True; + } else { // ICF[=iterations] + EnableCOMDATFolding = _True; + // [=iterations] case is not documented + } + break; + case 'R': // NOREF + OptimizeReferences = _False; + break; + case 'I': // NOICF + EnableCOMDATFolding = _False; + break; + default: + found = false; + } + } + break; + case 0x34468a2: // /ORDER:@filename + FunctionOrder = option+8; + break; + case 0x00344a4: // /OUT:filename + OutputFile = option+5; + break; + case 0x0034482: // /PDB:filename + ProgramDatabaseFile = option+5; + break; + case 0xa2ad314: // /PDBSTRIPPED:pdb_file_name + StripPrivateSymbols = option+13; + break; + case 0x00344b4: // /PGD:filename + ProfileGuidedDatabase = option+5; + break; + case 0x573af45: // /PROFILE + Profile = _True; + break; + case 0x6a09535: // /RELEASE + SetChecksum = _True; + break; + case 0x75AA4D8: // /SAFESEH:{NO} + { + if(*(option+8) == ':' && *(option+9) == 'N') + ImageHasSafeExceptionHandlers = _False; + else + ImageHasSafeExceptionHandlers = _True; + } + break; + case 0x7988f7e: // /SECTION:name,[E][R][W][S][D][K][L][P][X][,ALIGN=#] + SpecifySectionAttributes = option+9; + break; + case 0x348857b: // /STACK:reserve[,commit] + { + QStringList both = QString(option+7).split(","); + StackReserveSize = both[0].toLongLong(); + if(both.count() == 2) + StackCommitSize = both[1].toLongLong(); + } + break; + case 0x0348992: // /STUB:filename + MSDOSStubFileName = option+6; + break; + case 0x9B3C00D: + case 0x78dc00d: // /SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|WINDOWSCE}[,major[.minor]] + { + // Split up in subsystem, and version number + QStringList both = QString(option+11).split(","); + switch (elfHash(both[0].toLatin1())) { + case 0x8438445: // CONSOLE + SubSystem = "Console"; + break; + case 0xbe29493: // WINDOWS + SubSystem = "Windows"; + break; + case 0x5268ea5: // NATIVE + SubSystem = "Native"; + break; + case 0x240949e: // EFI_APPLICATION + SubSystem = "EFI Application"; + break; + case 0xe617652: // EFI_BOOT_SERVICE_DRIVER + SubSystem = "EFI Boot Service Driver"; + break; + case 0x9af477d: // EFI_ROM + SubSystem = "EFI ROM"; + break; + case 0xd34df42: // EFI_RUNTIME_DRIVER + SubSystem = "EFI Runtime"; + break; + case 0x2949c95: // WINDOWSCE + SubSystem = "WindowsCE"; + break; + case 0x05547e8: // POSIX + SubSystem = "POSIX"; + break; + // The following are undocumented, so add them to AdditionalOptions + case 0x4B69795: // windowsce + AdditionalOptions += option; + break; + default: + found = false; + } + } + break; + case 0x8b654de: // /SWAPRUN:{NET | CD} + if(*(option+9) == 'N') + SwapRunFromNet = _True; + else if(*(option+9) == 'C') + SwapRunFromCD = _True; + else + found = false; + break; + case 0x34906d4: // /TLBID:id + TypeLibraryResourceID = QString(option+7).toLongLong(); + break; + case 0x4907494: // /TLBOUT:[path\]filename + TypeLibraryFile = option+8; + break; + case 0x976b525: // /TSAWARE[:NO] + if(*(option+8) == ':') + TerminalServerAware = _False; + else + TerminalServerAware = _True; + break; + case 0xaa67735: // /VERBOSE[:ICF |:LIB |:REF |:SAFESEH] + if(*(option+9) == ':') { + if (*(option+10) == 'I') { + ShowProgress = "LinkVerboseICF"; + } else if ( *(option+10) == 'L') { + ShowProgress = "LinkVerboseLib"; + } else if ( *(option+10) == 'R') { + ShowProgress = "LinkVerboseREF"; + } else if ( *(option+10) == 'S') { + ShowProgress = "LinkVerboseSAFESEH"; + } else if ( *(option+10) == 'C') { + ShowProgress = "LinkVerboseCLR"; + } + } else { + ShowProgress = "LinkVerbose"; + } + break; + case 0xaa77f7e: // /VERSION:major[.minor] + Version = option+9; + break; + case 0x0034c50: // /WS[:NO] + if(*(option+3) == ':') + TreatLinkerWarningAsErrors = _False; + else + TreatLinkerWarningAsErrors = _True; + break; + default: + AdditionalOptions += option; + break; + } + if(!found) { + warn_msg(WarnLogic, "Could not parse Linker options: %s, added as AdditionalOption", option); + AdditionalOptions += option; + } + return found; +} + +// VCMIDLTool ------------------------------------------------------- +VCXMIDLTool::VCXMIDLTool() + : ApplicationConfigurationMode(unset), + ErrorCheckAllocations(unset), + ErrorCheckBounds(unset), + ErrorCheckEnumRange(unset), + ErrorCheckRefPointers(unset), + ErrorCheckStubData(unset), + GenerateStublessProxies(unset), + GenerateTypeLibrary(unset), + IgnoreStandardIncludePath(unset), + LocaleID(-1), + MkTypLibCompatible(unset), + SuppressCompilerWarnings(unset), + SuppressStartupBanner(unset), + ValidateAllParameters(unset), + WarnAsError(unset) +{ +} + +XmlOutput &operator<<(XmlOutput &xml, const VCXMIDLTool &tool) +{ + return xml + << tag(_Midl) + << attrTagX(_AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories, ";") + << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") + << attrTagT(_ApplicationConfigurationMode, tool.ApplicationConfigurationMode) + << attrTagS(_ClientStubFile, tool.ClientStubFile) + << attrTagS(_CPreprocessOptions, tool.CPreprocessOptions) + << attrTagS(_DefaultCharType, tool.DefaultCharType) + << attrTagS(_DLLDataFileName, tool.DLLDataFileName) + << attrTagS(_EnableErrorChecks, tool.EnableErrorChecks) + << attrTagT(_ErrorCheckAllocations, tool.ErrorCheckAllocations) + << attrTagT(_ErrorCheckBounds, tool.ErrorCheckBounds) + << attrTagT(_ErrorCheckEnumRange, tool.ErrorCheckEnumRange) + << attrTagT(_ErrorCheckRefPointers, tool.ErrorCheckRefPointers) + << attrTagT(_ErrorCheckStubData, tool.ErrorCheckStubData) + << attrTagS(_GenerateClientFiles, tool.GenerateClientFiles) + << attrTagS(_GenerateServerFiles, tool.GenerateServerFiles) + << attrTagT(_GenerateStublessProxies, tool.GenerateStublessProxies) + << attrTagT(_GenerateTypeLibrary, tool.GenerateTypeLibrary) + << attrTagS(_HeaderFileName, tool.HeaderFileName) + << attrTagT(_IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath) + << attrTagS(_InterfaceIdentifierFileName, tool.InterfaceIdentifierFileName) + << attrTagL(_LocaleID, tool.LocaleID, /*ifNot*/ -1) + << attrTagT(_MkTypLibCompatible, tool.MkTypLibCompatible) + << attrTagS(_OutputDirectory, tool.OutputDirectory) + << attrTagX(_PreprocessorDefinitions, tool.PreprocessorDefinitions, ";") + << attrTagS(_ProxyFileName, tool.ProxyFileName) + << attrTagS(_RedirectOutputAndErrors, tool.RedirectOutputAndErrors) + << attrTagS(_ServerStubFile, tool.ServerStubFile) + << attrTagS(_StructMemberAlignment, tool.StructMemberAlignment) + << attrTagT(_SuppressCompilerWarnings, tool.SuppressCompilerWarnings) + << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) + << attrTagS(_TargetEnvironment, tool.TargetEnvironment) + << attrTagS(_TypeLibFormat, tool.TypeLibFormat) + << attrTagS(_TypeLibraryName, tool.TypeLibraryName) + << attrTagX(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions, ";") + << attrTagT(_ValidateAllParameters, tool.ValidateAllParameters) + << attrTagT(_WarnAsError, tool.WarnAsError) + << attrTagS(_WarningLevel, tool.WarningLevel) + << closetag(_Midl); +} + +bool VCXMIDLTool::parseOption(const char* option) +{ +#ifdef USE_DISPLAY_HASH + displayHash("/D name[=def]"); displayHash("/I directory-list"); displayHash("/Oi"); + displayHash("/Oic"); displayHash("/Oicf"); displayHash("/Oif"); displayHash("/Os"); + displayHash("/U name"); displayHash("/WX"); displayHash("/W{0|1|2|3|4}"); + displayHash("/Zp {N}"); displayHash("/Zs"); displayHash("/acf filename"); + displayHash("/align {N}"); displayHash("/app_config"); displayHash("/c_ext"); + displayHash("/char ascii7"); displayHash("/char signed"); displayHash("/char unsigned"); + displayHash("/client none"); displayHash("/client stub"); displayHash("/confirm"); + displayHash("/cpp_cmd cmd_line"); displayHash("/cpp_opt options"); + displayHash("/cstub filename"); displayHash("/dlldata filename"); displayHash("/env win32"); + displayHash("/env win64"); displayHash("/error all"); displayHash("/error allocation"); + displayHash("/error bounds_check"); displayHash("/error enum"); displayHash("/error none"); + displayHash("/error ref"); displayHash("/error stub_data"); displayHash("/h filename"); + displayHash("/header filename"); displayHash("/iid filename"); displayHash("/lcid"); + displayHash("/mktyplib203"); displayHash("/ms_ext"); displayHash("/ms_union"); + displayHash("/msc_ver "); displayHash("/newtlb"); displayHash("/no_cpp"); + displayHash("/no_def_idir"); displayHash("/no_default_epv"); displayHash("/no_format_opt"); + displayHash("/no_warn"); displayHash("/nocpp"); displayHash("/nologo"); displayHash("/notlb"); + displayHash("/o filename"); displayHash("/oldnames"); displayHash("/oldtlb"); + displayHash("/osf"); displayHash("/out directory"); displayHash("/pack {N}"); + displayHash("/prefix all"); displayHash("/prefix client"); displayHash("/prefix server"); + displayHash("/prefix switch"); displayHash("/protocol all"); displayHash("/protocol dce"); + displayHash("/protocol ndr64"); displayHash("/proxy filename"); displayHash("/robust"); + displayHash("/rpcss"); displayHash("/savePP"); displayHash("/server none"); + displayHash("/server stub"); displayHash("/sstub filename"); displayHash("/syntax_check"); + displayHash("/target {system}"); displayHash("/tlb filename"); displayHash("/use_epv"); + displayHash("/win32"); displayHash("/win64"); +#endif + bool found = true; + int offset = 0; + switch(elfHash(option)) { + case 0x0000334: // /D name[=def] + PreprocessorDefinitions += option+3; + break; + case 0x0000339: // /I directory-list + AdditionalIncludeDirectories += option+3; + break; + case 0x0345f96: // /Oicf + case 0x00345f6: // /Oif + GenerateStublessProxies = _True; + break; + case 0x0000345: // /U name + UndefinePreprocessorDefinitions += option+3; + break; + case 0x00034c8: // /WX + WarnAsError = _True; + break; + case 0x3582fde: // /align {N} + offset = 3; // Fallthrough + case 0x0003510: // /Zp {N} + switch (*(option+offset+4)) { + case '1': + StructMemberAlignment = (*(option+offset+5) == '\0') ? "1" : "16"; + break; + case '2': + StructMemberAlignment = "2"; + break; + case '4': + StructMemberAlignment = "4"; + break; + case '8': + StructMemberAlignment = "8"; + break; + default: + found = false; + } + break; + case 0x5b1cb97: // /app_config + ApplicationConfigurationMode = _True; + break; + case 0x0359e82: // /char {ascii7|signed|unsigned} + switch(*(option+6)) { + case 'a': + DefaultCharType = "Ascii"; + break; + case 's': + DefaultCharType = "Signed"; + break; + case 'u': + DefaultCharType = "Unsigned"; + break; + default: + found = false; + } + break; + case 0x5a2fc64: // /client {none|stub} + if(*(option+8) == 's') + GenerateClientFiles = "Stub"; + else + GenerateClientFiles = "None"; + break; + case 0xa766524: // /cpp_opt options + CPreprocessOptions += option+9; + break; + case 0x35aabb2: // /cstub filename + ClientStubFile = option+7; + break; + case 0xb32abf1: // /dlldata filename + DLLDataFileName = option + 9; + break; + case 0x0035c56: // /env {win32|ia64|x64} + if(*(option+7) == 'w' && *(option+10) == '3') + TargetEnvironment = "Win32"; + else if(*(option+7) == 'i') + TargetEnvironment = "Itanium"; + else if(*(option+7) == 'x') + TargetEnvironment = "X64"; + else + AdditionalOptions += option; + break; + case 0x35c9962: // /error {all|allocation|bounds_check|enum|none|ref|stub_data} + EnableErrorChecks = midlEnableCustom; + switch (*(option+7)) { + case '\0': + EnableErrorChecks = "EnableCustom"; + break; + case 'a': + if(*(option+10) == '\0') + EnableErrorChecks = "All"; + else + ErrorCheckAllocations = _True; + break; + case 'b': + ErrorCheckBounds = _True; + break; + case 'e': + ErrorCheckEnumRange = _True; + break; + case 'n': + EnableErrorChecks = "None"; + break; + case 'r': + ErrorCheckRefPointers = _True; + break; + case 's': + ErrorCheckStubData = _True; + break; + default: + found = false; + } + break; + case 0x5eb7af2: // /header filename + offset = 5; + case 0x0000358: // /h filename + HeaderFileName = option + offset + 3; + break; + case 0x0035ff4: // /iid filename + InterfaceIdentifierFileName = option+5; + break; + case 0x64b7933: // /mktyplib203 + MkTypLibCompatible = _True; + break; + case 0x64ceb12: // /newtlb + TypeLibFormat = "NewFormat"; + break; + case 0x8e0b0a2: // /no_def_idir + IgnoreStandardIncludePath = _True; + break; + case 0x65635ef: // /nologo + SuppressStartupBanner = _True; + break; + case 0x695e9f4: // /no_robust + ValidateAllParameters = _False; + break; + case 0x3656b22: // /notlb + GenerateTypeLibrary = _True; + break; + case 0x556dbee: // /no_warn + SuppressCompilerWarnings = _True; + break; + case 0x000035f: // /o filename + RedirectOutputAndErrors = option+3; + break; + case 0x662bb12: // /oldtlb + TypeLibFormat = "OldFormat"; + break; + case 0x00366c4: // /out directory + OutputDirectory = option+5; + break; + case 0x36796f9: // /proxy filename + ProxyFileName = option+7; + break; + case 0x6959c94: // /robust + ValidateAllParameters = _True; + break; + case 0x69c9cf2: // /server {none|stub} + if(*(option+8) == 's') + GenerateServerFiles = "Stub"; + else + GenerateServerFiles = "None"; + break; + case 0x36aabb2: // /sstub filename + ServerStubFile = option+7; + break; + case 0x0036b22: // /tlb filename + TypeLibraryName = option+5; + break; + case 0x36e0162: // /win32 + TargetEnvironment = "Win32"; + break; + case 0x36e0194: // /win64 + TargetEnvironment = "Itanium"; + break; + case 0x0003459: // /Oi + case 0x00345f3: // /Oic + case 0x0003463: // /Os + case 0x0003513: // /Zs + case 0x0035796: // /acf filename + case 0x3595cf4: // /c_ext + case 0xa64d3dd: // /confirm + case 0xa765b64: // /cpp_cmd cmd_line + case 0x03629f4: // /lcid + case 0x6495cc4: // /ms_ext + case 0x96c7a1e: // /ms_union + case 0x4996fa2: // /msc_ver + case 0x6555a40: // /no_cpp + case 0xf64d6a6: // /no_default_epv + case 0x6dd9384: // /no_format_opt + case 0x3655a70: // /nocpp + case 0x2b455a3: // /oldnames + case 0x0036696: // /osf + case 0x036679b: // /pack {N} + case 0x678bd38: // /prefix {all|client|server|switch} + case 0x96b702c: // /protocol {all|dce|ndr64} + case 0x3696aa3: // /rpcss + case 0x698ca60: // /savePP + case 0xce9b12b: // /syntax_check + case 0xc9b5f16: // /use_epv + AdditionalOptions += option; + break; + default: + // /W{0|1|2|3|4} case + if(*(option+1) == 'W') { + switch (*(option+2)) { + case '0': + WarningLevel = "0"; + break; + case '1': + WarningLevel = "1"; + break; + case '2': + WarningLevel = "2"; + break; + case '3': + WarningLevel = "3"; + break; + case '4': + WarningLevel = "4"; + break; + default: + found = false; + } + } + break; + } + if(!found) + warn_msg(WarnLogic, "Could not parse MIDL option: %s", option); + return true; +} + +// VCLibrarianTool -------------------------------------------------- +VCXLibrarianTool::VCXLibrarianTool() + : IgnoreAllDefaultLibraries(unset), + LinkTimeCodeGeneration(unset), + SuppressStartupBanner(_True), + TreatLibWarningAsErrors(unset), + Verbose(unset) +{ +} + +XmlOutput &operator<<(XmlOutput &xml, const VCXLibrarianTool &tool) +{ + return xml + << tag(_Link) + << attrTagX(_AdditionalDependencies, tool.AdditionalDependencies, ";") + << attrTagX(_AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories, ";") + << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") + << attrTagS(_DisplayLibrary, tool.DisplayLibrary) + << attrTagS(_ErrorReporting, tool.ErrorReporting) + << attrTagX(_ExportNamedFunctions, tool.ExportNamedFunctions, ";") + << attrTagX(_ForceSymbolReferences, tool.ForceSymbolReferences, ";") + << attrTagT(_IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries) + << attrTagX(_IgnoreSpecificDefaultLibraries, tool.IgnoreSpecificDefaultLibraries, ";") + << attrTagT(_LinkTimeCodeGeneration, tool.LinkTimeCodeGeneration) + << attrTagS(_ModuleDefinitionFile, tool.ModuleDefinitionFile) + << attrTagS(_Name, tool.Name) + << attrTagS(_OutputFile, tool.OutputFile) + << attrTagX(_RemoveObjects, tool.RemoveObjects, ";") + << attrTagS(_SubSystem, tool.SubSystem) + << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) + << attrTagS(_TargetMachine, tool.TargetMachine) + << attrTagT(_TreatLibWarningAsErrors, tool.TreatLibWarningAsErrors) + << attrTagT(_Verbose, tool.Verbose) + << closetag(_Link); +} + +// VCCustomBuildTool ------------------------------------------------ +VCXCustomBuildTool::VCXCustomBuildTool() +{ + ToolName = "VCXCustomBuildTool"; +} + +XmlOutput &operator<<(XmlOutput &xml, const VCXCustomBuildTool &tool) +{ + // The code below offers two ways to split custom build step commands. + // Normally the $$escape_expand(\n\t) is used in a project file, which is correctly translated + // in all generators. However, if you use $$escape_expand(\n\r) (or \n\h) instead, the VCPROJ + // generator will instead of binding the commands with " && " will insert a proper newline into + // the VCPROJ file. We sometimes use this method of splitting commands if the custom buildstep + // contains a command-line which is too big to run on certain OS. + QString cmds; + int end = tool.CommandLine.count(); + for(int i = 0; i < end; ++i) { + QString cmdl = tool.CommandLine.at(i); + if (cmdl.contains("\r\t")) { + if (i == end - 1) + cmdl = cmdl.trimmed(); + cmdl.replace("\r\t", " && "); + } else if (cmdl.contains("\r\n")) { + ; + } else if (cmdl.contains("\r\\h")) { + // The above \r\n should work, but doesn't, so we have this hack + cmdl.replace("\r\\h", "\r\n"); + } else { + if (i < end - 1) + cmdl += " && "; + } + cmds += cmdl; + } + + if ( !tool.AdditionalDependencies.isEmpty() ) + { + xml << tag("AdditionalInputs") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) + << valueTagDefX(tool.AdditionalDependencies, "AdditionalInputs", ";"); + } + + if( !cmds.isEmpty() ) + { + xml << tag("Command") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) + << valueTag(cmds); + } + + if ( !tool.Description.isEmpty() ) + { + xml << tag("Message") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) + << valueTag(tool.Description); + } + + if ( !tool.Outputs.isEmpty() ) + { + xml << tag("Outputs") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) + << valueTagDefX(tool.Outputs, "Outputs", ";"); + } + + return xml; +} + +// VCResourceCompilerTool ------------------------------------------- +VCXResourceCompilerTool::VCXResourceCompilerTool() + : IgnoreStandardIncludePath(unset), + NullTerminateStrings(unset), + ShowProgress(unset), + SuppressStartupBanner(unset) +{ + PreprocessorDefinitions = QStringList("NDEBUG"); +} + +XmlOutput &operator<<(XmlOutput &xml, const VCXResourceCompilerTool &tool) +{ + return xml + << tag(_ResourceCompile) + << attrTagX(_AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories, ";") + << attrTagS(_AdditionalOptions, tool.AdditionalOptions) + << attrTagS(_Culture, tool.Culture) + << attrTagT(_IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath) + << attrTagT(_NullTerminateStrings, tool.NullTerminateStrings) + << attrTagX(_PreprocessorDefinitions, tool.PreprocessorDefinitions, ";") + << attrTagS(_ResourceOutputFileName, tool.ResourceOutputFileName) + << attrTagT(_ShowProgress, tool.ShowProgress) + << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) + << attrTagS(_TrackerLogDirectory, tool.TrackerLogDirectory) + << attrTagS(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions) + << closetag(_ResourceCompile); +} + +// VCXDeploymentTool -------------------------------------------- +VCXDeploymentTool::VCXDeploymentTool() +{ + DeploymentTag = "DeploymentTool"; + RemoteDirectory = ""; +} + +// http://msdn.microsoft.com/en-us/library/sa69he4t.aspx +XmlOutput &operator<<(XmlOutput &xml, const VCXDeploymentTool &tool) +{ + if (tool.AdditionalFiles.isEmpty()) + return xml; + return xml + << tag(tool.DeploymentTag) + << closetag(tool.DeploymentTag); +} + +// VCEventTool ------------------------------------------------- +XmlOutput &operator<<(XmlOutput &xml, const VCXEventTool &tool) +{ + return xml + << tag(tool.EventName) + << attrTagS(_Command, tool.CommandLine) + << attrTagS(_Message, tool.Description) + << closetag(tool.EventName); +} + +// VCXPostBuildEventTool --------------------------------------------- +VCXPostBuildEventTool::VCXPostBuildEventTool() +{ + EventName = "PostBuildEvent"; +} + +// VCXPreBuildEventTool ---------------------------------------------- +VCXPreBuildEventTool::VCXPreBuildEventTool() +{ + EventName = "PreBuildEvent"; +} + +// VCXPreLinkEventTool ----------------------------------------------- +VCXPreLinkEventTool::VCXPreLinkEventTool() +{ + EventName = "PreLinkEvent"; +} + +// VCConfiguration -------------------------------------------------- + +VCXConfiguration::VCXConfiguration() + : ATLMinimizesCRunTimeLibraryUsage(unset), + BuildBrowserInformation(unset), + RegisterOutput(unset), + WholeProgramOptimization(unset) +{ + compiler.config = this; + linker.config = this; + idl.config = this; +} + +XmlOutput &operator<<(XmlOutput &xml, const VCXConfiguration &tool) +{ + xml << tag("PropertyGroup") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Name)) + << attrTag("Label", "Configuration") + << attrTagS(_OutputDirectory, tool.OutputDirectory) + << attrTagT(_ATLMinimizesCRunTimeLibraryUsage, tool.ATLMinimizesCRunTimeLibraryUsage) + << attrTagT(_BuildBrowserInformation, tool.BuildBrowserInformation) + << attrTagS(_CharacterSet, tool.CharacterSet) + << attrTagS(_ConfigurationType, tool.ConfigurationType) + << attrTagS(_DeleteExtensionsOnClean, tool.DeleteExtensionsOnClean) + << attrTagS(_ImportLibrary, tool.ImportLibrary) + << attrTagS(_IntermediateDirectory, tool.IntermediateDirectory) + << attrTagS(_PrimaryOutput, tool.PrimaryOutput) + << attrTagS(_ProgramDatabase, tool.ProgramDatabase) + << attrTagT(_RegisterOutput, tool.RegisterOutput) + << attrTagS(_UseOfATL, tool.UseOfATL) + << attrTagS(_UseOfMfc, tool.UseOfMfc) + << attrTagT(_WholeProgramOptimization, tool.WholeProgramOptimization) + << closetag(); + return xml; +} +// VCXFilter --------------------------------------------------------- +VCXFilter::VCXFilter() + : ParseFiles(unset), + Config(0) +{ + useCustomBuildTool = false; + useCompilerTool = false; +} + +void VCXFilter::addFile(const QString& filename) +{ + Files += VCXFilterFile(filename); +} + +void VCXFilter::addFile(const VCXFilterFile& fileInfo) +{ + Files += VCXFilterFile(fileInfo); +} + +void VCXFilter::addFiles(const QStringList& fileList) +{ + for (int i = 0; i < fileList.count(); ++i) + addFile(fileList.at(i)); +} + +void VCXFilter::modifyPCHstage(QString str) +{ + bool autogenSourceFile = Project->autogenPrecompCPP; + bool pchThroughSourceFile = !Project->precompCPP.isEmpty(); + bool isCFile = false; + for (QStringList::Iterator it = Option::c_ext.begin(); it != Option::c_ext.end(); ++it) { + if (str.endsWith(*it)) { + isCFile = true; + break; + } + } + bool isHFile = str.endsWith(".h") && (str == Project->precompH); + bool isCPPFile = pchThroughSourceFile && (str == Project->precompCPP); + + if(!isCFile && !isHFile && !isCPPFile) + return; + + if(isHFile && pchThroughSourceFile) { + if (autogenSourceFile) { + useCustomBuildTool = true; + QString toFile(Project->precompCPP); + CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ..."; + CustomBuildTool.Outputs += toFile; + + QStringList lines; + CustomBuildTool.CommandLine += + "echo /*-------------------------------------------------------------------- >" + toFile; + lines << "* Precompiled header source file used by Visual Studio.NET to generate"; + lines << "* the .pch file."; + lines << "*"; + lines << "* Due to issues with the dependencies checker within the IDE, it"; + lines << "* sometimes fails to recompile the PCH file, if we force the IDE to"; + lines << "* create the PCH file directly from the header file."; + lines << "*"; + lines << "* This file is auto-generated by qmake since no PRECOMPILED_SOURCE was"; + lines << "* specified, and is used as the common stdafx.cpp. The file is only"; + lines << "* generated when creating .vcxproj project files, and is not used for"; + lines << "* command line compilations by nmake."; + lines << "*"; + lines << "* WARNING: All changes made in this file will be lost."; + lines << "--------------------------------------------------------------------*/"; + lines << "#include \"" + Project->precompHFilename + "\""; + foreach(QString line, lines) + CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile; + } + return; + } + + useCompilerTool = true; + // Setup PCH options + CompilerTool.PrecompiledHeader = (isCFile ? "NotUsing" : "Create" ); + CompilerTool.PrecompiledHeaderFile = (isCPPFile ? QString("$(INHERIT)") : QString("$(NOINHERIT)")); + CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); +} + +bool VCXFilter::addExtraCompiler(const VCXFilterFile &info) +{ + const QStringList &extraCompilers = Project->extraCompilerSources.value(info.file); + if (extraCompilers.isEmpty()) + return false; + + QString inFile = info.file; + + // is the extracompiler rule on a file with a built in compiler? + const QStringList &objectMappedFile = Project->extraCompilerOutputs[inFile]; + bool hasBuiltIn = false; + if (!objectMappedFile.isEmpty()) { + hasBuiltIn = Project->hasBuiltinCompiler(objectMappedFile.at(0)); +// qDebug("*** Extra compiler file has object mapped file '%s' => '%s'", qPrintable(inFile), qPrintable(objectMappedFile.join(" "))); + } + + CustomBuildTool.AdditionalDependencies.clear(); + CustomBuildTool.CommandLine.clear(); + CustomBuildTool.Description.clear(); + CustomBuildTool.Outputs.clear(); + CustomBuildTool.ToolPath.clear(); + CustomBuildTool.ToolName = QLatin1String(_VCCustomBuildTool); + + for (int x = 0; x < extraCompilers.count(); ++x) { + const QString &extraCompilerName = extraCompilers.at(x); + + if (!Project->verifyExtraCompiler(extraCompilerName, inFile) && !hasBuiltIn) + continue; + + // All information about the extra compiler + QString tmp_out = Project->project->first(extraCompilerName + ".output"); + QString tmp_cmd = Project->project->variables()[extraCompilerName + ".commands"].join(" "); + QString tmp_cmd_name = Project->project->variables()[extraCompilerName + ".name"].join(" "); + QStringList tmp_dep = Project->project->variables()[extraCompilerName + ".depends"]; + QString tmp_dep_cmd = Project->project->variables()[extraCompilerName + ".depend_command"].join(" "); + QStringList vars = Project->project->variables()[extraCompilerName + ".variables"]; + QStringList configs = Project->project->variables()[extraCompilerName + ".CONFIG"]; + bool combined = configs.indexOf("combine") != -1; + + QString cmd, cmd_name, out; + QStringList deps, inputs; + // Variabel replacement of output name + out = Option::fixPathToTargetOS( + Project->replaceExtraCompilerVariables(tmp_out, inFile, QString()), + false); + + // If file has built-in compiler, we've swapped the input and output of + // the command, as we in Visual Studio cannot have a Custom Buildstep on + // a file which uses a built-in compiler. We would in this case only get + // the result from the extra compiler. If 'hasBuiltIn' is true, we know + // that we're actually on the _output_file_ of the result, and we + // therefore swap inFile and out below, since the extra-compiler still + // must see it as the original way. If the result also has a built-in + // compiler, too bad.. + if (hasBuiltIn) { + out = inFile; + inFile = objectMappedFile.at(0); + } + + // Dependency for the output + if(!tmp_dep.isEmpty()) + deps = tmp_dep; + if(!tmp_dep_cmd.isEmpty()) { + // Execute dependency command, and add every line as a dep + char buff[256]; + QString dep_cmd = Project->replaceExtraCompilerVariables(tmp_dep_cmd, Option::fixPathToLocalOS(inFile, true, false), out); + if(Project->canExecute(dep_cmd)) { + if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { + QString indeps; + while(!feof(proc)) { + int read_in = (int)fread(buff, 1, 255, proc); + if(!read_in) + break; + indeps += QByteArray(buff, read_in); + } + QT_PCLOSE(proc); + if(!indeps.isEmpty()) { + QStringList extradeps = indeps.split(QLatin1Char('\n')); + for (int i = 0; i < extradeps.count(); ++i) { + QString dd = extradeps.at(i).simplified(); + if (!dd.isEmpty()) + deps += Project->fileFixify(dd); + } + } + } + } + } + for (int i = 0; i < deps.count(); ++i) + deps[i] = Option::fixPathToTargetOS( + Project->replaceExtraCompilerVariables(deps.at(i), inFile, out), + false).trimmed(); + // Command for file + if (combined) { + // Add dependencies for each file + QStringList tmp_in = Project->project->variables()[extraCompilerName + ".input"]; + for (int a = 0; a < tmp_in.count(); ++a) { + const QStringList &files = Project->project->variables()[tmp_in.at(a)]; + for (int b = 0; b < files.count(); ++b) { + deps += Project->findDependencies(files.at(b)); + inputs += Option::fixPathToTargetOS(files.at(b), false); + } + } + deps += inputs; // input files themselves too.. + + // Replace variables for command w/all input files + // ### join gives path issues with directories containing spaces! + cmd = Project->replaceExtraCompilerVariables(tmp_cmd, + inputs.join(" "), + out); + } else { + deps += inFile; // input file itself too.. + cmd = Project->replaceExtraCompilerVariables(tmp_cmd, + inFile, + out); + } + // Name for command + if(!tmp_cmd_name.isEmpty()) { + cmd_name = Project->replaceExtraCompilerVariables(tmp_cmd_name, inFile, out); + } else { + int space = cmd.indexOf(' '); + if(space != -1) + cmd_name = cmd.left(space); + else + cmd_name = cmd; + if((cmd_name[0] == '\'' || cmd_name[0] == '"') && + cmd_name[0] == cmd_name[cmd_name.length()-1]) + cmd_name = cmd_name.mid(1,cmd_name.length()-2); + } + + // Fixify paths + for (int i = 0; i < deps.count(); ++i) + deps[i] = Option::fixPathToTargetOS(deps[i], false); + + + // Output in info.additionalFile ----------- + if (!CustomBuildTool.Description.isEmpty()) + CustomBuildTool.Description += " & "; + CustomBuildTool.Description += cmd_name; + CustomBuildTool.CommandLine += cmd.trimmed().split("\n", QString::SkipEmptyParts); + int space = cmd.indexOf(' '); + QFileInfo finf(cmd.left(space)); + if (CustomBuildTool.ToolPath.isEmpty()) + CustomBuildTool.ToolPath += Option::fixPathToTargetOS(finf.path()); + CustomBuildTool.Outputs += out; + + deps += CustomBuildTool.AdditionalDependencies; + deps += cmd.left(cmd.indexOf(' ')); + // Make sure that all deps are only once + QMap uniqDeps; + for (int c = 0; c < deps.count(); ++c) { + QString aDep = deps.at(c).trimmed(); + if (!aDep.isEmpty()) + uniqDeps[aDep] = false; + } + CustomBuildTool.AdditionalDependencies = uniqDeps.keys(); + } + + // Ensure that none of the output files are also dependencies. Or else, the custom buildstep + // will be rebuild every time, even if nothing has changed. + foreach(QString output, CustomBuildTool.Outputs) { + CustomBuildTool.AdditionalDependencies.removeAll(output); + } + + useCustomBuildTool = !CustomBuildTool.CommandLine.isEmpty(); + return useCustomBuildTool; +} + +bool VCXFilter::outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, const QString &filtername, bool fileAllreadyAdded) +{ + bool fileAdded = false; + + // Clearing each filter tool + useCustomBuildTool = false; + useCompilerTool = false; + CustomBuildTool = VCXCustomBuildTool(); + CompilerTool = VCXCLCompilerTool(); + + // Unset some default options + CompilerTool.BufferSecurityCheck = unset; + CompilerTool.DebugInformationFormat = ""; + CompilerTool.ExceptionHandling = ""; + //CompilerTool.Optimization = optimizeDefault; + CompilerTool.ProgramDataBaseFileName.clear(); + CompilerTool.RuntimeLibrary = ""; + //CompilerTool.WarningLevel = warningLevelUnknown; + CompilerTool.config = Config; + + bool inBuild = false; + VCXFilterFile info; + for (int i = 0; i < Files.count(); ++i) { + if (Files.at(i).file == filename) { + info = Files.at(i); + inBuild = true; + } + } + inBuild &= !info.excludeFromBuild; + + if (inBuild) { + addExtraCompiler(info); + if(Project->usePCH) + modifyPCHstage(info.file); + } else { + // Excluded files uses an empty compiler stage + if(info.excludeFromBuild) + useCompilerTool = true; + } + + // Actual XML output ---------------------------------- + if(useCustomBuildTool || useCompilerTool || !inBuild) { + + if (useCustomBuildTool) + { + CustomBuildTool.ConfigName = (*Config).Name; + + if ( !fileAllreadyAdded ) { + + fileAdded = true; + + xmlFilter << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(filename)) + << attrTagS("Filter", filtername); + + xml << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(filename)); + + if ( filtername == "Form Files" || filtername == "Generated Files" || filtername == "Resource Files" ) + xml << attrTagS("FileType", "Document"); + } + + xml << CustomBuildTool; + } + + if ( !fileAdded && !fileAllreadyAdded ) + { + fileAdded = true; + + if (filtername == "Source Files") { + + xmlFilter << tag("ClCompile") + << attrTag("Include",Option::fixPathToLocalOS(filename)) + << attrTagS("Filter", filtername); + + xml << tag("ClCompile") + << attrTag("Include",Option::fixPathToLocalOS(filename)); + + } else if(filtername == "Header Files") { + + xmlFilter << tag("ClInclude") + << attrTag("Include",Option::fixPathToLocalOS(filename)) + << attrTagS("Filter", filtername); + + xml << tag("ClInclude") + << attrTag("Include",Option::fixPathToLocalOS(filename)); + } else if(filtername == "Generated Files" || filtername == "Form Files") { + + if (filename.endsWith(".h")) { + + xmlFilter << tag("ClInclude") + << attrTag("Include",Option::fixPathToLocalOS(filename)) + << attrTagS("Filter", filtername); + + xml << tag("ClInclude") + << attrTag("Include",Option::fixPathToLocalOS(filename)); + } else if(filename.endsWith(".cpp")) { + + xmlFilter << tag("ClCompile") + << attrTag("Include",Option::fixPathToLocalOS(filename)) + << attrTagS("Filter", filtername); + + xml << tag("ClCompile") + << attrTag("Include",Option::fixPathToLocalOS(filename)); + } else { + + xmlFilter << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(filename)) + << attrTagS("Filter", filtername); + + xml << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(filename)); + } + } + } + + if(!inBuild) { + + xml << tag("ExcludedFromBuild") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg((*Config).Name)) + << valueTag("true"); + } + + if (useCompilerTool) { + + if ( !CompilerTool.ForcedIncludeFiles.isEmpty() ) { + xml << tag("ForcedIncludeFiles") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg((*Config).Name)) + << valueTagX(CompilerTool.ForcedIncludeFiles); + } + + if ( !CompilerTool.PrecompiledHeaderFile.isEmpty() ) { + + xml << tag("PrecompiledHeaderFile") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg((*Config).Name)) + << valueTag(CompilerTool.PrecompiledHeaderFile); + } + + if ( !CompilerTool.PrecompiledHeader.isEmpty() ) { + + xml << tag("PrecompiledHeader") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg((*Config).Name)) + << valueTag(CompilerTool.PrecompiledHeader); + } + + //xml << CompilerTool; + } + } + + return fileAdded; +} + + +// VCXProjectSingleConfig -------------------------------------------- +VCXFilter nullFilter; +VCXFilter& VCXProjectSingleConfig::filterForExtraCompiler(const QString &compilerName) +{ + for (int i = 0; i < ExtraCompilersFiles.count(); ++i) + if (ExtraCompilersFiles.at(i).Name == compilerName) + return ExtraCompilersFiles[i]; + return nullFilter; +} + + +XmlOutput &operator<<(XmlOutput &xml, const VCXProjectSingleConfig &tool) +{ + xml.setIndentString(" "); + + xml << decl("1.0", "utf-8") + << tag("Project") + << attrTag("DefaultTargets","Build") + << attrTag("ToolsVersion", "4.0") + << attrTag("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003") + << tag("ItemGroup") + << attrTag("Label", "ProjectConfigurations"); + + xml << tag("ProjectConfiguration") + << attrTag("Include" , tool.Configuration.Name) + << tagValue("Configuration", tool.Configuration.ConfigurationName) + << tagValue("Platform", tool.PlatformName) + << closetag(); + + xml << closetag() + << tag("PropertyGroup") + << attrTag("Label", "Globals") + << tagValue("ProjectGuid", tool.ProjectGUID) + << tagValue("RootNamespace", tool.Name) + << tagValue("Keyword", tool.Keyword) + << closetag(); + + // config part. + xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props"); + + xml << tool.Configuration; + + xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.props"); + + // Extension settings + xml << tag("ImportGroup") + << attrTag("Label", "ExtensionSettings") + << closetag(); + + // PropertySheets + xml << tag("ImportGroup") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) + << attrTag("Label", "PropertySheets"); + + xml << tag("Import") + << attrTag("Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props") + << attrTag("Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')") + << closetag() + << closetag(); + + + // UserMacros + xml << tag("PropertyGroup") + << attrTag("Label", "UserMacros") + << closetag(); + + xml << tag("PropertyGroup"); + + if ( !tool.Configuration.OutputDirectory.isEmpty() ) { + xml<< tag("OutDir") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) + << valueTag(tool.Configuration.OutputDirectory); + } + if ( !tool.Configuration.IntermediateDirectory.isEmpty() ) { + xml<< tag("IntDir") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) + << valueTag(tool.Configuration.IntermediateDirectory); + } + if ( !tool.Configuration.TargetName.isEmpty() ) { + xml<< tag("TargetName") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) + << valueTag(tool.Configuration.TargetName); + } + + if ( tool.Configuration.linker.IgnoreImportLibrary != unset) { + xml<< tag("IgnoreImportLibrary") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) + << valueTagT(tool.Configuration.linker.IgnoreImportLibrary); + } + + if ( tool.Configuration.linker.LinkIncremental != unset) { + xml<< tag("LinkIncremental") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) + << valueTagT(tool.Configuration.linker.LinkIncremental); + } + + if ( tool.Configuration.preBuild.UseInBuild != unset ) + { + xml<< tag("PreBuildEventUseInBuild") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) + << valueTagT(tool.Configuration.preBuild.UseInBuild); + } + + if ( tool.Configuration.preLink.UseInBuild != unset ) + { + xml<< tag("PreLinkEventUseInBuild") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) + << valueTagT(tool.Configuration.preLink.UseInBuild); + } + + if ( tool.Configuration.postBuild.UseInBuild != unset ) + { + xml<< tag("PostBuildEventUseInBuild") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) + << valueTagT(tool.Configuration.postBuild.UseInBuild); + } + xml << closetag(); + + xml << tag("ItemDefinitionGroup") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)); + + // ClCompile + xml << tool.Configuration.compiler; + + // Link + xml << tool.Configuration.linker; + + // Midl + xml << tool.Configuration.idl; + + // ResourceCompiler + xml << tool.Configuration.resource; + + xml << closetag(); + + QFile filterFile; + filterFile.setFileName(Option::output.fileName().append(".filters")); + filterFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate); + QTextStream ts(&filterFile); + XmlOutput xmlFilter(ts, XmlOutput::NoConversion); + + xmlFilter.setIndentString(" "); + + xmlFilter << decl("1.0", "utf-8") + << tag("Project") + << attrTag("ToolsVersion", "4.0") + << attrTag("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); + + xmlFilter << tag("ItemGroup"); + + VCXProject tempProj; + tempProj.SingleProjects += tool; + + tempProj.addFilters(xmlFilter, "Form Files"); + tempProj.addFilters(xmlFilter, "Generated Files"); + tempProj.addFilters(xmlFilter, "Header Files"); + tempProj.addFilters(xmlFilter, "LexYacc Files"); + tempProj.addFilters(xmlFilter, "Resource Files"); + tempProj.addFilters(xmlFilter, "Source Files"); + tempProj.addFilters(xmlFilter, "Translation Files"); + xmlFilter << closetag(); + + tempProj.outputFilter(xml, xmlFilter, "Source Files"); + tempProj.outputFilter(xml, xmlFilter, "Header Files"); + tempProj.outputFilter(xml, xmlFilter, "Generated Files"); + tempProj.outputFilter(xml, xmlFilter, "LexYacc Files"); + tempProj.outputFilter(xml, xmlFilter, "Translation Files"); + tempProj.outputFilter(xml, xmlFilter, "Form Files"); + tempProj.outputFilter(xml, xmlFilter, "Resource Files"); + + for (int x = 0; x < tempProj.ExtraCompilers.count(); ++x) { + tempProj.outputFilter(xml, xmlFilter, tempProj.ExtraCompilers.at(x)); + } + + xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets"); + + xml << tag("ImportGroup") + << attrTag("Label", "ExtensionTargets") + << closetag(); + + return xml; +} + + +// Tree file generation --------------------------------------------- +void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &tool, const QString &filter) { + + if (children.size()) { + // Filter + ChildrenMap::ConstIterator it, end = children.constEnd(); + if (!tagName.isEmpty()) { + xmlFilter << tag("Filter") + << attrTag("Include", tagName) + << attrTagS("Extensions", ""); + } + // First round, do nested filters + for (it = children.constBegin(); it != end; ++it) + if ((*it)->children.size()) + (*it)->generateXML(xml, xmlFilter, it.key(), tool, filter); + // Second round, do leafs + for (it = children.constBegin(); it != end; ++it) + if (!(*it)->children.size()) + (*it)->generateXML(xml, xmlFilter, it.key(), tool, filter); + + if (!tagName.isEmpty()) + xml << closetag("Filter"); + } else { + // Leaf + tool.outputFileConfigs(xml, xmlFilter, info, filter); + } +} + + +// Flat file generation --------------------------------------------- +void XFlatNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &/*tagName*/, VCXProject &tool, const QString &filter) { + if (children.size()) { + ChildrenMapFlat::ConstIterator it = children.constBegin(); + ChildrenMapFlat::ConstIterator end = children.constEnd(); + xml << tag(_ItemGroup); + xmlFilter << tag(_ItemGroup); + for (; it != end; ++it) { + tool.outputFileConfigs(xml, xmlFilter, (*it), filter); + } + xml << closetag(); + xmlFilter << closetag(); + } +} + + +// VCXProject -------------------------------------------------------- +// Output all configurations (by filtername) for a file (by info) +// A filters config output is in VCXFilter.outputFileConfig() +void VCXProject::outputFileConfigs(XmlOutput &xml, + XmlOutput &xmlFilter, + const VCXFilterFile &info, + const QString &filtername) +{ + // We need to check if the file has any custom build step. + // If there is one then it has to be included with "CustomBuild Include" + bool fileAdded = false; + + for (int i = 0; i < SingleProjects.count(); ++i) { + VCXFilter filter; + if (filtername == "Root Files") { + filter = SingleProjects.at(i).RootFiles; + } else if (filtername == "Source Files") { + filter = SingleProjects.at(i).SourceFiles; + } else if (filtername == "Header Files") { + filter = SingleProjects.at(i).HeaderFiles; + } else if (filtername == "Generated Files") { + filter = SingleProjects.at(i).GeneratedFiles; + } else if (filtername == "LexYacc Files") { + filter = SingleProjects.at(i).LexYaccFiles; + } else if (filtername == "Translation Files") { + filter = SingleProjects.at(i).TranslationFiles; + } else if (filtername == "Form Files") { + filter = SingleProjects.at(i).FormFiles; + } else if (filtername == "Resource Files") { + filter = SingleProjects.at(i).ResourceFiles; + } else { + // ExtraCompilers + filter = SingleProjects[i].filterForExtraCompiler(filtername); + } + + if (filter.Config) // only if the filter is not empty + if (filter.outputFileConfig(xml, xmlFilter, info.file, filtername, fileAdded)) // only add it once. + fileAdded = true; + } + + if ( !fileAdded ) + { + if (filtername == "Source Files") { + + xmlFilter << tag("ClCompile") + << attrTag("Include",Option::fixPathToLocalOS(info.file)) + << attrTagS("Filter", filtername); + + xml << tag("ClCompile") + << attrTag("Include",Option::fixPathToLocalOS(info.file)); + + } else if(filtername == "Header Files") { + + xmlFilter << tag("ClInclude") + << attrTag("Include",Option::fixPathToLocalOS(info.file)) + << attrTagS("Filter", filtername); + + xml << tag("ClInclude") + << attrTag("Include",Option::fixPathToLocalOS(info.file)); + } else if(filtername == "Generated Files" || filtername == "Form Files") { + + if (info.file.endsWith(".h")) { + + xmlFilter << tag("ClInclude") + << attrTag("Include",Option::fixPathToLocalOS(info.file)) + << attrTagS("Filter", filtername); + + xml << tag("ClInclude") + << attrTag("Include",Option::fixPathToLocalOS(info.file)); + } else if(info.file.endsWith(".cpp")) { + + xmlFilter << tag("ClCompile") + << attrTag("Include",Option::fixPathToLocalOS(info.file)) + << attrTagS("Filter", filtername); + + xml << tag("ClCompile") + << attrTag("Include",Option::fixPathToLocalOS(info.file)); + } else { + + xmlFilter << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(info.file)) + << attrTagS("Filter", filtername); + + xml << tag("CustomBuild") + << attrTag("Include",Option::fixPathToLocalOS(info.file)); + } + + } else { + + xmlFilter << tag("None") + << attrTag("Include",Option::fixPathToLocalOS(info.file)) + << attrTagS("Filter", filtername); + + xml << tag("None") + << attrTag("Include",Option::fixPathToLocalOS(info.file)); + } + } + + xml << closetag(); + xmlFilter << closetag(); +} + +// outputs a given filter for all existing configurations of a project +void VCXProject::outputFilter(XmlOutput &xml, + XmlOutput &xmlFilter, + const QString &filtername) +{ + XNode *root; + if (SingleProjects.at(0).flat_files) + root = new XFlatNode; + else + root = new XTreeNode; + + QString name, extfilter; + triState parse; + + for (int i = 0; i < SingleProjects.count(); ++i) { + VCXFilter filter; + if (filtername == "Root Files") { + filter = SingleProjects.at(i).RootFiles; + } else if (filtername == "Source Files") { + filter = SingleProjects.at(i).SourceFiles; + } else if (filtername == "Header Files") { + filter = SingleProjects.at(i).HeaderFiles; + } else if (filtername == "Generated Files") { + filter = SingleProjects.at(i).GeneratedFiles; + } else if (filtername == "LexYacc Files") { + filter = SingleProjects.at(i).LexYaccFiles; + } else if (filtername == "Translation Files") { + filter = SingleProjects.at(i).TranslationFiles; + } else if (filtername == "Form Files") { + filter = SingleProjects.at(i).FormFiles; + } else if (filtername == "Resource Files") { + filter = SingleProjects.at(i).ResourceFiles; + } else { + // ExtraCompilers + filter = SingleProjects[i].filterForExtraCompiler(filtername); + } + + // Merge all files in this filter to root tree + for (int x = 0; x < filter.Files.count(); ++x) + root->addElement(filter.Files.at(x)); + + // Save filter setting from first filter. Next filters + // may differ but we cannot handle that. (ex. extfilter) + if (name.isEmpty()) { + name = filter.Name; + extfilter = filter.Filter; + parse = filter.ParseFiles; + } + } + + if (!root->hasElements()) + return; + + root->generateXML(xml, xmlFilter, "", *this, filtername); // output root tree +} + + +void VCXProject::addFilters(XmlOutput &xmlFilter, + const QString &filtername) +{ + bool added = false; + + for (int i = 0; i < SingleProjects.count(); ++i) { + VCXFilter filter; + if (filtername == "Root Files") { + filter = SingleProjects.at(i).RootFiles; + } else if (filtername == "Source Files") { + filter = SingleProjects.at(i).SourceFiles; + } else if (filtername == "Header Files") { + filter = SingleProjects.at(i).HeaderFiles; + } else if (filtername == "Generated Files") { + filter = SingleProjects.at(i).GeneratedFiles; + } else if (filtername == "LexYacc Files") { + filter = SingleProjects.at(i).LexYaccFiles; + } else if (filtername == "Translation Files") { + filter = SingleProjects.at(i).TranslationFiles; + } else if (filtername == "Form Files") { + filter = SingleProjects.at(i).FormFiles; + } else if (filtername == "Resource Files") { + filter = SingleProjects.at(i).ResourceFiles; + } else { + // ExtraCompilers + filter = SingleProjects[i].filterForExtraCompiler(filtername); + } + + if(!filter.Files.isEmpty() && !added) { + added = true; + xmlFilter << tag("Filter") + << attrTag("Include", filtername) + << attrTagS("UniqueIdentifier", filter.Guid) + << attrTagS("Extensions", filter.Filter) + << attrTagT("ParseFiles", filter.ParseFiles) + << closetag(); + } + } +} + + +XmlOutput &operator<<(XmlOutput &xml, VCXProject &tool) +{ + + if (tool.SingleProjects.count() == 0) { + warn_msg(WarnLogic, "Generator: .NET: no single project in merge project, no output"); + return xml; + } + + xml.setIndentString(" "); + + xml << decl("1.0", "utf-8") + << tag("Project") + << attrTag("DefaultTargets","Build") + << attrTag("ToolsVersion", "4.0") + << attrTag("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003") + << tag("ItemGroup") + << attrTag("Label", "ProjectConfigurations"); + + for (int i = 0; i < tool.SingleProjects.count(); ++i) { + xml << tag("ProjectConfiguration") + << attrTag("Include" , tool.SingleProjects.at(i).Configuration.Name) + << tagValue("Configuration", tool.SingleProjects.at(i).Configuration.ConfigurationName) + << tagValue("Platform", tool.SingleProjects.at(i).PlatformName) + << closetag(); + } + + xml << closetag() + << tag("PropertyGroup") + << attrTag("Label", "Globals") + << tagValue("ProjectGuid", tool.ProjectGUID) + << tagValue("RootNamespace", tool.Name) + << tagValue("Keyword", tool.Keyword) + << closetag(); + + // config part. + xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props"); + for (int i = 0; i < tool.SingleProjects.count(); ++i) + xml << tool.SingleProjects.at(i).Configuration; + xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.props"); + + // Extension settings + xml << tag("ImportGroup") + << attrTag("Label", "ExtensionSettings") + << closetag(); + + // PropertySheets + for (int i = 0; i < tool.SingleProjects.count(); ++i) { + xml << tag("ImportGroup") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) + << attrTag("Label", "PropertySheets"); + + xml << tag("Import") + << attrTag("Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props") + << attrTag("Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')") + << closetag() + << closetag(); + } + + // UserMacros + xml << tag("PropertyGroup") + << attrTag("Label", "UserMacros") + << closetag(); + + xml << tag("PropertyGroup"); + for (int i = 0; i < tool.SingleProjects.count(); ++i) { + + if ( !tool.SingleProjects.at(i).Configuration.OutputDirectory.isEmpty() ) { + xml << tag("OutDir") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) + << valueTag(tool.SingleProjects.at(i).Configuration.OutputDirectory); + } + if ( !tool.SingleProjects.at(i).Configuration.IntermediateDirectory.isEmpty() ) { + xml << tag("IntDir") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) + << valueTag(tool.SingleProjects.at(i).Configuration.IntermediateDirectory); + } + if ( !tool.SingleProjects.at(i).Configuration.TargetName.isEmpty() ) { + xml << tag("TargetName") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) + << valueTag(tool.SingleProjects.at(i).Configuration.TargetName); + } + + if ( tool.SingleProjects.at(i).Configuration.linker.IgnoreImportLibrary != unset) { + xml << tag("IgnoreImportLibrary") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) + << valueTagT(tool.SingleProjects.at(i).Configuration.linker.IgnoreImportLibrary); + } + + if ( tool.SingleProjects.at(i).Configuration.linker.LinkIncremental != unset) { + xml << tag("LinkIncremental") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) + << valueTagT(tool.SingleProjects.at(i).Configuration.linker.LinkIncremental); + } + + if ( tool.SingleProjects.at(i).Configuration.preBuild.UseInBuild != unset ) + { + xml << tag("PreBuildEventUseInBuild") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) + << valueTagT(tool.SingleProjects.at(i).Configuration.preBuild.UseInBuild); + } + + if ( tool.SingleProjects.at(i).Configuration.preLink.UseInBuild != unset ) + { + xml << tag("PreLinkEventUseInBuild") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) + << valueTagT(tool.SingleProjects.at(i).Configuration.preLink.UseInBuild); + } + + if ( tool.SingleProjects.at(i).Configuration.postBuild.UseInBuild != unset ) + { + xml << tag("PostBuildEventUseInBuild") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) + << valueTagT(tool.SingleProjects.at(i).Configuration.postBuild.UseInBuild); + } + } + xml << closetag(); + + for (int i = 0; i < tool.SingleProjects.count(); ++i) { + xml << tag("ItemDefinitionGroup") + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)); + + // ClCompile + xml << tool.SingleProjects.at(i).Configuration.compiler; + + // Link + xml << tool.SingleProjects.at(i).Configuration.linker; + + // Midl + xml << tool.SingleProjects.at(i).Configuration.idl; + + // ResourceCompiler + xml << tool.SingleProjects.at(i).Configuration.resource; + + xml << closetag(); + } + + // The file filters are added in a separate file for MSBUILD. + QFile filterFile; + filterFile.setFileName(Option::output.fileName().append(".filters")); + filterFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate); + QTextStream ts(&filterFile); + XmlOutput xmlFilter(ts, XmlOutput::NoConversion); + + xmlFilter.setIndentString(" "); + + xmlFilter << decl("1.0", "utf-8") + << tag("Project") + << attrTag("ToolsVersion", "4.0") + << attrTag("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); + + xmlFilter << tag("ItemGroup"); + + tool.addFilters(xmlFilter, "Form Files"); + tool.addFilters(xmlFilter, "Generated Files"); + tool.addFilters(xmlFilter, "Header Files"); + tool.addFilters(xmlFilter, "LexYacc Files"); + tool.addFilters(xmlFilter, "Resource Files"); + tool.addFilters(xmlFilter, "Source Files"); + tool.addFilters(xmlFilter, "Translation Files"); + xmlFilter << closetag(); + + tool.outputFilter(xml, xmlFilter, "Source Files"); + tool.outputFilter(xml, xmlFilter, "Header Files"); + tool.outputFilter(xml, xmlFilter, "Generated Files"); + tool.outputFilter(xml, xmlFilter, "LexYacc Files"); + tool.outputFilter(xml, xmlFilter, "Translation Files"); + tool.outputFilter(xml, xmlFilter, "Form Files"); + tool.outputFilter(xml, xmlFilter, "Resource Files"); + for (int x = 0; x < tool.ExtraCompilers.count(); ++x) { + tool.outputFilter(xml, xmlFilter, tool.ExtraCompilers.at(x)); + } + + xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets"); + + xml << tag("ImportGroup") + << attrTag("Label", "ExtensionTargets") + << closetag(); + + return xml; +} + +QT_END_NAMESPACE diff --git a/qmake/generators/win32/msbuild_objectmodel.h b/qmake/generators/win32/msbuild_objectmodel.h new file mode 100644 index 0000000..567985d --- /dev/null +++ b/qmake/generators/win32/msbuild_objectmodel.h @@ -0,0 +1,708 @@ +/**************************************************************************** +** +** 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 qmake application 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 MSBUILD_OBJECTMODEL_H +#define MSBUILD_OBJECTMODEL_H + +#include "project.h" +#include "xmloutput.h" +#include "msvc_objectmodel.h" +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + + +class VCXConfiguration; +class VCXProject; + +class VCXCLCompilerTool : public VCToolBase +{ +public: + // Functions + VCXCLCompilerTool(); + virtual ~VCXCLCompilerTool(){} + bool parseOption(const char* option); + + // Variables + QStringList AdditionalIncludeDirectories; + QStringList AdditionalOptions; + QStringList AdditionalUsingDirectories; + QString AlwaysAppend; + QString AssemblerListingLocation; + QString AssemblerOutput; + QString BasicRuntimeChecks; + triState BrowseInformation; + QString BrowseInformationFile; + triState BufferSecurityCheck; + QString CallingConvention; + QString CompileAs; + QString CompileAsManaged; + triState CreateHotpatchableImage; + QString DebugInformationFormat; + triState DisableLanguageExtensions; + QStringList DisableSpecificWarnings; + QString EnableEnhancedInstructionSet; + triState EnableFiberSafeOptimizations; + triState EnablePREfast; + QString ErrorReporting; + QString ExceptionHandling; + triState ExpandAttributedSource; + QString FavorSizeOrSpeed; + triState FloatingPointExceptions; + QString FloatingPointModel; + triState ForceConformanceInForLoopScope; + QStringList ForcedIncludeFiles; + QStringList ForcedUsingFiles; + triState FunctionLevelLinking; + triState GenerateXMLDocumentationFiles; + triState IgnoreStandardIncludePath; + QString InlineFunctionExpansion; + triState IntrinsicFunctions; + triState MinimalRebuild; + triState MultiProcessorCompilation; + QString ObjectFileName; + QStringList ObjectFiles; + triState OmitDefaultLibName; + triState OmitFramePointers; + triState OpenMPSupport; + QString Optimization; + QString PrecompiledHeader; + QString PrecompiledHeaderFile; + QString PrecompiledHeaderOutputFile; + triState PreprocessKeepComments; + QStringList PreprocessorDefinitions; + QString PreprocessOutputPath; + triState PreprocessSuppressLineNumbers; + triState PreprocessToFile; + QString ProgramDataBaseFileName; + QString ProcessorNumber; + QString RuntimeLibrary; + triState RuntimeTypeInfo; + triState ShowIncludes; + triState SmallerTypeCheck; + triState StringPooling; + QString StructMemberAlignment; + triState SuppressStartupBanner; + QString TreatSpecificWarningsAsErrors; + triState TreatWarningAsError; + triState TreatWChar_tAsBuiltInType; + triState UndefineAllPreprocessorDefinitions; + QStringList UndefinePreprocessorDefinitions; + triState UseFullPaths; + triState UseUnicodeForAssemblerListing; + QString WarningLevel; + triState WholeProgramOptimization; + QString XMLDocumentationFileName; + + VCXConfiguration* config; +}; + +class VCXLinkerTool : public VCToolBase +{ +public: + // Functions + VCXLinkerTool(); + virtual ~VCXLinkerTool(){} + bool parseOption(const char* option); + + // Variables + QStringList AdditionalDependencies; + QStringList AdditionalLibraryDirectories; + QStringList AdditionalManifestDependencies; + QStringList AdditionalOptions; + QStringList AddModuleNamesToAssembly; + triState AllowIsolation; + triState AssemblyDebug; + QStringList AssemblyLinkResource; + QString BaseAddress; + QString CLRImageType; + QString CLRSupportLastError; + QString CLRThreadAttribute; + QString CLRUnmanagedCodeCheck; + QString CreateHotPatchableImage; + triState DataExecutionPrevention; + QStringList DelayLoadDLLs; + triState DelaySign; + QString Driver; + QStringList EmbedManagedResourceFile; + triState EnableCOMDATFolding; + triState EnableUAC; + QString EntryPointSymbol; + triState FixedBaseAddress; + QString ForceFileOutput; + QStringList ForceSymbolReferences; + QString FunctionOrder; + triState GenerateDebugInformation; + triState GenerateManifest; + triState GenerateMapFile; + qlonglong HeapCommitSize; + qlonglong HeapReserveSize; + triState IgnoreAllDefaultLibraries; + triState IgnoreEmbeddedIDL; + triState IgnoreImportLibrary; + QStringList IgnoreSpecificDefaultLibraries; + triState ImageHasSafeExceptionHandlers; + QString ImportLibrary; + QString KeyContainer; + QString KeyFile; + triState LargeAddressAware; + triState LinkDLL; + QString LinkErrorReporting; + triState LinkIncremental; + triState LinkStatus; + QString LinkTimeCodeGeneration; + QString ManifestFile; + triState MapExports; + QString MapFileName; + QString MergedIDLBaseFileName; + QString MergeSections; + QString MidlCommandFile; + QString ModuleDefinitionFile; + QString MSDOSStubFileName; + triState NoEntryPoint; + triState OptimizeReferences; + QString OutputFile; + triState PreventDllBinding; + QString Profile; + QString ProfileGuidedDatabase; + QString ProgramDatabaseFile; + triState RandomizedBaseAddress; + triState RegisterOutput; + qlonglong SectionAlignment; + triState SetChecksum; + QString ShowProgress; + QString SpecifySectionAttributes; + QString StackCommitSize; + QString StackReserveSize; + QString StripPrivateSymbols; + QString SubSystem; + triState SupportNobindOfDelayLoadedDLL; + triState SupportUnloadOfDelayLoadedDLL; + triState SuppressStartupBanner; + triState SwapRunFromCD; + triState SwapRunFromNet; + QString TargetMachine; + triState TerminalServerAware; + triState TreatLinkerWarningAsErrors; + triState TurnOffAssemblyGeneration; + QString TypeLibraryFile; + qlonglong TypeLibraryResourceID; + QString UACExecutionLevel; + triState UACUIAccess; + QString Version; + + + VCXConfiguration* config; +}; + +class VCXMIDLTool : public VCToolBase +{ +public: + // Functions + VCXMIDLTool(); + virtual ~VCXMIDLTool(){} + bool parseOption(const char* option); + + // Variables + QStringList AdditionalIncludeDirectories; + QStringList AdditionalOptions; + triState ApplicationConfigurationMode; + QString ClientStubFile; + QString CPreprocessOptions; + QString DefaultCharType; + QString DLLDataFileName; + QString EnableErrorChecks; + triState ErrorCheckAllocations; + triState ErrorCheckBounds; + triState ErrorCheckEnumRange; + triState ErrorCheckRefPointers; + triState ErrorCheckStubData; + QString GenerateClientFiles; + QString GenerateServerFiles; + triState GenerateStublessProxies; + triState GenerateTypeLibrary; + QString HeaderFileName; + triState IgnoreStandardIncludePath; + QString InterfaceIdentifierFileName; + qlonglong LocaleID; + triState MkTypLibCompatible; + QString OutputDirectory; + QStringList PreprocessorDefinitions; + QString ProxyFileName; + QString RedirectOutputAndErrors; + QString ServerStubFile; + QString StructMemberAlignment; + triState SuppressCompilerWarnings; + triState SuppressStartupBanner; + QString TargetEnvironment; + QString TypeLibFormat; + QString TypeLibraryName; + QStringList UndefinePreprocessorDefinitions; + triState ValidateAllParameters; + triState WarnAsError; + QString WarningLevel; + + VCXConfiguration* config; +}; + +class VCXLibrarianTool : public VCToolBase +{ +public: + // Functions + VCXLibrarianTool(); + virtual ~VCXLibrarianTool(){} + bool parseOption(const char*){ return false; }; + + // Variables + QStringList AdditionalDependencies; + QStringList AdditionalLibraryDirectories; + QStringList AdditionalOptions; + QString DisplayLibrary; + QString ErrorReporting; + QStringList ExportNamedFunctions; + QStringList ForceSymbolReferences; + triState IgnoreAllDefaultLibraries; + QStringList IgnoreSpecificDefaultLibraries; + triState LinkTimeCodeGeneration; + QString ModuleDefinitionFile; + QString Name; + QString OutputFile; + QStringList RemoveObjects; + QString SubSystem; + triState SuppressStartupBanner; + QString TargetMachine; + triState TreatLibWarningAsErrors; + triState Verbose; + +}; + +class VCXCustomBuildTool : public VCToolBase +{ +public: + // Functions + VCXCustomBuildTool(); + virtual ~VCXCustomBuildTool(){} + bool parseOption(const char*){ return false; }; + + // Variables + QStringList AdditionalDependencies; + QStringList CommandLine; + QString Description; + QStringList Outputs; + QString ToolName; + QString ToolPath; + QString ConfigName; +}; + +class VCXResourceCompilerTool : public VCToolBase +{ +public: + // Functions + VCXResourceCompilerTool(); + virtual ~VCXResourceCompilerTool(){} + bool parseOption(const char*){ return false; }; + + // Variables + QStringList AdditionalIncludeDirectories; + QString AdditionalOptions; + QString Culture; + triState IgnoreStandardIncludePath; + triState NullTerminateStrings; + QStringList PreprocessorDefinitions; + QString ResourceOutputFileName; + triState ShowProgress; + triState SuppressStartupBanner; + QString TrackerLogDirectory; + QString UndefinePreprocessorDefinitions; +}; + +class VCXDeploymentTool +{ +public: + // Functions + VCXDeploymentTool(); + virtual ~VCXDeploymentTool() {} + + // Variables + QString DeploymentTag; + QString RemoteDirectory; + QString AdditionalFiles; +}; + +class VCXEventTool : public VCToolBase +{ +protected: + // Functions + VCXEventTool() : UseInBuild(unset){}; + virtual ~VCXEventTool(){} + bool parseOption(const char*){ return false; }; + +public: + // Variables + QString CommandLine; + QString Description; + triState UseInBuild; + QString EventName; + QString ToolPath; +}; + +class VCXPostBuildEventTool : public VCXEventTool +{ +public: + VCXPostBuildEventTool(); + ~VCXPostBuildEventTool(){} +}; + +class VCXPreBuildEventTool : public VCXEventTool +{ +public: + VCXPreBuildEventTool(); + ~VCXPreBuildEventTool(){} +}; + +class VCXPreLinkEventTool : public VCXEventTool +{ +public: + VCXPreLinkEventTool(); + ~VCXPreLinkEventTool(){} +}; + +class VCXConfiguration +{ +public: + // Functions + VCXConfiguration(); + ~VCXConfiguration(){} + + // Variables + triState ATLMinimizesCRunTimeLibraryUsage; + triState BuildBrowserInformation; + QString CharacterSet; + QString ConfigurationType; + QString DeleteExtensionsOnClean; + QString ImportLibrary; + QString IntermediateDirectory; + QString Name; + QString ConfigurationName; + QString OutputDirectory; + QString PrimaryOutput; + QString ProgramDatabase; + triState RegisterOutput; + QString TargetName; + QString UseOfATL; + QString UseOfMfc; + triState WholeProgramOptimization; + + // XML sub-parts + VCXCLCompilerTool compiler; + VCXLibrarianTool librarian; + VCXLinkerTool linker; + VCXMIDLTool idl; + VCXResourceCompilerTool resource; + VCXCustomBuildTool custom; + VCXDeploymentTool deployment; // Not likely to be supported: http://msdn.microsoft.com/en-us/library/sa69he4t.aspx + VCXPostBuildEventTool postBuild; + VCXPreBuildEventTool preBuild; + VCXPreLinkEventTool preLink; +}; + +struct VCXFilterFile +{ + VCXFilterFile() + { excludeFromBuild = false; } + VCXFilterFile(const QString &filename, bool exclude = false ) + { file = filename; excludeFromBuild = exclude; } + VCXFilterFile(const QString &filename, const QString &additional, bool exclude = false ) + { file = filename; excludeFromBuild = exclude; additionalFile = additional; } + bool operator==(const VCXFilterFile &other){ + return file == other.file + && additionalFile == other.additionalFile + && excludeFromBuild == other.excludeFromBuild; + } + + bool excludeFromBuild; + QString file; + QString additionalFile; // For tools like MOC +}; + +class VcxprojGenerator; +class VCXFilter +{ +public: + // Functions + VCXFilter(); + ~VCXFilter(){}; + + void addFile(const QString& filename); + void addFile(const VCXFilterFile& fileInfo); + void addFiles(const QStringList& fileList); + bool addExtraCompiler(const VCXFilterFile &info); + void modifyPCHstage(QString str); + bool outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, const QString &filtername, bool fileAllreadyAdded); + + // Variables + QString Name; + QString Filter; + QString Guid; + triState ParseFiles; + VcxprojGenerator* Project; + VCXConfiguration* Config; + QList Files; + + customBuildCheck CustomBuild; + + bool useCustomBuildTool; + VCXCustomBuildTool CustomBuildTool; + + bool useCompilerTool; + VCXCLCompilerTool CompilerTool; +}; + +typedef QList VCXFilterList; +class VCXProjectSingleConfig +{ +public: + enum FilterTypes { + None, + Source, + Header, + Generated, + LexYacc, + Translation, + Resources, + Extras + }; + // Functions + VCXProjectSingleConfig(){}; + ~VCXProjectSingleConfig(){} + + // Variables + QString Name; + QString Version; + QString ProjectGUID; + QString Keyword; + QString SccProjectName; + QString SccLocalPath; + QString PlatformName; + + // XML sub-parts + VCXConfiguration Configuration; + VCXFilter RootFiles; + VCXFilter SourceFiles; + VCXFilter HeaderFiles; + VCXFilter GeneratedFiles; + VCXFilter LexYaccFiles; + VCXFilter TranslationFiles; + VCXFilter FormFiles; + VCXFilter ResourceFiles; + VCXFilterList ExtraCompilersFiles; + + bool flat_files; + + // Accessor for extracompilers + VCXFilter &filterForExtraCompiler(const QString &compilerName); +}; + + + +// Tree & Flat view of files -------------------------------------------------- +class VCXFilter; +class XNode +{ +public: + virtual ~XNode() { } + void addElement(const VCXFilterFile &file) { + addElement(file.file, file); + } + virtual void addElement(const QString &filepath, const VCXFilterFile &allInfo) = 0; + virtual void removeElements()= 0; + virtual void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &tool, const QString &filter) = 0; + virtual bool hasElements() = 0; +}; + +class XTreeNode : public XNode +{ + typedef QMap ChildrenMap; + VCXFilterFile info; + ChildrenMap children; + +public: + virtual ~XTreeNode() { removeElements(); } + + int pathIndex(const QString &filepath) { + int Windex = filepath.indexOf("\\"); + int Uindex = filepath.indexOf("/"); + if (Windex != -1 && Uindex != -1) + return qMin(Windex, Uindex); + else if (Windex != -1) + return Windex; + return Uindex; + } + + void addElement(const QString &filepath, const VCXFilterFile &allInfo){ + QString newNodeName(filepath); + + int index = pathIndex(filepath); + if (index != -1) + newNodeName = filepath.left(index); + + XTreeNode *n = children.value(newNodeName); + if (!n) { + n = new XTreeNode; + n->info = allInfo; + children.insert(newNodeName, n); + } + if (index != -1) + n->addElement(filepath.mid(index+1), allInfo); + } + + void removeElements() { + ChildrenMap::ConstIterator it = children.constBegin(); + ChildrenMap::ConstIterator end = children.constEnd(); + for( ; it != end; it++) { + (*it)->removeElements(); + delete it.value(); + } + children.clear(); + } + + void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &tool, const QString &filter); + bool hasElements() { + return children.size() != 0; + } +}; + +class XFlatNode : public XNode +{ + typedef QMap ChildrenMapFlat; + ChildrenMapFlat children; + +public: + virtual ~XFlatNode() { removeElements(); } + + int pathIndex(const QString &filepath) { + int Windex = filepath.lastIndexOf("\\"); + int Uindex = filepath.lastIndexOf("/"); + if (Windex != -1 && Uindex != -1) + return qMax(Windex, Uindex); + else if (Windex != -1) + return Windex; + return Uindex; + } + + void addElement(const QString &filepath, const VCXFilterFile &allInfo){ + QString newKey(filepath); + + int index = pathIndex(filepath); + if (index != -1) + newKey = filepath.mid(index+1); + + // Key designed to sort files with same + // name in different paths correctly + children.insert(newKey + "\0" + allInfo.file, allInfo); + } + + void removeElements() { + children.clear(); + } + + void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &proj, const QString &filter); + bool hasElements() { + return children.size() != 0; + } +}; +// ---------------------------------------------------------------------------- + +class VCXProject +{ +public: + // Variables + QString Name; + QString Version; + QString ProjectGUID; + QString Keyword; + QString SccProjectName; + QString SccLocalPath; + QString PlatformName; + + // Single projects + QList SingleProjects; + + // List of all extracompilers + QStringList ExtraCompilers; + + // Functions + void outputFilter(XmlOutput &xml, + XmlOutput &xmlFilter, + const QString &filtername); + + void outputFileConfigs(XmlOutput &xml, + XmlOutput &xmlFilter, + const VCXFilterFile &info, + const QString &filtername); + + void addFilters(XmlOutput &xmlFilter, + const QString &filtername); + +}; + + +XmlOutput &operator<<(XmlOutput &, const VCXCLCompilerTool &); +XmlOutput &operator<<(XmlOutput &, const VCXLinkerTool &); +XmlOutput &operator<<(XmlOutput &, const VCXMIDLTool &); +XmlOutput &operator<<(XmlOutput &, const VCXCustomBuildTool &); +XmlOutput &operator<<(XmlOutput &, const VCXLibrarianTool &); +XmlOutput &operator<<(XmlOutput &, const VCXResourceCompilerTool &); +XmlOutput &operator<<(XmlOutput &, const VCXEventTool &); +XmlOutput &operator<<(XmlOutput &, const VCXDeploymentTool &); +XmlOutput &operator<<(XmlOutput &, const VCXConfiguration &); +XmlOutput &operator<<(XmlOutput &, const VCXProjectSingleConfig &); +XmlOutput &operator<<(XmlOutput &, VCXProject &); + + +QT_END_NAMESPACE + +#endif // MSVC_OBJECTMODEL_H diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 5f3d433..604aa8a 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -41,6 +41,7 @@ #include "msvc_objectmodel.h" #include "msvc_vcproj.h" +#include "msvc_vcxproj.h" #include #include diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index c56187c..3f60a13 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -58,7 +58,8 @@ enum DotNET { NET2002 = 0x70, NET2003 = 0x71, NET2005 = 0x80, - NET2008 = 0x90 + NET2008 = 0x90, + NET2010 = 0x91 }; /* @@ -867,7 +868,7 @@ public: customBuildCheck CustomBuild; - bool useCustomBuildTool; + bool useCustomBuildTool; VCCustomBuildTool CustomBuildTool; bool useCompilerTool; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index f1777e1..8c9bba8 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -77,6 +77,8 @@ struct { const char *regKey; } dotNetCombo[] = { #ifdef Q_OS_WIN64 + {NET2010, "MSVC.NET 2010 (10.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir"}, + {NET2010, "MSVC.NET 2010 Express Edition (10.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir"}, {NET2008, "MSVC.NET 2008 (9.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir"}, {NET2008, "MSVC.NET 2008 Express Edition (9.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir"}, {NET2005, "MSVC.NET 2005 (8.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir"}, @@ -84,6 +86,8 @@ struct { {NET2003, "MSVC.NET 2003 (7.1)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir"}, {NET2002, "MSVC.NET 2002 (7.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir"}, #else + {NET2010, "MSVC.NET 2010 (10.0)", "Software\\Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir"}, + {NET2010, "MSVC.NET 2010 Express Edition (10.0)", "Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir"}, {NET2008, "MSVC.NET 2008 (9.0)", "Software\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir"}, {NET2008, "MSVC.NET 2008 Express Edition (9.0)", "Software\\Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir"}, {NET2005, "MSVC.NET 2005 (8.0)", "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir"}, @@ -165,8 +169,12 @@ DotNET which_dotnet_version() // Flatfile Tags ---------------------------------------------------- const char _slnHeader70[] = "Microsoft Visual Studio Solution File, Format Version 7.00"; const char _slnHeader71[] = "Microsoft Visual Studio Solution File, Format Version 8.00"; -const char _slnHeader80[] = "Microsoft Visual Studio Solution File, Format Version 9.00"; -const char _slnHeader90[] = "Microsoft Visual Studio Solution File, Format Version 10.00"; +const char _slnHeader80[] = "Microsoft Visual Studio Solution File, Format Version 9.00" + "\n# Visual Studio 2005"; +const char _slnHeader90[] = "Microsoft Visual Studio Solution File, Format Version 10.00" + "\n# Visual Studio 2008"; +const char _slnHeader100[] = "Microsoft Visual Studio Solution File, Format Version 11.00" + "\n# Visual Studio 2010"; // The following UUID _may_ change for later servicepacks... // If so we need to search through the registry at // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects @@ -354,6 +362,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) } switch(which_dotnet_version()) { + case NET2010: + t << _slnHeader100; + break; case NET2008: t << _slnHeader90; break; diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index ed67ea7..8f028a1 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -61,7 +61,6 @@ class VcprojGenerator : public Win32MakefileGenerator bool writeMakefile(QTextStream &); bool writeProjectMakefile(); - void writeSubDirs(QTextStream &t); QString findTemplate(QString file); void init(); @@ -119,6 +118,9 @@ protected: void initLexYaccFiles(); void initExtraCompilerOutputs(); + void writeSubDirs(QTextStream &t); // Called from VCXProj backend + QUuid getProjectUUID(const QString &filename=QString()); // Called from VCXProj backend + Target projectTarget; // Used for single project @@ -129,7 +131,6 @@ protected: private: QString fixCommandLine(DotNET version, const QString &input) const; - QUuid getProjectUUID(const QString &filename=QString()); QUuid increaseUUID(const QUuid &id); friend class VCFilter; }; diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp new file mode 100644 index 0000000..6a91c6b --- /dev/null +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -0,0 +1,851 @@ +/**************************************************************************** +** +** 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 qmake application 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 "msvc_vcxproj.h" +#include "msbuild_objectmodel.h" +#include +#include +#include + + +QT_BEGIN_NAMESPACE +// Filter GUIDs (Do NOT change these!) ------------------------------ +const char _GUIDSourceFiles[] = "{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"; +const char _GUIDHeaderFiles[] = "{93995380-89BD-4b04-88EB-625FBE52EBFB}"; +const char _GUIDGeneratedFiles[] = "{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}"; +const char _GUIDResourceFiles[] = "{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}"; +const char _GUIDLexYaccFiles[] = "{E12AE0D2-192F-4d59-BD23-7D3FA58D3183}"; +const char _GUIDTranslationFiles[] = "{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}"; +const char _GUIDFormFiles[] = "{99349809-55BA-4b9d-BF79-8FDBB0286EB3}"; +const char _GUIDExtraCompilerFiles[] = "{E0D8C965-CC5F-43d7-AD63-FAEF0BBC0F85}"; +QT_END_NAMESPACE + +QT_BEGIN_NAMESPACE + + +VcxprojGenerator::VcxprojGenerator() : VcprojGenerator() +{ +} +bool VcxprojGenerator::writeMakefile(QTextStream &t) +{ + initProject(); // Fills the whole project with proper data + + // Generate solution file + if(project->first("TEMPLATE") == "vcsubdirs") { + if (!project->isActiveConfig("build_pass")) { + debug_msg(1, "Generator: MSVC.NET: Writing solution file"); + writeSubDirs(t); + } else { + debug_msg(1, "Generator: MSVC.NET: Not writing solution file for build_pass configs"); + } + return true; + } else + // Generate single configuration project file + if (project->first("TEMPLATE") == "vcapp" || + project->first("TEMPLATE") == "vclib") { + if(!project->isActiveConfig("build_pass")) { + debug_msg(1, "Generator: MSVC.NET: Writing single configuration project file"); + XmlOutput xmlOut(t); + xmlOut << vcxProject; + } + return true; + } + return project->isActiveConfig("build_pass"); + return true; +} + + +void VcxprojGenerator::initProject() +{ + // Initialize XML sub elements + // - Do this first since project elements may need + // - to know of certain configuration options + initConfiguration(); + initRootFiles(); + initSourceFiles(); + initHeaderFiles(); + initGeneratedFiles(); + initLexYaccFiles(); + initTranslationFiles(); + initFormFiles(); + initResourceFiles(); + initExtraCompilerOutputs(); + + // Own elements ----------------------------- + vcxProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET")); + + vcxProject.Keyword = project->first("VCPROJ_KEYWORD"); + if (project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { + vcxProject.PlatformName = vcxProject.Configuration.idl.TargetEnvironment; + if ( vcxProject.Configuration.idl.TargetEnvironment.isEmpty() ) + vcxProject.PlatformName = "Win32"; + } else { + vcxProject.PlatformName = project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; + } + // These are not used by Qt, but may be used by customers + vcxProject.SccProjectName = project->first("SCCPROJECTNAME"); + vcxProject.SccLocalPath = project->first("SCCLOCALPATH"); + vcxProject.flat_files = project->isActiveConfig("flat"); +} + + +void VcxprojGenerator::initConfiguration() +{ + // Initialize XML sub elements + // - Do this first since main configuration elements may need + // - to know of certain compiler/linker options + VCXConfiguration &conf = vcxProject.Configuration; + + initCompilerTool(); + + // Only on configuration per build + bool isDebug = project->isActiveConfig("debug"); + + if(projectTarget == StaticLib) + initLibrarianTool(); + else { + conf.linker.GenerateDebugInformation = isDebug ? _True : _False; + initLinkerTool(); + } + initResourceTool(); + initIDLTool(); + + // Own elements ----------------------------- + QString temp = project->first("BuildBrowserInformation"); + switch (projectTarget) { + case SharedLib: + conf.ConfigurationType = "DynamicLibrary"; + break; + case StaticLib: + conf.ConfigurationType = "StaticLibrary"; + break; + case Application: + default: + conf.ConfigurationType = "Application"; + break; + } + + conf.OutputDirectory = project->first("DESTDIR"); + + if(conf.OutputDirectory.isEmpty()) + conf.OutputDirectory = ".\\"; + + if(!conf.OutputDirectory.endsWith("\\")) + conf.OutputDirectory += '\\'; + + // The target name could have been changed. + conf.TargetName = project->first("TARGET"); + if ( !conf.TargetName.isEmpty() && !project->first("TARGET_VERSION_EXT").isEmpty() && project->isActiveConfig("shared")) + conf.TargetName.append(project->first("TARGET_VERSION_EXT")); + + conf.Name = project->values("BUILD_NAME").join(" "); + if (conf.Name.isEmpty()) + conf.Name = isDebug ? "Debug" : "Release"; + conf.ConfigurationName = conf.Name; + if (project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) { + conf.Name += (conf.idl.TargetEnvironment == "Win64" ? "|Win64" : "|Win32"); + } else { + conf.Name += "|" + project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")"; + } + conf.ATLMinimizesCRunTimeLibraryUsage = (project->first("ATLMinimizesCRunTimeLibraryUsage").isEmpty() ? _False : _True); + conf.BuildBrowserInformation = triState(temp.isEmpty() ? (short)unset : temp.toShort()); + temp = project->first("CharacterSet"); + if (!temp.isEmpty()) + { + switch (charSet(temp.toShort())) { + + case charSetMBCS: + conf.CharacterSet = "MultiByte"; + break; + case charSetUnicode: + conf.CharacterSet = "Unicode"; + break; + case charSetNotSet: + default: + conf.CharacterSet = "NotSet"; + break; + } + conf.CharacterSet = charSet(temp.isEmpty() ? (short)charSetNotSet : temp.toShort()); + } + conf.DeleteExtensionsOnClean = project->first("DeleteExtensionsOnClean"); + conf.ImportLibrary = conf.linker.ImportLibrary; + conf.IntermediateDirectory = project->first("OBJECTS_DIR"); + //conf.OutputDirectory = "."; + conf.PrimaryOutput = project->first("PrimaryOutput"); + conf.WholeProgramOptimization = conf.compiler.WholeProgramOptimization; + temp = project->first("UseOfATL"); + if(!temp.isEmpty()) + { + switch (useOfATL(temp.toShort())) { + + case useATLStatic: + conf.UseOfATL = "Static"; + break; + case useATLDynamic: + conf.UseOfATL = "Dynamic"; + break; + case useATLNotSet: + default: + conf.UseOfATL = "false"; + break; + } + } + temp = project->first("UseOfMfc"); + if(!temp.isEmpty()) + { + switch (useOfMfc(temp.toShort())) { + + case useMfcStatic: + conf.UseOfMfc = "Static"; + break; + case useMfcDynamic: + conf.UseOfMfc = "Dynamic"; + break; + case useMfcStdWin: + default: + conf.UseOfMfc = "false"; + break; + } + } + + // Configuration does not need parameters from + // these sub XML items; + initCustomBuildTool(); + initPreBuildEventTools(); + initPostBuildEventTools(); + // Only deploy for CE projects + if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) + initDeploymentTool(); + initPreLinkEventTools(); + + // Set definite values in both configurations + if (isDebug) { + conf.compiler.PreprocessorDefinitions.removeAll("NDEBUG"); + } else { + conf.compiler.PreprocessorDefinitions += "NDEBUG"; + } +} + + +void VcxprojGenerator::initCompilerTool() +{ + QString placement = project->first("OBJECTS_DIR"); + if(placement.isEmpty()) + placement = ".\\"; + + VCXConfiguration &conf = vcxProject.Configuration; + conf.compiler.AssemblerListingLocation = placement ; + conf.compiler.ProgramDataBaseFileName = ".\\" ; + conf.compiler.ObjectFileName = placement ; + // PCH + if (usePCH) { + conf.compiler.PrecompiledHeader = "Use"; + conf.compiler.PrecompiledHeaderOutputFile = "$(IntDir)\\" + precompPch; + conf.compiler.PrecompiledHeaderFile = project->first("PRECOMPILED_HEADER"); + conf.compiler.ForcedIncludeFiles = project->values("PRECOMPILED_HEADER"); + conf.compiler.PreprocessToFile = _False; + conf.compiler.PreprocessSuppressLineNumbers = _False; + // Minimal build option triggers an Internal Compiler Error + // when used in conjunction with /FI and /Yu, so remove it + project->values("QMAKE_CFLAGS_DEBUG").removeAll("-Gm"); + project->values("QMAKE_CFLAGS_DEBUG").removeAll("/Gm"); + project->values("QMAKE_CXXFLAGS_DEBUG").removeAll("-Gm"); + project->values("QMAKE_CXXFLAGS_DEBUG").removeAll("/Gm"); + } + + conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS")); + if(project->isActiveConfig("debug")){ + // Debug version + conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_DEBUG")); + if((projectTarget == Application) || (projectTarget == StaticLib)) + conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_MT_DBG")); + else + conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_MT_DLLDBG")); + } else { + // Release version + conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_RELEASE")); + conf.compiler.PreprocessorDefinitions += "QT_NO_DEBUG"; + conf.compiler.PreprocessorDefinitions += "NDEBUG"; + if((projectTarget == Application) || (projectTarget == StaticLib)) + conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_MT")); + else + conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_MT_DLL")); + } + + // Common for both release and debug + if(project->isActiveConfig("warn_off")) + conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_WARN_OFF")); + else if(project->isActiveConfig("warn_on")) + conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_WARN_ON")); + if(project->isActiveConfig("windows")) + conf.compiler.PreprocessorDefinitions += project->values("MSVCPROJ_WINCONDEF"); + + // Can this be set for ALL configs? + // If so, use qmake.conf! + if(projectTarget == SharedLib) + conf.compiler.PreprocessorDefinitions += "_WINDOWS"; + + conf.compiler.PreprocessorDefinitions += project->values("DEFINES"); + conf.compiler.PreprocessorDefinitions += project->values("PRL_EXPORT_DEFINES"); + conf.compiler.parseOptions(project->values("MSVCPROJ_INCPATH")); +} + +void VcxprojGenerator::initLinkerTool() +{ + findLibraries(); // Need to add the highest version of the libs + VCXConfiguration &conf = vcxProject.Configuration; + conf.linker.parseOptions(project->values("MSVCPROJ_LFLAGS")); + + foreach(QString libs, project->values("MSVCPROJ_LIBS")) { + if (libs.left(9).toUpper() == "/LIBPATH:") { + QStringList l = QStringList(libs); + conf.linker.parseOptions(l); + } else { + conf.linker.AdditionalDependencies += libs; + } + } + + switch (projectTarget) { + case Application: + conf.linker.OutputFile = project->first("DESTDIR"); + break; + case SharedLib: + conf.linker.parseOptions(project->values("MSVCPROJ_LIBOPTIONS")); + conf.linker.OutputFile = project->first("DESTDIR"); + break; + case StaticLib: //unhandled - added to remove warnings.. + break; + } + + if(conf.linker.OutputFile.isEmpty()) + conf.linker.OutputFile = ".\\"; + + if(!conf.linker.OutputFile.endsWith("\\")) + conf.linker.OutputFile += '\\'; + + conf.linker.OutputFile += project->first("MSVCPROJ_TARGET"); + + if(project->isActiveConfig("debug")){ + conf.linker.parseOptions(project->values("QMAKE_LFLAGS_DEBUG")); + } else { + conf.linker.parseOptions(project->values("QMAKE_LFLAGS_RELEASE")); + } + + if(project->isActiveConfig("dll")){ + conf.linker.parseOptions(project->values("QMAKE_LFLAGS_QT_DLL")); + } + + if(project->isActiveConfig("console")){ + conf.linker.parseOptions(project->values("QMAKE_LFLAGS_CONSOLE")); + } else { + conf.linker.parseOptions(project->values("QMAKE_LFLAGS_WINDOWS")); + } + +} + +void VcxprojGenerator::initResourceTool() +{ + VCXConfiguration &conf = vcxProject.Configuration; + conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions; + + // We need to add _DEBUG for the debug version of the project, since the normal compiler defines + // do not contain it. (The compiler defines this symbol automatically, which is wy we don't need + // to add it for the compiler) However, the resource tool does not do this. + if(project->isActiveConfig("debug")) + conf.resource.PreprocessorDefinitions += "_DEBUG"; + if(project->isActiveConfig("staticlib")) + conf.resource.ResourceOutputFileName = project->first("DESTDIR") + "/$(InputName).res"; +} + + +void VcxprojGenerator::initPostBuildEventTools() +{ + VCXConfiguration &conf = vcxProject.Configuration; + if(!project->values("QMAKE_POST_LINK").isEmpty()) { + QString cmdline = var("QMAKE_POST_LINK"); + conf.postBuild.CommandLine = cmdline; + conf.postBuild.Description = cmdline; + } + + QString signature = !project->isEmpty("SIGNATURE_FILE") ? var("SIGNATURE_FILE") : var("DEFAULT_SIGNATURE"); + bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") && + !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); + if(useSignature) + conf.postBuild.CommandLine.prepend(QLatin1String("signtool sign /F ") + signature + " \"$(TargetPath)\"\n" + + (!conf.postBuild.CommandLine.isEmpty() ? " && " : "")); + + if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { + if(!conf.postBuild.CommandLine.isEmpty()) + conf.postBuild.CommandLine += " && "; + conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC"); + conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL"); + } +} + + +void VcxprojGenerator::initDeploymentTool() +{ + VCXConfiguration &conf = vcxProject.Configuration; + QString targetPath = project->values("deploy.path").join(" "); + if (targetPath.isEmpty()) + targetPath = QString("%CSIDL_PROGRAM_FILES%\\") + project->first("TARGET"); + if (targetPath.endsWith("/") || targetPath.endsWith("\\")) + targetPath.chop(1); + + // Only deploy Qt libs for shared build + if (!project->values("QMAKE_QT_DLL").isEmpty()) { + QStringList& arg = project->values("MSVCPROJ_LIBS"); + for (QStringList::ConstIterator it = arg.constBegin(); it != arg.constEnd(); ++it) { + if (it->contains(project->first("QMAKE_LIBDIR"))) { + QString dllName = *it; + + if (dllName.contains(QLatin1String("QAxContainer")) + || dllName.contains(QLatin1String("qtmain")) + || dllName.contains(QLatin1String("QtUiTools"))) + continue; + dllName.replace(QLatin1String(".lib") , QLatin1String(".dll")); + QFileInfo info(dllName); + conf.deployment.AdditionalFiles += info.fileName() + + "|" + QDir::toNativeSeparators(info.absolutePath()) + + "|" + targetPath + + "|0;"; + } + } + } + + // C-runtime deployment + QString runtime = project->values("QT_CE_C_RUNTIME").join(QLatin1String(" ")); + if (!runtime.isEmpty() && (runtime != QLatin1String("no"))) { + QString runtimeVersion = QLatin1String("msvcr"); + QString mkspec = project->first("QMAKESPEC"); + // If no .qmake.cache has been found, we fallback to the original mkspec + if (mkspec.isEmpty()) + mkspec = project->first("QMAKESPEC_ORIGINAL"); + + if (!mkspec.isEmpty()) { + if (mkspec.endsWith("2010")) + runtimeVersion.append("100"); + else if (mkspec.endsWith("2008")) + runtimeVersion.append("90"); + else + runtimeVersion.append("80"); + if (project->isActiveConfig("debug")) + runtimeVersion.append("d"); + runtimeVersion.append(".dll"); + + if (runtime == "yes") { + // Auto-find C-runtime + QString vcInstallDir = qgetenv("VCINSTALLDIR"); + if (!vcInstallDir.isEmpty()) { + vcInstallDir += "\\ce\\dll\\"; + vcInstallDir += project->values("CE_ARCH").join(QLatin1String(" ")); + if (!QFileInfo(vcInstallDir + QDir::separator() + runtimeVersion).exists()) + runtime.clear(); + else + runtime = vcInstallDir; + } + } + } + + if (!runtime.isEmpty() && runtime != QLatin1String("yes")) { + conf.deployment.AdditionalFiles += runtimeVersion + + "|" + QDir::toNativeSeparators(runtime) + + "|" + targetPath + + "|0;"; + } + } + + // foreach item in DEPLOYMENT + foreach(QString item, project->values("DEPLOYMENT")) { + // get item.path + QString devicePath = project->first(item + ".path"); + if (devicePath.isEmpty()) + devicePath = targetPath; + // check if item.path is relative (! either /,\ or %) + if (!(devicePath.at(0) == QLatin1Char('/') + || devicePath.at(0) == QLatin1Char('\\') + || devicePath.at(0) == QLatin1Char('%'))) { + // create output path + devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath)); + } + // foreach d in item.sources + foreach(QString source, project->values(item + ".sources")) { + QString itemDevicePath = devicePath; + source = Option::fixPathToLocalOS(source); + QString nameFilter; + QFileInfo info(source); + QString searchPath; + if (info.isDir()) { + nameFilter = QLatin1String("*"); + itemDevicePath += "\\" + info.fileName(); + searchPath = info.absoluteFilePath(); + } else { + nameFilter = source.split('\\').last(); + searchPath = info.absolutePath(); + } + + int pathSize = searchPath.size(); + QDirIterator iterator(searchPath, QStringList() << nameFilter + , QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks + , QDirIterator::Subdirectories); + // foreach dirIterator-entry in d + while(iterator.hasNext()) { + iterator.next(); + QString absoluteItemPath = Option::fixPathToLocalOS(QFileInfo(iterator.filePath()).absolutePath()); + // Identify if it is just another subdir + int diffSize = absoluteItemPath.size() - pathSize; + // write out rules + conf.deployment.AdditionalFiles += iterator.fileName() + + "|" + absoluteItemPath + + "|" + itemDevicePath + (diffSize ? (absoluteItemPath.right(diffSize)) : QLatin1String("")) + + "|0;"; + } + } + } +} + +void VcxprojGenerator::initPreLinkEventTools() +{ + VCXConfiguration &conf = vcxProject.Configuration; + if(!project->values("QMAKE_PRE_LINK").isEmpty()) { + QString cmdline = var("QMAKE_PRE_LINK"); + conf.preLink.Description = cmdline; + conf.preLink.CommandLine = cmdline; + } +} + +void VcxprojGenerator::initRootFiles() +{ + vcxProject.RootFiles.addFiles(project->values("RC_FILE")); + vcxProject.RootFiles.Project = this; + vcxProject.RootFiles.Config = &(vcxProject.Configuration); + vcxProject.RootFiles.CustomBuild = none; +} + +void VcxprojGenerator::initSourceFiles() +{ + vcxProject.SourceFiles.Name = "Source Files"; + vcxProject.SourceFiles.Filter = "cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"; + vcxProject.SourceFiles.Guid = _GUIDSourceFiles; + + vcxProject.SourceFiles.addFiles(project->values("SOURCES")); + + vcxProject.SourceFiles.Project = this; + vcxProject.SourceFiles.Config = &(vcxProject.Configuration); + vcxProject.SourceFiles.CustomBuild = none; +} + +void VcxprojGenerator::initHeaderFiles() +{ + vcxProject.HeaderFiles.Name = "Header Files"; + vcxProject.HeaderFiles.Filter = "h;hpp;hxx;hm;inl;inc;xsd"; + vcxProject.HeaderFiles.Guid = _GUIDHeaderFiles; + + vcxProject.HeaderFiles.addFiles(project->values("HEADERS")); + if (usePCH) // Generated PCH cpp file + vcxProject.HeaderFiles.addFile(precompH); + + vcxProject.HeaderFiles.Project = this; + vcxProject.HeaderFiles.Config = &(vcxProject.Configuration); +} + +void VcxprojGenerator::initGeneratedFiles() +{ + vcxProject.GeneratedFiles.Name = "Generated Files"; + vcxProject.GeneratedFiles.Filter = "cpp;c;cxx;moc;h;def;odl;idl;res"; + vcxProject.GeneratedFiles.Guid = _GUIDGeneratedFiles; + + // ### These cannot have CustomBuild (mocSrc)!! + vcxProject.GeneratedFiles.addFiles(project->values("GENERATED_SOURCES")); + vcxProject.GeneratedFiles.addFiles(project->values("GENERATED_FILES")); + vcxProject.GeneratedFiles.addFiles(project->values("IDLSOURCES")); + vcxProject.GeneratedFiles.addFiles(project->values("RES_FILE")); + vcxProject.GeneratedFiles.addFiles(project->values("QMAKE_IMAGE_COLLECTION")); // compat + if(!extraCompilerOutputs.isEmpty()) + vcxProject.GeneratedFiles.addFiles(extraCompilerOutputs.keys()); + + vcxProject.GeneratedFiles.Project = this; + vcxProject.GeneratedFiles.Config = &(vcxProject.Configuration); +} + +void VcxprojGenerator::initLexYaccFiles() +{ + vcxProject.LexYaccFiles.Name = "Lex / Yacc Files"; + vcxProject.LexYaccFiles.ParseFiles = _False; + vcxProject.LexYaccFiles.Filter = "l;y"; + vcxProject.LexYaccFiles.Guid = _GUIDLexYaccFiles; + + vcxProject.LexYaccFiles.addFiles(project->values("LEXSOURCES")); + vcxProject.LexYaccFiles.addFiles(project->values("YACCSOURCES")); + + vcxProject.LexYaccFiles.Project = this; + vcxProject.LexYaccFiles.Config = &(vcxProject.Configuration); + vcxProject.LexYaccFiles.CustomBuild = lexyacc; +} + +void VcxprojGenerator::initTranslationFiles() +{ + vcxProject.TranslationFiles.Name = "Translation Files"; + vcxProject.TranslationFiles.ParseFiles = _False; + vcxProject.TranslationFiles.Filter = "ts;xlf"; + vcxProject.TranslationFiles.Guid = _GUIDTranslationFiles; + + vcxProject.TranslationFiles.addFiles(project->values("TRANSLATIONS")); + + vcxProject.TranslationFiles.Project = this; + vcxProject.TranslationFiles.Config = &(vcxProject.Configuration); + vcxProject.TranslationFiles.CustomBuild = none; +} + + +void VcxprojGenerator::initFormFiles() +{ + vcxProject.FormFiles.Name = "Form Files"; + vcxProject.FormFiles.ParseFiles = _False; + vcxProject.FormFiles.Filter = "ui"; + vcxProject.FormFiles.Guid = _GUIDFormFiles; + + vcxProject.FormFiles.addFiles(project->values("FORMS")); + vcxProject.FormFiles.addFiles(project->values("FORMS3")); + + vcxProject.FormFiles.Project = this; + vcxProject.FormFiles.Config = &(vcxProject.Configuration); + vcxProject.FormFiles.CustomBuild = none; +} + + +void VcxprojGenerator::initResourceFiles() +{ + vcxProject.ResourceFiles.Name = "Resource Files"; + vcxProject.ResourceFiles.ParseFiles = _False; + vcxProject.ResourceFiles.Filter = "qrc;*"; //"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;ts;xlf;qrc"; + vcxProject.ResourceFiles.Guid = _GUIDResourceFiles; + + // Bad hack, please look away ------------------------------------- + QString rcc_dep_cmd = project->values("rcc.depend_command").join(" "); + if(!rcc_dep_cmd.isEmpty()) { + QStringList qrc_files = project->values("RESOURCES"); + QStringList deps; + if(!qrc_files.isEmpty()) { + for (int i = 0; i < qrc_files.count(); ++i) { + char buff[256]; + QString dep_cmd = replaceExtraCompilerVariables(rcc_dep_cmd, qrc_files.at(i),""); + + dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false); + if(canExecute(dep_cmd)) { + if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { + QString indeps; + while(!feof(proc)) { + int read_in = (int)fread(buff, 1, 255, proc); + if(!read_in) + break; + indeps += QByteArray(buff, read_in); + } + QT_PCLOSE(proc); + if(!indeps.isEmpty()) + deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' ')); + } + } + } + vcxProject.ResourceFiles.addFiles(deps); + } + } + // You may look again -------------------------------------------- + + vcxProject.ResourceFiles.addFiles(project->values("RESOURCES")); + vcxProject.ResourceFiles.addFiles(project->values("IMAGES")); + + vcxProject.ResourceFiles.Project = this; + vcxProject.ResourceFiles.Config = &(vcxProject.Configuration); + vcxProject.ResourceFiles.CustomBuild = none; +} + +void VcxprojGenerator::initExtraCompilerOutputs() +{ + QStringList otherFilters; + otherFilters << "FORMS" + << "FORMS3" + << "GENERATED_FILES" + << "GENERATED_SOURCES" + << "HEADERS" + << "IDLSOURCES" + << "IMAGES" + << "LEXSOURCES" + << "QMAKE_IMAGE_COLLECTION" + << "RC_FILE" + << "RESOURCES" + << "RES_FILE" + << "SOURCES" + << "TRANSLATIONS" + << "YACCSOURCES"; + const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS"); + for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { + QString extracompilerName = project->first((*it) + ".name"); + if (extracompilerName.isEmpty()) + extracompilerName = (*it); + + // Create an extra compiler filter and add the files + VCXFilter extraCompile; + extraCompile.Name = extracompilerName; + extraCompile.ParseFiles = _False; + extraCompile.Filter = ""; + extraCompile.Guid = QString(_GUIDExtraCompilerFiles) + "-" + (*it); + + // If the extra compiler has a variable_out set the output file + // is added to an other file list, and does not need its own.. + bool addOnInput = hasBuiltinCompiler(project->first((*it) + ".output")); + QString tmp_other_out = project->first((*it) + ".variable_out"); + if (!tmp_other_out.isEmpty() && !addOnInput) + continue; + + if (!addOnInput) { + QString tmp_out = project->first((*it) + ".output"); + if (project->values((*it) + ".CONFIG").indexOf("combine") != -1) { + // Combined output, only one file result + extraCompile.addFile( + Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, QString(), QString()), false)); + } else { + // One output file per input + QStringList tmp_in = project->values(project->first((*it) + ".input")); + for (int i = 0; i < tmp_in.count(); ++i) { + const QString &filename = tmp_in.at(i); + if (extraCompilerSources.contains(filename)) + extraCompile.addFile( + Option::fixPathToTargetOS(replaceExtraCompilerVariables(filename, tmp_out, QString()), false)); + } + } + } else { + // In this case we the outputs have a built-in compiler, so we cannot add the custom + // build steps there. So, we turn it around and add it to the input files instead, + // provided that the input file variable is not handled already (those in otherFilters + // are handled, so we avoid them). + QStringList inputVars = project->values((*it) + ".input"); + foreach(QString inputVar, inputVars) { + if (!otherFilters.contains(inputVar)) { + QStringList tmp_in = project->values(inputVar); + for (int i = 0; i < tmp_in.count(); ++i) { + const QString &filename = tmp_in.at(i); + if (extraCompilerSources.contains(filename)) + extraCompile.addFile( + Option::fixPathToTargetOS(replaceExtraCompilerVariables(filename, QString(), QString()), false)); + } + } + } + } + extraCompile.Project = this; + extraCompile.Config = &(vcxProject.Configuration); + extraCompile.CustomBuild = none; + + vcxProject.ExtraCompilersFiles.append(extraCompile); + } +} + + + +bool VcxprojGenerator::writeProjectMakefile() +{ + usePlatformDir(); + QTextStream t(&Option::output); + + // Check if all requirements are fulfilled + if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) { + fprintf(stderr, "Project file not generated because all requirements not met:\n\t%s\n", + var("QMAKE_FAILED_REQUIREMENTS").toLatin1().constData()); + return true; + } + + // Generate project file + if(project->first("TEMPLATE") == "vcapp" || + project->first("TEMPLATE") == "vclib") { + if (!mergedProjects.count()) { + warn_msg(WarnLogic, "Generator: MSVC.NET: no single configuration created, cannot output project!"); + return false; + } + + debug_msg(1, "Generator: MSVC.NET: Writing project file"); + VCXProject mergedProject; + for (int i = 0; i < mergedProjects.count(); ++i) { + VCXProjectSingleConfig *singleProject = &(mergedProjects.at(i)->vcxProject); + mergedProject.SingleProjects += *singleProject; + for (int j = 0; j < singleProject->ExtraCompilersFiles.count(); ++j) { + const QString &compilerName = singleProject->ExtraCompilersFiles.at(j).Name; + if (!mergedProject.ExtraCompilers.contains(compilerName)) + mergedProject.ExtraCompilers += compilerName; + } + } + + if(mergedProjects.count() > 1 && + mergedProjects.at(0)->vcxProject.Name == + mergedProjects.at(1)->vcxProject.Name) + mergedProjects.at(0)->writePrlFile(); + mergedProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET")); + mergedProject.Version = mergedProjects.at(0)->vcxProject.Version; + mergedProject.ProjectGUID = project->isEmpty("QMAKE_UUID") ? getProjectUUID().toString().toUpper() : project->first("QMAKE_UUID"); + mergedProject.Keyword = project->first("VCPROJ_KEYWORD"); + mergedProject.SccProjectName = mergedProjects.at(0)->vcxProject.SccProjectName; + mergedProject.SccLocalPath = mergedProjects.at(0)->vcxProject.SccLocalPath; + mergedProject.PlatformName = mergedProjects.at(0)->vcxProject.PlatformName; + + XmlOutput xmlOut(t); + xmlOut << mergedProject; + return true; + } else if(project->first("TEMPLATE") == "vcsubdirs") { + return writeMakefile(t); + } + return false; +} + + + + +bool VcxprojGenerator::mergeBuildProject(MakefileGenerator *other) +{ + VcxprojGenerator *otherVC = static_cast(other); + if (!otherVC) { + warn_msg(WarnLogic, "VcxprojGenerator: Cannot merge other types of projects! (ignored)"); + return false; + } + mergedProjects += otherVC; + return true; +} + +QT_END_NAMESPACE + diff --git a/qmake/generators/win32/msvc_vcxproj.h b/qmake/generators/win32/msvc_vcxproj.h new file mode 100644 index 0000000..8a183e9 --- /dev/null +++ b/qmake/generators/win32/msvc_vcxproj.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** 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 qmake application 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 MSVC_VCXPROJ_H +#define MSVC_VCXPROJ_H + +#include "winmakefile.h" +#include "msbuild_objectmodel.h" +#include "msvc_vcproj.h" + +QT_BEGIN_NAMESPACE + +class VcxprojGenerator : public VcprojGenerator +{ + bool writeMakefile(QTextStream &); + bool writeProjectMakefile(); + +public: + VcxprojGenerator(); + ~VcxprojGenerator(); + +protected: + virtual bool supportsMetaBuild() { return true; } + virtual bool supportsMergedBuilds() { return true; } + virtual bool mergeBuildProject(MakefileGenerator *other); + + virtual void initProject(); + + void initConfiguration(); + void initCompilerTool(); + void initDeploymentTool(); + void initLinkerTool(); + void initPreLinkEventTools(); + void initPostBuildEventTools(); + void initRootFiles(); + void initResourceTool(); + void initSourceFiles(); + void initHeaderFiles(); + void initGeneratedFiles(); + void initTranslationFiles(); + void initFormFiles(); + void initResourceFiles(); + void initLexYaccFiles(); + void initExtraCompilerOutputs(); + + // Used for single project + VCXProjectSingleConfig vcxProject; + + // Holds all configurations for glue (merged) project + QList mergedProjects; + +private: + friend class VCXFilter; + +}; + +inline VcxprojGenerator::~VcxprojGenerator() +{ } + +QT_END_NAMESPACE + +#endif // MSVC_VCXPROJ_H diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp index e8578aa..718bdd6 100644 --- a/qmake/generators/xmloutput.cpp +++ b/qmake/generators/xmloutput.cpp @@ -81,6 +81,11 @@ void XmlOutput::setState(XMLState state) currentState = state; } +void XmlOutput::setFormat(XMLFormat newFormat) +{ + format = newFormat; +} + XmlOutput::XMLState XmlOutput::state() { return currentState; @@ -172,6 +177,20 @@ XmlOutput& XmlOutput::operator<<(const xml_output& o) case tTag: newTagOpen(o.xo_text); break; + case tTagValue: + addRaw(QString("\n%1<%2>").arg(currentIndent).arg(o.xo_text)); + addRaw(QString("%1").arg(o.xo_value)); + addRaw(QString("").arg(o.xo_text)); + break; + case tValueTag: + addRaw(QString("%1").arg(doConversion(o.xo_text))); + setFormat(NoNewLine); + closeTag(); + setFormat(NewLine); + break; + case tImport: + addRaw(QString("\n%1").arg(currentIndent).arg(o.xo_text).arg(o.xo_value)); + break; case tCloseTag: if (o.xo_value.count()) closeAll(); @@ -183,6 +202,9 @@ XmlOutput& XmlOutput::operator<<(const xml_output& o) case tAttribute: addAttribute(o.xo_text, o.xo_value); break; + case tAttributeTag: + addAttributeTag(o.xo_text, o.xo_value); + break; case tData: { // Special case to be able to close tag in normal @@ -266,7 +288,7 @@ void XmlOutput::closeTag() tagStack.pop_back(); break; case Attribute: - xmlFile << "/>"; + xmlFile << " />"; tagStack.pop_back(); currentState = Tag; decreaseIndent(); // <--- Post-decrease indent @@ -307,7 +329,7 @@ void XmlOutput::addDeclaration(const QString &version, const QString &encoding) qDebug("<%s>: Cannot add declaration when not in bare state", tagStack.last().toLatin1().constData()); return; } - QString outData = QString("") + QString outData = QString("") .arg(doConversion(version)) .arg(doConversion(encoding)); addRaw(outData); @@ -337,4 +359,20 @@ void XmlOutput::addAttribute(const QString &attribute, const QString &value) xmlFile << currentIndent << doConversion(attribute) << "=\"" << doConversion(value) << "\""; } +void XmlOutput::addAttributeTag(const QString &attribute, const QString &value) +{ + switch(currentState) { + case Bare: + case Tag: + //warn_msg(WarnLogic, "<%s>: Cannot add attribute since tags not open", tagStack.last().toLatin1().constData()); + qDebug("<%s>: Cannot add attribute (%s) since tag's not open", + (tagStack.count() ? tagStack.last().toLatin1().constData() : "Root"), + attribute.toLatin1().constData()); + return; + case Attribute: + break; + } + xmlFile << " " << doConversion(attribute) << "=\"" << doConversion(value) << "\""; +} + QT_END_NAMESPACE diff --git a/qmake/generators/xmloutput.h b/qmake/generators/xmloutput.h index a472c99..7c0667c 100644 --- a/qmake/generators/xmloutput.h +++ b/qmake/generators/xmloutput.h @@ -69,9 +69,13 @@ public: tRaw, // Raw text (no formating) tDeclaration, // tTag, // value + tValueTag, // value tCloseTag, // Closes an open tag tAttribute, // attribute2="value"> + tAttributeTag, // attribute on the same line as a tag tData, // Tag data (formating done) + tImport, // tComment, // tCDATA // }; @@ -85,6 +89,7 @@ public: void setIndentLevel(int level); int indentLevel(); void setState(XMLState state); + void setFormat(XMLFormat newFormat); XMLState state(); @@ -121,6 +126,7 @@ private: void addDeclaration(const QString &version, const QString &encoding); void addRaw(const QString &rawText); void addAttribute(const QString &attribute, const QString &value); + void addAttributeTag(const QString &attribute, const QString &value); void addData(const QString &data); // Data @@ -163,6 +169,22 @@ inline XmlOutput::xml_output tag(const QString &name) return XmlOutput::xml_output(XmlOutput::tTag, name, QString()); } + +inline XmlOutput::xml_output valueTag(const QString &value) +{ + return XmlOutput::xml_output(XmlOutput::tValueTag, value, QString()); +} + +inline XmlOutput::xml_output tagValue(const QString &tagName, const QString &value) +{ + return XmlOutput::xml_output(XmlOutput::tTagValue, tagName, value); +} + +inline XmlOutput::xml_output import(const QString &tagName, const QString &value) +{ + return XmlOutput::xml_output(XmlOutput::tImport, tagName, value); +} + inline XmlOutput::xml_output closetag() { return XmlOutput::xml_output(XmlOutput::tCloseTag, QString(), QString()); @@ -184,12 +206,24 @@ inline XmlOutput::xml_output attribute(const QString &name, return XmlOutput::xml_output(XmlOutput::tAttribute, name, value); } +inline XmlOutput::xml_output attributeTag(const QString &name, + const QString &value) +{ + return XmlOutput::xml_output(XmlOutput::tAttributeTag, name, value); +} + inline XmlOutput::xml_output attr(const QString &name, const QString &value) { return attribute(name, value); } +inline XmlOutput::xml_output attrTag(const QString &name, + const QString &value) +{ + return attributeTag(name, value); +} + inline XmlOutput::xml_output data(const QString &text = QString()) { return XmlOutput::xml_output(XmlOutput::tData, text, QString()); diff --git a/qmake/qmake.pro b/qmake/qmake.pro index f3f9d53..4213253 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -19,7 +19,8 @@ VPATH += $$QT_SOURCE_TREE/src/corelib/global \ $$QT_SOURCE_TREE/src/corelib/plugin \ $$QT_SOURCE_TREE/src/corelib/xml \ $$QT_SOURCE_TREE/src/corelib/io -INCPATH += generators \ +INCPATH += . \ + generators \ generators/unix \ generators/win32 \ generators/mac \ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 8a004fc..f4bd92e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1186,7 +1186,8 @@ void Configure::parseCmdLine() dictionary[ "QMAKESPEC" ].endsWith( "-msvc2002" ) || dictionary[ "QMAKESPEC" ].endsWith( "-msvc2003" ) || dictionary[ "QMAKESPEC" ].endsWith( "-msvc2005" ) || - dictionary[ "QMAKESPEC" ].endsWith( "-msvc2008" )) { + dictionary[ "QMAKESPEC" ].endsWith( "-msvc2008" ) || + dictionary[ "QMAKESPEC" ].endsWith( "-msvc2010" )) { if ( dictionary[ "MAKE" ].isEmpty() ) dictionary[ "MAKE" ] = "nmake"; dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32"; } else if ( dictionary[ "QMAKESPEC" ] == QString( "win32-g++" ) ) { @@ -2095,7 +2096,7 @@ bool Configure::checkAvailability(const QString &part) } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS" || part == "DECLARATIVE") { available = true; } else if (part == "WEBKIT") { - available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++"); + available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-msvc2010") || (dictionary.value("QMAKESPEC") == "win32-g++"); } else if (part == "AUDIO_BACKEND") { available = true; if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 60b8dcc..943a8a2 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -80,6 +80,7 @@ struct CompilerInfo{ {CC_NET2003, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2003 (7.1)", "Software\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe {CC_NET2005, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2005 (8.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\8.0", "cl.exe"}, // link.exe, lib.exe {CC_NET2008, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2008 (9.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\9.0", "cl.exe"}, // link.exe, lib.exe + {CC_NET2010, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2010 (10.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\10.0", "cl.exe"}, // link.exe, lib.exe {CC_UNKNOWN, "Unknown", 0, 0}, }; @@ -105,6 +106,9 @@ QString Environment::detectQMakeSpec() { QString spec; switch (detectCompiler()) { + case CC_NET2010: + spec = "win32-msvc2010"; + break; case CC_NET2008: spec = "win32-msvc2008"; break; diff --git a/tools/configure/environment.h b/tools/configure/environment.h index b1cbe3a..16af8df 100644 --- a/tools/configure/environment.h +++ b/tools/configure/environment.h @@ -56,7 +56,8 @@ enum Compiler { CC_NET2002 = 0x70, CC_NET2003 = 0x71, CC_NET2005 = 0x80, - CC_NET2008 = 0x90 + CC_NET2008 = 0x90, + CC_NET2010 = 0x91 }; struct CompilerInfo; -- cgit v0.12 From d2e32241b227a7662390ade8639f48804493f6fc Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 21 Apr 2010 12:48:45 +0200 Subject: New configure.exe binary --- configure.exe | Bin 1318400 -> 1318400 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index ab97e1e..f1e0215 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From 94cca4856d4a023a6f79ddc290c4495803557e93 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 21 Apr 2010 13:56:48 +0200 Subject: Fix parsing of regular expression literals. Recognize regular expression classes and escape sequences. Task-number: QTBUG-8108 Reviewed-by: Olivier Goffart --- src/declarative/qml/parser/qdeclarativejslexer.cpp | 108 +++++++++++++++------ .../declarative/parserstress/tst_parserstress.cpp | 3 +- 2 files changed, 80 insertions(+), 31 deletions(-) diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp index a686dca..975ad4c 100644 --- a/src/declarative/qml/parser/qdeclarativejslexer.cpp +++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp @@ -1144,47 +1144,97 @@ void Lexer::recordStartPos() bool Lexer::scanRegExp(RegExpBodyPrefix prefix) { pos16 = 0; - bool lastWasEscape = false; + pattern = 0; if (prefix == EqualPrefix) record16(QLatin1Char('=')); - while (1) { - if (isLineTerminator() || current == 0) { + while (true) { + switch (current) { + + case 0: // eof + case '\n': case '\r': // line terminator errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression literal"); return false; - } - else if (current != '/' || lastWasEscape == true) - { - record16(current); - lastWasEscape = !lastWasEscape && (current == '\\'); - } - else { - if (driver) + + case '/': + shift(1); + + if (driver) // create the pattern pattern = driver->intern(buffer16, pos16); - else - pattern = 0; + + // scan the flags pos16 = 0; + flags = 0; + while (isIdentLetter(current)) { + int flag = Ecma::RegExp::flagFromChar(current); + if (flag == 0) { + errmsg = QCoreApplication::translate("QDeclarativeParser", "Invalid regular expression flag '%0'") + .arg(QChar(current)); + return false; + } + flags |= flag; + record16(current); + shift(1); + } + return true; + + case '\\': + // regular expression backslash sequence + record16(current); + shift(1); + + if (! current || isLineTerminator()) { + errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression backslash sequence"); + return false; + } + + record16(current); shift(1); break; - } - shift(1); - } - flags = 0; - while (isIdentLetter(current)) { - int flag = Ecma::RegExp::flagFromChar(current); - if (flag == 0) { - errmsg = QCoreApplication::translate("QDeclarativeParser", "Invalid regular expression flag '%0'") - .arg(QChar(current)); - return false; - } - flags |= flag; - record16(current); - shift(1); - } + case '[': + // regular expression class + record16(current); + shift(1); + + while (current && ! isLineTerminator()) { + if (current == ']') + break; + else if (current == '\\') { + // regular expression backslash sequence + record16(current); + shift(1); + + if (! current || isLineTerminator()) { + errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression backslash sequence"); + return false; + } + + record16(current); + shift(1); + } else { + record16(current); + shift(1); + } + } + + if (current != ']') { + errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression class"); + return false; + } + + record16(current); + shift(1); // skip ] + break; + + default: + record16(current); + shift(1); + } // switch + } // while - return true; + return false; } void Lexer::syncProhibitAutomaticSemicolon() diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp index f61ca9f..f1e9c6e 100644 --- a/tests/auto/declarative/parserstress/tst_parserstress.cpp +++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp @@ -131,8 +131,7 @@ void tst_parserstress::ecmascript() QDeclarativeComponent component(&engine); component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml"))); QSet failingTests; - failingTests << "regress-352044-02-n.js" - << "regress-334158.js"; + failingTests << "regress-352044-02-n.js"; QFileInfo info(file); foreach (const QString &failing, failingTests) { if (info.fileName().endsWith(failing)) { -- cgit v0.12 From 44a28b5530d3be2a12c91d084ea02f19aa6a9db3 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 21 Apr 2010 14:39:20 +0200 Subject: Fixed declarative/parserstress autotest. The test ecma_3/Unicode/regress-352044-02-n.js is expected to throw an uncaught syntax error when parsing the expression statement "i \u002b= 1;". Task-number: QTBUG-8108 --- .../declarative/parserstress/tst_parserstress.cpp | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp index f1e9c6e..294f2f7 100644 --- a/tests/auto/declarative/parserstress/tst_parserstress.cpp +++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp @@ -130,16 +130,24 @@ void tst_parserstress::ecmascript() QDeclarativeComponent component(&engine); component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml"))); - QSet failingTests; - failingTests << "regress-352044-02-n.js"; + QFileInfo info(file); - foreach (const QString &failing, failingTests) { - if (info.fileName().endsWith(failing)) { - QEXPECT_FAIL("", "QTBUG-8108", Continue); - break; - } + + if (info.fileName() == QLatin1String("regress-352044-02-n.js")) { + QVERIFY(component.isError()); + + QCOMPARE(component.errors().length(), 2); + + QCOMPARE(component.errors().at(0).description(), QString("Expected token `;'")); + QCOMPARE(component.errors().at(0).line(), 66); + + QCOMPARE(component.errors().at(1).description(), QString("Expected token `;'")); + QCOMPARE(component.errors().at(1).line(), 142); + + } else { + + QVERIFY(!component.isError()); } - QVERIFY(!component.isError()); } -- cgit v0.12 From a29627231a02ebf98645675acbd353618d1109d4 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 21 Apr 2010 18:30:11 +0200 Subject: Fix versioning of Qt Declarative's in-built types Since we aren't releasing for 4.6, all types are new in 4.7. Task-number: QTBUG-10081 --- .../graphicsitems/qdeclarativeitemsmodule.cpp | 104 ++++++++++----------- src/declarative/qml/qdeclarativecompiler.cpp | 2 +- src/declarative/qml/qdeclarativeengine.cpp | 6 +- src/declarative/qml/qdeclarativevaluetype.cpp | 2 +- src/declarative/util/qdeclarativeutilmodule.cpp | 70 +++++++------- src/imports/widgets/widgets.cpp | 6 +- .../graphicswidgets/data/graphicswidgets.qml | 4 +- .../qdeclarativeanchors/data/anchors.qml | 2 +- .../data/anchorsqgraphicswidget.qml | 2 +- .../qdeclarativeanchors/data/centerin.qml | 2 +- .../qdeclarativeanchors/data/crash1.qml | 2 +- .../declarative/qdeclarativeanchors/data/fill.qml | 2 +- .../declarative/qdeclarativeanchors/data/loop1.qml | 2 +- .../declarative/qdeclarativeanchors/data/loop2.qml | 2 +- .../qdeclarativeanchors/data/margins.qml | 2 +- .../qdeclarativeanimatedimage/data/colors.qml | 2 +- .../qdeclarativeanimatedimage/data/stickman.qml | 2 +- .../data/stickmanerror1.qml | 2 +- .../data/stickmanpause.qml | 2 +- .../data/stickmanscaled.qml | 2 +- .../data/stickmanstopped.qml | 2 +- .../qdeclarativeanimations/data/attached.qml | 2 +- .../qdeclarativeanimations/data/badproperty1.qml | 2 +- .../qdeclarativeanimations/data/badproperty2.qml | 2 +- .../qdeclarativeanimations/data/badtype1.qml | 2 +- .../qdeclarativeanimations/data/badtype2.qml | 2 +- .../qdeclarativeanimations/data/badtype3.qml | 2 +- .../qdeclarativeanimations/data/badtype4.qml | 2 +- .../qdeclarativeanimations/data/dontAutoStart.qml | 2 +- .../qdeclarativeanimations/data/dontStart.qml | 2 +- .../qdeclarativeanimations/data/dontStart2.qml | 2 +- .../qdeclarativeanimations/data/dotproperty.qml | 2 +- .../qdeclarativeanimations/data/mixedtype1.qml | 2 +- .../qdeclarativeanimations/data/mixedtype2.qml | 2 +- .../qdeclarativeanimations/data/properties.qml | 2 +- .../qdeclarativeanimations/data/properties2.qml | 2 +- .../qdeclarativeanimations/data/properties3.qml | 2 +- .../qdeclarativeanimations/data/properties4.qml | 2 +- .../qdeclarativeanimations/data/properties5.qml | 2 +- .../data/propertiesTransition.qml | 2 +- .../data/propertiesTransition2.qml | 2 +- .../data/propertiesTransition3.qml | 2 +- .../data/propertiesTransition4.qml | 2 +- .../data/propertiesTransition5.qml | 2 +- .../data/propertiesTransition6.qml | 2 +- .../qdeclarativeanimations/data/rotation.qml | 2 +- .../qdeclarativeanimations/data/valuesource.qml | 2 +- .../qdeclarativeanimations/data/valuesource2.qml | 2 +- .../qdeclarativebehaviors/data/binding.qml | 2 +- .../qdeclarativebehaviors/data/color.qml | 2 +- .../qdeclarativebehaviors/data/cpptrigger.qml | 2 +- .../qdeclarativebehaviors/data/disabled.qml | 2 +- .../qdeclarativebehaviors/data/dontStart.qml | 2 +- .../qdeclarativebehaviors/data/empty.qml | 2 +- .../qdeclarativebehaviors/data/explicit.qml | 2 +- .../qdeclarativebehaviors/data/groupProperty.qml | 2 +- .../qdeclarativebehaviors/data/groupProperty2.qml | 2 +- .../qdeclarativebehaviors/data/loop.qml | 2 +- .../qdeclarativebehaviors/data/nonSelecting2.qml | 2 +- .../qdeclarativebehaviors/data/parent.qml | 2 +- .../data/reassignedAnimation.qml | 2 +- .../qdeclarativebehaviors/data/scripttrigger.qml | 2 +- .../qdeclarativebehaviors/data/simple.qml | 2 +- .../qdeclarativebinding/data/test-binding.qml | 2 +- .../qdeclarativebinding/data/test-binding2.qml | 2 +- .../data/test-connection.qml | 2 +- .../data/test-connection2.qml | 2 +- .../data/test-connection3.qml | 2 +- .../qdeclarativeconnection/data/trimming.qml | 2 +- .../qdeclarativedom/data/MyComponent.qml | 2 +- .../declarative/qdeclarativedom/data/MyItem.qml | 2 +- .../qdeclarativedom/data/import/Bar.qml | 2 +- .../qdeclarativedom/data/importlib/sublib/Foo.qml | 2 +- .../auto/declarative/qdeclarativedom/data/top.qml | 2 +- .../qdeclarativeecmascript/data/CustomObject.qml | 2 +- .../qdeclarativeecmascript/data/MethodsObject.qml | 2 +- .../data/NestedTypeTransientErrors.qml | 2 +- .../qdeclarativeecmascript/data/ScopeObject.qml | 2 +- .../data/SpuriousWarning.qml | 2 +- .../data/aliasPropertyAndBinding.qml | 2 +- .../data/assignBasicTypes.qml | 2 +- .../data/attachedPropertyScope.qml | 2 +- .../qdeclarativeecmascript/data/bug.1.qml | 2 +- .../data/canAssignNullToQObject.2.qml | 2 +- .../qdeclarativeecmascript/data/compiled.qml | 2 +- .../data/compositePropertyType.qml | 2 +- .../qdeclarativeecmascript/data/deletedEngine.qml | 2 +- .../qdeclarativeecmascript/data/deletedObject.qml | 2 +- .../data/exceptionProducesWarning.qml | 2 +- .../data/exceptionProducesWarning2.qml | 2 +- .../data/extendedObjectPropertyLookup.qml | 2 +- .../data/extensionObjects.qml | 2 +- .../qdeclarativeecmascript/data/functionErrors.qml | 2 +- .../data/idShortcutInvalidates.1.qml | 2 +- .../data/idShortcutInvalidates.qml | 2 +- .../qdeclarativeecmascript/data/jsObject.qml | 2 +- .../data/libraryScriptAssert.qml | 2 +- .../qdeclarativeecmascript/data/listProperties.qml | 2 +- .../qdeclarativeecmascript/data/listToVariant.qml | 2 +- .../qdeclarativeecmascript/data/methods.3.qml | 2 +- .../qdeclarativeecmascript/data/methods.4.qml | 2 +- .../qdeclarativeecmascript/data/methods.5.qml | 2 +- .../data/multiEngineObject.qml | 2 +- .../data/noSpuriousWarningsAtShutdown.2.qml | 2 +- .../data/noSpuriousWarningsAtShutdown.qml | 2 +- .../data/nullObjectBinding.qml | 2 +- .../data/objectsCompareAsEqual.qml | 2 +- .../qdeclarativeecmascript/data/ownership.qml | 2 +- .../data/propertyAssignmentErrors.qml | 2 +- .../data/qlistqobjectMethods.qml | 2 +- .../qdeclarativeecmascript/data/scope.2.qml | 2 +- .../qdeclarativeecmascript/data/scope.3.qml | 2 +- .../qdeclarativeecmascript/data/scope.qml | 2 +- .../data/scriptConnect.1.qml | 2 +- .../data/scriptConnect.2.qml | 2 +- .../data/scriptConnect.3.qml | 2 +- .../data/scriptConnect.4.qml | 2 +- .../data/scriptConnect.5.qml | 2 +- .../data/scriptConnect.6.qml | 2 +- .../data/scriptDisconnect.1.qml | 2 +- .../data/scriptDisconnect.2.qml | 2 +- .../data/scriptDisconnect.3.qml | 2 +- .../data/scriptDisconnect.4.qml | 2 +- .../qdeclarativeecmascript/data/shutdownErrors.qml | 2 +- .../data/signalTriggeredBindings.qml | 2 +- .../qdeclarativeecmascript/data/strictlyEquals.qml | 2 +- .../data/transientErrors.qml | 2 +- .../data/variantsAssignedUndefined.qml | 2 +- .../qdeclarativeflickable/data/flickable01.qml | 2 +- .../qdeclarativeflickable/data/flickable02.qml | 2 +- .../qdeclarativeflickable/data/flickable03.qml | 2 +- .../qdeclarativeflickable/data/flickable04.qml | 2 +- .../qdeclarativeflipable/data/crash.qml | 2 +- .../qdeclarativeflipable/data/flipable-abort.qml | 2 +- .../qdeclarativeflipable/data/test-flipable.qml | 2 +- .../qdeclarativefocusscope/data/forcefocus.qml | 2 +- .../qdeclarativefocusscope/data/test.qml | 2 +- .../qdeclarativefocusscope/data/test2.qml | 2 +- .../qdeclarativefocusscope/data/test3.qml | 2 +- .../qdeclarativefocusscope/data/test4.qml | 2 +- .../qdeclarativefocusscope/data/test5.qml | 2 +- .../qdeclarativegridview/data/displaygrid.qml | 2 +- .../data/gridview-enforcerange.qml | 2 +- .../data/gridview-initCurrent.qml | 2 +- .../qdeclarativegridview/data/gridview1.qml | 2 +- .../qdeclarativegridview/data/gridview2.qml | 2 +- .../qdeclarativegridview/data/gridview3.qml | 2 +- .../data/propertychangestest.qml | 2 +- .../qdeclarativegridview/data/setindex.qml | 2 +- .../qdeclarativeinfo/data/NestedObject.qml | 2 +- .../qdeclarativeinfo/data/nestedQmlObject.qml | 2 +- .../qdeclarativeinfo/data/qmlObject.qml | 2 +- .../qdeclarativeitem/data/childrenProperty.qml | 2 +- .../qdeclarativeitem/data/keynavigationtest.qml | 2 +- .../declarative/qdeclarativeitem/data/keystest.qml | 2 +- .../qdeclarativeitem/data/mapCoordinates.qml | 2 +- .../qdeclarativeitem/data/propertychanges.qml | 2 +- .../qdeclarativeitem/data/resourcesProperty.qml | 2 +- .../qdeclarativelanguage/data/Alias.qml | 2 +- .../qdeclarativelanguage/data/Alias2.qml | 2 +- .../qdeclarativelanguage/data/Alias3.qml | 2 +- .../qdeclarativelanguage/data/Alias4.qml | 2 +- .../data/ComponentComposite.qml | 2 +- .../qdeclarativelanguage/data/CompositeType.qml | 2 +- .../qdeclarativelanguage/data/CompositeType3.qml | 2 +- .../data/DynamicPropertiesNestedType.qml | 2 +- .../qdeclarativelanguage/data/HelperAlias.qml | 2 +- .../qdeclarativelanguage/data/LocalLast.qml | 2 +- .../qdeclarativelanguage/data/NestedAlias.qml | 2 +- .../qdeclarativelanguage/data/NestedErrorsType.qml | 2 +- .../qdeclarativelanguage/data/OnCompletedType.qml | 2 +- .../data/OnDestructionType.qml | 2 +- .../qdeclarativelanguage/data/alias.1.qml | 2 +- .../qdeclarativelanguage/data/alias.3.qml | 2 +- .../qdeclarativelanguage/data/alias.5.qml | 2 +- .../qdeclarativelanguage/data/alias.6.qml | 2 +- .../qdeclarativelanguage/data/alias.7.qml | 2 +- .../qdeclarativelanguage/data/alias.8.qml | 2 +- .../qdeclarativelanguage/data/alias.9.qml | 2 +- .../data/assignCompositeToType.qml | 2 +- .../data/assignLiteralToVariant.qml | 2 +- .../data/assignObjectToVariant.qml | 2 +- .../data/assignToNamespace.qml | 2 +- .../data/attachedProperties.qml | 2 +- .../qdeclarativelanguage/data/component.1.qml | 2 +- .../qdeclarativelanguage/data/component.2.qml | 2 +- .../qdeclarativelanguage/data/component.3.qml | 2 +- .../qdeclarativelanguage/data/component.4.qml | 2 +- .../qdeclarativelanguage/data/component.5.qml | 2 +- .../qdeclarativelanguage/data/component.6.qml | 2 +- .../qdeclarativelanguage/data/component.7.qml | 2 +- .../qdeclarativelanguage/data/component.8.qml | 2 +- .../qdeclarativelanguage/data/component.9.qml | 2 +- .../data/componentCompositeType.qml | 2 +- .../qdeclarativelanguage/data/crash2.qml | 2 +- .../qdeclarativelanguage/data/customOnProperty.qml | 2 +- .../data/customParserIdNotAllowed.qml | 2 +- .../data/customParserTypes.qml | 2 +- .../data/declaredPropertyValues.qml | 2 +- .../qdeclarativelanguage/data/defaultGrouped.qml | 2 +- .../data/defaultPropertyListOrder.qml | 2 +- .../qdeclarativelanguage/data/destroyedSignal.qml | 2 +- .../qdeclarativelanguage/data/dynamicMeta.1.qml | 2 +- .../qdeclarativelanguage/data/dynamicMeta.2.qml | 2 +- .../qdeclarativelanguage/data/dynamicMeta.3.qml | 2 +- .../qdeclarativelanguage/data/dynamicMeta.4.qml | 2 +- .../qdeclarativelanguage/data/dynamicMeta.5.qml | 2 +- .../qdeclarativelanguage/data/dynamicObject.1.qml | 2 +- .../data/dynamicObjectProperties.qml | 4 +- .../data/dynamicProperties.qml | 2 +- .../data/dynamicPropertiesNested.qml | 2 +- .../data/dynamicSignalsAndSlots.qml | 2 +- .../qdeclarativelanguage/data/enumTypes.qml | 2 +- .../data/importNamespaceConflict.qml | 2 +- .../qdeclarativelanguage/data/importNonExist.qml | 2 +- .../data/inlineQmlComponents.qml | 2 +- .../data/interfaceProperty.qml | 2 +- .../data/invalidAttachedProperty.1.qml | 2 +- .../data/invalidAttachedProperty.10.qml | 2 +- .../data/invalidAttachedProperty.11.qml | 2 +- .../data/invalidAttachedProperty.2.qml | 2 +- .../data/invalidAttachedProperty.3.qml | 2 +- .../data/invalidAttachedProperty.4.qml | 2 +- .../data/invalidAttachedProperty.5.qml | 2 +- .../data/invalidAttachedProperty.6.qml | 2 +- .../data/invalidAttachedProperty.7.qml | 2 +- .../data/invalidAttachedProperty.8.qml | 2 +- .../data/invalidAttachedProperty.9.qml | 2 +- .../data/invalidGroupedProperty.1.qml | 2 +- .../data/invalidGroupedProperty.2.qml | 2 +- .../qdeclarativelanguage/data/invalidImportID.qml | 4 +- .../lib/com/nokia/installedtest/InstalledTest.qml | 2 +- .../lib/com/nokia/installedtest/InstalledTest2.qml | 2 +- .../data/lib/com/nokia/installedtest/LocalLast.qml | 2 +- .../lib/com/nokia/installedtest/PrivateType.qml | 2 +- .../data/listItemDeleteSelf.qml | 2 +- .../qdeclarativelanguage/data/listProperties.qml | 2 +- .../qdeclarativelanguage/data/method.1.qml | 2 +- .../qdeclarativelanguage/data/missingSignal.qml | 2 +- .../qdeclarativelanguage/data/nestedErrors.qml | 2 +- .../qdeclarativelanguage/data/noCreation.qml | 2 +- .../qdeclarativelanguage/data/onCompleted.qml | 2 +- .../qdeclarativelanguage/data/onDestruction.qml | 2 +- .../qdeclarativelanguage/data/property.1.qml | 2 +- .../qdeclarativelanguage/data/property.2.qml | 2 +- .../qdeclarativelanguage/data/property.3.qml | 2 +- .../qdeclarativelanguage/data/property.4.qml | 2 +- .../qdeclarativelanguage/data/property.5.qml | 2 +- .../qdeclarativelanguage/data/property.6.qml | 2 +- .../qdeclarativelanguage/data/property.7.qml | 2 +- .../data/qmlAttachedPropertiesObjectMethod.1.qml | 2 +- .../data/qmlAttachedPropertiesObjectMethod.2.qml | 2 +- .../qdeclarativelanguage/data/readOnly.3.qml | 2 +- .../qdeclarativelanguage/data/signal.1.qml | 2 +- .../qdeclarativelanguage/data/signal.2.qml | 2 +- .../qdeclarativelanguage/data/signal.3.qml | 2 +- .../qdeclarativelanguage/data/signal.4.qml | 2 +- .../qdeclarativelanguage/data/subdir/Test.qml | 2 +- .../data/subdir/subsubdir/SubTest.qml | 2 +- .../declarative/qmllanguage/LocalInternal.qml | 2 +- .../qtest/declarative/qmllanguage/Test.qml | 2 +- .../declarative/qmllanguage/UndeclaredLocal.qml | 2 +- .../declarative/qmllanguage/subdir/SubTest.qml | 2 +- .../qdeclarativelayouts/data/layouts.qml | 4 +- .../qdeclarativelistmodel/data/enumerate.qml | 2 +- .../qdeclarativelistmodel/data/model.qml | 2 +- .../qdeclarativelistreference/data/MyType.qml | 2 +- .../qdeclarativelistreference/data/engineTypes.qml | 2 +- .../data/variantToList.qml | 2 +- .../qdeclarativelistview/data/displaylist.qml | 2 +- .../qdeclarativelistview/data/itemlist.qml | 2 +- .../data/listview-enforcerange.qml | 2 +- .../data/listview-initCurrent.qml | 2 +- .../data/listview-sections.qml | 2 +- .../qdeclarativelistview/data/listviewtest.qml | 2 +- .../data/propertychangestest.qml | 2 +- .../qdeclarativeloader/data/BlueRect.qml | 2 +- .../data/GraphicsWidget250x250.qml | 2 +- .../qdeclarativeloader/data/GreenRect.qml | 2 +- .../qdeclarativeloader/data/NoResize.qml | 2 +- .../data/NoResizeGraphicsWidget.qml | 2 +- .../qdeclarativeloader/data/Rect120x60.qml | 2 +- .../qdeclarativeloader/data/SetSourceComponent.qml | 2 +- .../data/SizeGraphicsWidgetToLoader.qml | 2 +- .../data/SizeLoaderToGraphicsWidget.qml | 2 +- .../qdeclarativeloader/data/SizeToItem.qml | 2 +- .../qdeclarativeloader/data/SizeToLoader.qml | 2 +- .../qdeclarativeloader/data/VmeError.qml | 2 +- .../declarative/qdeclarativeloader/data/crash.qml | 2 +- .../qdeclarativeloader/data/differentorigin.qml | 2 +- .../qdeclarativeloader/data/nonItem.qml | 2 +- .../qdeclarativeloader/data/sameorigin-load.qml | 2 +- .../qdeclarativeloader/data/sameorigin.qml | 2 +- .../qdeclarativeloader/data/vmeErrors.qml | 2 +- .../qdeclarativemousearea/data/clickandhold.qml | 2 +- .../qdeclarativemousearea/data/dragproperties.qml | 2 +- .../qdeclarativemousearea/data/dragreset.qml | 2 +- .../data/updateMousePosOnClick.qml | 2 +- .../data/updateMousePosOnResize.qml | 2 +- .../data/particlemotiontest.qml | 2 +- .../qdeclarativeparticles/data/particlestest.qml | 2 +- .../qdeclarativepathview/data/datamodel.qml | 2 +- .../qdeclarativepathview/data/displaypath.qml | 2 +- .../qdeclarativepathview/data/pathtest.qml | 2 +- .../qdeclarativepathview/data/pathview0.qml | 2 +- .../qdeclarativepathview/data/pathview1.qml | 2 +- .../qdeclarativepathview/data/pathview2.qml | 2 +- .../qdeclarativepathview/data/pathview3.qml | 2 +- .../qdeclarativepathview/data/propertychanges.qml | 2 +- .../qdeclarativepositioners/data/flowtest.qml | 2 +- .../qdeclarativepositioners/data/grid-animated.qml | 2 +- .../qdeclarativepositioners/data/grid-spacing.qml | 2 +- .../data/grid-toptobottom.qml | 2 +- .../qdeclarativepositioners/data/gridtest.qml | 2 +- .../data/gridzerocolumns.qml | 2 +- .../data/horizontal-animated.qml | 2 +- .../data/horizontal-spacing.qml | 2 +- .../qdeclarativepositioners/data/horizontal.qml | 2 +- .../data/propertychangestest.qml | 2 +- .../qdeclarativepositioners/data/repeatertest.qml | 2 +- .../data/vertical-animated.qml | 2 +- .../data/vertical-spacing.qml | 2 +- .../qdeclarativepositioners/data/vertical.qml | 2 +- .../qdeclarativeproperty/data/TestType.qml | 2 +- .../data/readSynthesizedObject.qml | 2 +- .../declarative/qdeclarativeqt/data/consoleLog.qml | 2 +- .../qdeclarativeqt/data/createComponent.qml | 2 +- .../qdeclarativeqt/data/createComponentData.qml | 2 +- .../qdeclarativeqt/data/createQmlObject.qml | 16 ++-- .../declarative/qdeclarativeqt/data/darker.qml | 2 +- .../auto/declarative/qdeclarativeqt/data/enums.qml | 2 +- .../declarative/qdeclarativeqt/data/formatting.qml | 2 +- .../auto/declarative/qdeclarativeqt/data/hsla.qml | 2 +- .../declarative/qdeclarativeqt/data/isQtObject.qml | 2 +- .../declarative/qdeclarativeqt/data/lighter.qml | 2 +- tests/auto/declarative/qdeclarativeqt/data/md5.qml | 2 +- .../qdeclarativeqt/data/openUrlExternally.qml | 2 +- .../auto/declarative/qdeclarativeqt/data/point.qml | 2 +- .../auto/declarative/qdeclarativeqt/data/rect.qml | 2 +- .../auto/declarative/qdeclarativeqt/data/rgba.qml | 2 +- .../auto/declarative/qdeclarativeqt/data/size.qml | 2 +- .../auto/declarative/qdeclarativeqt/data/tint.qml | 2 +- .../declarative/qdeclarativeqt/data/vector.qml | 2 +- .../qdeclarativerepeater/data/intmodel.qml | 2 +- .../qdeclarativerepeater/data/itemlist.qml | 2 +- .../qdeclarativerepeater/data/objlist.qml | 2 +- .../qdeclarativerepeater/data/properties.qml | 2 +- .../qdeclarativerepeater/data/repeater1.qml | 2 +- .../qdeclarativerepeater/data/repeater2.qml | 2 +- .../data/smoothedanimation1.qml | 2 +- .../data/smoothedanimation2.qml | 2 +- .../data/smoothedanimation3.qml | 2 +- .../data/smoothedanimationBehavior.qml | 2 +- .../data/smoothedanimationValueSource.qml | 2 +- .../data/smoothedfollow1.qml | 2 +- .../data/smoothedfollow2.qml | 2 +- .../data/smoothedfollow3.qml | 2 +- .../data/smoothedfollowDisabled.qml | 2 +- .../data/smoothedfollowValueSource.qml | 2 +- .../data/springfollow1.qml | 2 +- .../data/springfollow2.qml | 2 +- .../data/springfollow3.qml | 2 +- .../qdeclarativestates/data/ExtendedRectangle.qml | 2 +- .../qdeclarativestates/data/anchorChanges1.qml | 2 +- .../qdeclarativestates/data/anchorChanges2.qml | 2 +- .../qdeclarativestates/data/anchorChanges3.qml | 2 +- .../qdeclarativestates/data/anchorChanges4.qml | 2 +- .../qdeclarativestates/data/anchorChanges5.qml | 2 +- .../data/autoStateAtStartupRestoreBug.qml | 2 +- .../qdeclarativestates/data/basicBinding.qml | 2 +- .../qdeclarativestates/data/basicBinding2.qml | 2 +- .../qdeclarativestates/data/basicBinding3.qml | 2 +- .../qdeclarativestates/data/basicBinding4.qml | 2 +- .../qdeclarativestates/data/basicChanges.qml | 2 +- .../qdeclarativestates/data/basicChanges2.qml | 2 +- .../qdeclarativestates/data/basicChanges3.qml | 2 +- .../qdeclarativestates/data/basicChanges4.qml | 2 +- .../qdeclarativestates/data/basicExtension.qml | 2 +- .../qdeclarativestates/data/deleting.qml | 2 +- .../qdeclarativestates/data/deletingState.qml | 2 +- .../qdeclarativestates/data/explicit.qml | 2 +- .../qdeclarativestates/data/fakeExtension.qml | 2 +- .../qdeclarativestates/data/illegalObj.qml | 2 +- .../qdeclarativestates/data/illegalTempState.qml | 2 +- .../qdeclarativestates/data/legalTempState.qml | 2 +- .../qdeclarativestates/data/nonExistantProp.qml | 2 +- .../qdeclarativestates/data/parentChange1.qml | 2 +- .../qdeclarativestates/data/parentChange2.qml | 2 +- .../qdeclarativestates/data/parentChange3.qml | 2 +- .../qdeclarativestates/data/parentChange4.qml | 2 +- .../qdeclarativestates/data/parentChange5.qml | 2 +- .../qdeclarativestates/data/propertyErrors.qml | 2 +- .../declarative/qdeclarativestates/data/reset.qml | 2 +- .../qdeclarativestates/data/restoreEntryValues.qml | 2 +- .../declarative/qdeclarativestates/data/script.qml | 2 +- .../qdeclarativestates/data/signalOverride.qml | 2 +- .../qdeclarativestates/data/signalOverride2.qml | 2 +- .../data/signalOverrideCrash.qml | 2 +- .../qdeclarativestates/data/whenOrdering.qml | 2 +- .../qdeclarativetext/data/embeddedImagesLocal.qml | 2 +- .../data/embeddedImagesLocalError.qml | 2 +- .../qdeclarativetext/data/embeddedImagesRemote.qml | 2 +- .../data/embeddedImagesRemoteError.qml | 2 +- .../qdeclarativetextedit/data/cursorTest.qml | 2 +- .../qdeclarativetextedit/data/http/ErrItem.qml | 2 +- .../qdeclarativetextedit/data/http/NormItem.qml | 2 +- .../data/http/cursorHttpTest.qml | 2 +- .../data/http/cursorHttpTestFail1.qml | 2 +- .../data/http/cursorHttpTestFail2.qml | 2 +- .../data/http/cursorHttpTestPass.qml | 2 +- .../data/httpfail/FailItem.qml | 2 +- .../data/httpslow/WaitItem.qml | 2 +- .../qdeclarativetextedit/data/inputmethodhints.qml | 2 +- .../qdeclarativetextedit/data/navigation.qml | 2 +- .../qdeclarativetextedit/data/readOnly.qml | 2 +- .../qdeclarativetextinput/data/cursorTest.qml | 2 +- .../data/inputmethodhints.qml | 2 +- .../qdeclarativetextinput/data/masks.qml | 2 +- .../qdeclarativetextinput/data/maxLength.qml | 2 +- .../qdeclarativetextinput/data/navigation.qml | 2 +- .../qdeclarativetextinput/data/readOnly.qml | 2 +- .../qdeclarativevaluetypes/data/conflicting.1.qml | 2 +- .../qdeclarativevaluetypes/data/conflicting.2.qml | 2 +- .../qdeclarativevaluetypes/data/conflicting.3.qml | 2 +- .../qdeclarativevaluetypes/data/deletedObject.qml | 2 +- .../qdeclarativevaluetypes/data/enums.3.qml | 2 +- .../qdeclarativevaluetypes/data/enums.4.qml | 2 +- .../qdeclarativevaluetypes/data/font_write.5.qml | 2 +- .../qdeclarativevaluetypes/data/returnValues.qml | 2 +- .../qdeclarativevaluetypes/data/scriptAccess.qml | 2 +- .../data/sizereadonly_writeerror4.qml | 2 +- .../declarative/qdeclarativewebview/data/basic.qml | 2 +- .../qdeclarativewebview/data/elements.qml | 2 +- .../qdeclarativewebview/data/javaScript.qml | 2 +- .../qdeclarativewebview/data/loadError.qml | 2 +- .../qdeclarativewebview/data/newwindows.qml | 2 +- .../qdeclarativewebview/data/propertychanges.qml | 2 +- .../qdeclarativewebview/data/sethtml.qml | 2 +- .../qdeclarativeworkerscript/data/worker.qml | 2 +- .../qdeclarativexmlhttprequest/data/abort.qml | 2 +- .../data/abort_opened.qml | 2 +- .../data/abort_unsent.qml | 2 +- .../qdeclarativexmlhttprequest/data/attr.qml | 2 +- .../data/callbackException.qml | 2 +- .../qdeclarativexmlhttprequest/data/cdata.qml | 2 +- .../data/constructor.qml | 2 +- .../data/defaultState.qml | 2 +- .../qdeclarativexmlhttprequest/data/document.qml | 2 +- .../data/domExceptionCodes.qml | 2 +- .../qdeclarativexmlhttprequest/data/element.qml | 2 +- .../data/getAllResponseHeaders.qml | 2 +- .../data/getAllResponseHeaders_args.qml | 2 +- .../data/getAllResponseHeaders_sent.qml | 2 +- .../data/getAllResponseHeaders_unsent.qml | 2 +- .../data/getResponseHeader.qml | 2 +- .../data/getResponseHeader_args.qml | 2 +- .../data/getResponseHeader_sent.qml | 2 +- .../data/getResponseHeader_unsent.qml | 2 +- .../data/instanceStateValues.qml | 2 +- .../data/invalidMethodUsage.qml | 2 +- .../qdeclarativexmlhttprequest/data/open.qml | 2 +- .../data/open_arg_count.1.qml | 2 +- .../data/open_arg_count.2.qml | 2 +- .../data/open_invalid_method.qml | 2 +- .../qdeclarativexmlhttprequest/data/open_sync.qml | 2 +- .../qdeclarativexmlhttprequest/data/open_user.qml | 2 +- .../data/open_username.qml | 2 +- .../data/redirectError.qml | 2 +- .../data/redirectRecur.qml | 2 +- .../qdeclarativexmlhttprequest/data/redirects.qml | 2 +- .../data/responseText.qml | 2 +- .../data/responseXML_invalid.qml | 2 +- .../data/send_alreadySent.qml | 2 +- .../data/send_data.1.qml | 2 +- .../data/send_data.2.qml | 2 +- .../data/send_data.3.qml | 2 +- .../data/send_data.4.qml | 2 +- .../data/send_data.5.qml | 2 +- .../data/send_data.6.qml | 2 +- .../data/send_data.7.qml | 2 +- .../data/send_ignoreData.qml | 2 +- .../data/send_unsent.qml | 2 +- .../data/setRequestHeader.qml | 2 +- .../data/setRequestHeader_args.qml | 2 +- .../data/setRequestHeader_illegalName.qml | 2 +- .../data/setRequestHeader_sent.qml | 2 +- .../data/setRequestHeader_unsent.qml | 2 +- .../data/staticStateValues.qml | 2 +- .../qdeclarativexmlhttprequest/data/status.qml | 2 +- .../qdeclarativexmlhttprequest/data/statusText.qml | 2 +- .../qdeclarativexmlhttprequest/data/text.qml | 2 +- .../qdeclarativexmlhttprequest/data/utf16.qml | 2 +- .../qdeclarativexmllistmodel/data/model.qml | 2 +- .../qdeclarativexmllistmodel/data/model2.qml | 2 +- .../data/propertychanges.qml | 2 +- .../qdeclarativexmllistmodel/data/recipes.qml | 2 +- .../qdeclarativexmllistmodel/data/roleErrors.qml | 2 +- .../qdeclarativexmllistmodel/data/roleKeys.qml | 2 +- .../qdeclarativexmllistmodel/data/unique.qml | 2 +- .../auto/declarative/qmlvisual/ListView/basic1.qml | 2 +- .../auto/declarative/qmlvisual/ListView/basic2.qml | 2 +- .../auto/declarative/qmlvisual/ListView/basic3.qml | 2 +- .../auto/declarative/qmlvisual/ListView/basic4.qml | 2 +- .../qmlvisual/ListView/data-MAC/basic1.qml | 2 +- .../qmlvisual/ListView/data-MAC/basic2.qml | 2 +- .../qmlvisual/ListView/data-MAC/basic3.qml | 2 +- .../qmlvisual/ListView/data-MAC/basic4.qml | 2 +- .../qmlvisual/ListView/data-MAC/itemlist.qml | 2 +- .../qmlvisual/ListView/data-MAC/listview.qml | 2 +- .../qmlvisual/ListView/data-X11/basic1.qml | 2 +- .../qmlvisual/ListView/data-X11/basic2.qml | 2 +- .../qmlvisual/ListView/data-X11/basic3.qml | 2 +- .../qmlvisual/ListView/data-X11/basic4.qml | 2 +- .../declarative/qmlvisual/ListView/data/basic1.qml | 2 +- .../declarative/qmlvisual/ListView/data/basic2.qml | 2 +- .../declarative/qmlvisual/ListView/data/basic3.qml | 2 +- .../declarative/qmlvisual/ListView/data/basic4.qml | 2 +- .../qmlvisual/ListView/data/itemlist.qml | 2 +- .../qmlvisual/ListView/data/listview.qml | 2 +- .../declarative/qmlvisual/ListView/itemlist.qml | 2 +- .../declarative/qmlvisual/ListView/listview.qml | 2 +- .../qmlvisual/Package_Views/data/packageviews.qml | 2 +- .../qmlvisual/Package_Views/packageviews.qml | 2 +- .../bindinganimation/bindinganimation.qml | 2 +- .../bindinganimation/data/bindinganimation.qml | 2 +- .../colorAnimation/colorAnimation-visual.qml | 2 +- .../colorAnimation/data/colorAnimation-visual.qml | 2 +- .../qmlvisual/animation/easing/data/easing.qml | 2 +- .../qmlvisual/animation/easing/easing.qml | 2 +- .../qmlvisual/animation/loop/data/loop.qml | 2 +- .../declarative/qmlvisual/animation/loop/loop.qml | 2 +- .../data/parallelAnimation-visual.qml | 2 +- .../parallelAnimation/parallelAnimation-visual.qml | 2 +- .../data/parentAnimation-visual.qml | 2 +- .../parentAnimation/parentAnimation-visual.qml | 2 +- .../pauseAnimation/data/pauseAnimation-visual.qml | 2 +- .../pauseAnimation/pauseAnimation-visual.qml | 2 +- .../propertyAction/data/propertyAction-visual.qml | 2 +- .../propertyAction/propertyAction-visual.qml | 2 +- .../qmlvisual/animation/reanchor/data/reanchor.qml | 2 +- .../qmlvisual/animation/reanchor/reanchor.qml | 2 +- .../scriptAction/data/scriptAction-visual.qml | 2 +- .../animation/scriptAction/scriptAction-visual.qml | 2 +- .../qmlvisual/fillmode/data/fillmode.qml | 2 +- .../declarative/qmlvisual/fillmode/fillmode.qml | 2 +- .../qmlvisual/focusscope/data-MAC/test.qml | 2 +- .../qmlvisual/focusscope/data-MAC/test2.qml | 2 +- .../qmlvisual/focusscope/data-MAC/test3.qml | 2 +- .../qmlvisual/focusscope/data-X11/test.qml | 2 +- .../qmlvisual/focusscope/data-X11/test2.qml | 2 +- .../qmlvisual/focusscope/data-X11/test3.qml | 2 +- .../declarative/qmlvisual/focusscope/data/test.qml | 2 +- .../qmlvisual/focusscope/data/test2.qml | 2 +- .../qmlvisual/focusscope/data/test3.qml | 2 +- .../auto/declarative/qmlvisual/focusscope/test.qml | 2 +- .../declarative/qmlvisual/focusscope/test2.qml | 2 +- .../declarative/qmlvisual/focusscope/test3.qml | 2 +- .../qdeclarativeborderimage/animated-smooth.qml | 2 +- .../qmlvisual/qdeclarativeborderimage/animated.qml | 2 +- .../qmlvisual/qdeclarativeborderimage/borders.qml | 2 +- .../content/MyBorderImage.qml | 2 +- .../data/animated-smooth.qml | 2 +- .../qdeclarativeborderimage/data/animated.qml | 2 +- .../qdeclarativeborderimage/data/borders.qml | 2 +- .../data/flickable-horizontal.qml | 2 +- .../data/flickable-vertical.qml | 2 +- .../qdeclarativeflickable/flickable-horizontal.qml | 2 +- .../qdeclarativeflickable/flickable-vertical.qml | 2 +- .../qdeclarativeflipable/data/test-flipable.qml | 2 +- .../data/test_flipable_resize.qml | 2 +- .../qdeclarativeflipable/test-flipable.qml | 2 +- .../qdeclarativeflipable/test_flipable_resize.qml | 2 +- .../qdeclarativegridview/data/gridview.qml | 2 +- .../qdeclarativegridview/data/gridview2.qml | 2 +- .../qmlvisual/qdeclarativegridview/gridview.qml | 2 +- .../qmlvisual/qdeclarativegridview/gridview2.qml | 2 +- .../qmlvisual/qdeclarativemousearea/data/drag.qml | 2 +- .../data/mousearea-flickable.qml | 2 +- .../data/mousearea-visual.qml | 2 +- .../qmlvisual/qdeclarativemousearea/drag.qml | 2 +- .../qdeclarativemousearea/mousearea-visual.qml | 2 +- .../qdeclarativeparticles/data/particles.qml | 2 +- .../qmlvisual/qdeclarativeparticles/particles.qml | 2 +- .../qdeclarativepathview/data/test-pathview-2.qml | 2 +- .../qdeclarativepathview/data/test-pathview.qml | 2 +- .../qdeclarativepathview/test-pathview-2.qml | 2 +- .../qdeclarativepathview/test-pathview.qml | 2 +- .../qdeclarativepositioners/data/dynamic.qml | 2 +- .../qdeclarativepositioners/data/usingRepeater.qml | 2 +- .../qmlvisual/qdeclarativepositioners/dynamic.qml | 2 +- .../qdeclarativepositioners/usingRepeater.qml | 2 +- .../data/easefollow.qml | 2 +- .../smoothedanimation.qml | 2 +- .../smoothedfollow.qml | 2 +- .../qmlvisual/qdeclarativespringfollow/clock.qml | 2 +- .../qdeclarativespringfollow/data/clock.qml | 2 +- .../qdeclarativespringfollow/data/follow.qml | 2 +- .../qmlvisual/qdeclarativespringfollow/follow.qml | 2 +- .../baseline/data-X11/parentanchor.qml | 2 +- .../baseline/data/parentanchor.qml | 2 +- .../qdeclarativetext/baseline/parentanchor.qml | 2 +- .../qdeclarativetext/elide/data-MAC/elide.qml | 2 +- .../qdeclarativetext/elide/data-MAC/elide2.qml | 2 +- .../elide/data-MAC/multilength.qml | 2 +- .../qdeclarativetext/elide/data-X11/elide.qml | 2 +- .../elide/data-X11/multilength.qml | 2 +- .../qdeclarativetext/elide/data/elide.qml | 2 +- .../qdeclarativetext/elide/data/elide2.qml | 2 +- .../qmlvisual/qdeclarativetext/elide/elide.qml | 2 +- .../qmlvisual/qdeclarativetext/elide/elide2.qml | 2 +- .../qdeclarativetext/elide/multilength.qml | 2 +- .../qdeclarativetext/font/data-MAC/plaintext.qml | 2 +- .../qdeclarativetext/font/data-MAC/richtext.qml | 2 +- .../qdeclarativetext/font/data/plaintext.qml | 2 +- .../qdeclarativetext/font/data/richtext.qml | 2 +- .../qmlvisual/qdeclarativetext/font/plaintext.qml | 2 +- .../qmlvisual/qdeclarativetext/font/richtext.qml | 2 +- .../qdeclarativetextedit/cursorDelegate.qml | 2 +- .../data-MAC/cursorDelegate.qml | 2 +- .../qdeclarativetextedit/data-MAC/qt-669.qml | 2 +- .../qdeclarativetextedit/data-X11/wrap.qml | 2 +- .../qdeclarativetextedit/data/cursorDelegate.qml | 2 +- .../qmlvisual/qdeclarativetextedit/data/qt-669.qml | 2 +- .../qmlvisual/qdeclarativetextedit/data/wrap.qml | 2 +- .../qmlvisual/qdeclarativetextedit/qt-669.qml | 2 +- .../qmlvisual/qdeclarativetextedit/wrap.qml | 2 +- .../qdeclarativetextinput/cursorDelegate.qml | 2 +- .../data-MAC/cursorDelegate.qml | 2 +- .../qdeclarativetextinput/data-X11/echoMode.qml | 2 +- .../qdeclarativetextinput/data-X11/hAlign.qml | 2 +- .../data-X11/usingLineEdit.qml | 2 +- .../qdeclarativetextinput/data/cursorDelegate.qml | 2 +- .../qdeclarativetextinput/data/echoMode.qml | 2 +- .../qdeclarativetextinput/data/hAlign.qml | 2 +- .../qmlvisual/qdeclarativetextinput/echoMode.qml | 2 +- .../qmlvisual/qdeclarativetextinput/hAlign.qml | 2 +- .../qmlvisual/qfxwebview/autosize/autosize.qml | 2 +- .../qfxwebview/autosize/data-X11/autosize.qml | 2 +- .../qfxwebview/autosize/data/autosize.qml | 2 +- .../declarative/qmlvisual/rect/GradientRect.qml | 2 +- tests/auto/declarative/qmlvisual/rect/MyRect.qml | 2 +- .../qmlvisual/rect/data/rect-painting.qml | 2 +- .../declarative/qmlvisual/rect/rect-painting.qml | 2 +- .../auto/declarative/qmlvisual/repeater/basic1.qml | 2 +- .../auto/declarative/qmlvisual/repeater/basic2.qml | 2 +- .../auto/declarative/qmlvisual/repeater/basic3.qml | 2 +- .../auto/declarative/qmlvisual/repeater/basic4.qml | 2 +- .../qmlvisual/repeater/data-MAC/basic1.qml | 2 +- .../qmlvisual/repeater/data-MAC/basic2.qml | 2 +- .../qmlvisual/repeater/data-MAC/basic3.qml | 2 +- .../qmlvisual/repeater/data-MAC/basic4.qml | 2 +- .../qmlvisual/repeater/data-X11/basic1.qml | 2 +- .../qmlvisual/repeater/data-X11/basic2.qml | 2 +- .../qmlvisual/repeater/data-X11/basic3.qml | 2 +- .../qmlvisual/repeater/data-X11/basic4.qml | 2 +- .../declarative/qmlvisual/repeater/data/basic1.qml | 2 +- .../declarative/qmlvisual/repeater/data/basic2.qml | 2 +- .../declarative/qmlvisual/repeater/data/basic3.qml | 2 +- .../declarative/qmlvisual/repeater/data/basic4.qml | 2 +- .../selftest_noimages/data/selftest_noimages.qml | 2 +- .../selftest_noimages/selftest_noimages.qml | 2 +- .../qmlvisual/webview/embedding/data/nesting.qml | 2 +- .../qmlvisual/webview/embedding/egg.qml | 2 +- .../qmlvisual/webview/embedding/nesting.qml | 2 +- .../webview/javascript/data/evaluateJavaScript.qml | 2 +- .../webview/javascript/data/windowObjects.qml | 2 +- .../webview/javascript/evaluateJavaScript.qml | 2 +- .../qmlvisual/webview/javascript/windowObjects.qml | 2 +- .../qmlvisual/webview/settings/data/fontFamily.qml | 2 +- .../qmlvisual/webview/settings/data/fontSize.qml | 2 +- .../webview/settings/data/noAutoLoadImages.qml | 2 +- .../webview/settings/data/setFontFamily.qml | 2 +- .../qmlvisual/webview/settings/fontFamily.qml | 2 +- .../qmlvisual/webview/settings/fontSize.qml | 2 +- .../webview/settings/noAutoLoadImages.qml | 2 +- .../qmlvisual/webview/settings/setFontFamily.qml | 2 +- .../qmlvisual/webview/zooming/data/pageWidth.qml | 2 +- .../webview/zooming/data/renderControl.qml | 2 +- .../qmlvisual/webview/zooming/data/resolution.qml | 2 +- .../webview/zooming/data/zoomTextOnly.qml | 2 +- .../qmlvisual/webview/zooming/data/zooming.qml | 2 +- .../qmlvisual/webview/zooming/pageWidth.qml | 2 +- .../qmlvisual/webview/zooming/renderControl.qml | 2 +- .../qmlvisual/webview/zooming/resolution.qml | 2 +- .../qmlvisual/webview/zooming/zoomTextOnly.qml | 2 +- .../qmlvisual/webview/zooming/zooming.qml | 2 +- .../benchmarks/declarative/creation/data/item.qml | 2 +- .../declarative/creation/data/qobject.qml | 2 +- .../declarative/creation/tst_creation.cpp | 2 +- .../qdeclarativecomponent/data/object.qml | 2 +- .../qdeclarativecomponent/data/object_id.qml | 2 +- .../data/samegame/BoomBlock.qml | 2 +- .../data/synthesized_properties.2.qml | 2 +- .../data/synthesized_properties.qml | 2 +- .../qdeclarativemetaproperty/data/object.qml | 2 +- .../data/synthesized_object.qml | 2 +- tests/benchmarks/declarative/qmltime/example.qml | 2 +- .../declarative/qmltime/tests/anchors/empty.qml | 2 +- .../declarative/qmltime/tests/anchors/fill.qml | 2 +- .../declarative/qmltime/tests/anchors/null.qml | 2 +- .../declarative/qmltime/tests/animation/large.qml | 2 +- .../qmltime/tests/animation/largeNoProps.qml | 2 +- .../qmltime/tests/item_creation/children.qml | 2 +- .../qmltime/tests/item_creation/data.qml | 2 +- .../qmltime/tests/item_creation/no_creation.qml | 2 +- .../qmltime/tests/item_creation/resources.qml | 2 +- .../declarative/qmltime/tests/loader/Loaded.qml | 2 +- .../qmltime/tests/loader/component_loader.qml | 2 +- .../qmltime/tests/loader/empty_loader.qml | 2 +- .../declarative/qmltime/tests/loader/no_loader.qml | 2 +- .../qmltime/tests/loader/source_loader.qml | 2 +- .../tests/positioner_creation/no_positioner.qml | 2 +- .../tests/positioner_creation/null_positioner.qml | 2 +- .../tests/positioner_creation/positioner.qml | 2 +- .../qmltime/tests/vmemetaobject/null.qml | 2 +- .../qmltime/tests/vmemetaobject/property.qml | 2 +- .../declarative/script/data/CustomObject.qml | 2 +- tests/benchmarks/declarative/script/data/block.qml | 2 +- tools/qml/content/Browser.qml | 2 +- tools/qml/qdeclarativefolderlistmodel.cpp | 2 +- tools/qml/qdeclarativetester.cpp | 10 +- 721 files changed, 825 insertions(+), 825 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 16972a8..8e34472 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -83,58 +83,58 @@ void QDeclarativeItemModule::defineModule() { #ifdef QT_NO_MOVIE - qmlRegisterTypeNotAvailable("Qt",4,6,"AnimatedImage", + qmlRegisterTypeNotAvailable("Qt",4,7,"AnimatedImage", qApp->translate("QDeclarativeAnimatedImage","Qt was built without support for QMovie")); #else - qmlRegisterType("Qt",4,6,"AnimatedImage"); + qmlRegisterType("Qt",4,7,"AnimatedImage"); #endif - qmlRegisterType("Qt",4,6,"BorderImage"); - qmlRegisterType("Qt",4,6,"Column"); - qmlRegisterType("Qt",4,6,"Drag"); - qmlRegisterType("Qt",4,6,"Flickable"); - qmlRegisterType("Qt",4,6,"Flipable"); - qmlRegisterType("Qt",4,6,"Flow"); - qmlRegisterType("Qt",4,6,"FocusPanel"); - qmlRegisterType("Qt",4,6,"FocusScope"); - qmlRegisterType("Qt",4,6,"Gradient"); - qmlRegisterType("Qt",4,6,"GradientStop"); - qmlRegisterType("Qt",4,6,"Grid"); - qmlRegisterType("Qt",4,6,"GridView"); - qmlRegisterType("Qt",4,6,"Image"); - qmlRegisterType("Qt",4,6,"Item"); - qmlRegisterType("Qt",4,6,"LayoutItem"); - qmlRegisterType("Qt",4,6,"ListView"); - qmlRegisterType("Qt",4,6,"Loader"); - qmlRegisterType("Qt",4,6,"MouseArea"); - qmlRegisterType("Qt",4,6,"Path"); - qmlRegisterType("Qt",4,6,"PathAttribute"); - qmlRegisterType("Qt",4,6,"PathCubic"); - qmlRegisterType("Qt",4,6,"PathLine"); - qmlRegisterType("Qt",4,6,"PathPercent"); - qmlRegisterType("Qt",4,6,"PathQuad"); - qmlRegisterType("Qt",4,6,"PathView"); - qmlRegisterType("Qt",4,6,"IntValidator"); + qmlRegisterType("Qt",4,7,"BorderImage"); + qmlRegisterType("Qt",4,7,"Column"); + qmlRegisterType("Qt",4,7,"Drag"); + qmlRegisterType("Qt",4,7,"Flickable"); + qmlRegisterType("Qt",4,7,"Flipable"); + qmlRegisterType("Qt",4,7,"Flow"); + qmlRegisterType("Qt",4,7,"FocusPanel"); + qmlRegisterType("Qt",4,7,"FocusScope"); + qmlRegisterType("Qt",4,7,"Gradient"); + qmlRegisterType("Qt",4,7,"GradientStop"); + qmlRegisterType("Qt",4,7,"Grid"); + qmlRegisterType("Qt",4,7,"GridView"); + qmlRegisterType("Qt",4,7,"Image"); + qmlRegisterType("Qt",4,7,"Item"); + qmlRegisterType("Qt",4,7,"LayoutItem"); + qmlRegisterType("Qt",4,7,"ListView"); + qmlRegisterType("Qt",4,7,"Loader"); + qmlRegisterType("Qt",4,7,"MouseArea"); + qmlRegisterType("Qt",4,7,"Path"); + qmlRegisterType("Qt",4,7,"PathAttribute"); + qmlRegisterType("Qt",4,7,"PathCubic"); + qmlRegisterType("Qt",4,7,"PathLine"); + qmlRegisterType("Qt",4,7,"PathPercent"); + qmlRegisterType("Qt",4,7,"PathQuad"); + qmlRegisterType("Qt",4,7,"PathView"); + qmlRegisterType("Qt",4,7,"IntValidator"); qmlRegisterType("Qt",4,7,"DoubleValidator"); qmlRegisterType("Qt",4,7,"RegExpValidator"); - qmlRegisterType("Qt",4,6,"Rectangle"); - qmlRegisterType("Qt",4,6,"Repeater"); - qmlRegisterType("Qt",4,6,"Rotation"); - qmlRegisterType("Qt",4,6,"Row"); - qmlRegisterType("Qt",4,6,"Translate"); - qmlRegisterType("Qt",4,6,"Scale"); - qmlRegisterType("Qt",4,6,"Text"); - qmlRegisterType("Qt",4,6,"TextEdit"); - qmlRegisterType("Qt",4,6,"TextInput"); - qmlRegisterType("Qt",4,6,"ViewSection"); - qmlRegisterType("Qt",4,6,"VisualDataModel"); - qmlRegisterType("Qt",4,6,"VisualItemModel"); + qmlRegisterType("Qt",4,7,"Rectangle"); + qmlRegisterType("Qt",4,7,"Repeater"); + qmlRegisterType("Qt",4,7,"Rotation"); + qmlRegisterType("Qt",4,7,"Row"); + qmlRegisterType("Qt",4,7,"Translate"); + qmlRegisterType("Qt",4,7,"Scale"); + qmlRegisterType("Qt",4,7,"Text"); + qmlRegisterType("Qt",4,7,"TextEdit"); + qmlRegisterType("Qt",4,7,"TextInput"); + qmlRegisterType("Qt",4,7,"ViewSection"); + qmlRegisterType("Qt",4,7,"VisualDataModel"); + qmlRegisterType("Qt",4,7,"VisualItemModel"); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); - qmlRegisterType("Qt",4,6,"QGraphicsWidget"); - qmlRegisterExtendedType("Qt",4,6,"QGraphicsWidget"); + qmlRegisterType("Qt",4,7,"QGraphicsWidget"); + qmlRegisterExtendedType("Qt",4,7,"QGraphicsWidget"); qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); @@ -146,18 +146,18 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType(); #ifdef QT_NO_GRAPHICSEFFECT QString no_graphicseffect = qApp->translate("QGraphicsBlurEffect","Qt was built without support for graphicseffects"); - qmlRegisterTypeNotAvailable("Qt",4,6,"Blur",no_graphicseffect); - qmlRegisterTypeNotAvailable("Qt",4,6,"Colorize",no_graphicseffect); - qmlRegisterTypeNotAvailable("Qt",4,6,"DropShadow",no_graphicseffect); - qmlRegisterTypeNotAvailable("Qt",4,6,"Opacity",no_graphicseffect); + qmlRegisterTypeNotAvailable("Qt",4,7,"Blur",no_graphicseffect); + qmlRegisterTypeNotAvailable("Qt",4,7,"Colorize",no_graphicseffect); + qmlRegisterTypeNotAvailable("Qt",4,7,"DropShadow",no_graphicseffect); + qmlRegisterTypeNotAvailable("Qt",4,7,"Opacity",no_graphicseffect); #else qmlRegisterType(); - qmlRegisterType("Qt",4,6,"Blur"); - qmlRegisterType("Qt",4,6,"Colorize"); - qmlRegisterType("Qt",4,6,"DropShadow"); - qmlRegisterType("Qt",4,6,"Opacity"); + qmlRegisterType("Qt",4,7,"Blur"); + qmlRegisterType("Qt",4,7,"Colorize"); + qmlRegisterType("Qt",4,7,"DropShadow"); + qmlRegisterType("Qt",4,7,"Opacity"); #endif - qmlRegisterUncreatableType("Qt",4,6,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); - qmlRegisterUncreatableType("Qt",4,6,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties")); + qmlRegisterUncreatableType("Qt",4,7,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); + qmlRegisterUncreatableType("Qt",4,7,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties")); } diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 10cd886..edafe59 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1258,7 +1258,7 @@ bool QDeclarativeCompiler::buildSubObject(Object *obj, const BindingContext &ctx int QDeclarativeCompiler::componentTypeRef() { - QDeclarativeType *t = QDeclarativeMetaType::qmlType("Qt/Component",4,6); + QDeclarativeType *t = QDeclarativeMetaType::qmlType("Qt/Component",4,7); for (int ii = output->types.count() - 1; ii >= 0; --ii) { if (output->types.at(ii).type == t) return ii; diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index a41eaa9..6d64f63 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -144,9 +144,9 @@ static bool qt_QmlQtModule_registered = false; void QDeclarativeEnginePrivate::defineModule() { - qmlRegisterType("Qt",4,6,"Component"); - qmlRegisterType("Qt",4,6,"QtObject"); - qmlRegisterType("Qt",4,6,"WorkerScript"); + qmlRegisterType("Qt",4,7,"Component"); + qmlRegisterType("Qt",4,7,"QtObject"); + qmlRegisterType("Qt",4,7,"WorkerScript"); qmlRegisterType(); } diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp index d4bb8ee..c6fe161 100644 --- a/src/declarative/qml/qdeclarativevaluetype.cpp +++ b/src/declarative/qml/qdeclarativevaluetype.cpp @@ -61,7 +61,7 @@ int qmlRegisterValueTypeEnums(const char *qmlName) QString(), - "Qt", 4, 6, qmlName, &T::staticMetaObject, + "Qt", 4, 7, qmlName, &T::staticMetaObject, 0, 0, diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp index 0611093..eb59fb1 100644 --- a/src/declarative/util/qdeclarativeutilmodule.cpp +++ b/src/declarative/util/qdeclarativeutilmodule.cpp @@ -76,52 +76,52 @@ void QDeclarativeUtilModule::defineModule() { - qmlRegisterType("Qt",4,6,"AnchorAnimation"); - qmlRegisterType("Qt",4,6,"AnchorChanges"); - qmlRegisterType("Qt",4,6,"Behavior"); - qmlRegisterType("Qt",4,6,"Binding"); - qmlRegisterType("Qt",4,6,"ColorAnimation"); - qmlRegisterType("Qt",4,6,"Connections"); - qmlRegisterType("Qt",4,6,"SmoothedAnimation"); - qmlRegisterType("Qt",4,6,"SmoothedFollow"); - qmlRegisterType("Qt",4,6,"FontLoader"); - qmlRegisterType("Qt",4,6,"ListElement"); - qmlRegisterType("Qt",4,6,"NumberAnimation"); - qmlRegisterType("Qt",4,6,"Package"); - qmlRegisterType("Qt",4,6,"ParallelAnimation"); - qmlRegisterType("Qt",4,6,"ParentAnimation"); - qmlRegisterType("Qt",4,6,"ParentChange"); - qmlRegisterType("Qt",4,6,"PauseAnimation"); - qmlRegisterType("Qt",4,6,"PropertyAction"); - qmlRegisterType("Qt",4,6,"PropertyAnimation"); - qmlRegisterType("Qt",4,6,"RotationAnimation"); - qmlRegisterType("Qt",4,6,"ScriptAction"); - qmlRegisterType("Qt",4,6,"SequentialAnimation"); - qmlRegisterType("Qt",4,6,"SpringFollow"); - qmlRegisterType("Qt",4,6,"StateChangeScript"); - qmlRegisterType("Qt",4,6,"StateGroup"); - qmlRegisterType("Qt",4,6,"State"); - qmlRegisterType("Qt",4,6,"SystemPalette"); - qmlRegisterType("Qt",4,6,"Timer"); - qmlRegisterType("Qt",4,6,"Transition"); - qmlRegisterType("Qt",4,6,"Vector3dAnimation"); + qmlRegisterType("Qt",4,7,"AnchorAnimation"); + qmlRegisterType("Qt",4,7,"AnchorChanges"); + qmlRegisterType("Qt",4,7,"Behavior"); + qmlRegisterType("Qt",4,7,"Binding"); + qmlRegisterType("Qt",4,7,"ColorAnimation"); + qmlRegisterType("Qt",4,7,"Connections"); + qmlRegisterType("Qt",4,7,"SmoothedAnimation"); + qmlRegisterType("Qt",4,7,"SmoothedFollow"); + qmlRegisterType("Qt",4,7,"FontLoader"); + qmlRegisterType("Qt",4,7,"ListElement"); + qmlRegisterType("Qt",4,7,"NumberAnimation"); + qmlRegisterType("Qt",4,7,"Package"); + qmlRegisterType("Qt",4,7,"ParallelAnimation"); + qmlRegisterType("Qt",4,7,"ParentAnimation"); + qmlRegisterType("Qt",4,7,"ParentChange"); + qmlRegisterType("Qt",4,7,"PauseAnimation"); + qmlRegisterType("Qt",4,7,"PropertyAction"); + qmlRegisterType("Qt",4,7,"PropertyAnimation"); + qmlRegisterType("Qt",4,7,"RotationAnimation"); + qmlRegisterType("Qt",4,7,"ScriptAction"); + qmlRegisterType("Qt",4,7,"SequentialAnimation"); + qmlRegisterType("Qt",4,7,"SpringFollow"); + qmlRegisterType("Qt",4,7,"StateChangeScript"); + qmlRegisterType("Qt",4,7,"StateGroup"); + qmlRegisterType("Qt",4,7,"State"); + qmlRegisterType("Qt",4,7,"SystemPalette"); + qmlRegisterType("Qt",4,7,"Timer"); + qmlRegisterType("Qt",4,7,"Transition"); + qmlRegisterType("Qt",4,7,"Vector3dAnimation"); #ifdef QT_NO_XMLPATTERNS - qmlRegisterTypeNotAvailable("Qt",4,6,"XmlListModel", + qmlRegisterTypeNotAvailable("Qt",4,7,"XmlListModel", qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns")); - qmlRegisterTypeNotAvailable("Qt",4,6,"XmlRole", + qmlRegisterTypeNotAvailable("Qt",4,7,"XmlRole", qApp->translate("QDeclarativeXmlListModel","Qt was built without support for xmlpatterns")); #else - qmlRegisterType("Qt",4,6,"XmlListModel"); - qmlRegisterType("Qt",4,6,"XmlRole"); + qmlRegisterType("Qt",4,7,"XmlListModel"); + qmlRegisterType("Qt",4,7,"XmlRole"); #endif qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); - qmlRegisterUncreatableType("Qt",4,6,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class")); + qmlRegisterUncreatableType("Qt",4,7,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class")); - qmlRegisterCustomType("Qt", 4,6, "ListModel", new QDeclarativeListModelParser); + qmlRegisterCustomType("Qt", 4,7, "ListModel", new QDeclarativeListModelParser); qmlRegisterCustomType("Qt", 4, 6, "PropertyChanges", new QDeclarativePropertyChangesParser); qmlRegisterCustomType("Qt", 4, 6, "Connections", new QDeclarativeConnectionsParser); } diff --git a/src/imports/widgets/widgets.cpp b/src/imports/widgets/widgets.cpp index 1a71a68..20de1fe 100644 --- a/src/imports/widgets/widgets.cpp +++ b/src/imports/widgets/widgets.cpp @@ -57,9 +57,9 @@ public: qmlRegisterInterface("QGraphicsLayoutItem"); qmlRegisterInterface("QGraphicsLayout"); - qmlRegisterType(uri,4,6,"QGraphicsLinearLayoutStretchItem"); - qmlRegisterType(uri,4,6,"QGraphicsLinearLayout"); - qmlRegisterType(uri,4,6,"QGraphicsGridLayout"); + qmlRegisterType(uri,4,7,"QGraphicsLinearLayoutStretchItem"); + qmlRegisterType(uri,4,7,"QGraphicsLinearLayout"); + qmlRegisterType(uri,4,7,"QGraphicsGridLayout"); } }; diff --git a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml index f45a78c..d6cf4de 100644 --- a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml +++ b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml @@ -1,5 +1,5 @@ -import Qt 4.6 -import Qt.widgets 4.6 +import Qt 4.7 +import Qt.widgets 4.7 QGraphicsWidget { geometry: "20,0,600x400" diff --git a/tests/auto/declarative/qdeclarativeanchors/data/anchors.qml b/tests/auto/declarative/qdeclarativeanchors/data/anchors.qml index b64d0b0..227a055 100644 --- a/tests/auto/declarative/qdeclarativeanchors/data/anchors.qml +++ b/tests/auto/declarative/qdeclarativeanchors/data/anchors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml b/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml index ba424b9..91973a3 100644 --- a/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml +++ b/tests/auto/declarative/qdeclarativeanchors/data/anchorsqgraphicswidget.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.widgets 4.7 Rectangle { diff --git a/tests/auto/declarative/qdeclarativeanchors/data/centerin.qml b/tests/auto/declarative/qdeclarativeanchors/data/centerin.qml index 09b97f6..e248cc3 100644 --- a/tests/auto/declarative/qdeclarativeanchors/data/centerin.qml +++ b/tests/auto/declarative/qdeclarativeanchors/data/centerin.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 200; height: 200 diff --git a/tests/auto/declarative/qdeclarativeanchors/data/crash1.qml b/tests/auto/declarative/qdeclarativeanchors/data/crash1.qml index fd9dc55..01b469b 100644 --- a/tests/auto/declarative/qdeclarativeanchors/data/crash1.qml +++ b/tests/auto/declarative/qdeclarativeanchors/data/crash1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Column { Text { diff --git a/tests/auto/declarative/qdeclarativeanchors/data/fill.qml b/tests/auto/declarative/qdeclarativeanchors/data/fill.qml index 902465c..c594365 100644 --- a/tests/auto/declarative/qdeclarativeanchors/data/fill.qml +++ b/tests/auto/declarative/qdeclarativeanchors/data/fill.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 200; height: 200 diff --git a/tests/auto/declarative/qdeclarativeanchors/data/loop1.qml b/tests/auto/declarative/qdeclarativeanchors/data/loop1.qml index a266612..bd7f3de 100644 --- a/tests/auto/declarative/qdeclarativeanchors/data/loop1.qml +++ b/tests/auto/declarative/qdeclarativeanchors/data/loop1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: rect diff --git a/tests/auto/declarative/qdeclarativeanchors/data/loop2.qml b/tests/auto/declarative/qdeclarativeanchors/data/loop2.qml index acb57cd..e2dfde2 100644 --- a/tests/auto/declarative/qdeclarativeanchors/data/loop2.qml +++ b/tests/auto/declarative/qdeclarativeanchors/data/loop2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: container; diff --git a/tests/auto/declarative/qdeclarativeanchors/data/margins.qml b/tests/auto/declarative/qdeclarativeanchors/data/margins.qml index 4a29e77..58bc8a8 100644 --- a/tests/auto/declarative/qdeclarativeanchors/data/margins.qml +++ b/tests/auto/declarative/qdeclarativeanchors/data/margins.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 200; height: 200 diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml index 5bada34..62e5b14 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml +++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/colors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 AnimatedImage { source: "colors.gif" diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml index a70db5d..3400789 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml +++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickman.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 AnimatedImage { source: "stickman.gif" diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml index 5b0bdcb..566f9ea 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml +++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanerror1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 AnimatedImage { sourceSize: "240x180" diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml index 7ab17d4..92c57b6 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml +++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanpause.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 AnimatedImage { source: "stickman.gif" diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml index f4d277a..b8a254f 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml +++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanscaled.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 AnimatedImage { width: 240 diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml index 53b0c3a..2b6074c 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml +++ b/tests/auto/declarative/qdeclarativeanimatedimage/data/stickmanstopped.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 AnimatedImage { source: "stickman.gif" diff --git a/tests/auto/declarative/qdeclarativeanimations/data/attached.qml b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml index 0fb6f8c..78949f9 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/attached.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/attached.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 180; height: 200; diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml b/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml index d31cae9..5bb20f6 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badproperty1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml b/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml index 3b8b111..8dc422c 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badproperty2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml index 2629cf4..89cc424 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml index 1543a2a..f14eaee 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml index aa98c33..dd0368c 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml b/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml index e80762f..8d3d05e 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/badtype4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml index d6bfe45..09987de 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/dontAutoStart.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml index efed058..aab9d11 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/dontStart.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml b/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml index 1a6540f..034531c 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/dontStart2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml b/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml index 9f0e699..0e77c48 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/dotproperty.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml index 6770366..def350e 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml index 80c9473..a95bf2a 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/mixedtype2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties.qml index 4437815..9e4a74e 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml index b1f2020..5de813e 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml index 0a0ed6f..cf1bc3f 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml index a90f004..ce9f632 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml b/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml index 7d3cec9..a7f5116 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/properties5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml index b13b94b..d8ef5d6 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml index 033c5c1..b3b827d 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml index d0704c9..e6f773c 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml index e70c95c..0ae717a 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml index b9e27da..44cedf0 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml index 7417ed1..277cc1b 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/propertiesTransition6.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml b/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml index e9c57d4..6e48585 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/rotation.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 600; height: 200 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml b/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml index 2260440..bb6b028 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/valuesource.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml b/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml index 36d6c72..b844bd8 100644 --- a/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml +++ b/tests/auto/declarative/qdeclarativeanimations/data/valuesource2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml b/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml index e9fb286..62e6be5 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/color.qml b/tests/auto/declarative/qdeclarativebehaviors/data/color.qml index f2f4742..e075bd0 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/color.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/color.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml b/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml index 3ea9376..c766f42 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml b/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml index 1403eb9..e1f4699 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml index 5e1891a..c0f4eac 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml b/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml index 5e30f03..b58e332 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml b/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml index ca0ea54..0b5d00b 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml index a6c4ed9..6eb0729 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml index 2dda220..42b80a5 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml b/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml index 6187768..9e328d6 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml index 640a7d1..5857c4d 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml b/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml index 3860ec7..e3fd77d 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml index 11b2d3a..4528cce 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml b/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml index 795b309..f2f6352 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml index 5e72bca..de27f69 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 height: 400 diff --git a/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml b/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml index 8f5b39e..9c619e6 100644 --- a/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml +++ b/tests/auto/declarative/qdeclarativebinding/data/test-binding.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: screen diff --git a/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml b/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml index ea20c16..e0f1811 100644 --- a/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml +++ b/tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: screen diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml index 81ab599..954ca97 100644 --- a/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml +++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: screen; width: 50 diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml index 22e9422..9e5a99c 100644 --- a/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml +++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 Connections { id: connection; target: connection; onTargetChanged: 1 == 1 } diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml index 6e396c0..51efde6 100644 --- a/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml +++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 Connections {} diff --git a/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml b/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml index 736d5e8..361474c 100644 --- a/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml +++ b/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: screen; width: 50 diff --git a/tests/auto/declarative/qdeclarativedom/data/MyComponent.qml b/tests/auto/declarative/qdeclarativedom/data/MyComponent.qml index 1472f01..dd9e9ea 100644 --- a/tests/auto/declarative/qdeclarativedom/data/MyComponent.qml +++ b/tests/auto/declarative/qdeclarativedom/data/MyComponent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { } diff --git a/tests/auto/declarative/qdeclarativedom/data/MyItem.qml b/tests/auto/declarative/qdeclarativedom/data/MyItem.qml index 1472f01..dd9e9ea 100644 --- a/tests/auto/declarative/qdeclarativedom/data/MyItem.qml +++ b/tests/auto/declarative/qdeclarativedom/data/MyItem.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { } diff --git a/tests/auto/declarative/qdeclarativedom/data/import/Bar.qml b/tests/auto/declarative/qdeclarativedom/data/import/Bar.qml index 2d1a4a3..d26b299 100644 --- a/tests/auto/declarative/qdeclarativedom/data/import/Bar.qml +++ b/tests/auto/declarative/qdeclarativedom/data/import/Bar.qml @@ -1,2 +1,2 @@ -import Qt 4.6 +import Qt 4.7 diff --git a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml index 2d1a4a3..d26b299 100644 --- a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml +++ b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml @@ -1,2 +1,2 @@ -import Qt 4.6 +import Qt 4.7 diff --git a/tests/auto/declarative/qdeclarativedom/data/top.qml b/tests/auto/declarative/qdeclarativedom/data/top.qml index 2681993..6405cd2 100644 --- a/tests/auto/declarative/qdeclarativedom/data/top.qml +++ b/tests/auto/declarative/qdeclarativedom/data/top.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 MyComponent { width: 100 diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml index 691d9ec..170d027 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string greeting: "hello world" diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml index f51ca86..e9a41ed 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { function testFunction() { return 19; } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml index 28252df..6e50b10 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int b: obj.prop.a diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml index 12ac754..fe0492f 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property int a: 3 diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml index 86c312c..e144de7 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property int children: root.children.length diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml index 5c3ea1f..515f80f 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.test 1.0 MyQmlObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml index 128db69..72ae865 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyTypeObject { Component.onCompleted: { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml b/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml index 4b5464d..f31f142 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.test 1.0 QtObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml index 266de76..88740dc 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int a: 10 diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml index 19b0c42..7530396 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { objectProperty: MyQmlObject {} diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml index 1c88700..a883e85 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { //real diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml b/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml index 80a2814..1dc0ada 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property CustomObject myObject diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml index 6c538fe..6fc1211 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { function calculate() { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml index 64b83af..72b59ae 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.test 1.0 QtObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml index acc3163..14046f0 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.test 1.0 MyQmlObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml index 44e10c1..146f6f1 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.test 1.0 MyQmlObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml index 9a82ad1..dc78cd8 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { property MyExtendedObject a; diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml index 566f5ed..c57e5f8 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyExtendedObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml index 4aca111..a893fb0 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { function myFunction() { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml index 93054f8..e3b29ae 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { objectProperty: if(1) otherObject diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml index 5ae8b14..4746f3f 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { objectProperty: otherObject diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml index 4128c92..fb4fa4d 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int test diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml index 9e8408f..a945a16 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import "libraryScriptAssert.js" as Test QtObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml index 216e916..3ba4183 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { id: root diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml index e6d31c7..697530f 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant test: children diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml index 79efc50..269bd83 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { function testFunction() { return 19; } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml index aac711c..2ea9cdb 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 MethodsObject { function testFunction2() { return 17; } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml b/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml index 5ba324a..0065add 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property alias blah: item.x diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml index 7da09e4..a8cb50e 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string test: thing.stringProperty diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml index a762d6d..8be2d5b 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml index a52c772..daa9b0b 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml index 1bf0b81..11472a0 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property QtObject test diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml index edcd340..4b51109 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml index 72edf6e..231c9e5 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { Component.onCompleted: { var a = getObject(); a = null; } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml index c66f071..bef40fd 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { id: root diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml index 5897e2a..22c4f0b 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int test: getObjects().length diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml index 9beda6a..d4d7eb2 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property int a: 0 diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml index 4ad7f34..4395ba3 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml index 1c0be98..7f895ff 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scope.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml index d6e4207..5d8e29e 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 import "scriptConnect.1.js" as Script MyQmlObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml index 7992ba5..5681907 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 import "scriptConnect.2.js" as Script MyQmlObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml index 0d8e6ef..40d8079 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml index 3e1ff1b..0356650 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml index 3ad5cbc..661f28e 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml index d546495..36655ee 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 import "scriptConnect.6.js" as Script MyQmlObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml index 0d262c6..0cb4d79 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 import "scriptDisconnect.1.js" as Script MyQmlObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml index 6d379e6..05ca7a4 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 import "scriptDisconnect.1.js" as Script MyQmlObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml index 526580a..2a66bed 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 import "scriptDisconnect.1.js" as Script MyQmlObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml index 18b05ad..7beb84e 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 import "scriptDisconnect.1.js" as Script MyQmlObject { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml index 5a19639..823096b 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property int test: myObject.object.a diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml index 7d419cd..a2fb4d0 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { property real base: 50 diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml b/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml index b9e455d..ec49a95 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool test1: (a === true) diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml index bd23544..26d9596 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant obj: nested diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml index 5488e1a..46e18e5 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool runTest: false diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml index 8a1843c..45272e3 100644 --- a/tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml +++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable01.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Flickable { } diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml index 4b82d5c..2550fcc 100644 --- a/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml +++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Flickable { width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml index 49eed5a..27fe653 100644 --- a/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml +++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Flickable { width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml index 40c4606..ff742f0 100644 --- a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml +++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Flickable { width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativeflipable/data/crash.qml b/tests/auto/declarative/qdeclarativeflipable/data/crash.qml index ad40bf0..fb369a6 100644 --- a/tests/auto/declarative/qdeclarativeflipable/data/crash.qml +++ b/tests/auto/declarative/qdeclarativeflipable/data/crash.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Flipable { transform: Rotation { diff --git a/tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml b/tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml index f6f2014..41463fe 100644 --- a/tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml +++ b/tests/auto/declarative/qdeclarativeflipable/data/flipable-abort.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { Flipable { diff --git a/tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml b/tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml index 21d356d..5ddf09d 100644 --- a/tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml +++ b/tests/auto/declarative/qdeclarativeflipable/data/test-flipable.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Flipable { id: flipable diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml index adde522..5904fd6 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml +++ b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 800; height: 600 diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml index f060bdc..6b09c29 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml +++ b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml index 277fda4..216277e 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml +++ b/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml index 9344d07..2ac0d18 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml +++ b/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml index e41c6b8..8862b39 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml +++ b/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml index 838e557..d67ec57 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml +++ b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml b/tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml index d3cdcd8..9c3c847 100644 --- a/tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml +++ b/tests/auto/declarative/qdeclarativegridview/data/displaygrid.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml index e45c4c3..2fe173f 100644 --- a/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml +++ b/tests/auto/declarative/qdeclarativegridview/data/gridview-enforcerange.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml index cc3e549..9331243 100644 --- a/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml +++ b/tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { property int current: grid.currentIndex diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml index a061ae2..3d826dd 100644 --- a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml +++ b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: root diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview2.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview2.qml index 62b5bd3..772255d 100644 --- a/tests/auto/declarative/qdeclarativegridview/data/gridview2.qml +++ b/tests/auto/declarative/qdeclarativegridview/data/gridview2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 GridView { anchors.fill: parent diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview3.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview3.qml index b133d55..f108e3d 100644 --- a/tests/auto/declarative/qdeclarativegridview/data/gridview3.qml +++ b/tests/auto/declarative/qdeclarativegridview/data/gridview3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 GridView { anchors.fill: parent diff --git a/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml b/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml index 5ce758d..8e4e178 100644 --- a/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml +++ b/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 360; height: 120; color: "white" diff --git a/tests/auto/declarative/qdeclarativegridview/data/setindex.qml b/tests/auto/declarative/qdeclarativegridview/data/setindex.qml index b272d58..93ef69b 100644 --- a/tests/auto/declarative/qdeclarativegridview/data/setindex.qml +++ b/tests/auto/declarative/qdeclarativegridview/data/setindex.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 200 diff --git a/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml index 548e498..30e8274 100644 --- a/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml +++ b/tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant nested diff --git a/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml index eac0b73..9bd8571 100644 --- a/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml +++ b/tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant nested diff --git a/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml index 176636a..9bb6be7 100644 --- a/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml +++ b/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant nested diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml b/tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml index dcd4061..5958004 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/childrenProperty.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root diff --git a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml b/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml index 08da901..87e64c5 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Grid { columns: 2 diff --git a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml index 7d34fc8..8ff3e87 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { focus: true diff --git a/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml b/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml index 40a2106..4a92e9d 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root; objectName: "root" diff --git a/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml b/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml index 5f97408..dd86453 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/propertychanges.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { Item { diff --git a/tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml b/tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml index fa299be..852f242 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/resourcesProperty.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml index 55aa231..deb84a8 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { id: root diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml index f62c860..db205f1 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { property variant other diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml index 9050c3a..04f5ba3 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { property alias obj : otherObj diff --git a/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml b/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml index 573674c..80414ac 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 Alias3 {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml b/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml index 05fbc3f..4c78cd7 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { QtObject {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml index 99d010f..61e6146 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml index d08f35b..0275e21 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int a diff --git a/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml b/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml index aefbf9a..9746ab0 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int super_a: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml b/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml index df8c851..23d6ed9 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { property variant child diff --git a/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml index a0706ad..8c953cb 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml @@ -1,2 +1,2 @@ -import Qt 4.6 +import Qt 4.7 Text {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml index 5155612..fdf4800 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property QtObject o1 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml b/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml index 5cc8d20..ee02335 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { x: "You can't assign a string to a real!" diff --git a/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml b/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml index 2889caf..5373959 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { property int a: Math.max(10, 9) diff --git a/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml b/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml index e5a7cf8..d5c6979 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { property int a: Math.max(10, 9) diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml index 500b0f6..291d47a 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { id: root diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml index 0b968c2..787eb77 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant other diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml index 125c518..bbd1901 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Test 1.0 QtObject { diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml index e3af230..2d99b64 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property QtObject o; diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml index a9a57eb..4ceff3d 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property QtObject object diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml index 629dd2a..5bf8702 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant other diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml index 7c072e1..b8c71e1 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant other diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml index f6422bd..1009df7 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Test 1.0 QtObject { diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml index 91fd833..5af3d6e 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant test1: 1 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml index 774762a..2b1ef76 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { property variant a; diff --git a/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml index 4681879..8eb9768 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml @@ -1,4 +1,4 @@ -import Qt 4.6 as Qt +import Qt 4.7 as Qt Qt.QtObject { Qt: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml index b46ec34..3a78170 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml @@ -1,6 +1,6 @@ import Test 1.0 import Test 1.0 as Namespace -import Qt 4.6 +import Qt 4.7 QtObject { MyQmlObject.value: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml index 07e463a..730fffd 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml index 88e0f73..7e7dd0f 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: myId diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml index 287a959..f0d5f71 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { Component { diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml index ab1e29b..521adbc 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { QtObject {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml index 629e998..9c3938b 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { x: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml index 2303ebf..9208722 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.6.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { id: QtObject {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml index ad708fe..b81e0c3 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.7.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { property int a diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml index 67b1b89..0b00890 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.8.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { signal a diff --git a/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml index a4dbae0..c5f93c9 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/component.9.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Component { function a() {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml b/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml index e745e91..725069e 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant test diff --git a/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml b/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml index a22c776..f11abd9 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/crash2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { objectName: "Hello" + "World" diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml index 7cd6a83..438e8e9 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int on diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml b/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml index 00cc0c4..902b598 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 ListModel { ListElement { a: 10 } ListElement { id: foo; a: 12 } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml b/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml index cf2f272..3230e49 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 ListModel { ListElement { a: 10 } ListElement { a: 12 } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml b/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml index 3987a3c..c241861 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int a: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml b/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml index 0fd1404..0cd0338 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyTypeObject { grouped { diff --git a/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml b/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml index 3651511..b4203b5 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyContainer { QtObject { diff --git a/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml index 4eab50a..54d080a 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { onDestroyed: print("Hello World!") diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml index 1efe791..c0ed52c 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { default property QtObject a diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml index 4e7b5ae..1f46b96 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int a diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml index 573c1ba..cf49062 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { signal a diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml index 51dd834..a14ec4c 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { function a() {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml index 6b93e00..ea77cfd 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property UnknownType a diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml index 930bf2c..a1be43a 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyCustomParserType { propa: a + 10 propb: Math.min(a, 10) diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml index c80a7c0..e870046 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml @@ -1,6 +1,6 @@ import Test 1.0 -import Qt 4.6 -import Qt 4.6 as Qt +import Qt 4.7 +import Qt 4.7 as Qt QtObject { property QtObject objectProperty diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml index 6411609..6bcae0f 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { default property int intProperty : 10 property bool boolProperty: false diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml index 7bfab67..cceb44b 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 DynamicPropertiesNestedType { property int a: 13 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml index 2a834e8..9aa5e86 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { signal signal1 function slot1() {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml b/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml index a723269..6b5b451 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Font { } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml index cd112af..3b80f0b 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml @@ -1,4 +1,4 @@ import Test 1.0 as Rectangle -import Qt 4.6 +import Qt 4.7 Rectangle { } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml index ec6aa2b..483cfec 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml @@ -1,5 +1,5 @@ // imports... import "will-not-be-found" -import Qt 4.6 +import Qt 4.7 Rectangle { } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml b/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml index 478f06a..1ebec1b 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyContainer { Component { id: myComponent diff --git a/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml index 70879ff..6a47536 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyQmlObject { interfaceProperty: MyQmlObject {} } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml index 324f79c..84d39df 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { MyQmlObject.foo: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml index b768e9f..40e3926 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml @@ -1,5 +1,5 @@ import Test 1.0 as Namespace -import Qt 4.6 +import Qt 4.7 QtObject { Namespace.MadeUpClass.foo: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml index 7b782be..28f8220 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml @@ -1,5 +1,5 @@ import Test 1.0 as Namespace -import Qt 4.6 +import Qt 4.7 QtObject { Namespace.madeUpClass.foo: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml index 1f47c61..f45f88f 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml @@ -1,5 +1,5 @@ import Test 1.0 as Namespace -import Qt 4.6 +import Qt 4.7 QtObject { Namespace.MyQmlObject.foo: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml index 79c2981..64bc8bd 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { MyQmlObject: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml index af0be80..ee3dedb 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml @@ -1,5 +1,5 @@ import Test 1.0 as Namespace -import Qt 4.6 +import Qt 4.7 QtObject { Namespace.MyQmlObject: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml index 0546322..66cad2d 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { MyQmlObject: QtObject {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml index 108109a..90d80bc 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { Test.MyQmlObject: QtObject {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml index ccf0353..5293d55 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { MyTypeObject.foo: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml index e736379..6f319c1 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml @@ -1,5 +1,5 @@ import Test 1.0 as Namespace -import Qt 4.6 +import Qt 4.7 QtObject { Namespace.MyTypeObject.foo: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml index a095229..b7e1302 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { MadeUpClass.foo: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml index 9012aa6..671f5ab 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant o; diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml index a0c8306..f897cc8 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int o; diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml index 30d88d5..00fc81b 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml @@ -1,4 +1,4 @@ -import Qt 4.6 -import Qt 4.6 as qt +import Qt 4.7 +import Qt 4.7 as qt QtObject {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml index 38cf6bb..6d33361 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml @@ -1,2 +1,2 @@ -import Qt 4.6 as Qt +import Qt 4.7 as Qt Qt.Rectangle {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml index a0706ad..8c953cb 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml @@ -1,2 +1,2 @@ -import Qt 4.6 +import Qt 4.7 Text {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml index d8a22a8..d09dea7 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml @@ -1,2 +1,2 @@ -import Qt 4.6 +import Qt 4.7 Rectangle {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml index 93c7630..62e41a9 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml @@ -1,2 +1,2 @@ -import Qt 4.6 +import Qt 4.7 Image {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml b/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml index 32b5b6c..0393382 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { ListModel { diff --git a/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml b/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml index ba9e37c..3027722 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property list listProperty diff --git a/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml index d9794b4..a2d8799 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { function MyMethod() {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml b/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml index 3bf75f6..1a417a9 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { onClicked: console.log("Hello world!") } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml b/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml index c0d755a..0aa3405 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { NestedErrorsType {} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml index 0612fa2..077abe1 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Keys { } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml b/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml index 5725f85..71a7d26 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyTypeObject { // We set a and b to ensure that onCompleted is executed after bindings and diff --git a/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml b/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml index 7ebae7b..1b1eef9 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyTypeObject { // We set a and b to ensure that onCompleted is executed after bindings and diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml index cadc39a..b3384d4 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property blah a; diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml index e810c6c..1ba9b17 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property invalidmodifier a; diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml index 04147c2..261e7e3 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property invalidmodifier a; diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml index b2ec482..0a0f969 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { readonly property int a diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml index 65fafbb..0340f79 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { readonly property int a: value diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml index f39bed3..aad9e07 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int Hello diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml index 502eb22..0246b2f 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int Hello: 10 diff --git a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml index 429c327..d038ba3 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml index 0f57b61..1eab9f6 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { MyQmlObject.value: 10 } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml index a4a976e..cfe255a 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 QtObject { property variant child diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml index fbaf017..63fd74f 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { signal mySignal(nontype a) diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml index 5049192..c11ce17 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { signal mySignal(,) diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml index 9dd4cc7..771ea50 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { signal mySignal(a) diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml index 7279a46..37c938a 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { signal MySignal diff --git a/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml b/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml index c4d5905..1421361 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml @@ -1,2 +1,2 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml b/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml index c4d5905..1421361 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml @@ -1,2 +1,2 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { } diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml index 836c20a..d5a61ae 100644 --- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml +++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/LocalInternal.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 Image { source: "pics/blue.png" } diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml index c4d5905..1421361 100644 --- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml +++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/Test.qml @@ -1,2 +1,2 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { } diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml index 836c20a..d5a61ae 100644 --- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml +++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/UndeclaredLocal.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 Image { source: "pics/blue.png" } diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml index 0ea9ec6..43aeb74 100644 --- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml +++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/subdir/SubTest.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 Text {} diff --git a/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml b/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml index 5c2178f..0538738 100644 --- a/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml +++ b/tests/auto/declarative/qdeclarativelayouts/data/layouts.qml @@ -1,5 +1,5 @@ -import Qt 4.6 -import Qt.widgets 4.6 +import Qt 4.7 +import Qt.widgets 4.7 Item { id: resizable diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml index 8d23d4b..296cb9c 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml +++ b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property string result diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/model.qml b/tests/auto/declarative/qdeclarativelistmodel/data/model.qml index 4019948..f8a9175 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/data/model.qml +++ b/tests/auto/declarative/qdeclarativelistmodel/data/model.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: item diff --git a/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml b/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml index d08f35b..0275e21 100644 --- a/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml +++ b/tests/auto/declarative/qdeclarativelistreference/data/MyType.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int a diff --git a/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml b/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml index 670aee4..1ab5692 100644 --- a/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml +++ b/tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property list myList diff --git a/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml b/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml index d64be0f..13de975 100644 --- a/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml +++ b/tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property list myList; diff --git a/tests/auto/declarative/qdeclarativelistview/data/displaylist.qml b/tests/auto/declarative/qdeclarativelistview/data/displaylist.qml index 7b124a5..defd13e 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/displaylist.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/displaylist.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml b/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml index e6b5c8f..66728d6 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml @@ -1,7 +1,7 @@ // This example demonstrates placing items in a view using // a VisualItemModel -import Qt 4.6 +import Qt 4.7 Rectangle { color: "lightgray" diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml index 46fddae..939a4d5 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/listview-enforcerange.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml index a6d7610..0599ddd 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { property int current: list.currentIndex diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml index 4b5bea6..a6f3ab8 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml b/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml index 40fc436..3b2db5e 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml b/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml index 09877ac..300fcb5 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 180; height: 120; color: "white" diff --git a/tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml b/tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml index 3b49f6a..f202fc8 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/BlueRect.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { objectName: "blue" diff --git a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml index 4ebf366..9bb0b37 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.widgets 4.6 QGraphicsWidget { diff --git a/tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml b/tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml index 7ee3513..9b8f770 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/GreenRect.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml b/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml index cfbb55a..6aa3d2f 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/NoResize.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Loader { resizeMode: "NoResize" diff --git a/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml b/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml index 5eab965..9322141 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/NoResizeGraphicsWidget.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Loader { resizeMode: Loader.NoResize diff --git a/tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml b/tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml index aa4b0c2..d808c51 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/Rect120x60.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 120 diff --git a/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml b/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml index f600e85..d99dd01 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/SetSourceComponent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { function clear() { diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml index 568a136..0cfb4df 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/SizeGraphicsWidgetToLoader.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Loader { resizeMode: Loader.SizeItemToLoader diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml index a710803..b588c9d 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/SizeLoaderToGraphicsWidget.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Loader { resizeMode: Loader.SizeLoaderToItem diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml index b52fa03..93be6f1 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/SizeToItem.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Loader { resizeMode: "SizeLoaderToItem" diff --git a/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml index 1a107e1..04b46fb 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/SizeToLoader.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Loader { resizeMode: "SizeItemToLoader" diff --git a/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml b/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml index da4f6cb..633f03d 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 100; height: 100; color: "red" diff --git a/tests/auto/declarative/qdeclarativeloader/data/crash.qml b/tests/auto/declarative/qdeclarativeloader/data/crash.qml index 8474e78..db9abca 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/crash.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/crash.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400 diff --git a/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml b/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml index e682d1c..b32558b 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 Loader { source: "http://evil.place/evil.qml" } diff --git a/tests/auto/declarative/qdeclarativeloader/data/nonItem.qml b/tests/auto/declarative/qdeclarativeloader/data/nonItem.qml index f42c1d5..5ce003d 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/nonItem.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/nonItem.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Loader { sourceComponent: QtObject {} diff --git a/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml b/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml index e281246..812c1be 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 Item { } diff --git a/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml b/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml index e7f5a14..91732a1 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 Loader { source: "sameorigin-load.qml" } diff --git a/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml b/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml index 782562b..ae33e00 100644 --- a/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml +++ b/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Loader { source: "VmeError.qml" diff --git a/tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml b/tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml index e800f98..f926daa 100644 --- a/tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml +++ b/tests/auto/declarative/qdeclarativemousearea/data/clickandhold.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml b/tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml index 4cd78da..ba15250 100644 --- a/tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml +++ b/tests/auto/declarative/qdeclarativemousearea/data/dragproperties.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: whiteRect width: 200 diff --git a/tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml b/tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml index 4bfb9c3..789125b 100644 --- a/tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml +++ b/tests/auto/declarative/qdeclarativemousearea/data/dragreset.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: whiteRect width: 200 diff --git a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml index 0da7c45..6008499 100644 --- a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml +++ b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnClick.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "#ffffff" diff --git a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml index 63de624..2a2b905 100644 --- a/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml +++ b/tests/auto/declarative/qdeclarativemousearea/data/updateMousePosOnResize.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "#ffffff" diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml b/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml index f1e4909..ec8f452 100644 --- a/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml +++ b/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.labs.particles 1.0 Rectangle { diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml b/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml index 4f168a9..af15665 100644 --- a/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml +++ b/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.labs.particles 1.0 Rectangle{ diff --git a/tests/auto/declarative/qdeclarativepathview/data/datamodel.qml b/tests/auto/declarative/qdeclarativepathview/data/datamodel.qml index 8d07db2..a5c3772 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/datamodel.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/datamodel.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 PathView { id: pathview diff --git a/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml b/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml index eded122..c82914f 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml b/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml index 7e82a48..caa1586 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Path { startX: 120; startY: 100 diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml index 1866875..a3afd38 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: root diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview1.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview1.qml index b3b0a9a..c3d2f91 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/pathview1.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/pathview1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 PathView { } diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview2.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview2.qml index c825292..2ce66a2 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/pathview2.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/pathview2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 PathView { id: photoPathView diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml index b143294..066c531 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 PathView { id: photoPathView diff --git a/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml b/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml index 1ae1ad2..6cc9d2a 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 350; height: 220; color: "white" diff --git a/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml b/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml index 6c1c823..3ba015d 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 90 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml index 9741ba9..3a56be6 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml index e335932..e098812 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml index 34a84bf..8799366 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/grid-toptobottom.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml index 1d6f44e..ab7238a 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml b/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml index 052d96b..8e11f4e 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/gridzerocolumns.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml index a1c05a8..20a6258 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml index fb9fdd1..0e368c1 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml index 3a7a3b1..71ad6ec 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml b/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml index 4370a18..a53ff82 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Grid { id: myGrid diff --git a/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml b/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml index 2bc5e94..531d716 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml b/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml index 31faa54..1499c1e 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml b/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml index 1c5696b..f7e853a 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml b/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml index cd777e2..9e3d6ab 100644 --- a/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml +++ b/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 640 diff --git a/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml b/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml index 1dfb3e1..2177ae2 100644 --- a/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml +++ b/tests/auto/declarative/qdeclarativeproperty/data/TestType.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int a: 10 diff --git a/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml b/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml index 8085db2..0918e86 100644 --- a/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml +++ b/tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property TestType test diff --git a/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml b/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml index e657ff1..aa9e92a 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { Component.onCompleted: { diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml index 253a4e3..f966931 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool emptyArg: false diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml index a5e99a0..dc3e0d3 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int test: 1913 diff --git a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml index 9fe169d..ca3ff22 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml @@ -1,14 +1,14 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root // errors resulting in exceptions property QtObject incorrectArgCount1: Qt.createQmlObject() - property QtObject incorrectArgCount2: Qt.createQmlObject("import Qt 4.6\nQtObject{}", root, "main.qml", 10) - property QtObject noParent: Qt.createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13}", 0) - property QtObject notAvailable: Qt.createQmlObject("import Qt 4.6\nQtObject{Blah{}}", root) - property QtObject errors: Qt.createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml") + property QtObject incorrectArgCount2: Qt.createQmlObject("import Qt 4.7\nQtObject{}", root, "main.qml", 10) + property QtObject noParent: Qt.createQmlObject("import Qt 4.7\nQtObject{\nproperty int test: 13}", 0) + property QtObject notAvailable: Qt.createQmlObject("import Qt 4.7\nQtObject{Blah{}}", root) + property QtObject errors: Qt.createQmlObject("import Qt 4.7\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml") property bool emptyArg: false @@ -18,14 +18,14 @@ Item { // errors resulting in nulls emptyArg = (Qt.createQmlObject("", root) == null); try { - Qt.createQmlObject("import Qt 4.6\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root) + Qt.createQmlObject("import Qt 4.7\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root) } catch (error) { console.log("RunTimeError: ",error.message); } - var o = Qt.createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\n}", root); + var o = Qt.createQmlObject("import Qt 4.7\nQtObject{\nproperty int test: 13\n}", root); success = (o.test == 13); - Qt.createQmlObject("import Qt 4.6\nItem {}\n", root); + Qt.createQmlObject("import Qt 4.7\nItem {}\n", root); } } diff --git a/tests/auto/declarative/qdeclarativeqt/data/darker.qml b/tests/auto/declarative/qdeclarativeqt/data/darker.qml index b265a0e..f6333fe 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/darker.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/darker.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant test1: Qt.darker(Qt.rgba(1, 0.8, 0.3)) diff --git a/tests/auto/declarative/qdeclarativeqt/data/enums.qml b/tests/auto/declarative/qdeclarativeqt/data/enums.qml index 1efa6f5..a0190cc 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/enums.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/enums.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int test1: Qt.Key_Escape diff --git a/tests/auto/declarative/qdeclarativeqt/data/formatting.qml b/tests/auto/declarative/qdeclarativeqt/data/formatting.qml index 4cf0602..59a15929 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/formatting.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/formatting.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property date date1: "2008-12-24" diff --git a/tests/auto/declarative/qdeclarativeqt/data/hsla.qml b/tests/auto/declarative/qdeclarativeqt/data/hsla.qml index 142410b..4ca67a3 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/hsla.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/hsla.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property color test1: Qt.hsla(1, 0, 0, 0.8); diff --git a/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml b/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml index d986492..0f573c4 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { id: root diff --git a/tests/auto/declarative/qdeclarativeqt/data/lighter.qml b/tests/auto/declarative/qdeclarativeqt/data/lighter.qml index 2d2b835..6c0053ba 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/lighter.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/lighter.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant test1: Qt.lighter(Qt.rgba(1, 0.8, 0.3)) diff --git a/tests/auto/declarative/qdeclarativeqt/data/md5.qml b/tests/auto/declarative/qdeclarativeqt/data/md5.qml index c474b71..07f719b 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/md5.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/md5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string test1: Qt.md5() diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml index 70bd74d..3ceb05d 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { Component.onCompleted: Qt.openUrlExternally("test:url") diff --git a/tests/auto/declarative/qdeclarativeqt/data/point.qml b/tests/auto/declarative/qdeclarativeqt/data/point.qml index 1054ac9..0ada2d5 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/point.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/point.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant test1: Qt.point(19, 34); diff --git a/tests/auto/declarative/qdeclarativeqt/data/rect.qml b/tests/auto/declarative/qdeclarativeqt/data/rect.qml index e008656..fd38628 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/rect.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/rect.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant test1: Qt.rect(10, 13, 100, 109) diff --git a/tests/auto/declarative/qdeclarativeqt/data/rgba.qml b/tests/auto/declarative/qdeclarativeqt/data/rgba.qml index 66305a4..16606cd 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/rgba.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/rgba.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property color test1: Qt.rgba(1, 0, 0, 0.8); diff --git a/tests/auto/declarative/qdeclarativeqt/data/size.qml b/tests/auto/declarative/qdeclarativeqt/data/size.qml index 93577f2..afcfb62 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/size.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/size.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant test1: Qt.size(19, 34); diff --git a/tests/auto/declarative/qdeclarativeqt/data/tint.qml b/tests/auto/declarative/qdeclarativeqt/data/tint.qml index 478245f..25e7051 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/tint.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/tint.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property color test1: Qt.tint("red", "blue"); diff --git a/tests/auto/declarative/qdeclarativeqt/data/vector.qml b/tests/auto/declarative/qdeclarativeqt/data/vector.qml index 16716db..b7708f5 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/vector.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/vector.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property variant test1: Qt.vector3d(1, 0, 0.9); diff --git a/tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml b/tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml index cf1fb4d..9cd03c4 100644 --- a/tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml +++ b/tests/auto/declarative/qdeclarativerepeater/data/intmodel.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: container diff --git a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml index d74b2dc..e8dd8cc 100644 --- a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml +++ b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml @@ -1,7 +1,7 @@ // This example demonstrates placing items in a view using // a VisualItemModel -import Qt 4.6 +import Qt 4.7 Rectangle { color: "lightgray" diff --git a/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml b/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml index e6d0acb..17c5d8d 100644 --- a/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml +++ b/tests/auto/declarative/qdeclarativerepeater/data/objlist.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: container diff --git a/tests/auto/declarative/qdeclarativerepeater/data/properties.qml b/tests/auto/declarative/qdeclarativerepeater/data/properties.qml index 8c9f88e..34bbde0 100644 --- a/tests/auto/declarative/qdeclarativerepeater/data/properties.qml +++ b/tests/auto/declarative/qdeclarativerepeater/data/properties.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Row { Repeater { diff --git a/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml b/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml index 7d83230..3047435 100644 --- a/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml +++ b/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: container diff --git a/tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml b/tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml index c3c3260..c8b863c 100644 --- a/tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml +++ b/tests/auto/declarative/qdeclarativerepeater/data/repeater2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 240 diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml index cfece41..1de5f16 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation1.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 SmoothedAnimation {} diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml index 74a110d..544e7e9 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 SmoothedAnimation { to: 10; duration: 300; reversingMode: SmoothedAnimation.Immediate diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml index 3111e82..c1f3af0 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimation3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 SmoothedAnimation { to: 10; velocity: 250; reversingMode: SmoothedAnimation.Sync diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml index ec35067..3afeb7b 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationBehavior.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400; height: 400; color: "blue" diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml index 9ae744c..53429e2 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/data/smoothedanimationValueSource.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 300; diff --git a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow1.qml b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow1.qml index c162e7a..8c9d8ad 100644 --- a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow1.qml +++ b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow1.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 SmoothedFollow {} diff --git a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow2.qml b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow2.qml index d45001f..a634302 100644 --- a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow2.qml +++ b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 SmoothedFollow { to: 10; duration: 300; reversingMode: SmoothedFollow.Immediate diff --git a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow3.qml b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow3.qml index c09fb8e..c60da7f 100644 --- a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow3.qml +++ b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollow3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 SmoothedFollow { to: 10; velocity: 250; reversingMode: SmoothedFollow.Sync diff --git a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollowDisabled.qml b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollowDisabled.qml index 131f674..486bdee 100644 --- a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollowDisabled.qml +++ b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollowDisabled.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 300; diff --git a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollowValueSource.qml b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollowValueSource.qml index 514537c..2e01d74 100644 --- a/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollowValueSource.qml +++ b/tests/auto/declarative/qdeclarativesmoothedfollow/data/smoothedfollowValueSource.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 300; diff --git a/tests/auto/declarative/qdeclarativespringfollow/data/springfollow1.qml b/tests/auto/declarative/qdeclarativespringfollow/data/springfollow1.qml index 959d206..8528cfa 100644 --- a/tests/auto/declarative/qdeclarativespringfollow/data/springfollow1.qml +++ b/tests/auto/declarative/qdeclarativespringfollow/data/springfollow1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 SpringFollow { } diff --git a/tests/auto/declarative/qdeclarativespringfollow/data/springfollow2.qml b/tests/auto/declarative/qdeclarativespringfollow/data/springfollow2.qml index ffbf7d5..31a740a 100644 --- a/tests/auto/declarative/qdeclarativespringfollow/data/springfollow2.qml +++ b/tests/auto/declarative/qdeclarativespringfollow/data/springfollow2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 SpringFollow { to: 1.44; velocity: 0.9 diff --git a/tests/auto/declarative/qdeclarativespringfollow/data/springfollow3.qml b/tests/auto/declarative/qdeclarativespringfollow/data/springfollow3.qml index 9a8f6f3..0fa4aa9 100644 --- a/tests/auto/declarative/qdeclarativespringfollow/data/springfollow3.qml +++ b/tests/auto/declarative/qdeclarativespringfollow/data/springfollow3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 SpringFollow { to: 1.44; velocity: 0.9 diff --git a/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml b/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml index 8d64663..28e083c 100644 --- a/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml +++ b/tests/auto/declarative/qdeclarativestates/data/ExtendedRectangle.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: extendedRect objectName: "extendedRect" diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml index 5443e54..e9c9d67 100644 --- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml +++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: container diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml index 56de560..cee2ce5 100644 --- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml +++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 200; height: 200 diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml index 59c3c06..54dc34b 100644 --- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml +++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: container diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml index 7e3ba1c..885c3ce 100644 --- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml +++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 200; height: 200 diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml index b85a922..c3db72e 100644 --- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml +++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 200; height: 200 diff --git a/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml b/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml index 693a5c5..37e1e5a 100644 --- a/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml +++ b/tests/auto/declarative/qdeclarativestates/data/autoStateAtStartupRestoreBug.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: root diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml index 6528113..d559691 100644 --- a/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml +++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml index 2e7b4cf..a429b24 100644 --- a/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml +++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml index a3c47d9..26405d9 100644 --- a/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml +++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle diff --git a/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml b/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml index 1f52d0e..153a2c1 100644 --- a/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml +++ b/tests/auto/declarative/qdeclarativestates/data/basicBinding4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml index 88ea256..fca7916 100644 --- a/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml +++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml index 4dd293f..72bd23e 100644 --- a/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml +++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml index 62ab1d5..4fb1274 100644 --- a/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml +++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml b/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml index a373cfc..b2f02c9 100644 --- a/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml +++ b/tests/auto/declarative/qdeclarativestates/data/basicChanges4.qml @@ -1,5 +1,5 @@ import Qt.test 1.0 -import Qt 4.6 +import Qt 4.7 MyRectangle { id: rect diff --git a/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml b/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml index 1836f8a..abfe71a 100644 --- a/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml +++ b/tests/auto/declarative/qdeclarativestates/data/basicExtension.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/deleting.qml b/tests/auto/declarative/qdeclarativestates/data/deleting.qml index 3da0b12..a8a66cb 100644 --- a/tests/auto/declarative/qdeclarativestates/data/deleting.qml +++ b/tests/auto/declarative/qdeclarativestates/data/deleting.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/deletingState.qml b/tests/auto/declarative/qdeclarativestates/data/deletingState.qml index a5e8ed3..fadb7d9 100644 --- a/tests/auto/declarative/qdeclarativestates/data/deletingState.qml +++ b/tests/auto/declarative/qdeclarativestates/data/deletingState.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/explicit.qml b/tests/auto/declarative/qdeclarativestates/data/explicit.qml index 7543f84..718b169 100644 --- a/tests/auto/declarative/qdeclarativestates/data/explicit.qml +++ b/tests/auto/declarative/qdeclarativestates/data/explicit.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle property color sourceColor: "blue" diff --git a/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml b/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml index c7975e1..44397b5 100644 --- a/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml +++ b/tests/auto/declarative/qdeclarativestates/data/fakeExtension.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml b/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml index 480764e..26d0f50 100644 --- a/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml +++ b/tests/auto/declarative/qdeclarativestates/data/illegalObj.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myItem diff --git a/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml b/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml index 0dc39ae..13cab18 100644 --- a/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml +++ b/tests/auto/declarative/qdeclarativestates/data/illegalTempState.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: card diff --git a/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml b/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml index 9be984c..f757da0 100644 --- a/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml +++ b/tests/auto/declarative/qdeclarativestates/data/legalTempState.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: card diff --git a/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml b/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml index a5dd86a..db9b017 100644 --- a/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml +++ b/tests/auto/declarative/qdeclarativestates/data/nonExistantProp.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml index b8c7818..8b0e3bf 100644 --- a/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml +++ b/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400; height: 400 diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml index 8b23591..3a14dbe 100644 --- a/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml +++ b/tests/auto/declarative/qdeclarativestates/data/parentChange2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: newParent diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml index ddf9268..17c07e8 100644 --- a/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml +++ b/tests/auto/declarative/qdeclarativestates/data/parentChange3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400; height: 400 diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml index 34d667a..11d0831 100644 --- a/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml +++ b/tests/auto/declarative/qdeclarativestates/data/parentChange4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400; height: 400 diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml index 56bdd89..329d277 100644 --- a/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml +++ b/tests/auto/declarative/qdeclarativestates/data/parentChange5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400; height: 400 diff --git a/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml b/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml index 080e833..807eec9 100644 --- a/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml +++ b/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/reset.qml b/tests/auto/declarative/qdeclarativestates/data/reset.qml index 7da80b3..5725320 100644 --- a/tests/auto/declarative/qdeclarativestates/data/reset.qml +++ b/tests/auto/declarative/qdeclarativestates/data/reset.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 640 diff --git a/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml b/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml index 088c608..621adf0 100644 --- a/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml +++ b/tests/auto/declarative/qdeclarativestates/data/restoreEntryValues.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/script.qml b/tests/auto/declarative/qdeclarativestates/data/script.qml index 3c5f33e..cdb6be1 100644 --- a/tests/auto/declarative/qdeclarativestates/data/script.qml +++ b/tests/auto/declarative/qdeclarativestates/data/script.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: myRectangle width: 100; height: 100 diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml index 5ba1566..c4ab96c 100644 --- a/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml +++ b/tests/auto/declarative/qdeclarativestates/data/signalOverride.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.test 1.0 MyRectangle { diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml index 527e165..65a8cea 100644 --- a/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml +++ b/tests/auto/declarative/qdeclarativestates/data/signalOverride2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.test 1.0 MyRectangle { diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml index 702fa86..8a0b51a 100644 --- a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml +++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.test 1.0 MyRectangle { diff --git a/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml b/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml index 7369c63..08d0795 100644 --- a/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml +++ b/tests/auto/declarative/qdeclarativestates/data/whenOrdering.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { property bool condition1: false diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml index 5aeea56..877222f 100644 --- a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml +++ b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocal.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Text { text: "" diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml index 17bb21c..abc7077 100644 --- a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml +++ b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesLocalError.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Text { text: "" diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml index 53b0266..b6ca3e3 100644 --- a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml +++ b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemote.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Text { text: "" diff --git a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml index 48c7a95..fbfce9a 100644 --- a/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml +++ b/tests/auto/declarative/qdeclarativetext/data/embeddedImagesRemoteError.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Text { text: "" diff --git a/tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml b/tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml index e5df8f1..586e606 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/cursorTest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 300; color: "white" TextEdit { text: "Hello world!"; id: textEditObject; objectName: "textEditObject" diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml index 34b3883..b5c807e 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/http/ErrItem.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item{ Fungus{ diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml index 718cb71..df843d8 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/http/NormItem.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { objectName: "delegateOkay" diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml index 3c31e11..1b41f8f 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 300; color: "white" resources: [ diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml index a44aec2..51be3cf 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 300; color: "white" resources: [ diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml index 57d3e47..30c3fbd 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestFail2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 300; color: "white" resources: [ diff --git a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml index a44e867..a1ca58a 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/http/cursorHttpTestPass.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 300; color: "white" resources: [ diff --git a/tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml b/tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml index ddbf526..8dfac48 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/httpfail/FailItem.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { Rectangle { } diff --git a/tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml b/tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml index ddbf526..8dfac48 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/httpslow/WaitItem.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { Rectangle { } diff --git a/tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml b/tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml index c3d4c16..8067edb 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/inputmethodhints.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 TextEdit { text: "Hello world!" diff --git a/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml b/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml index 1aed8d8..7772687 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/navigation.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { property variant myInput: input diff --git a/tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml b/tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml index 69a6479..a68e4b4 100644 --- a/tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml +++ b/tests/auto/declarative/qdeclarativetextedit/data/readOnly.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { property variant myInput: input diff --git a/tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml b/tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml index ddc98cc..f0d1be5 100644 --- a/tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml +++ b/tests/auto/declarative/qdeclarativetextinput/data/cursorTest.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 300; color: "white" TextInput { text: "Hello world!"; id: textInputObject; objectName: "textInputObject" diff --git a/tests/auto/declarative/qdeclarativetextinput/data/inputmethodhints.qml b/tests/auto/declarative/qdeclarativetextinput/data/inputmethodhints.qml index b404682..da6b81f 100644 --- a/tests/auto/declarative/qdeclarativetextinput/data/inputmethodhints.qml +++ b/tests/auto/declarative/qdeclarativetextinput/data/inputmethodhints.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 TextInput { text: "Hello world!" diff --git a/tests/auto/declarative/qdeclarativetextinput/data/masks.qml b/tests/auto/declarative/qdeclarativetextinput/data/masks.qml index 08a857c..141c243 100644 --- a/tests/auto/declarative/qdeclarativetextinput/data/masks.qml +++ b/tests/auto/declarative/qdeclarativetextinput/data/masks.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 TextInput{ focus: true diff --git a/tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml b/tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml index 7cbeadd..c3d5994 100644 --- a/tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml +++ b/tests/auto/declarative/qdeclarativetextinput/data/maxLength.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 TextInput{ focus: true diff --git a/tests/auto/declarative/qdeclarativetextinput/data/navigation.qml b/tests/auto/declarative/qdeclarativetextinput/data/navigation.qml index 04f06da..58866b7 100644 --- a/tests/auto/declarative/qdeclarativetextinput/data/navigation.qml +++ b/tests/auto/declarative/qdeclarativetextinput/data/navigation.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { property variant myInput: input diff --git a/tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml b/tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml index 41e8b59..b10ea81 100644 --- a/tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml +++ b/tests/auto/declarative/qdeclarativetextinput/data/readOnly.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { property variant myInput: input diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml index 2697bb5..52591b1 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: root diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml index 478104e1..35005fe 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: root diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml index d35c72e..4ae45a4 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: root diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml index 7c22775..69b5bfd 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 import "deletedObject.js" as JS MyTypeObject { diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml index 3be5099..b6767b0 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyTypeObject { font.capitalization: Font.AllUppercase diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml index 6b494e4..4227ebf 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 as MyQt +import Qt 4.7 as MyQt MyTypeObject { font.capitalization: MyQt.Font.AllUppercase diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml index 4c12f21..cc51c31 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Test 1.0 Item { diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml index 185e7ba..0615300 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyTypeObject { property bool test1: false; diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml index 96592eb..e962ab0 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Test 1.0 MyTypeObject { diff --git a/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml index 8ae2ef8..045fc51 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml +++ b/tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml @@ -1,5 +1,5 @@ import Test 1.0 -import Qt 4.6 +import Qt 4.7 MyTypeObject { Component.onCompleted: { diff --git a/tests/auto/declarative/qdeclarativewebview/data/basic.qml b/tests/auto/declarative/qdeclarativewebview/data/basic.qml index f0b41ef..a5a8d34 100644 --- a/tests/auto/declarative/qdeclarativewebview/data/basic.qml +++ b/tests/auto/declarative/qdeclarativewebview/data/basic.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qdeclarativewebview/data/elements.qml b/tests/auto/declarative/qdeclarativewebview/data/elements.qml index 16e5788..5af76ed 100644 --- a/tests/auto/declarative/qdeclarativewebview/data/elements.qml +++ b/tests/auto/declarative/qdeclarativewebview/data/elements.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qdeclarativewebview/data/javaScript.qml b/tests/auto/declarative/qdeclarativewebview/data/javaScript.qml index 0e92e0e..4141166 100644 --- a/tests/auto/declarative/qdeclarativewebview/data/javaScript.qml +++ b/tests/auto/declarative/qdeclarativewebview/data/javaScript.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qdeclarativewebview/data/loadError.qml b/tests/auto/declarative/qdeclarativewebview/data/loadError.qml index f827238..2061b5f 100644 --- a/tests/auto/declarative/qdeclarativewebview/data/loadError.qml +++ b/tests/auto/declarative/qdeclarativewebview/data/loadError.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml b/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml index 5f9f757..d066c07 100644 --- a/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml +++ b/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml @@ -1,6 +1,6 @@ // Demonstrates opening new WebViews from HTML -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 Grid { diff --git a/tests/auto/declarative/qdeclarativewebview/data/propertychanges.qml b/tests/auto/declarative/qdeclarativewebview/data/propertychanges.qml index 0770acf..45684ff 100644 --- a/tests/auto/declarative/qdeclarativewebview/data/propertychanges.qml +++ b/tests/auto/declarative/qdeclarativewebview/data/propertychanges.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 Item { diff --git a/tests/auto/declarative/qdeclarativewebview/data/sethtml.qml b/tests/auto/declarative/qdeclarativewebview/data/sethtml.qml index 9e17597..b14bcf9 100644 --- a/tests/auto/declarative/qdeclarativewebview/data/sethtml.qml +++ b/tests/auto/declarative/qdeclarativewebview/data/sethtml.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml b/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml index ca989f8..5c7a5ff 100644 --- a/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml +++ b/tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 WorkerScript { id: worker diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml index 729793e..24e4071 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string urlDummy diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml index 33ca020..e78ce63 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url: "testdocument.html" diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml index c0957ed..79d1355 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url: "testdocument.html" diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml index 0b4badc..81d8e1d 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool xmlTest: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml index 9255922..cee07d6 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { id: obj diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml index 928e514..49bfebd 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool xmlTest: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml index 93e44fd..ab033a5 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool calledAsConstructor diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml index 4dcf6f9..d66f283 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int readyState diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml index 682ea9f..1df43ef 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool xmlTest: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml index de5ee4f..827ff3f 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int index_size_err: DOMException.INDEX_SIZE_ERR diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml index 200214f..e7a3fb4 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool xmlTest: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml index 9096999..157ae81 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml index 37124c7..7008224 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool exceptionThrown: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml index 505e4b1..ff58710 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml index 20fb040..d6256ed 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml index 7a65e25..0f3cdef 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml index d5aa4b1..a7a8bba 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool exceptionThrown: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml index 7538ffd..fc0f757 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml index 3b55802..c5507a8 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml index b8d01c4..d3cc845 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int unsent diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml index b30989b..8c603a4 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool onreadystatechange: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml index 72fb9d7..24bde60 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml index b6d4c32..86a6ac9 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool exceptionThrown: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml index 8c86c20..198219c 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool exceptionThrown: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml index 69f79ae..dacc484 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool exceptionThrown: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml index 1477279..d38380b 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool exceptionThrown: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml index b07f8e7..2c072e4 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml index 983ea14..825ad60 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml index 6b345cc..cb8f869 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml index c0321dc..f895a8c 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml index f6fabdb..268966e 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml index 9fa4847..22a9b96 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml index 63f288e..d754921 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool xmlNull: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml index a9ef3e8..8f69a94 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool dataOK: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml index 171e0b1..7ab53d3 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml index 09b742b..3a48e28 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml index 8786917..c68b821 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml index 6789480..8fee2cd 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml index 08d999d..ea214fa 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml index e047fc8..524622c 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml index ba0db25..a4828cd 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml index ddf520e..a1f46e2 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string reqType diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml index 7f51ecf..0efa40a 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml index 61eea33..b252f4a 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml index 8305ae1..e83cb72 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool exceptionThrown: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml index b22b239..3f9041c 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml index 666c791..b15b404 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml index 30bc93e..aadc580 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool test: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml index ec1c5d8..97d42ac 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int unsent: XMLHttpRequest.UNSENT diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml index c903e12..e28add2 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml index a3b98be..a44c6ba 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property string url diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml index 0eb31d5..63bfb08 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool xmlTest: false diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml index 63165ab..a54ef4a 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property bool dataOK: false diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml index 2cbb027..8354193 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/model.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 XmlListModel { source: "model.xml" diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml index 140e0ad..09077b6 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/model2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 XmlListModel { source: "model.xml" diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml index 737ec81..b014aa3 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/propertychanges.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 XmlListModel { source: "model.xml" diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml index 13dea91..59b8ddc 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/recipes.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 XmlListModel { source: "recipes.xml" diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml index 26c533f..a905963 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleErrors.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 XmlListModel { source: "model.xml" diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml index b90e57e..eaf5f0a 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleKeys.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 XmlListModel { query: "/data/item" diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml index ed0f293..3aa7b1f3 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/unique.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 XmlListModel { source: "model.xml" diff --git a/tests/auto/declarative/qmlvisual/ListView/basic1.qml b/tests/auto/declarative/qmlvisual/ListView/basic1.qml index 3c371a6..c67aaaa 100644 --- a/tests/auto/declarative/qmlvisual/ListView/basic1.qml +++ b/tests/auto/declarative/qmlvisual/ListView/basic1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "blue" diff --git a/tests/auto/declarative/qmlvisual/ListView/basic2.qml b/tests/auto/declarative/qmlvisual/ListView/basic2.qml index bdba65e..73c1b9a 100644 --- a/tests/auto/declarative/qmlvisual/ListView/basic2.qml +++ b/tests/auto/declarative/qmlvisual/ListView/basic2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "blue" diff --git a/tests/auto/declarative/qmlvisual/ListView/basic3.qml b/tests/auto/declarative/qmlvisual/ListView/basic3.qml index 2d68c0a..44f74a5 100644 --- a/tests/auto/declarative/qmlvisual/ListView/basic3.qml +++ b/tests/auto/declarative/qmlvisual/ListView/basic3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "blue" diff --git a/tests/auto/declarative/qmlvisual/ListView/basic4.qml b/tests/auto/declarative/qmlvisual/ListView/basic4.qml index 7c68df1..e5d097b 100644 --- a/tests/auto/declarative/qmlvisual/ListView/basic4.qml +++ b/tests/auto/declarative/qmlvisual/ListView/basic4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "blue" diff --git a/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic1.qml b/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic1.qml index 83b700d..3373247 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic1.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic1.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic2.qml b/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic2.qml index 1483512..20b889d 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic2.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic3.qml b/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic3.qml index bf68998..f49de2f 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic3.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic3.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic4.qml b/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic4.qml index 4aa9ab6..1ea5547 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic4.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-MAC/basic4.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data-MAC/itemlist.qml b/tests/auto/declarative/qmlvisual/ListView/data-MAC/itemlist.qml index 073749f..829fbb3 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-MAC/itemlist.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-MAC/itemlist.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data-MAC/listview.qml b/tests/auto/declarative/qmlvisual/ListView/data-MAC/listview.qml index 3765668..f47179d 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-MAC/listview.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-MAC/listview.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data-X11/basic1.qml b/tests/auto/declarative/qmlvisual/ListView/data-X11/basic1.qml index ae59b14..b291ea4 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-X11/basic1.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-X11/basic1.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data-X11/basic2.qml b/tests/auto/declarative/qmlvisual/ListView/data-X11/basic2.qml index ff19d22..e32e9e6 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-X11/basic2.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-X11/basic2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data-X11/basic3.qml b/tests/auto/declarative/qmlvisual/ListView/data-X11/basic3.qml index 2f33cae..ed0c53b 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-X11/basic3.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-X11/basic3.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data-X11/basic4.qml b/tests/auto/declarative/qmlvisual/ListView/data-X11/basic4.qml index 4b1c5cf..a70b741 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data-X11/basic4.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data-X11/basic4.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic1.qml b/tests/auto/declarative/qmlvisual/ListView/data/basic1.qml index 4cd44fc..7aadf36 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data/basic1.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data/basic1.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic2.qml b/tests/auto/declarative/qmlvisual/ListView/data/basic2.qml index 34ad5ed..5624d6b 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data/basic2.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data/basic2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic3.qml b/tests/auto/declarative/qmlvisual/ListView/data/basic3.qml index 1c5ddb0..16a8329 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data/basic3.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data/basic3.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data/basic4.qml b/tests/auto/declarative/qmlvisual/ListView/data/basic4.qml index d121d91..23cc255 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data/basic4.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data/basic4.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.qml b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.qml index 073749f..829fbb3 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data/itemlist.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data/itemlist.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/data/listview.qml b/tests/auto/declarative/qmlvisual/ListView/data/listview.qml index cd5d7b4..bf64029 100644 --- a/tests/auto/declarative/qmlvisual/ListView/data/listview.qml +++ b/tests/auto/declarative/qmlvisual/ListView/data/listview.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/ListView/itemlist.qml b/tests/auto/declarative/qmlvisual/ListView/itemlist.qml index 8cbbdb0..2a00397 100644 --- a/tests/auto/declarative/qmlvisual/ListView/itemlist.qml +++ b/tests/auto/declarative/qmlvisual/ListView/itemlist.qml @@ -1,7 +1,7 @@ // This example demonstrates placing items in a view using // a VisualItemModel -import Qt 4.6 +import Qt 4.7 Rectangle { color: "lightgray" diff --git a/tests/auto/declarative/qmlvisual/ListView/listview.qml b/tests/auto/declarative/qmlvisual/ListView/listview.qml index fb9eecd..6e0b47a 100644 --- a/tests/auto/declarative/qmlvisual/ListView/listview.qml +++ b/tests/auto/declarative/qmlvisual/ListView/listview.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 600; height: 300; color: "white" diff --git a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.qml b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.qml index d062667..08cb46b 100644 --- a/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.qml +++ b/tests/auto/declarative/qmlvisual/Package_Views/data/packageviews.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/Package_Views/packageviews.qml b/tests/auto/declarative/qmlvisual/Package_Views/packageviews.qml index 7ccba10..9db0f0d 100644 --- a/tests/auto/declarative/qmlvisual/Package_Views/packageviews.qml +++ b/tests/auto/declarative/qmlvisual/Package_Views/packageviews.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: root diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/bindinganimation.qml b/tests/auto/declarative/qmlvisual/animation/bindinganimation/bindinganimation.qml index 70c14cf..406e10b 100644 --- a/tests/auto/declarative/qmlvisual/animation/bindinganimation/bindinganimation.qml +++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/bindinganimation.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "blue" diff --git a/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.qml b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.qml index 8297c5a..dbe0276 100644 --- a/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.qml +++ b/tests/auto/declarative/qmlvisual/animation/bindinganimation/data/bindinganimation.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/colorAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/colorAnimation/colorAnimation-visual.qml index f205ae8..49730fc 100644 --- a/tests/auto/declarative/qmlvisual/animation/colorAnimation/colorAnimation-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/colorAnimation-visual.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: mainrect diff --git a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.qml index 4ab94f3..9611d27 100644 --- a/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/colorAnimation/data/colorAnimation-visual.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/easing/data/easing.qml b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.qml index d8e8688..5923222 100644 --- a/tests/auto/declarative/qmlvisual/animation/easing/data/easing.qml +++ b/tests/auto/declarative/qmlvisual/animation/easing/data/easing.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/easing/easing.qml b/tests/auto/declarative/qmlvisual/animation/easing/easing.qml index 4248d88..d42f069 100644 --- a/tests/auto/declarative/qmlvisual/animation/easing/easing.qml +++ b/tests/auto/declarative/qmlvisual/animation/easing/easing.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: item diff --git a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.qml b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.qml index 8804d44..58d0b26 100644 --- a/tests/auto/declarative/qmlvisual/animation/loop/data/loop.qml +++ b/tests/auto/declarative/qmlvisual/animation/loop/data/loop.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/loop/loop.qml b/tests/auto/declarative/qmlvisual/animation/loop/loop.qml index 5389b26..78fbc68 100644 --- a/tests/auto/declarative/qmlvisual/animation/loop/loop.qml +++ b/tests/auto/declarative/qmlvisual/animation/loop/loop.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: wrapper diff --git a/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.qml index 5f5b8fc..8fd5944 100644 --- a/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/data/parallelAnimation-visual.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/parallelAnimation/parallelAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/parallelAnimation-visual.qml index ba606f4..7e0374c 100644 --- a/tests/auto/declarative/qmlvisual/animation/parallelAnimation/parallelAnimation-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/parallelAnimation/parallelAnimation-visual.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 /* This test verifies that a single animation animating two properties is visually the same as two diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.qml index 5718560..edefd01 100644 --- a/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation/data/parentAnimation-visual.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/parentAnimation/parentAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/parentAnimation/parentAnimation-visual.qml index 8d0b375..b30281d 100644 --- a/tests/auto/declarative/qmlvisual/animation/parentAnimation/parentAnimation-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/parentAnimation/parentAnimation-visual.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 /* This test shows a green rectangle moving and growing from the upper-left corner diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.qml index 73c6542..8e1e1d7 100644 --- a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/data/pauseAnimation-visual.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml index 8830170..d82c6df 100644 --- a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 /* This test shows a bouncing logo. diff --git a/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.qml b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.qml index 0a9057e..36b39fa 100644 --- a/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/propertyAction/data/propertyAction-visual.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/propertyAction/propertyAction-visual.qml b/tests/auto/declarative/qmlvisual/animation/propertyAction/propertyAction-visual.qml index 5651b87..89c2c5b 100644 --- a/tests/auto/declarative/qmlvisual/animation/propertyAction/propertyAction-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/propertyAction/propertyAction-visual.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 /* This test starts with a red rectangle at 0,0. It should animate a color change to blue, diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.qml index a130b75..b4ee569 100644 --- a/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.qml +++ b/tests/auto/declarative/qmlvisual/animation/reanchor/data/reanchor.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/reanchor/reanchor.qml b/tests/auto/declarative/qmlvisual/animation/reanchor/reanchor.qml index 1d0495e..7a10db1 100644 --- a/tests/auto/declarative/qmlvisual/animation/reanchor/reanchor.qml +++ b/tests/auto/declarative/qmlvisual/animation/reanchor/reanchor.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: container diff --git a/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.qml b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.qml index 01da490..d1de5d0 100644 --- a/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/scriptAction/data/scriptAction-visual.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/animation/scriptAction/scriptAction-visual.qml b/tests/auto/declarative/qmlvisual/animation/scriptAction/scriptAction-visual.qml index dc2fcee..5008356 100644 --- a/tests/auto/declarative/qmlvisual/animation/scriptAction/scriptAction-visual.qml +++ b/tests/auto/declarative/qmlvisual/animation/scriptAction/scriptAction-visual.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 /* This test starts with a red rectangle at 0,0. It should animate moving 50 pixels right, diff --git a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml index 1dc2d29..b1871ce 100644 --- a/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml +++ b/tests/auto/declarative/qmlvisual/fillmode/data/fillmode.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/fillmode/fillmode.qml b/tests/auto/declarative/qmlvisual/fillmode/fillmode.qml index 7c3b486..817ccc0 100644 --- a/tests/auto/declarative/qmlvisual/fillmode/fillmode.qml +++ b/tests/auto/declarative/qmlvisual/fillmode/fillmode.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 /* This is a static display test of the various Image fill modes. See the png file in the data diff --git a/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test.qml b/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test.qml index 44900fc..ee9a550 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test2.qml b/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test2.qml index 7837ad9..5d84bfe 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test2.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test3.qml b/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test3.qml index 7308a23..cd73a3c 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test3.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/data-MAC/test3.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/focusscope/data-X11/test.qml b/tests/auto/declarative/qmlvisual/focusscope/data-X11/test.qml index 93189fa..8d36200 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/data-X11/test.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/data-X11/test.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/focusscope/data-X11/test2.qml b/tests/auto/declarative/qmlvisual/focusscope/data-X11/test2.qml index 7170907..813665d 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/data-X11/test2.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/data-X11/test2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/focusscope/data-X11/test3.qml b/tests/auto/declarative/qmlvisual/focusscope/data-X11/test3.qml index b1f628f..0fba451 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/data-X11/test3.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/data-X11/test3.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test.qml b/tests/auto/declarative/qmlvisual/focusscope/data/test.qml index d86c034..460ba1a 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/data/test.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/data/test.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test2.qml b/tests/auto/declarative/qmlvisual/focusscope/data/test2.qml index fedc96a..03ece10 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/data/test2.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/data/test2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/focusscope/data/test3.qml b/tests/auto/declarative/qmlvisual/focusscope/data/test3.qml index 8ce7944..dd48e39 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/data/test3.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/data/test3.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/focusscope/test.qml b/tests/auto/declarative/qmlvisual/focusscope/test.qml index 401c7dc..d83bad4 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/test.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/test.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qmlvisual/focusscope/test2.qml b/tests/auto/declarative/qmlvisual/focusscope/test2.qml index 5b6971a..7a6ed83 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/test2.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/test2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qmlvisual/focusscope/test3.qml b/tests/auto/declarative/qmlvisual/focusscope/test3.qml index a8bb523..7535c31 100644 --- a/tests/auto/declarative/qmlvisual/focusscope/test3.qml +++ b/tests/auto/declarative/qmlvisual/focusscope/test3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "white" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated-smooth.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated-smooth.qml index 0ceaf49..fdb4da3 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated-smooth.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated-smooth.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import "content" Rectangle { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated.qml index 29c02b3..730aeca 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/animated.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import "content" Rectangle { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/borders.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/borders.qml index 9879416..8956128 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/borders.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/borders.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: page diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/MyBorderImage.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/MyBorderImage.qml index 58d03a6..ce0c38c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/MyBorderImage.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/content/MyBorderImage.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property alias horizontalMode: image.horizontalTileMode diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.qml index c6df3c4..e974234 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated-smooth.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.qml index 29e591a..630a6d2 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/animated.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml index dd38ea5..eb40fcb 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.qml index 46086f9..289af88 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.qml index db70298..a5ca451 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-vertical.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-horizontal.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-horizontal.qml index 50ba9ad..175a891 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-horizontal.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-horizontal.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "lightSteelBlue" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml index ebb963d..09e414d 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "lightSteelBlue" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.qml index 520d9a2..d2d46e4 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test-flipable.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml index 6e5f7a0..d1a5ade 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/data/test_flipable_resize.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test-flipable.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test-flipable.qml index a27aa6e..da76ff9 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test-flipable.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test-flipable.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 400; height: 240 diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml index 5a73e67..fa68753 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflipable/test_flipable_resize.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { //realWindow width: 370 height: 480 diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.qml b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.qml index c7ac52d..67aa10a 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.qml b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.qml index fb5f1fb..1c90af9 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/data/gridview2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview.qml b/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview.qml index f8782a5..1b0bd65 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 400; color: "black" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview2.qml b/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview2.qml index d8512eb..30e2424 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview2.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativegridview/gridview2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 300; height: 400; color: "black" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.qml index f3071e4..b88bd83 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/drag.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml index e6a09bf..307fef6 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-flickable.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.qml index cc374fd..433fd82 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/data/mousearea-visual.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/drag.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/drag.qml index 21c46d8..6762645 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/drag.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/drag.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 /* this test shows a blue box being dragged around -- first roughly tracing the diff --git a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-visual.qml b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-visual.qml index 3019006..a686188 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-visual.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativemousearea/mousearea-visual.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 /* This test displays 6 red rects -- 4 in the top row, 2 in the bottom. diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.qml b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.qml index d766dc6..463edf8 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/data/particles.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/particles.qml b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/particles.qml index fc8261f..1b64376 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeparticles/particles.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeparticles/particles.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.labs.particles 1.0 Rectangle { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.qml b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.qml index b8ff925..54ef858 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview-2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.qml b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.qml index 8cff5c6..9595a5c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview-2.qml b/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview-2.qml index c6d71d5..aed6380 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview-2.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview-2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 800; height: 450 diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview.qml b/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview.qml index 0adfa02..3bcab5a 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativepathview/test-pathview.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 800; height: 450 diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.qml b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.qml index 7091bb3..4b36e16 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml index 1eb115d..a4036fe 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/dynamic.qml b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/dynamic.qml index f45e9a4..5981b12 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/dynamic.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/dynamic.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { width: 400; height: 400; diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/usingRepeater.qml b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/usingRepeater.qml index ff60365..91895c2 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/usingRepeater.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/usingRepeater.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item{ width: 200; height: 600 diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/easefollow.qml b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/easefollow.qml index 029a2fc..2500ef0 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/easefollow.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/easefollow.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedanimation.qml b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedanimation.qml index ee94857..d17233e 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedanimation.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedanimation.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 800; height: 240; color: "gray" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml index 5dee0c6..7ca0ca5 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 800; height: 240; color: "gray" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/clock.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/clock.qml index 0ddcca4..d981763 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/clock.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/clock.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: clock diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/data/clock.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/data/clock.qml index ffc6a5e..5da471e 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/data/clock.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/data/clock.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/data/follow.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/data/follow.qml index fec5428..e7e5b3c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/data/follow.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/data/follow.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/follow.qml b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/follow.qml index 5368349..cabdce7 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/follow.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativespringfollow/follow.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "#ffffff" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.qml index 56d616e..880609b 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data/parentanchor.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data/parentanchor.qml index 56d616e..880609b 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data/parentanchor.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data/parentanchor.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/parentanchor.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/parentanchor.qml index 80f0f03..f04aa66 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/parentanchor.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/parentanchor.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: s; width: 600; height: 100; color: "lightsteelblue" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.qml index 1ccede4..9439f73 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.qml index 07ad236..3e34f04 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/elide2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.qml index c2fd0d8..76c2ee1 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-MAC/multilength.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.qml index cfd832e..d460514 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.qml index 0c06196..ee06b1a 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data/elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data/elide.qml index 59f17f7..3b8ae0c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data/elide.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data/elide.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data/elide2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data/elide2.qml index c592f18..27fbaf4 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data/elide2.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data/elide2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide.qml index fa6b5da..a4bf452 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: childrenRect.width diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide2.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide2.qml index ecd9470..1058b04 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide2.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/elide2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 500 diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/multilength.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/multilength.qml index ab6e1533..2b9c85c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/multilength.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/elide/multilength.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 500 diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml index ab17eb1..a39c340 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml index 72499b9..8529b92 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/richtext.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml index f4cbcbd..bf3aea6 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/plaintext.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml index 9f396c2..4a87240 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/data/richtext.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml index 90b5411..d948e4a 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: s; width: 800; height: 1000; color: "lightsteelblue" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml index 0dba47c..d10cfd3 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: s; width: 800; height: 1000; color: "lightsteelblue" diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/cursorDelegate.qml index 5516fc9..686dd2c 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/cursorDelegate.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/cursorDelegate.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { resources: [ Component { id: cursorA diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.qml index 8ee92d7..1241d14 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/cursorDelegate.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.qml index 84c16e1..f1099c8 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/qt-669.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.qml index 4ff00f4..1f5b365 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.qml index 8578d48..ef9ba33 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/cursorDelegate.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.qml index 352c890..5926e04 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/qt-669.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.qml index f96daa9..2e755a4 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/data/wrap.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/qt-669.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/qt-669.qml index b01ddf8..277b9fc 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/qt-669.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/qt-669.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { Component { id: testableCursor diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/wrap.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/wrap.qml index b2a0754..abb4464 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextedit/wrap.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextedit/wrap.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { height:400 diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/cursorDelegate.qml index 09f16ab..1de2f4f 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/cursorDelegate.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/cursorDelegate.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { resources: [ Component { id: cursorA diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.qml index 3b664b6..208d05f 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/cursorDelegate.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.qml index b779c21..b5a4837 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/echoMode.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.qml index e29ac56..a0351e8 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/hAlign.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.qml index 645b447..cdc5153 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/cursorDelegate.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/cursorDelegate.qml index df2dd38..a1d998f 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/cursorDelegate.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/cursorDelegate.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/echoMode.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/echoMode.qml index 873a86d..707734a 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/echoMode.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/echoMode.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/hAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/hAlign.qml index e29ac56..a0351e8 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/hAlign.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/data/hAlign.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/echoMode.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/echoMode.qml index ed8bc2c..5a12e2e 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/echoMode.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/echoMode.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item{ height: 50; width: 200 diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/hAlign.qml b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/hAlign.qml index 2d65adf..08df173 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativetextinput/hAlign.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativetextinput/hAlign.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item{ width:600; diff --git a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/autosize.qml b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/autosize.qml index 3c00ee6..c4a502e 100644 --- a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/autosize.qml +++ b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/autosize.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 // The WebView size is determined by the width, height, diff --git a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.qml b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.qml index d920a4c..f4c4e29 100644 --- a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.qml +++ b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data-X11/autosize.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.qml b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.qml index 47999be..273c2b0 100644 --- a/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.qml +++ b/tests/auto/declarative/qmlvisual/qfxwebview/autosize/data/autosize.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/rect/GradientRect.qml b/tests/auto/declarative/qmlvisual/rect/GradientRect.qml index 1d3ec98..0272f84 100644 --- a/tests/auto/declarative/qmlvisual/rect/GradientRect.qml +++ b/tests/auto/declarative/qmlvisual/rect/GradientRect.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: rect diff --git a/tests/auto/declarative/qmlvisual/rect/MyRect.qml b/tests/auto/declarative/qmlvisual/rect/MyRect.qml index 22e0948..7a315e8 100644 --- a/tests/auto/declarative/qmlvisual/rect/MyRect.qml +++ b/tests/auto/declarative/qmlvisual/rect/MyRect.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { id: rect diff --git a/tests/auto/declarative/qmlvisual/rect/data/rect-painting.qml b/tests/auto/declarative/qmlvisual/rect/data/rect-painting.qml index 52acadf..7c42d13 100644 --- a/tests/auto/declarative/qmlvisual/rect/data/rect-painting.qml +++ b/tests/auto/declarative/qmlvisual/rect/data/rect-painting.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/rect/rect-painting.qml b/tests/auto/declarative/qmlvisual/rect/rect-painting.qml index 93beeec..6abb03d 100644 --- a/tests/auto/declarative/qmlvisual/rect/rect-painting.qml +++ b/tests/auto/declarative/qmlvisual/rect/rect-painting.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 900; height: 500 diff --git a/tests/auto/declarative/qmlvisual/repeater/basic1.qml b/tests/auto/declarative/qmlvisual/repeater/basic1.qml index acb669c..3d31324 100644 --- a/tests/auto/declarative/qmlvisual/repeater/basic1.qml +++ b/tests/auto/declarative/qmlvisual/repeater/basic1.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "blue" diff --git a/tests/auto/declarative/qmlvisual/repeater/basic2.qml b/tests/auto/declarative/qmlvisual/repeater/basic2.qml index 3323da5..9cad9eb 100644 --- a/tests/auto/declarative/qmlvisual/repeater/basic2.qml +++ b/tests/auto/declarative/qmlvisual/repeater/basic2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "blue" diff --git a/tests/auto/declarative/qmlvisual/repeater/basic3.qml b/tests/auto/declarative/qmlvisual/repeater/basic3.qml index cb57d49..6346412 100644 --- a/tests/auto/declarative/qmlvisual/repeater/basic3.qml +++ b/tests/auto/declarative/qmlvisual/repeater/basic3.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "blue" diff --git a/tests/auto/declarative/qmlvisual/repeater/basic4.qml b/tests/auto/declarative/qmlvisual/repeater/basic4.qml index f31de2c..817d438 100644 --- a/tests/auto/declarative/qmlvisual/repeater/basic4.qml +++ b/tests/auto/declarative/qmlvisual/repeater/basic4.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { color: "blue" diff --git a/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic1.qml b/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic1.qml index 5bc0d6b..d11a9dd 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic1.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic1.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic2.qml b/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic2.qml index 64cf2ea..9b36f60 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic2.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic3.qml b/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic3.qml index 41e174a..9752b72 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic3.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic3.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic4.qml b/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic4.qml index fcf2504..8492621 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic4.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data-MAC/basic4.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data-X11/basic1.qml b/tests/auto/declarative/qmlvisual/repeater/data-X11/basic1.qml index bf215ca..f9880f8 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data-X11/basic1.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data-X11/basic1.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data-X11/basic2.qml b/tests/auto/declarative/qmlvisual/repeater/data-X11/basic2.qml index cb6b46c..cc980e1 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data-X11/basic2.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data-X11/basic2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data-X11/basic3.qml b/tests/auto/declarative/qmlvisual/repeater/data-X11/basic3.qml index 9545fa9..e395dde 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data-X11/basic3.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data-X11/basic3.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data-X11/basic4.qml b/tests/auto/declarative/qmlvisual/repeater/data-X11/basic4.qml index 4839206..b0dc6b8 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data-X11/basic4.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data-X11/basic4.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic1.qml b/tests/auto/declarative/qmlvisual/repeater/data/basic1.qml index 9535a2c..f0950d7 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data/basic1.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data/basic1.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic2.qml b/tests/auto/declarative/qmlvisual/repeater/data/basic2.qml index 81bc1f7..fcf3fee 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data/basic2.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data/basic2.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic3.qml b/tests/auto/declarative/qmlvisual/repeater/data/basic3.qml index 417eaab..8447aca 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data/basic3.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data/basic3.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/repeater/data/basic4.qml b/tests/auto/declarative/qmlvisual/repeater/data/basic4.qml index 264d825..eeb60fa 100644 --- a/tests/auto/declarative/qmlvisual/repeater/data/basic4.qml +++ b/tests/auto/declarative/qmlvisual/repeater/data/basic4.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/selftest_noimages/data/selftest_noimages.qml b/tests/auto/declarative/qmlvisual/selftest_noimages/data/selftest_noimages.qml index 3104906..70ee988 100644 --- a/tests/auto/declarative/qmlvisual/selftest_noimages/data/selftest_noimages.qml +++ b/tests/auto/declarative/qmlvisual/selftest_noimages/data/selftest_noimages.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/selftest_noimages/selftest_noimages.qml b/tests/auto/declarative/qmlvisual/selftest_noimages/selftest_noimages.qml index da7f9b6..cd4dab1 100644 --- a/tests/auto/declarative/qmlvisual/selftest_noimages/selftest_noimages.qml +++ b/tests/auto/declarative/qmlvisual/selftest_noimages/selftest_noimages.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Text { property string error: "not pressed" text: (new Date()).valueOf() diff --git a/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.qml b/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.qml index 8d38ebe..9664566 100644 --- a/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.qml +++ b/tests/auto/declarative/qmlvisual/webview/embedding/data/nesting.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/embedding/egg.qml b/tests/auto/declarative/qmlvisual/webview/embedding/egg.qml index 711a747..c569c9a 100644 --- a/tests/auto/declarative/qmlvisual/webview/embedding/egg.qml +++ b/tests/auto/declarative/qmlvisual/webview/embedding/egg.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property variant period : 250 diff --git a/tests/auto/declarative/qmlvisual/webview/embedding/nesting.qml b/tests/auto/declarative/qmlvisual/webview/embedding/nesting.qml index 5e35306..9e008de 100644 --- a/tests/auto/declarative/qmlvisual/webview/embedding/nesting.qml +++ b/tests/auto/declarative/qmlvisual/webview/embedding/nesting.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.qml b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.qml index 957f9d5..bfe40da 100644 --- a/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.qml +++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/evaluateJavaScript.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.qml b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.qml index 7fce295..07aa13d 100644 --- a/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.qml +++ b/tests/auto/declarative/qmlvisual/webview/javascript/data/windowObjects.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/evaluateJavaScript.qml b/tests/auto/declarative/qmlvisual/webview/javascript/evaluateJavaScript.qml index 6c01382..4a72d7f 100644 --- a/tests/auto/declarative/qmlvisual/webview/javascript/evaluateJavaScript.qml +++ b/tests/auto/declarative/qmlvisual/webview/javascript/evaluateJavaScript.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 Column { diff --git a/tests/auto/declarative/qmlvisual/webview/javascript/windowObjects.qml b/tests/auto/declarative/qmlvisual/webview/javascript/windowObjects.qml index 8c52aff..4006b47 100644 --- a/tests/auto/declarative/qmlvisual/webview/javascript/windowObjects.qml +++ b/tests/auto/declarative/qmlvisual/webview/javascript/windowObjects.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 Column { diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.qml b/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.qml index 195c3ba..34d1116 100644 --- a/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.qml +++ b/tests/auto/declarative/qmlvisual/webview/settings/data/fontFamily.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.qml b/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.qml index 438ffa5..efe3875 100644 --- a/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.qml +++ b/tests/auto/declarative/qmlvisual/webview/settings/data/fontSize.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.qml b/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.qml index ead5c3b..624a16b 100644 --- a/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.qml +++ b/tests/auto/declarative/qmlvisual/webview/settings/data/noAutoLoadImages.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.qml b/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.qml index cf74d42..414d64f 100644 --- a/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.qml +++ b/tests/auto/declarative/qmlvisual/webview/settings/data/setFontFamily.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/settings/fontFamily.qml b/tests/auto/declarative/qmlvisual/webview/settings/fontFamily.qml index f547b0e..2f68f24 100644 --- a/tests/auto/declarative/qmlvisual/webview/settings/fontFamily.qml +++ b/tests/auto/declarative/qmlvisual/webview/settings/fontFamily.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qmlvisual/webview/settings/fontSize.qml b/tests/auto/declarative/qmlvisual/webview/settings/fontSize.qml index 7eaa96b..c017cd9 100644 --- a/tests/auto/declarative/qmlvisual/webview/settings/fontSize.qml +++ b/tests/auto/declarative/qmlvisual/webview/settings/fontSize.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 Grid { diff --git a/tests/auto/declarative/qmlvisual/webview/settings/noAutoLoadImages.qml b/tests/auto/declarative/qmlvisual/webview/settings/noAutoLoadImages.qml index 67f1633..4f8d3b2 100644 --- a/tests/auto/declarative/qmlvisual/webview/settings/noAutoLoadImages.qml +++ b/tests/auto/declarative/qmlvisual/webview/settings/noAutoLoadImages.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 Grid { diff --git a/tests/auto/declarative/qmlvisual/webview/settings/setFontFamily.qml b/tests/auto/declarative/qmlvisual/webview/settings/setFontFamily.qml index 823469f..42220e4 100644 --- a/tests/auto/declarative/qmlvisual/webview/settings/setFontFamily.qml +++ b/tests/auto/declarative/qmlvisual/webview/settings/setFontFamily.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/pageWidth.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/pageWidth.qml index 1a993e1..2e60b7f 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/data/pageWidth.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/pageWidth.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.qml index d3c5890..464e009 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/renderControl.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.qml index 0a2b8db..edf8040 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/resolution.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.qml index aaa7583..4aab708 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zoomTextOnly.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.qml b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.qml index ad83800..080d4d0 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/data/zooming.qml @@ -1,4 +1,4 @@ -import Qt.VisualTest 4.6 +import Qt.VisualTest 4.7 VisualTest { Frame { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/pageWidth.qml b/tests/auto/declarative/qmlvisual/webview/zooming/pageWidth.qml index 4a876dd..c9e3c02 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/pageWidth.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/pageWidth.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.qml b/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.qml index 52a569e..8174606 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/renderControl.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 Rectangle { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/resolution.qml b/tests/auto/declarative/qmlvisual/webview/zooming/resolution.qml index d6c35d4..b2638f9 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/resolution.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/resolution.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.qml b/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.qml index 741450f..bf7f9ff 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/zoomTextOnly.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 WebView { diff --git a/tests/auto/declarative/qmlvisual/webview/zooming/zooming.qml b/tests/auto/declarative/qmlvisual/webview/zooming/zooming.qml index adbd7a5..5b4dd7a 100644 --- a/tests/auto/declarative/qmlvisual/webview/zooming/zooming.qml +++ b/tests/auto/declarative/qmlvisual/webview/zooming/zooming.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import org.webkit 1.0 // Note that zooming is better done using zoomFactor and careful diff --git a/tests/benchmarks/declarative/creation/data/item.qml b/tests/benchmarks/declarative/creation/data/item.qml index 74d2f27..bc6adfb 100644 --- a/tests/benchmarks/declarative/creation/data/item.qml +++ b/tests/benchmarks/declarative/creation/data/item.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { Item {} diff --git a/tests/benchmarks/declarative/creation/data/qobject.qml b/tests/benchmarks/declarative/creation/data/qobject.qml index 99d010f..61e6146 100644 --- a/tests/benchmarks/declarative/creation/data/qobject.qml +++ b/tests/benchmarks/declarative/creation/data/qobject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { } diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp index 7aec32a..6f00473 100644 --- a/tests/benchmarks/declarative/creation/tst_creation.cpp +++ b/tests/benchmarks/declarative/creation/tst_creation.cpp @@ -127,7 +127,7 @@ void tst_creation::qobject_cpp() void tst_creation::qobject_qml() { QDeclarativeComponent component(&engine); - component.setData("import Qt 4.6\nQtObject {}", QUrl()); + component.setData("import Qt 4.7\nQtObject {}", QUrl()); QObject *obj = component.create(); delete obj; diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml index 0d2d49b..45e418d 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 QtObject {} diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml index dc29f15..43ce916 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { id: blah diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml index 9b88b53..db43182 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import Qt.labs.particles 1.0 Item { id:block diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml index 972f405..6ff2546 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int a diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml index d08f35b..0275e21 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml +++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property int a diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml index 11b95e1..565a8ee 100644 --- a/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml @@ -1,3 +1,3 @@ -import Qt 4.6 +import Qt 4.7 Item {} diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml index a923a0a..b0b4e99 100644 --- a/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { property int blah diff --git a/tests/benchmarks/declarative/qmltime/example.qml b/tests/benchmarks/declarative/qmltime/example.qml index 68889f0..dde0671 100644 --- a/tests/benchmarks/declarative/qmltime/example.qml +++ b/tests/benchmarks/declarative/qmltime/example.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml b/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml index 31c879b..a383fc7 100644 --- a/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml +++ b/tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml b/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml index 23fe78e..209b572 100644 --- a/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml +++ b/tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml b/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml index bc447ef..c2e08c7 100644 --- a/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml +++ b/tests/benchmarks/declarative/qmltime/tests/anchors/null.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/animation/large.qml b/tests/benchmarks/declarative/qmltime/tests/animation/large.qml index c1cdb68..f117e83 100644 --- a/tests/benchmarks/declarative/qmltime/tests/animation/large.qml +++ b/tests/benchmarks/declarative/qmltime/tests/animation/large.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml b/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml index 3db9f08..faf93d0 100644 --- a/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml +++ b/tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml index 996602c..c9bd866 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml index 9f79c34..6626d78 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml index f228c2a..8c72288 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml b/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml index 335aeb8..e2c05d6 100644 --- a/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml +++ b/tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml b/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml index 6f8d849..e31d46d 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Item { Rectangle {} diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml index 65d5010..6496223 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml index 2dfe922..b699459 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml index 1fa0d3b..bce30b7 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml b/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml index 33bb91c..6a2b19d 100644 --- a/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml +++ b/tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml index 97bad47..9ca67b7 100644 --- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml +++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml index 36dda15..d213a51 100644 --- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml +++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml index 396e27d..8878450 100644 --- a/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml +++ b/tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/null.qml b/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/null.qml index a31af5a..7144abf 100644 --- a/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/null.qml +++ b/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/null.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/property.qml b/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/property.qml index 007d12a..84cf735 100644 --- a/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/property.qml +++ b/tests/benchmarks/declarative/qmltime/tests/vmemetaobject/property.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 import QmlTime 1.0 as QmlTime Item { diff --git a/tests/benchmarks/declarative/script/data/CustomObject.qml b/tests/benchmarks/declarative/script/data/CustomObject.qml index 22b7be7..ae02117 100644 --- a/tests/benchmarks/declarative/script/data/CustomObject.qml +++ b/tests/benchmarks/declarative/script/data/CustomObject.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 QtObject { property real prop1: 0 diff --git a/tests/benchmarks/declarative/script/data/block.qml b/tests/benchmarks/declarative/script/data/block.qml index bb03d8d..1376492 100644 --- a/tests/benchmarks/declarative/script/data/block.qml +++ b/tests/benchmarks/declarative/script/data/block.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { width: 200; height: 200 diff --git a/tools/qml/content/Browser.qml b/tools/qml/content/Browser.qml index 8882d5a..0912f58 100644 --- a/tools/qml/content/Browser.qml +++ b/tools/qml/content/Browser.qml @@ -1,4 +1,4 @@ -import Qt 4.6 +import Qt 4.7 Rectangle { id: root diff --git a/tools/qml/qdeclarativefolderlistmodel.cpp b/tools/qml/qdeclarativefolderlistmodel.cpp index d36033d..5a9d88b 100644 --- a/tools/qml/qdeclarativefolderlistmodel.cpp +++ b/tools/qml/qdeclarativefolderlistmodel.cpp @@ -413,7 +413,7 @@ void QDeclarativeFolderListModel::setShowOnlyReadable(bool on) void QDeclarativeFolderListModel::registerTypes() { - qmlRegisterType("Qt",4,6,"FolderListModel"); + qmlRegisterType("Qt",4,7,"FolderListModel"); } QT_END_NAMESPACE diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp index 6a6048a..9864df6 100644 --- a/tools/qml/qdeclarativetester.cpp +++ b/tools/qml/qdeclarativetester.cpp @@ -181,7 +181,7 @@ void QDeclarativeTester::save() file.open(QIODevice::WriteOnly); QTextStream ts(&file); - ts << "import Qt.VisualTest 4.6\n\n"; + ts << "import Qt.VisualTest 4.7\n\n"; ts << "VisualTest {\n"; int imgCount = 0; @@ -398,10 +398,10 @@ void QDeclarativeTester::updateCurrentTime(int msec) void QDeclarativeTester::registerTypes() { - qmlRegisterType("Qt.VisualTest", 4,6, "VisualTest"); - qmlRegisterType("Qt.VisualTest", 4,6, "Frame"); - qmlRegisterType("Qt.VisualTest", 4,6, "Mouse"); - qmlRegisterType("Qt.VisualTest", 4,6, "Key"); + qmlRegisterType("Qt.VisualTest", 4,7, "VisualTest"); + qmlRegisterType("Qt.VisualTest", 4,7, "Frame"); + qmlRegisterType("Qt.VisualTest", 4,7, "Mouse"); + qmlRegisterType("Qt.VisualTest", 4,7, "Key"); } QT_END_NAMESPACE -- cgit v0.12 From 7140938c8504357532a04661a06841dea5bbe5b8 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 22 Apr 2010 09:02:32 +1000 Subject: Compile on Windows (export decl fix). --- src/declarative/qml/qdeclarativeinfo.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h index 82f44f2..2ac28f4 100644 --- a/src/declarative/qml/qdeclarativeinfo.h +++ b/src/declarative/qml/qdeclarativeinfo.h @@ -84,9 +84,9 @@ public: inline QDeclarativeInfo &operator<<(const QUrl &t) { static_cast(*this) << t; return *this; } private: - friend QDeclarativeInfo qmlInfo(const QObject *me); - friend QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error); - friend QDeclarativeInfo qmlInfo(const QObject *me, const QList &errors); + friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me); + friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error); + friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QList &errors); QDeclarativeInfo(QDeclarativeInfoPrivate *); QDeclarativeInfoPrivate *d; -- cgit v0.12 From 8d467e0ab02abfae1e0ac851c236485231aa682f Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 22 Apr 2010 11:17:42 +1000 Subject: Remove dead code --- src/declarative/qml/qdeclarativecompiler.cpp | 19 ------------------- src/declarative/qml/qdeclarativecompiler_p.h | 1 - 2 files changed, 20 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index edafe59..1727687 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -2809,25 +2809,6 @@ bool QDeclarativeCompiler::canCoerce(int to, QDeclarativeParser::Object *from) return false; } -/*! - Returns true if from can be assigned to a (QObject) property of type - to. -*/ -bool QDeclarativeCompiler::canCoerce(int to, int from) -{ - const QMetaObject *toMo = - QDeclarativeEnginePrivate::get(engine)->rawMetaObjectForType(to); - const QMetaObject *fromMo = - QDeclarativeEnginePrivate::get(engine)->rawMetaObjectForType(from); - - while (fromMo) { - if (QDeclarativePropertyPrivate::equal(fromMo, toMo)) - return true; - fromMo = fromMo->superClass(); - } - return false; -} - QDeclarativeType *QDeclarativeCompiler::toQmlType(QDeclarativeParser::Object *from) { // ### Optimize diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h index cdc514d..fefab7a 100644 --- a/src/declarative/qml/qdeclarativecompiler_p.h +++ b/src/declarative/qml/qdeclarativecompiler_p.h @@ -274,7 +274,6 @@ private: static QDeclarativeType *toQmlType(QDeclarativeParser::Object *from); bool canCoerce(int to, QDeclarativeParser::Object *from); - bool canCoerce(int to, int from); QStringList deferredProperties(QDeclarativeParser::Object *); -- cgit v0.12 From 141b48584633189c0fa83e9ca04f017048a5c5ff Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 22 Apr 2010 11:18:07 +1000 Subject: Autotest --- src/declarative/qml/qdeclarativeengine.cpp | 6 ++ .../qdeclarativeengine/tst_qdeclarativeengine.cpp | 86 ++++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 6d64f63..9e6c060 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -767,6 +767,9 @@ void QDeclarativeEngine::setContextForObject(QObject *object, QDeclarativeContex */ void QDeclarativeEngine::setObjectOwnership(QObject *object, ObjectOwnership ownership) { + if (!object) + return; + QDeclarativeData *ddata = QDeclarativeData::get(object, true); if (!ddata) return; @@ -780,6 +783,9 @@ void QDeclarativeEngine::setObjectOwnership(QObject *object, ObjectOwnership own */ QDeclarativeEngine::ObjectOwnership QDeclarativeEngine::objectOwnership(QObject *object) { + if (!object) + return CppOwnership; + QDeclarativeData *ddata = QDeclarativeData::get(object, false); if (!ddata) return CppOwnership; diff --git a/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp b/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp index 5d8a52d..ee320aa 100644 --- a/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp +++ b/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp @@ -63,6 +63,8 @@ private slots: void contextForObject(); void offlineStoragePath(); void clearComponentCache(); + void outputWarningsToStandardError(); + void objectOwnership(); }; void tst_qdeclarativeengine::rootContext() @@ -101,6 +103,7 @@ void tst_qdeclarativeengine::networkAccessManager() engine = new QDeclarativeEngine; NetworkAccessManagerFactory factory; engine->setNetworkAccessManagerFactory(&factory); + QVERIFY(engine->networkAccessManagerFactory() == &factory); QVERIFY(engine->networkAccessManager() == factory.manager); delete engine; } @@ -235,6 +238,89 @@ void tst_qdeclarativeengine::clearComponentCache() } } +static QStringList warnings; +static void msgHandler(QtMsgType, const char *warning) +{ + warnings << QString::fromUtf8(warning); +} + +void tst_qdeclarativeengine::outputWarningsToStandardError() +{ + QDeclarativeEngine engine; + + QCOMPARE(engine.outputWarningsToStandardError(), true); + + QDeclarativeComponent c(&engine); + c.setData("import Qt 4.7; QtObject { property int a: undefined }", QUrl()); + + QVERIFY(c.isReady() == true); + + warnings.clear(); + QtMsgHandler old = qInstallMsgHandler(msgHandler); + + QObject *o = c.create(); + + qInstallMsgHandler(old); + + QVERIFY(o != 0); + delete o; + + QCOMPARE(warnings.count(), 1); + QCOMPARE(warnings.at(0), QLatin1String(":1: Unable to assign [undefined] to int")); + warnings.clear(); + + + engine.setOutputWarningsToStandardError(false); + QCOMPARE(engine.outputWarningsToStandardError(), false); + + + old = qInstallMsgHandler(msgHandler); + + o = c.create(); + + qInstallMsgHandler(old); + + QVERIFY(o != 0); + delete o; + + QCOMPARE(warnings.count(), 0); +} + +void tst_qdeclarativeengine::objectOwnership() +{ + { + QCOMPARE(QDeclarativeEngine::objectOwnership(0), QDeclarativeEngine::CppOwnership); + QDeclarativeEngine::setObjectOwnership(0, QDeclarativeEngine::JavaScriptOwnership); + QCOMPARE(QDeclarativeEngine::objectOwnership(0), QDeclarativeEngine::CppOwnership); + } + + { + QObject o; + QCOMPARE(QDeclarativeEngine::objectOwnership(&o), QDeclarativeEngine::CppOwnership); + QDeclarativeEngine::setObjectOwnership(&o, QDeclarativeEngine::JavaScriptOwnership); + QCOMPARE(QDeclarativeEngine::objectOwnership(&o), QDeclarativeEngine::JavaScriptOwnership); + QDeclarativeEngine::setObjectOwnership(&o, QDeclarativeEngine::CppOwnership); + QCOMPARE(QDeclarativeEngine::objectOwnership(&o), QDeclarativeEngine::CppOwnership); + } + + { + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine); + c.setData("import Qt 4.7; QtObject { property QtObject object: QtObject {} }", QUrl()); + + QObject *o = c.create(); + QVERIFY(o != 0); + + QCOMPARE(QDeclarativeEngine::objectOwnership(o), QDeclarativeEngine::CppOwnership); + + QObject *o2 = qvariant_cast(o->property("object")); + QCOMPARE(QDeclarativeEngine::objectOwnership(o2), QDeclarativeEngine::JavaScriptOwnership); + + delete o; + } + +} + QTEST_MAIN(tst_qdeclarativeengine) #include "tst_qdeclarativeengine.moc" -- cgit v0.12 From 9487cbbeba7654200339c1850503b494b46158d1 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 10:58:39 +1000 Subject: Add duration and easing properties to AnchorAnimation. --- src/declarative/util/qdeclarativeanimation.cpp | 63 +++++++++++++++++++++++++- src/declarative/util/qdeclarativeanimation_p.h | 12 +++++ 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 27f37df..4f7719b 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1674,7 +1674,7 @@ void QDeclarativePropertyAnimationPrivate::init() /*! \qmlproperty int PropertyAnimation::duration - This property holds the duration of the transition, in milliseconds. + This property holds the duration of the animation, in milliseconds. The default value is 250. */ @@ -2690,6 +2690,67 @@ QDeclarativeListProperty QDeclarativeAnchorAnimation::targets( return QDeclarativeListProperty(this, d->targets); } +/*! + \qmlproperty int AnchorAnimation::duration + This property holds the duration of the animation, in milliseconds. + + The default value is 250. +*/ +int QDeclarativeAnchorAnimation::duration() const +{ + Q_D(const QDeclarativeAnchorAnimation); + return d->va->duration(); +} + +void QDeclarativeAnchorAnimation::setDuration(int duration) +{ + if (duration < 0) { + qmlInfo(this) << tr("Cannot set a duration of < 0"); + return; + } + + Q_D(QDeclarativeAnchorAnimation); + if (d->va->duration() == duration) + return; + d->va->setDuration(duration); + emit durationChanged(duration); +} + +/*! + \qmlproperty enumeration AnchorAnimation::easing.type + \qmlproperty real AnchorAnimation::easing.amplitude + \qmlproperty real AnchorAnimation::easing.overshoot + \qmlproperty real AnchorAnimation::easing.period + \brief the easing curve used for the animation. + + To specify an easing curve you need to specify at least the type. For some curves you can also specify + amplitude, period and/or overshoot. The default easing curve is + Linear. + + \qml + AnchorAnimation { easing.type: "InOutQuad" } + \endqml + + See the \l{PropertyAnimation::easing.type} documentation for information + about the different types of easing curves. +*/ + +QEasingCurve QDeclarativeAnchorAnimation::easing() const +{ + Q_D(const QDeclarativeAnchorAnimation); + return d->va->easingCurve(); +} + +void QDeclarativeAnchorAnimation::setEasing(const QEasingCurve &e) +{ + Q_D(QDeclarativeAnchorAnimation); + if (d->va->easingCurve() == e) + return; + + d->va->setEasingCurve(e); + emit easingChanged(e); +} + void QDeclarativeAnchorAnimation::transition(QDeclarativeStateActions &actions, QDeclarativeProperties &modified, TransitionDirection direction) diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h index c839c2c..40c893c 100644 --- a/src/declarative/util/qdeclarativeanimation_p.h +++ b/src/declarative/util/qdeclarativeanimation_p.h @@ -475,6 +475,8 @@ class QDeclarativeAnchorAnimation : public QDeclarativeAbstractAnimation Q_OBJECT Q_DECLARE_PRIVATE(QDeclarativeAnchorAnimation) Q_PROPERTY(QDeclarativeListProperty targets READ targets) + Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) + Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged) public: QDeclarativeAnchorAnimation(QObject *parent=0); @@ -482,6 +484,16 @@ public: QDeclarativeListProperty targets(); + int duration() const; + void setDuration(int); + + QEasingCurve easing() const; + void setEasing(const QEasingCurve &); + +Q_SIGNALS: + void durationChanged(int); + void easingChanged(const QEasingCurve&); + protected: virtual void transition(QDeclarativeStateActions &actions, QDeclarativeProperties &modified, -- cgit v0.12 From 646c768dda33fdce846e50a34f83b98c87541fb8 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 11:15:25 +1000 Subject: Change return type to match value(). --- src/declarative/util/qdeclarativepropertymap.cpp | 2 +- src/declarative/util/qdeclarativepropertymap.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/util/qdeclarativepropertymap.cpp b/src/declarative/util/qdeclarativepropertymap.cpp index c8161a7..919727f 100644 --- a/src/declarative/util/qdeclarativepropertymap.cpp +++ b/src/declarative/util/qdeclarativepropertymap.cpp @@ -265,7 +265,7 @@ QVariant &QDeclarativePropertyMap::operator[](const QString &key) Same as value(). */ -const QVariant QDeclarativePropertyMap::operator[](const QString &key) const +QVariant QDeclarativePropertyMap::operator[](const QString &key) const { return value(key); } diff --git a/src/declarative/util/qdeclarativepropertymap.h b/src/declarative/util/qdeclarativepropertymap.h index e0b7ce3..1b6594b 100644 --- a/src/declarative/util/qdeclarativepropertymap.h +++ b/src/declarative/util/qdeclarativepropertymap.h @@ -73,7 +73,7 @@ public: bool contains(const QString &key) const; QVariant &operator[](const QString &key); - const QVariant operator[](const QString &key) const; + QVariant operator[](const QString &key) const; Q_SIGNALS: void valueChanged(const QString &key, const QVariant &value); -- cgit v0.12 From 05f695084d8f003982c9c8eca1b96301b8353fe4 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 22 Apr 2010 11:58:23 +1000 Subject: Doc: fix QStringList model docs --- examples/declarative/declarative.pro | 1 + examples/declarative/stringlistmodel/main.cpp | 76 ++++++++++++++++++++++ .../stringlistmodel/stringlistmodel.pro | 9 +++ .../stringlistmodel/stringlistmodel.qrc | 5 ++ examples/declarative/stringlistmodel/view.qml | 15 +++++ 5 files changed, 106 insertions(+) create mode 100644 examples/declarative/stringlistmodel/main.cpp create mode 100644 examples/declarative/stringlistmodel/stringlistmodel.pro create mode 100644 examples/declarative/stringlistmodel/stringlistmodel.qrc create mode 100644 examples/declarative/stringlistmodel/view.qml diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro index 98ea6c4..e37c3d4 100644 --- a/examples/declarative/declarative.pro +++ b/examples/declarative/declarative.pro @@ -5,6 +5,7 @@ SUBDIRS = \ extending \ imageprovider \ objectlistmodel \ + stringlistmodel \ plugins \ proxywidgets diff --git a/examples/declarative/stringlistmodel/main.cpp b/examples/declarative/stringlistmodel/main.cpp new file mode 100644 index 0000000..abbffa7 --- /dev/null +++ b/examples/declarative/stringlistmodel/main.cpp @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** 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 demonstration applications 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 +#include +#include + + +/* + This example illustrates exposing a QStringList as a + model in QML +*/ + +int main(int argc, char ** argv) +{ + QApplication app(argc, argv); + + QDeclarativeView view; + + QStringList dataList; + dataList.append("Item 1"); + dataList.append("Item 2"); + dataList.append("Item 3"); + dataList.append("Item 4"); + + QDeclarativeContext *ctxt = view.rootContext(); + ctxt->setContextProperty("myModel", QVariant::fromValue(dataList)); + + view.setSource(QUrl("qrc:view.qml")); + view.show(); + + return app.exec(); +} + diff --git a/examples/declarative/stringlistmodel/stringlistmodel.pro b/examples/declarative/stringlistmodel/stringlistmodel.pro new file mode 100644 index 0000000..23dc481 --- /dev/null +++ b/examples/declarative/stringlistmodel/stringlistmodel.pro @@ -0,0 +1,9 @@ +TEMPLATE = app +TARGET = stringlistmodel +DEPENDPATH += . +INCLUDEPATH += . +QT += declarative + +# Input +SOURCES += main.cpp +RESOURCES += stringlistmodel.qrc diff --git a/examples/declarative/stringlistmodel/stringlistmodel.qrc b/examples/declarative/stringlistmodel/stringlistmodel.qrc new file mode 100644 index 0000000..17e9301 --- /dev/null +++ b/examples/declarative/stringlistmodel/stringlistmodel.qrc @@ -0,0 +1,5 @@ + + + view.qml + + diff --git a/examples/declarative/stringlistmodel/view.qml b/examples/declarative/stringlistmodel/view.qml new file mode 100644 index 0000000..41c03d9 --- /dev/null +++ b/examples/declarative/stringlistmodel/view.qml @@ -0,0 +1,15 @@ +import Qt 4.7 + +ListView { + width: 100 + height: 100 + anchors.fill: parent + model: myModel + delegate: Component { + Rectangle { + height: 25 + width: 100 + Text { text: modelData } + } + } +} -- cgit v0.12 From 6b03492619243a1ede75ba324b8422304c662231 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 22 Apr 2010 11:59:07 +1000 Subject: Doc: fix QStringList model doc (really). --- doc/src/declarative/qdeclarativemodels.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index eecc117..91acb3c 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -233,7 +233,7 @@ dataList.append("Ginger"); dataList.append("Skipper"); QDeclarativeContext *ctxt = view.rootContext(); -ctxt->setContextProperty("myModel", QVariant::fromValue(&dataList)); +ctxt->setContextProperty("myModel", QVariant::fromValue(dataList)); \endcode \o -- cgit v0.12 From f9062c44fc21da110fcfae68b19c70d4da7b3fc0 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Thu, 22 Apr 2010 10:42:38 +1000 Subject: De-straighten them lines. --- .../declarative/tic-tac-toe/content/pics/board.png | Bin 1423 -> 12258 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/examples/declarative/tic-tac-toe/content/pics/board.png b/examples/declarative/tic-tac-toe/content/pics/board.png index 29118a9..7e5b7ba 100644 Binary files a/examples/declarative/tic-tac-toe/content/pics/board.png and b/examples/declarative/tic-tac-toe/content/pics/board.png differ -- cgit v0.12 From ca6eaf461886142256dfa64a761fc650be2b006f Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 22 Apr 2010 01:54:43 +0200 Subject: When using Qt::BypassGraphicsProxyWidget with QMenu the application is not stuck anymore When using this flag the child of the widget which is embedded is becoming a top level QWidget. So a right click on a text edit trigger the context menu to be top level. When creating this top level context menu we are grabbing the mouse but we were never releasing it when the menu was hidden. The patch check if the widget uses the Qt::BypassGraphicsProxyWidget and ungrab the mouse. The patch also fix a bug when positioning the QMenu, it was for the same reason. Task-number:QTBUG-7254 Reviewed-by:brad --- src/gui/graphicsview/qgraphicsproxywidget.cpp | 11 ++++++++++- src/gui/kernel/qwidget.cpp | 2 +- src/gui/widgets/qmenu.cpp | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp index ad7cf5d..1f89714 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget.cpp +++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp @@ -1024,9 +1024,18 @@ void QGraphicsProxyWidget::contextMenuEvent(QGraphicsSceneContextMenuEvent *even // Map event position from us to the receiver pos = d->mapToReceiver(pos, receiver); + QPoint globalPos = receiver->mapToGlobal(pos.toPoint()); + //If the receiver by-pass the proxy its popups + //will be top level QWidgets therefore they need + //the screen position. mapToGlobal expect the widget to + //have proper coordinates in regards of the windowing system + //but it's not true because the widget is embedded. + if (bypassGraphicsProxyWidget(receiver)) + globalPos = event->screenPos(); + // Send mouse event. ### Doesn't propagate the event. QContextMenuEvent contextMenuEvent(QContextMenuEvent::Reason(event->reason()), - pos.toPoint(), receiver->mapToGlobal(pos.toPoint()), event->modifiers()); + pos.toPoint(), globalPos, event->modifiers()); QApplication::sendEvent(receiver, &contextMenuEvent); event->setAccepted(contextMenuEvent.isAccepted()); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 046bc7f..441e823 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -7322,7 +7322,7 @@ void QWidgetPrivate::hide_helper() bool isEmbedded = false; #if !defined QT_NO_GRAPHICSVIEW - isEmbedded = q->isWindow() && nearestGraphicsProxyWidget(q->parentWidget()) != 0; + isEmbedded = q->isWindow() && !bypassGraphicsProxyWidget(q) && nearestGraphicsProxyWidget(q->parentWidget()) != 0; #else Q_UNUSED(isEmbedded); #endif diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index f9b132e..907dd14 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1834,7 +1834,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) QSize size = sizeHint(); QRect screen; #ifndef QT_NO_GRAPHICSVIEW - bool isEmbedded = d->nearestGraphicsProxyWidget(this); + bool isEmbedded = !bypassGraphicsProxyWidget(this) && d->nearestGraphicsProxyWidget(this); if (isEmbedded) screen = d->popupGeometry(this); else -- cgit v0.12 From 5bcf21e6bbbfa2c990197695963caba25530827c Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 12:08:33 +1000 Subject: Remove (undocumented) QML bindings for effects. Support for effects will be introduced in a future release, when we can make better guarantees about performance. --- examples/declarative/effects/effects.qml | 65 -------- examples/declarative/effects/effects.qmlproject | 16 -- examples/declarative/effects/pic.png | Bin 12933 -> 0 bytes src/declarative/graphicsitems/graphicsitems.pri | 2 - .../graphicsitems/qdeclarativeeffects.cpp | 174 --------------------- .../graphicsitems/qdeclarativeeffects_p.h | 67 -------- src/declarative/graphicsitems/qdeclarativeitem.cpp | 12 +- .../graphicsitems/qdeclarativeitemsmodule.cpp | 14 -- 8 files changed, 2 insertions(+), 348 deletions(-) delete mode 100644 examples/declarative/effects/effects.qml delete mode 100644 examples/declarative/effects/effects.qmlproject delete mode 100644 examples/declarative/effects/pic.png delete mode 100644 src/declarative/graphicsitems/qdeclarativeeffects.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeeffects_p.h diff --git a/examples/declarative/effects/effects.qml b/examples/declarative/effects/effects.qml deleted file mode 100644 index feb7c69..0000000 --- a/examples/declarative/effects/effects.qml +++ /dev/null @@ -1,65 +0,0 @@ -import Qt 4.7 - -Rectangle { - width: 400; height: 200 - - Image { - id: blur - x: 5 - source: "pic.png" - - effect: Blur { - NumberAnimation on blurRadius { - id: blurEffect - running: false - from: 0; to: 10 - duration: 1000 - loops: Animation.Infinite - } - } - - MouseArea { anchors.fill: parent; onClicked: blurEffect.running = !blurEffect.running } - } - - Text { text: "Blur"; anchors.top: blur.bottom; anchors.horizontalCenter: blur.horizontalCenter } - - Image { - id: dropShadow - source: "pic.png" - x: 135 - - effect: DropShadow { - blurRadius: 3 - offset.x: 3 - - NumberAnimation on offset.y { - id: dropShadowEffect - from: 0; to: 10 - duration: 1000 - running: false - loops: Animation.Infinite - } - } - - MouseArea { anchors.fill: parent; onClicked: dropShadowEffect.running = !dropShadowEffect.running } - } - - Image { - id: colorize - source: "pic.png" - x: 265 - - effect: Colorize { color: "blue" } - } - - Text { text: "Colorize"; anchors.top: colorize.bottom; anchors.horizontalCenter: colorize.horizontalCenter } - - Text { text: "Drop Shadow"; anchors.top: dropShadow.bottom; anchors.horizontalCenter: dropShadow.horizontalCenter } - - Text { - y: 155; anchors.horizontalCenter: parent.horizontalCenter - text: "Clicking Blur or Drop Shadow will \ntoggle animation." - color: "black" - } - -} diff --git a/examples/declarative/effects/effects.qmlproject b/examples/declarative/effects/effects.qmlproject deleted file mode 100644 index d4909f8..0000000 --- a/examples/declarative/effects/effects.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/effects/pic.png b/examples/declarative/effects/pic.png deleted file mode 100644 index 051e738..0000000 Binary files a/examples/declarative/effects/pic.png and /dev/null differ diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri index ad7ccb5..d420595 100644 --- a/src/declarative/graphicsitems/graphicsitems.pri +++ b/src/declarative/graphicsitems/graphicsitems.pri @@ -5,7 +5,6 @@ HEADERS += \ $$PWD/qdeclarativeanchors_p.h \ $$PWD/qdeclarativeanchors_p_p.h \ $$PWD/qdeclarativeevents_p_p.h \ - $$PWD/qdeclarativeeffects_p.h \ $$PWD/qdeclarativeflickable_p.h \ $$PWD/qdeclarativeflickable_p_p.h \ $$PWD/qdeclarativeflipable_p.h \ @@ -50,7 +49,6 @@ HEADERS += \ $$PWD/qdeclarativelistview_p.h \ $$PWD/qdeclarativelayoutitem_p.h \ $$PWD/qdeclarativeitemchangelistener_p.h \ - $$PWD/qdeclarativeeffects.cpp \ $$PWD/qdeclarativegraphicswidget_p.h SOURCES += \ diff --git a/src/declarative/graphicsitems/qdeclarativeeffects.cpp b/src/declarative/graphicsitems/qdeclarativeeffects.cpp deleted file mode 100644 index ea1f9cc..0000000 --- a/src/declarative/graphicsitems/qdeclarativeeffects.cpp +++ /dev/null @@ -1,174 +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 - -#include - -/*! - \qmlclass Blur QGraphicsBlurEffect - \since 4.7 - \brief The Blur object provides a blur effect. - - A blur effect blurs the source item. This effect is useful for reducing details; - for example, when the a source loses focus and attention should be drawn to other - elements. Use blurRadius to control the level of detail and blurHint to control - the quality of the blur. - - By default, the blur radius is 5 pixels. - - \img graphicseffect-blur.png -*/ - -/*! - \qmlproperty real Blur::blurRadius - - This controls how blurry an item will appear. - - A smaller radius produces a sharper appearance, and a larger radius produces - a more blurred appearance. - - The default radius is 5 pixels. -*/ -/*! - \qmlproperty enumeration Blur::blurHint - - Use Qt.PerformanceHint to specify a faster blur or Qt.QualityHint hint - to specify a higher quality blur. - - If the blur radius is animated, it is recommended you use Qt.PerformanceHint. - - The default hint is Qt.PerformanceHint. -*/ - -/*! - \qmlclass Colorize QGraphicsColorizeEffect - \since 4.7 - \brief The Colorize object provides a colorize effect. - - A colorize effect renders the source item with a tint of its color. - - By default, the color is light blue. - - \img graphicseffect-colorize.png -*/ - -/*! - \qmlproperty color Colorize::color - The color of the effect. - - By default, the color is light blue. -*/ - -/*! - \qmlproperty real Colorize::strength - - To what extent the source item is "colored". A strength of 0.0 is equal to no effect, - while 1.0 means full colorization. By default, the strength is 1.0. -*/ - - -/*! - \qmlclass DropShadow QGraphicsDropShadowEffect - \since 4.7 - \brief The DropShadow object provides a drop shadow effect. - - A drop shadow effect renders the source item with a drop shadow. The color of - the drop shadow can be modified using the color property. The drop - shadow offset can be modified using the xOffset and yOffset properties and the blur - radius of the drop shadow can be changed with the blurRadius property. - - By default, the drop shadow is a semi-transparent dark gray shadow, - blurred with a radius of 1 at an offset of 8 pixels towards the lower right. - - \img graphicseffect-drop-shadow.png -*/ - -/*! - \qmlproperty real DropShadow::xOffset - \qmlproperty real DropShadow::yOffset - The shadow offset in pixels. - - By default, xOffset and yOffset are 8 pixels. -*/ - -/*! - \qmlproperty real DropShadow::blurRadius - The blur radius in pixels of the drop shadow. - - Using a smaller radius results in a sharper shadow, whereas using a bigger - radius results in a more blurred shadow. - - By default, the blur radius is 1 pixel. -*/ - -/*! - \qmlproperty color DropShadow::color - The color of the drop shadow. - - By default, the drop color is a semi-transparent dark gray. -*/ - - -/*! - \qmlclass Opacity QGraphicsOpacityEffect - \since 4.7 - \brief The Opacity object provides an opacity effect. - - An opacity effect renders the source with an opacity. This effect is useful - for making the source semi-transparent, similar to a fade-in/fade-out - sequence. The opacity can be modified using the opacity property. - - By default, the opacity is 0.7. - - \img graphicseffect-opacity.png -*/ - -/*! - \qmlproperty real Opacity::opacity - This property specifies how opaque an item should appear. - - The value should be in the range of 0.0 to 1.0, where 0.0 is - fully transparent and 1.0 is fully opaque. - - By default, the opacity is 0.7. -*/ - diff --git a/src/declarative/graphicsitems/qdeclarativeeffects_p.h b/src/declarative/graphicsitems/qdeclarativeeffects_p.h deleted file mode 100644 index 0de5854..0000000 --- a/src/declarative/graphicsitems/qdeclarativeeffects_p.h +++ /dev/null @@ -1,67 +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 QDECLARATIVEEFFECTS_P_H -#define QDECLARATIVEEFFECTS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#ifndef QT_NO_GRAPHICSEFFECT -QML_DECLARE_TYPE(QGraphicsEffect) -QML_DECLARE_TYPE(QGraphicsBlurEffect) -QML_DECLARE_TYPE(QGraphicsColorizeEffect) -QML_DECLARE_TYPE(QGraphicsDropShadowEffect) -QML_DECLARE_TYPE(QGraphicsOpacityEffect) -#endif - -#endif // QDECLARATIVEEFFECTS_P_H diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index bdd24b6..bc0c65e 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -61,7 +61,6 @@ #include #include #include -#include #include QT_BEGIN_NAMESPACE @@ -70,8 +69,6 @@ QT_BEGIN_NAMESPACE #define FLT_MAX 1E+37 #endif -#include "qdeclarativeeffects.cpp" - /*! \qmlclass Transform QGraphicsTransform \since 4.7 @@ -234,11 +231,6 @@ QT_BEGIN_NAMESPACE */ /*! - \group group_effects - \title Effects -*/ - -/*! \group group_layouts \title Layouts */ @@ -2154,8 +2146,8 @@ void QDeclarativeItem::setBaselineOffset(qreal offset) Opacity is an \e inherited attribute. That is, the opacity is also applied individually to child items. In almost all cases this - is what you want. If you can spot the issue in the following - example, you might need to use an \l Opacity effect instead. + is what you want, but in some cases (like the following example) + it may produce undesired results. \table \row diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 8e34472..4238c53 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -46,7 +46,6 @@ #include #include "private/qdeclarativeevents_p_p.h" -#include "private/qdeclarativeeffects_p.h" #include "private/qdeclarativescalegrid_p_p.h" #include "private/qdeclarativeanimatedimage_p.h" #include "private/qdeclarativeborderimage_p.h" @@ -144,19 +143,6 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); -#ifdef QT_NO_GRAPHICSEFFECT - QString no_graphicseffect = qApp->translate("QGraphicsBlurEffect","Qt was built without support for graphicseffects"); - qmlRegisterTypeNotAvailable("Qt",4,7,"Blur",no_graphicseffect); - qmlRegisterTypeNotAvailable("Qt",4,7,"Colorize",no_graphicseffect); - qmlRegisterTypeNotAvailable("Qt",4,7,"DropShadow",no_graphicseffect); - qmlRegisterTypeNotAvailable("Qt",4,7,"Opacity",no_graphicseffect); -#else - qmlRegisterType(); - qmlRegisterType("Qt",4,7,"Blur"); - qmlRegisterType("Qt",4,7,"Colorize"); - qmlRegisterType("Qt",4,7,"DropShadow"); - qmlRegisterType("Qt",4,7,"Opacity"); -#endif qmlRegisterUncreatableType("Qt",4,7,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); qmlRegisterUncreatableType("Qt",4,7,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties")); -- cgit v0.12 From 9a40a3e76171c06d32ab4cadf700f6504dada129 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 22 Apr 2010 12:44:39 +1000 Subject: Give error on attempt to import types from too-early version number. eg. "import Qt 4.6" not valid. --- doc/src/declarative/qtdeclarative.qdoc | 4 +++ src/declarative/qml/qdeclarativeengine.cpp | 2 +- src/declarative/qml/qdeclarativemetatype.cpp | 32 +++++++++++++++++----- .../data/importNonExistOlder.errors.txt | 1 + .../data/importNonExistOlder.qml | 3 ++ .../tst_qdeclarativelanguage.cpp | 1 + 6 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.qml diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index 5d1e18f..670a218 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -91,6 +91,10 @@ qmlRegisterType("MinehuntCore", 0, 1, "Game"); \endcode + Note that it's perfectly reasonable for a library to register types to older versions + than the actual version of the library. Indeed, it is normal for the new library to allow + QML written to previous versions to continue to work, even if more advanced versions of + some of its types are available. */ /*! diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 9e6c060..84146b3 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1736,7 +1736,7 @@ public: found = QDeclarativeMetaType::isModule(uri.toUtf8(), vmaj, vmin); if (!found) { if (errorString) { - bool anyversion = QDeclarativeMetaType::isModule(uri.toUtf8(), 0, 0); + bool anyversion = QDeclarativeMetaType::isModule(uri.toUtf8(), -1, -1); if (anyversion) *errorString = QDeclarativeEngine::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin); else diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 8fee8a7..d9ea8dc 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -99,8 +99,12 @@ struct QDeclarativeMetaTypeData StringConverters stringConverters; struct ModuleInfo { - ModuleInfo(int maj, int min) : vmajor(maj), vminor(min) {} - int vmajor, vminor; + ModuleInfo(int major, int minor) + : vmajor_min(major), vminor_min(minor), vmajor_max(major), vminor_max(minor) {} + ModuleInfo(int major_min, int minor_min, int major_max, int minor_max) + : vmajor_min(major_min), vminor_min(minor_min), vmajor_max(major_max), vminor_max(minor_max) {} + int vmajor_min, vminor_min; + int vmajor_max, vminor_max; }; typedef QHash ModuleInfoHash; ModuleInfoHash modules; @@ -544,9 +548,15 @@ int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &t if (type.uri) { QByteArray mod(type.uri); QDeclarativeMetaTypeData::ModuleInfoHash::Iterator it = data->modules.find(mod); - if (it == data->modules.end() - || ((*it).vmajor < type.versionMajor || ((*it).vmajor == type.versionMajor && (*it).vminor < type.versionMinor))) { + if (it == data->modules.end()) { + // New module data->modules.insert(mod, QDeclarativeMetaTypeData::ModuleInfo(type.versionMajor,type.versionMinor)); + } else if ((*it).vmajor_max < type.versionMajor || ((*it).vmajor_max == type.versionMajor && (*it).vminor_max < type.versionMinor)) { + // Newer module + data->modules.insert(mod, QDeclarativeMetaTypeData::ModuleInfo((*it).vmajor_min, (*it).vminor_min, type.versionMajor, type.versionMinor)); + } else if ((*it).vmajor_min > type.versionMajor || ((*it).vmajor_min == type.versionMajor && (*it).vminor_min > type.versionMinor)) { + // Older module + data->modules.insert(mod, QDeclarativeMetaTypeData::ModuleInfo(type.versionMajor, type.versionMinor, (*it).vmajor_min, (*it).vminor_min)); } } @@ -554,15 +564,23 @@ int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &t } /* - Have any types been registered for \a module with at least versionMajor.versionMinor. + Have any types been registered for \a module with at least versionMajor.versionMinor, and types + for \a module with at most versionMajor.versionMinor. + + So if only 4.7 and 4.9 have been registered, 4.7,4.8, and 4.9 are valid, but not 4.6 nor 4.10. + + Passing -1 for both \a versionMajor \a versionMinor will return true if any version is installed. */ bool QDeclarativeMetaType::isModule(const QByteArray &module, int versionMajor, int versionMinor) { QDeclarativeMetaTypeData *data = metaTypeData(); QDeclarativeMetaTypeData::ModuleInfoHash::Iterator it = data->modules.find(module); return it != data->modules.end() - && ((*it).vmajor > versionMajor || - ((*it).vmajor == versionMajor && (*it).vminor >= versionMinor)); + && ((versionMajor<0 && versionMinor<0) || + (((*it).vmajor_max > versionMajor || + ((*it).vmajor_max == versionMajor && (*it).vminor_max >= versionMinor)) + && ((*it).vmajor_min < versionMajor || + ((*it).vmajor_min == versionMajor && (*it).vminor_min <= versionMinor)))); } QObject *QDeclarativeMetaType::toQObject(const QVariant &v, bool *ok) diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.errors.txt new file mode 100644 index 0000000..dfa7a36 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.errors.txt @@ -0,0 +1 @@ +1:1:module "Test" version 0.1 is not installed diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.qml new file mode 100644 index 0000000..18514b1 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.qml @@ -0,0 +1,3 @@ +import Test 0.1 + +MyTypeObject { } diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index c1397de..c39e6f7 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -277,6 +277,7 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false; QTest::newRow("importVersionMissing (installed)") << "importVersionMissingInstalled.qml" << "importVersionMissingInstalled.errors.txt" << false; QTest::newRow("importNonExist (installed)") << "importNonExist.qml" << "importNonExist.errors.txt" << false; + QTest::newRow("importNonExistOlder (installed)") << "importNonExistOlder.qml" << "importNonExistOlder.errors.txt" << false; QTest::newRow("importNewerVersion (installed)") << "importNewerVersion.qml" << "importNewerVersion.errors.txt" << false; QTest::newRow("invalidImportID") << "invalidImportID.qml" << "invalidImportID.errors.txt" << false; -- cgit v0.12 From e6b5d2a4df73aa26812e26daa3199443bd84cc90 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 22 Apr 2010 13:07:09 +1000 Subject: Autotests and doc --- doc/src/declarative/globalobject.qdoc | 4 +- src/declarative/qml/qdeclarativeengine.cpp | 70 +++++++++--------- .../auto/declarative/qdeclarativeqt/data/atob.qml | 7 ++ .../auto/declarative/qdeclarativeqt/data/btoa.qml | 6 ++ .../qdeclarativeqt/tst_qdeclarativeqt.cpp | 83 +++++++++++++++------- 5 files changed, 110 insertions(+), 60 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeqt/data/atob.qml create mode 100644 tests/auto/declarative/qdeclarativeqt/data/btoa.qml diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index d729d4f..6709ab4 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -190,10 +190,10 @@ This function attempts to open the specified \c target url in an external applic This function returns a hex string of the md5 hash of \c data. \section3 Qt.btoa(data) -This function returns a base64 encoding of \c data. +Binary to ASCII - this function returns a base64 encoding of \c data. \section3 Qt.atob(data) -This function returns a base64 decoding of \c data. +ASCII to binary - this function returns a base64 decoding of \c data. \section3 Qt.quit() This function causes the QML engine to emit the quit signal, which in diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 84146b3..8eae120 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -986,7 +986,7 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QS Q_ASSERT(context); if(ctxt->argumentCount() != 1) { - return ctxt->throwError(QDeclarativeEngine::tr("expected 1 parameter")); + return ctxt->throwError("Qt.createComponent(): Invalid arguments"); }else{ QString arg = ctxt->argument(0).toString(); if (arg.isEmpty()) @@ -1006,7 +1006,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS QDeclarativeEngine* activeEngine = activeEnginePriv->q_func(); if(ctxt->argumentCount() < 2 || ctxt->argumentCount() > 3) - return ctxt->throwError(QDeclarativeEngine::tr("expected 2 or 3 parameters")); + return ctxt->throwError("Qt.createQmlObject(): Invalid arguments"); QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt); Q_ASSERT(context); @@ -1026,7 +1026,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS QObject *parentArg = activeEnginePriv->objectClass->toQObject(ctxt->argument(1)); if(!parentArg) - return ctxt->throwError(QDeclarativeEngine::tr("parent object not found")); + return ctxt->throwError("Qt.createQmlObject(): Missing parent object"); QDeclarativeComponent component(activeEngine); component.setData(qml.toUtf8(), url); @@ -1051,7 +1051,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS } if (!component.isReady()) - return ctxt->throwError(QDeclarativeEngine::tr("Qt.createQmlObject(): component is not ready")); + return ctxt->throwError("Qt.createQmlObject(): Component is not ready"); QObject *obj = component.create(context->asQDeclarativeContext()); @@ -1097,7 +1097,7 @@ QScriptValue QDeclarativeEnginePrivate::isQtObject(QScriptContext *ctxt, QScript QScriptValue QDeclarativeEnginePrivate::vector(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 3) - return ctxt->throwError(QDeclarativeEngine::tr("expected 3 parameters")); + return ctxt->throwError("Qt.vector(): Invalid arguments"); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); qsreal z = ctxt->argument(2).toNumber(); @@ -1108,7 +1108,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptE { int argCount = ctxt->argumentCount(); if(argCount == 0 || argCount > 2) - return ctxt->throwError(QDeclarativeEngine::tr("expected 1 or 2 parameters")); + return ctxt->throwError("Qt.formatDate(): Invalid arguments"); QDate date = ctxt->argument(0).toDateTime().date(); Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate; @@ -1118,8 +1118,9 @@ QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptE return engine->newVariant(qVariantFromValue(date.toString(format))); } else if (ctxt->argument(1).isNumber()) { enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32()); - } else - return ctxt->throwError(QDeclarativeEngine::tr("invalid date format")); + } else { + return ctxt->throwError("Qt.formatDate(): Invalid date format"); + } } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); } @@ -1128,7 +1129,7 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE { int argCount = ctxt->argumentCount(); if(argCount == 0 || argCount > 2) - return ctxt->throwError(QDeclarativeEngine::tr("expected 1 or 2 parameters")); + return ctxt->throwError("Qt.formatTime(): Invalid arguments"); QTime date = ctxt->argument(0).toDateTime().time(); Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate; @@ -1138,8 +1139,9 @@ QScriptValue QDeclarativeEnginePrivate::formatTime(QScriptContext*ctxt, QScriptE return engine->newVariant(qVariantFromValue(date.toString(format))); } else if (ctxt->argument(1).isNumber()) { enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32()); - } else - return ctxt->throwError(QDeclarativeEngine::tr("invalid time format")); + } else { + return ctxt->throwError("Qt.formatTime(): Invalid time format"); + } } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); } @@ -1148,7 +1150,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr { int argCount = ctxt->argumentCount(); if(argCount == 0 || argCount > 2) - return ctxt->throwError(QDeclarativeEngine::tr("expected 1 or 2 parameters")); + return ctxt->throwError("Qt.formatDateTime(): Invalid arguments"); QDateTime date = ctxt->argument(0).toDateTime(); Qt::DateFormat enumFormat = Qt::DefaultLocaleShortDate; @@ -1158,8 +1160,9 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr return engine->newVariant(qVariantFromValue(date.toString(format))); } else if (ctxt->argument(1).isNumber()) { enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32()); - } else - return ctxt->throwError(QDeclarativeEngine::tr("invalid datetiem format")); + } else { + return ctxt->throwError("Qt.formatDateTime(): Invalid datetime formate"); + } } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); } @@ -1168,7 +1171,7 @@ QScriptValue QDeclarativeEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine { int argCount = ctxt->argumentCount(); if(argCount < 3 || argCount > 4) - return ctxt->throwError(QDeclarativeEngine::tr("expected 3 or 4 parameters")); + return ctxt->throwError("Qt.rgba(): Invalid arguments"); qsreal r = ctxt->argument(0).toNumber(); qsreal g = ctxt->argument(1).toNumber(); qsreal b = ctxt->argument(2).toNumber(); @@ -1190,7 +1193,7 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine { int argCount = ctxt->argumentCount(); if(argCount < 3 || argCount > 4) - return ctxt->throwError(QDeclarativeEngine::tr("expected 3 or 4 parameters")); + return ctxt->throwError("Qt.hsla(): Invalid arguments"); qsreal h = ctxt->argument(0).toNumber(); qsreal s = ctxt->argument(1).toNumber(); qsreal l = ctxt->argument(2).toNumber(); @@ -1211,7 +1214,7 @@ QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 4) - return ctxt->throwError(QDeclarativeEngine::tr("expected 4 parameters")); + return ctxt->throwError("Qt.rect(): Invalid arguments"); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); @@ -1227,7 +1230,7 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 2) - return ctxt->throwError(QDeclarativeEngine::tr("expected 2 parameters")); + return ctxt->throwError("Qt.point(): Invalid arguments"); qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); return qScriptValueFromValue(engine, qVariantFromValue(QPointF(x, y))); @@ -1236,7 +1239,7 @@ QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngin QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 2) - return ctxt->throwError(QDeclarativeEngine::tr("expected 2 parameters")); + return ctxt->throwError("Qt.size(): Invalid arguments"); qsreal w = ctxt->argument(0).toNumber(); qsreal h = ctxt->argument(1).toNumber(); return qScriptValueFromValue(engine, qVariantFromValue(QSizeF(w, h))); @@ -1245,7 +1248,7 @@ QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 1) - return ctxt->throwError(QDeclarativeEngine::tr("expected 1 parameter")); + return ctxt->throwError("Qt.lighter(): Invalid arguments"); QVariant v = ctxt->argument(0).toVariant(); QColor color; if (v.userType() == QVariant::Color) @@ -1264,7 +1267,7 @@ QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEng QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 1) - return ctxt->throwError(QDeclarativeEngine::tr("expected 1 parameter")); + return ctxt->throwError("Qt.darker(): Invalid arguments"); QVariant v = ctxt->argument(0).toVariant(); QColor color; if (v.userType() == QVariant::Color) @@ -1283,21 +1286,20 @@ QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngi QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QScriptEngine *e) { if(ctxt->argumentCount() < 1) - return e->newVariant(QVariant(false)); + return QScriptValue(e, false); bool ret = false; #ifndef QT_NO_DESKTOPSERVICES ret = QDesktopServices::openUrl(QUrl(ctxt->argument(0).toString())); #endif - return e->newVariant(QVariant(ret)); + return QScriptValue(e, ret); } QScriptValue QDeclarativeEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *) { - QByteArray data; - - if (ctxt->argumentCount() >= 1) - data = ctxt->argument(0).toString().toUtf8(); + if (ctxt->argumentCount() != 1) + return ctxt->throwError("Qt.md5(): Invalid arguments"); + QByteArray data = ctxt->argument(0).toString().toUtf8(); QByteArray result = QCryptographicHash::hash(data, QCryptographicHash::Md5); return QScriptValue(QLatin1String(result.toHex())); @@ -1305,20 +1307,20 @@ QScriptValue QDeclarativeEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine QScriptValue QDeclarativeEnginePrivate::btoa(QScriptContext *ctxt, QScriptEngine *) { - QByteArray data; + if (ctxt->argumentCount() != 1) + return ctxt->throwError("Qt.btoa(): Invalid arguments"); - if (ctxt->argumentCount() >= 1) - data = ctxt->argument(0).toString().toUtf8(); + QByteArray data = ctxt->argument(0).toString().toUtf8(); return QScriptValue(QLatin1String(data.toBase64())); } QScriptValue QDeclarativeEnginePrivate::atob(QScriptContext *ctxt, QScriptEngine *) { - QByteArray data; + if (ctxt->argumentCount() != 1) + return ctxt->throwError("Qt.atob(): Invalid arguments"); - if (ctxt->argumentCount() >= 1) - data = ctxt->argument(0).toString().toUtf8(); + QByteArray data = ctxt->argument(0).toString().toUtf8(); return QScriptValue(QLatin1String(QByteArray::fromBase64(data))); } @@ -1417,7 +1419,7 @@ QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptE QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine) { if(ctxt->argumentCount() != 2) - return ctxt->throwError(QDeclarativeEngine::tr("expected 2 parameters")); + return ctxt->throwError("Qt.tint(): Invalid arguments"); //get color QVariant v = ctxt->argument(0).toVariant(); QColor color; diff --git a/tests/auto/declarative/qdeclarativeqt/data/atob.qml b/tests/auto/declarative/qdeclarativeqt/data/atob.qml new file mode 100644 index 0000000..8355fa5 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeqt/data/atob.qml @@ -0,0 +1,7 @@ +import Qt 4.7 + +QtObject { + property string test1: Qt.atob() + property string test2: Qt.atob("SGVsbG8gd29ybGQh") +} + diff --git a/tests/auto/declarative/qdeclarativeqt/data/btoa.qml b/tests/auto/declarative/qdeclarativeqt/data/btoa.qml new file mode 100644 index 0000000..c2993ff --- /dev/null +++ b/tests/auto/declarative/qdeclarativeqt/data/btoa.qml @@ -0,0 +1,6 @@ +import Qt 4.7 + +QtObject { + property string test1: Qt.btoa() + property string test2: Qt.btoa("Hello world!") +} diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index 727d74c..f5d5926 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -74,6 +74,8 @@ private slots: void consoleLog(); void formatting(); void isQtObject(); + void btoa(); + void atob(); private: QDeclarativeEngine engine; @@ -102,8 +104,8 @@ void tst_qdeclarativeqt::rgba() { QDeclarativeComponent component(&engine, TEST_FILE("rgba.qml")); - QString warning1 = component.url().toString() + ":6: Error: expected 3 or 4 parameters"; - QString warning2 = component.url().toString() + ":7: Error: expected 3 or 4 parameters"; + QString warning1 = component.url().toString() + ":6: Error: Qt.rgba(): Invalid arguments"; + QString warning2 = component.url().toString() + ":7: Error: Qt.rgba(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -125,8 +127,8 @@ void tst_qdeclarativeqt::hsla() { QDeclarativeComponent component(&engine, TEST_FILE("hsla.qml")); - QString warning1 = component.url().toString() + ":6: Error: expected 3 or 4 parameters"; - QString warning2 = component.url().toString() + ":7: Error: expected 3 or 4 parameters"; + QString warning1 = component.url().toString() + ":6: Error: Qt.hsla(): Invalid arguments"; + QString warning2 = component.url().toString() + ":7: Error: Qt.hsla(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -147,8 +149,8 @@ void tst_qdeclarativeqt::rect() { QDeclarativeComponent component(&engine, TEST_FILE("rect.qml")); - QString warning1 = component.url().toString() + ":6: Error: expected 4 parameters"; - QString warning2 = component.url().toString() + ":7: Error: expected 4 parameters"; + QString warning1 = component.url().toString() + ":6: Error: Qt.rect(): Invalid arguments"; + QString warning2 = component.url().toString() + ":7: Error: Qt.rect(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -168,8 +170,8 @@ void tst_qdeclarativeqt::point() { QDeclarativeComponent component(&engine, TEST_FILE("point.qml")); - QString warning1 = component.url().toString() + ":6: Error: expected 2 parameters"; - QString warning2 = component.url().toString() + ":7: Error: expected 2 parameters"; + QString warning1 = component.url().toString() + ":6: Error: Qt.point(): Invalid arguments"; + QString warning2 = component.url().toString() + ":7: Error: Qt.point(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -188,8 +190,8 @@ void tst_qdeclarativeqt::size() { QDeclarativeComponent component(&engine, TEST_FILE("size.qml")); - QString warning1 = component.url().toString() + ":7: Error: expected 2 parameters"; - QString warning2 = component.url().toString() + ":8: Error: expected 2 parameters"; + QString warning1 = component.url().toString() + ":7: Error: Qt.size(): Invalid arguments"; + QString warning2 = component.url().toString() + ":8: Error: Qt.size(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -209,8 +211,8 @@ void tst_qdeclarativeqt::vector() { QDeclarativeComponent component(&engine, TEST_FILE("vector.qml")); - QString warning1 = component.url().toString() + ":6: Error: expected 3 parameters"; - QString warning2 = component.url().toString() + ":7: Error: expected 3 parameters"; + QString warning1 = component.url().toString() + ":6: Error: Qt.vector(): Invalid arguments"; + QString warning2 = component.url().toString() + ":7: Error: Qt.vector(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -229,8 +231,8 @@ void tst_qdeclarativeqt::lighter() { QDeclarativeComponent component(&engine, TEST_FILE("lighter.qml")); - QString warning1 = component.url().toString() + ":5: Error: expected 1 parameter"; - QString warning2 = component.url().toString() + ":6: Error: expected 1 parameter"; + QString warning1 = component.url().toString() + ":5: Error: Qt.lighter(): Invalid arguments"; + QString warning2 = component.url().toString() + ":6: Error: Qt.lighter(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -251,8 +253,8 @@ void tst_qdeclarativeqt::darker() { QDeclarativeComponent component(&engine, TEST_FILE("darker.qml")); - QString warning1 = component.url().toString() + ":5: Error: expected 1 parameter"; - QString warning2 = component.url().toString() + ":6: Error: expected 1 parameter"; + QString warning1 = component.url().toString() + ":5: Error: Qt.darker(): Invalid arguments"; + QString warning2 = component.url().toString() + ":6: Error: Qt.darker(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -273,8 +275,8 @@ void tst_qdeclarativeqt::tint() { QDeclarativeComponent component(&engine, TEST_FILE("tint.qml")); - QString warning1 = component.url().toString() + ":7: Error: expected 2 parameters"; - QString warning2 = component.url().toString() + ":8: Error: expected 2 parameters"; + QString warning1 = component.url().toString() + ":7: Error: Qt.tint(): Invalid arguments"; + QString warning2 = component.url().toString() + ":8: Error: Qt.tint(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -322,10 +324,13 @@ void tst_qdeclarativeqt::openUrlExternally() void tst_qdeclarativeqt::md5() { QDeclarativeComponent component(&engine, TEST_FILE("md5.qml")); + + QString warning1 = component.url().toString() + ":4: Error: Qt.md5(): Invalid arguments"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QObject *object = component.create(); QVERIFY(object != 0); - QCOMPARE(object->property("test1").toString(), QLatin1String(QCryptographicHash::hash(QByteArray(), QCryptographicHash::Md5).toHex())); QCOMPARE(object->property("test2").toString(), QLatin1String(QCryptographicHash::hash("Hello World", QCryptographicHash::Md5).toHex())); delete object; @@ -335,8 +340,8 @@ void tst_qdeclarativeqt::createComponent() { QDeclarativeComponent component(&engine, TEST_FILE("createComponent.qml")); - QString warning1 = component.url().toString() + ":9: Error: expected 1 parameter"; - QString warning2 = component.url().toString() + ":10: Error: expected 1 parameter"; + QString warning1 = component.url().toString() + ":9: Error: Qt.createComponent(): Invalid arguments"; + QString warning2 = component.url().toString() + ":10: Error: Qt.createComponent(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); @@ -353,11 +358,11 @@ void tst_qdeclarativeqt::createQmlObject() { QDeclarativeComponent component(&engine, TEST_FILE("createQmlObject.qml")); - QString warning1 = component.url().toString() + ":7: Error: expected 2 or 3 parameters"; + QString warning1 = component.url().toString() + ":7: Error: Qt.createQmlObject(): Invalid arguments"; QString warning2 = component.url().toString()+ ":10: Error: Qt.createQmlObject() failed to create object: " + TEST_FILE("inline").toString() + ":2:10: Blah is not a type\n"; QString warning3 = component.url().toString()+ ":11: Error: Qt.createQmlObject() failed to create object: " + TEST_FILE("main.qml").toString() + ":4:1: Duplicate property name\n"; - QString warning4 = component.url().toString()+ ":9: Error: parent object not found"; - QString warning5 = component.url().toString()+ ":8: Error: expected 2 or 3 parameters"; + QString warning4 = component.url().toString()+ ":9: Error: Qt.createQmlObject(): Missing parent object"; + QString warning5 = component.url().toString()+ ":8: Error: Qt.createQmlObject(): Invalid arguments"; QString warning6 = "RunTimeError: Qt.createQmlObject() failed to create object: " + TEST_FILE("inline").toString() + ":3: Cannot assign object type QObject with no default method\n"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); @@ -433,6 +438,36 @@ void tst_qdeclarativeqt::isQtObject() delete object; } +void tst_qdeclarativeqt::btoa() +{ + QDeclarativeComponent component(&engine, TEST_FILE("btoa.qml")); + + QString warning1 = component.url().toString() + ":4: Error: Qt.btoa(): Invalid arguments"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("test2").toString(), QString("SGVsbG8gd29ybGQh")); + + delete object; +} + +void tst_qdeclarativeqt::atob() +{ + QDeclarativeComponent component(&engine, TEST_FILE("atob.qml")); + + QString warning1 = component.url().toString() + ":4: Error: Qt.atob(): Invalid arguments"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("test2").toString(), QString("Hello world!")); + + delete object; +} + QTEST_MAIN(tst_qdeclarativeqt) #include "tst_qdeclarativeqt.moc" -- cgit v0.12 From 47862497693ffac597557f940535909df549d897 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 22 Apr 2010 13:35:10 +1000 Subject: Replace Flickable overshoot property with boundsBehavior Task-number: QTBUG-9993 --- examples/declarative/parallax/qml/ParallaxView.qml | 2 +- src/declarative/QmlChanges.txt | 5 ++ .../graphicsitems/qdeclarativeflickable.cpp | 62 ++++++++++++++++------ .../graphicsitems/qdeclarativeflickable_p.h | 9 +++- .../graphicsitems/qdeclarativeflickable_p_p.h | 2 +- .../graphicsitems/qdeclarativegridview.cpp | 1 + .../graphicsitems/qdeclarativelistview.cpp | 1 + .../qdeclarativeflickable/data/flickable04.qml | 2 +- .../tst_qdeclarativeflickable.cpp | 32 ++++++----- .../qdeclarativeflickable/flickable-vertical.qml | 5 +- 10 files changed, 86 insertions(+), 35 deletions(-) diff --git a/examples/declarative/parallax/qml/ParallaxView.qml b/examples/declarative/parallax/qml/ParallaxView.qml index 8f5f290..4b38d45 100644 --- a/examples/declarative/parallax/qml/ParallaxView.qml +++ b/examples/declarative/parallax/qml/ParallaxView.qml @@ -21,7 +21,7 @@ Item { onCurrentIndexChanged: root.currentIndex = currentIndex orientation: "Horizontal" - overShoot: false + boundsBehavior: Flickable.DragOverBounds anchors.fill: parent model: VisualItemModel { id: visualModel } diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index 2cae293..55f7b21 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -1,4 +1,9 @@ ============================================================================= +The changes below are pre Qt 4.7.0 RC + +Flickable: overShoot is replaced by boundsBehavior enumeration. + +============================================================================= The changes below are pre Qt 4.7.0 beta TextEdit: wrap property is replaced by wrapMode enumeration. diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 7b9b5e0..b462443 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -41,7 +41,7 @@ #include "private/qdeclarativeflickable_p.h" #include "private/qdeclarativeflickable_p_p.h" - +#include #include #include #include @@ -125,12 +125,13 @@ QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate() : viewport(new QDeclarativeItem) , hData(this, &QDeclarativeFlickablePrivate::setRoundedViewportX) , vData(this, &QDeclarativeFlickablePrivate::setRoundedViewportY) - , overShoot(true), flicked(false), moving(false), stealMouse(false) + , flicked(false), moving(false), stealMouse(false) , pressed(false) , interactive(true), deceleration(500), maxVelocity(2000), reportedVelocitySmoothing(100) , delayedPressEvent(0), delayedPressTarget(0), pressDelay(0), fixupDuration(600) , vTime(0), visibleArea(0) , flickDirection(QDeclarativeFlickable::AutoFlickDirection) + , boundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds) { } @@ -203,6 +204,7 @@ void QDeclarativeFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal { Q_Q(QDeclarativeFlickable); qreal maxDistance = -1; + bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds; // -ve velocity means list is moving up if (velocity > 0) { if (data.move.value() < minExtent) @@ -646,7 +648,7 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent newY = minY + (newY - minY) / 2; if (newY < maxY && maxY - minY <= 0) newY = maxY + (newY - maxY) / 2; - if (!q->overShoot() && (newY > minY || newY < maxY)) { + if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newY > minY || newY < maxY)) { if (newY > minY) newY = minY; else if (newY < maxY) @@ -673,7 +675,7 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent newX = minX + (newX - minX) / 2; if (newX < maxX && maxX - minX <= 0) newX = maxX + (newX - maxX) / 2; - if (!q->overShoot() && (newX > minX || newX < maxX)) { + if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newX > minX || newX < maxX)) { if (newX > minX) newX = minX; else if (newX < maxX) @@ -997,28 +999,58 @@ QDeclarativeListProperty QDeclarativeFlickable::flickableChildr return QGraphicsItemPrivate::get(d->viewport)->childrenList(); } +bool QDeclarativeFlickable::overShoot() const +{ + Q_D(const QDeclarativeFlickable); + return d->boundsBehavior == DragAndOvershootBounds; +} + +void QDeclarativeFlickable::setOverShoot(bool o) +{ + Q_D(QDeclarativeFlickable); + if ((o && d->boundsBehavior == DragAndOvershootBounds) + || (!o && d->boundsBehavior == StopAtBounds)) + return; + qmlInfo(this) << "overshoot is deprecated and will be removed imminently - use boundsBehavior."; + d->boundsBehavior = o ? DragAndOvershootBounds : StopAtBounds; + emit boundsBehaviorChanged(); + emit overShootChanged(); +} + /*! - \qmlproperty bool Flickable::overShoot - This property holds whether the surface may overshoot the + \qmlproperty enumeration Flickable::boundsBehavior + This property holds whether the surface may be dragged + beyond the Fickable's boundaries, or overshoot the Flickable's boundaries when flicked. - If overShoot is true the contents can be flicked beyond the boundary - of the Flickable before being moved back to the boundary. This provides - the feeling that the edges of the view are soft, rather than a hard - physical boundary. + This enables the feeling that the edges of the view are soft, + rather than a hard physical boundary. + + boundsBehavior can be one of: + + \list + \o \e StopAtBounds - the contents can not be dragged beyond the boundary + of the flickable, and flicks will not overshoot. + \o \e DragOverBounds - the contents can be dragged beyond the boundary + of the Flickable, but flicks will not overshoot. + \o \e DragAndOvershootBounds (default) - the contents can be dragged + beyond the boundary of the Flickable, and can overshoot the + boundary when flicked. + \endlist */ -bool QDeclarativeFlickable::overShoot() const +QDeclarativeFlickable::BoundsBehavior QDeclarativeFlickable::boundsBehavior() const { Q_D(const QDeclarativeFlickable); - return d->overShoot; + return d->boundsBehavior; } -void QDeclarativeFlickable::setOverShoot(bool o) +void QDeclarativeFlickable::setBoundsBehavior(BoundsBehavior b) { Q_D(QDeclarativeFlickable); - if (d->overShoot == o) + if (b == d->boundsBehavior) return; - d->overShoot = o; + d->boundsBehavior = b; + emit boundsBehaviorChanged(); emit overShootChanged(); } diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h index 1fa2c74..f031a24 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h +++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h @@ -64,7 +64,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged) Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged) - Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot NOTIFY overShootChanged) + Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot NOTIFY overShootChanged) // deprecated + Q_PROPERTY(BoundsBehavior boundsBehavior READ boundsBehavior WRITE setBoundsBehavior NOTIFY boundsBehaviorChanged) Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged) Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged) Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged) @@ -86,6 +87,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem Q_CLASSINFO("DefaultProperty", "flickableData") Q_ENUMS(FlickDirection) + Q_ENUMS(BoundsBehavior) public: QDeclarativeFlickable(QDeclarativeItem *parent=0); @@ -97,6 +99,10 @@ public: bool overShoot() const; void setOverShoot(bool); + enum BoundsBehavior { StopAtBounds, DragOverBounds, DragAndOvershootBounds }; + BoundsBehavior boundsBehavior() const; + void setBoundsBehavior(BoundsBehavior); + qreal contentWidth() const; void setContentWidth(qreal); @@ -156,6 +162,7 @@ Q_SIGNALS: void flickDirectionChanged(); void interactiveChanged(); void overShootChanged(); + void boundsBehaviorChanged(); void maximumFlickVelocityChanged(); void flickDecelerationChanged(); void pressDelayChanged(); diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h index 1a04091..01cfb18 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h @@ -131,7 +131,6 @@ public: AxisData vData; QDeclarativeTimeLine timeline; - bool overShoot : 1; bool flicked : 1; bool moving : 1; bool stealMouse : 1; @@ -160,6 +159,7 @@ public: QDeclarativeTimeLine velocityTimeline; QDeclarativeFlickableVisibleArea *visibleArea; QDeclarativeFlickable::FlickDirection flickDirection; + QDeclarativeFlickable::BoundsBehavior boundsBehavior; void handleMousePressEvent(QGraphicsSceneMouseEvent *); void handleMouseMoveEvent(QGraphicsSceneMouseEvent *); diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index f6666f2..f8b773e 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -831,6 +831,7 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m if (snapMode == QDeclarativeGridView::NoSnap && highlightRange != QDeclarativeGridView::StrictlyEnforceRange) data.flickTarget = maxExtent; } + bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds; if (maxDistance > 0 || overShoot) { // This mode requires the grid to stop exactly on a row boundary. qreal v = velocity; diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index a4ca651..60e8f6c 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1190,6 +1190,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m if (snapMode == QDeclarativeListView::NoSnap && highlightRange != QDeclarativeListView::StrictlyEnforceRange) data.flickTarget = maxExtent; } + bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds; if (maxDistance > 0 || overShoot) { // These modes require the list to stop exactly on an item boundary. // The initial flick will estimate the boundary to stop on. diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml index ff742f0..aa156ed 100644 --- a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml +++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml @@ -3,7 +3,7 @@ import Qt 4.7 Flickable { width: 100; height: 100 contentWidth: column.width; contentHeight: column.height - pressDelay: 200; overShoot: false; interactive: false + pressDelay: 200; boundsBehavior: Flickable.StopAtBounds; interactive: false maximumFlickVelocity: 2000 Column { diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp index a345a60..9ce9c49 100644 --- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp +++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp @@ -57,7 +57,7 @@ private slots: void horizontalViewportSize(); void verticalViewportSize(); void properties(); - void overShoot(); + void boundsBehavior(); void maximumFlickVelocity(); void flickDeceleration(); void pressDelay(); @@ -88,7 +88,7 @@ void tst_qdeclarativeflickable::create() QCOMPARE(obj->verticalVelocity(), 0.); QCOMPARE(obj->isInteractive(), true); - QCOMPARE(obj->overShoot(), true); + QCOMPARE(obj->boundsBehavior(), QDeclarativeFlickable::DragAndOvershootBounds); QCOMPARE(obj->pressDelay(), 0); QCOMPARE(obj->maximumFlickVelocity(), 2000.); @@ -137,34 +137,40 @@ void tst_qdeclarativeflickable::properties() QVERIFY(obj != 0); QCOMPARE(obj->isInteractive(), false); - QCOMPARE(obj->overShoot(), false); + QCOMPARE(obj->boundsBehavior(), QDeclarativeFlickable::StopAtBounds); QCOMPARE(obj->pressDelay(), 200); QCOMPARE(obj->maximumFlickVelocity(), 2000.); delete obj; } -void tst_qdeclarativeflickable::overShoot() +void tst_qdeclarativeflickable::boundsBehavior() { QDeclarativeComponent component(&engine); - component.setData("import Qt 4.7; Flickable { overShoot: false; }", QUrl::fromLocalFile("")); + component.setData("import Qt 4.7; Flickable { boundsBehavior: Flickable.StopAtBounds }", QUrl::fromLocalFile("")); QDeclarativeFlickable *flickable = qobject_cast(component.create()); - QSignalSpy spy(flickable, SIGNAL(overShootChanged())); + QSignalSpy spy(flickable, SIGNAL(boundsBehaviorChanged())); QVERIFY(flickable); - QVERIFY(!flickable->overShoot()); + QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::StopAtBounds); - flickable->setOverShoot(true); - QVERIFY(flickable->overShoot()); + flickable->setBoundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds); + QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::DragAndOvershootBounds); QCOMPARE(spy.count(),1); - flickable->setOverShoot(true); + flickable->setBoundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds); QCOMPARE(spy.count(),1); - flickable->setOverShoot(false); - QVERIFY(!flickable->overShoot()); + flickable->setBoundsBehavior(QDeclarativeFlickable::DragOverBounds); + QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::DragOverBounds); QCOMPARE(spy.count(),2); - flickable->setOverShoot(false); + flickable->setBoundsBehavior(QDeclarativeFlickable::DragOverBounds); QCOMPARE(spy.count(),2); + + flickable->setBoundsBehavior(QDeclarativeFlickable::StopAtBounds); + QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::StopAtBounds); + QCOMPARE(spy.count(),3); + flickable->setBoundsBehavior(QDeclarativeFlickable::StopAtBounds); + QCOMPARE(spy.count(),3); } void tst_qdeclarativeflickable::maximumFlickVelocity() diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml index 09e414d..d845353 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml @@ -15,7 +15,7 @@ Rectangle { ListElement { dayColor: "orange" } } - flickable { + Flickable { id: flick height: parent.height-50 width: parent.width; contentHeight: column.height @@ -33,7 +33,6 @@ Rectangle { } } clip: true - reportedVelocitySmoothing: 1000 } Rectangle { radius: 3 @@ -77,7 +76,7 @@ Rectangle { color: "yellow" MouseArea { anchors.fill: parent - onClicked: flick.overShoot = flick.overShoot > 0 ? 0 : 30 + onClicked: flick.boundsBehavior = flick.boundsBehavior == Flickable.StopAtBounds ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds } } -- cgit v0.12 From e9da512e321c6ea7795a4abc0b9d24bf4d3d2527 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 22 Apr 2010 14:58:11 +1000 Subject: Do not treat images in qml examples differently. --- tools/qdoc3/cppcodeparser.cpp | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 730f122..13678af 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -2268,44 +2268,35 @@ void CppCodeParser::instantiateIteratorMacro(const QString &container, void CppCodeParser::createExampleFileNodes(FakeNode *fake) { QString examplePath = fake->name(); + QString proFileName = examplePath + "/" + examplePath.split("/").last() + ".pro"; QString userFriendlyFilePath; - bool isQmlExample = false; - // let's check if this is a QML example - QString proFileName = examplePath + "/" + examplePath.split("/").last() + ".qmlproject"; QString fullPath = Config::findFile(fake->doc().location(), exampleFiles, exampleDirs, proFileName, userFriendlyFilePath); - if (!fullPath.isEmpty()) { - isQmlExample = true; - } else { - // let's check if there is a .pro file - proFileName = examplePath + "/" + examplePath.split("/").last() + ".pro"; + if (fullPath.isEmpty()) { + QString tmp = proFileName; + proFileName = examplePath + "/" + "qbuild.pro"; userFriendlyFilePath.clear(); - fullPath = Config::findFile(fake->doc().location(), exampleFiles, exampleDirs, proFileName, userFriendlyFilePath); - if (fullPath.isEmpty()) { - // let's check if there is a qbuild.pro file - QString tmp = proFileName; - proFileName = examplePath + "/" + "qbuild.pro"; + proFileName = examplePath + "/" + examplePath.split("/").last() + ".qmlproject"; userFriendlyFilePath.clear(); fullPath = Config::findFile(fake->doc().location(), exampleFiles, exampleDirs, proFileName, userFriendlyFilePath); - if (fullPath.isEmpty()) { fake->doc().location().warning( - tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName)); + tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName)); return; } } @@ -2315,14 +2306,7 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake) fullPath.truncate(fullPath.lastIndexOf('/')); QStringList exampleFiles = Config::getFilesHere(fullPath,exampleNameFilter); - - // QML examples do not put images in a "images" directory. - QString imagesPath; - if (isQmlExample) - imagesPath = fullPath; - else - imagesPath = fullPath + "/images"; - + QString imagesPath = fullPath + "/images"; QStringList imageFiles = Config::getFilesHere(imagesPath,exampleImageFilter); if (!exampleFiles.isEmpty()) { -- cgit v0.12 From af3c75a63e9b7dd9725443a8e23114f825c6d12b Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 22 Apr 2010 16:19:40 +1000 Subject: Remove the deprecated wrap property. --- src/declarative/graphicsitems/qdeclarativetext.cpp | 12 ------------ src/declarative/graphicsitems/qdeclarativetext_p.h | 3 --- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 13 ------------- src/declarative/graphicsitems/qdeclarativetextedit_p.h | 3 --- 4 files changed, 31 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index a95c930..0b59503 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -525,18 +525,6 @@ void QDeclarativeText::setWrapMode(WrapMode mode) emit wrapModeChanged(); } -bool QDeclarativeText::wrap() const -{ - Q_D(const QDeclarativeText); - return d->wrapMode != NoWrap; -} - -void QDeclarativeText::setWrap(bool w) -{ - qmlInfo(this) << "\"wrap\" property is deprecated and will soon be removed. Use wrapMode"; - setWrapMode(w ? WordWrap : NoWrap); -} - /*! \qmlproperty enumeration Text::textFormat diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h index 4fd5e3a..00ce126 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p.h @@ -69,7 +69,6 @@ class Q_DECLARATIVE_EXPORT QDeclarativeText : public QDeclarativeItem Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged) Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged) Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged) - Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY wrapModeChanged) Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged) Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode NOTIFY elideModeChanged) //### elideMode? @@ -123,8 +122,6 @@ public: VAlignment vAlign() const; void setVAlign(VAlignment align); - bool wrap() const; - void setWrap(bool w); WrapMode wrapMode() const; void setWrapMode(WrapMode w); diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 77fb459..25eaef6 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -495,19 +495,6 @@ void QDeclarativeTextEdit::setWrapMode(WrapMode mode) emit wrapModeChanged(); } -bool QDeclarativeTextEdit::wrap() const -{ - Q_D(const QDeclarativeTextEdit); - return d->wrapMode != QDeclarativeTextEdit::NoWrap; -} - -void QDeclarativeTextEdit::setWrap(bool w) -{ - - qmlInfo(this) << "\"wrap\" property is deprecated and will soon be removed. Use wrapMode"; - setWrapMode(w ? WordWrap : NoWrap); -} - /*! \qmlproperty bool TextEdit::cursorVisible If true the text edit shows a cursor. diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h index 605b620..474de09 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h @@ -73,7 +73,6 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged) Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged) - Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY wrapChanged) //### deprecated Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged) Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged) @@ -139,8 +138,6 @@ public: VAlignment vAlign() const; void setVAlign(VAlignment align); - bool wrap() const; - void setWrap(bool w); WrapMode wrapMode() const; void setWrapMode(WrapMode w); -- cgit v0.12 From 7dc1d86ef4fd365483dec83b7cafff06521bf8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Thu, 22 Apr 2010 11:18:28 +0200 Subject: Diagram scene example (graphicsview/diagramscene) refresh problem. Connections between shapes were not updated when moving items around. Problem was that the QGraphicsItem::ItemSendsGeometryChanges flag was not enabled. (Geoemtry changes notifications were disabled by default in 4.6 for performance reasons) Task-number: QT-2482 Reviewed-by: TrustMe --- examples/graphicsview/diagramscene/diagramitem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/graphicsview/diagramscene/diagramitem.cpp b/examples/graphicsview/diagramscene/diagramitem.cpp index ee028bb..41534d1 100644 --- a/examples/graphicsview/diagramscene/diagramitem.cpp +++ b/examples/graphicsview/diagramscene/diagramitem.cpp @@ -82,6 +82,7 @@ DiagramItem::DiagramItem(DiagramType diagramType, QMenu *contextMenu, setPolygon(myPolygon); setFlag(QGraphicsItem::ItemIsMovable, true); setFlag(QGraphicsItem::ItemIsSelectable, true); + setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); } //! [0] -- cgit v0.12 From f7d61dab69308f0993c8a5f2232226d1713ac4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 22 Apr 2010 09:58:03 +0200 Subject: Removed bezier intersection code in path clipper. The bezier intersections caused a lot of numerical stability issues, so instead we now convert them to line segments. In the future it might be possible to keep track of which bezier curve a line segment originated from and reconstruct the bezier curves at the end. Task-number: QTBUG-8035 Reviewed-by: Gunnar Sletta --- src/gui/painting/qbezier.cpp | 305 ---------------- src/gui/painting/qbezier_p.h | 9 - src/gui/painting/qpainterpath.cpp | 9 +- src/gui/painting/qpathclipper.cpp | 508 +++++---------------------- src/gui/painting/qpathclipper_p.h | 30 +- src/s60installs/bwins/QtGuiu.def | 6 +- src/s60installs/eabi/QtGuiu.def | 6 +- tests/auto/qpathclipper/tst_qpathclipper.cpp | 50 --- 8 files changed, 98 insertions(+), 825 deletions(-) diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp index a08c79e..7ff2a37 100644 --- a/src/gui/painting/qbezier.cpp +++ b/src/gui/painting/qbezier.cpp @@ -612,88 +612,6 @@ give_up: return o - curveSegments; } -#if 0 -static inline bool IntersectBB(const QBezier &a, const QBezier &b) -{ - return a.bounds().intersects(b.bounds()); -} -#else -static int IntersectBB(const QBezier &a, const QBezier &b) -{ - // Compute bounding box for a - qreal minax, maxax, minay, maxay; - if (a.x1 > a.x4) // These are the most likely to be extremal - minax = a.x4, maxax = a.x1; - else - minax = a.x1, maxax = a.x4; - - if (a.x3 < minax) - minax = a.x3; - else if (a.x3 > maxax) - maxax = a.x3; - - if (a.x2 < minax) - minax = a.x2; - else if (a.x2 > maxax) - maxax = a.x2; - - if (a.y1 > a.y4) - minay = a.y4, maxay = a.y1; - else - minay = a.y1, maxay = a.y4; - - if (a.y3 < minay) - minay = a.y3; - else if (a.y3 > maxay) - maxay = a.y3; - - if (a.y2 < minay) - minay = a.y2; - else if (a.y2 > maxay) - maxay = a.y2; - - // Compute bounding box for b - qreal minbx, maxbx, minby, maxby; - if (b.x1 > b.x4) - minbx = b.x4, maxbx = b.x1; - else - minbx = b.x1, maxbx = b.x4; - - if (b.x3 < minbx) - minbx = b.x3; - else if (b.x3 > maxbx) - maxbx = b.x3; - - if (b.x2 < minbx) - minbx = b.x2; - else if (b.x2 > maxbx) - maxbx = b.x2; - - if (b.y1 > b.y4) - minby = b.y4, maxby = b.y1; - else - minby = b.y1, maxby = b.y4; - - if (b.y3 < minby) - minby = b.y3; - else if (b.y3 > maxby) - maxby = b.y3; - - if (b.y2 < minby) - minby = b.y2; - else if (b.y2 > maxby) - maxby = b.y2; - - // Test bounding box of b against bounding box of a - if ((minax > maxbx) || (minay > maxby) // Not >= : need boundary case - || (minbx > maxax) || (minby > maxay)) - return 0; // they don't intersect - else - return 1; // they intersect -} -#endif - - #ifdef QDEBUG_BEZIER static QDebug operator<<(QDebug dbg, const QBezier &bz) { @@ -705,193 +623,6 @@ static QDebug operator<<(QDebug dbg, const QBezier &bz) } #endif -static bool RecursivelyIntersect(const QBezier &a, qreal t0, qreal t1, int deptha, - const QBezier &b, qreal u0, qreal u1, int depthb, - QVector > *t) -{ -#ifdef QDEBUG_BEZIER - static int I = 0; - int currentD = I; - fprintf(stderr, "%d) t0 = %lf, t1 = %lf, deptha = %d\n" - "u0 = %lf, u1 = %lf, depthb = %d\n", I++, t0, t1, deptha, - u0, u1, depthb); -#endif - if (deptha > 0) { - QBezier A[2]; - a.split(&A[0], &A[1]); - qreal tmid = (t0+t1)*0.5; - //qDebug()<<"\t1)"< 0) { - QBezier B[2]; - b.split(&B[0], &B[1]); - //qDebug()<<"\t3)"<isEmpty() : false; - } else { - if (IntersectBB(A[0], b)) { - //fprintf(stderr, "\t 5 from %d\n", currentD); - if (RecursivelyIntersect(A[0], t0, tmid, deptha, - b, u0, u1, depthb, - t) && !t) - return true; - } - if (IntersectBB(A[1], b)) { - //fprintf(stderr, "\t 6 from %d\n", currentD); - if (RecursivelyIntersect(A[1], tmid, t1, deptha, - b, u0, u1, depthb, - t) && !t) - return true; - } - return t ? !t->isEmpty() : false; - } - } else { - if (depthb > 0) { - QBezier B[2]; - b.split(&B[0], &B[1]); - qreal umid = (u0 + u1)*0.5; - depthb--; - if (IntersectBB(a, B[0])) { - //fprintf(stderr, "\t 7 from %d\n", currentD); - if (RecursivelyIntersect(a, t0, t1, deptha, - B[0], u0, umid, depthb, - t) && !t) - return true; - } - if (IntersectBB(a, B[1])) { - //fprintf(stderr, "\t 8 from %d\n", currentD); - if (RecursivelyIntersect(a, t0, t1, deptha, - B[1], umid, u1, depthb, - t) && !t) - return true; - } - return t ? !t->isEmpty() : false; - } - else { - // Both segments are fully subdivided; now do line segments - qreal xlk = a.x4 - a.x1; - qreal ylk = a.y4 - a.y1; - qreal xnm = b.x4 - b.x1; - qreal ynm = b.y4 - b.y1; - qreal xmk = b.x1 - a.x1; - qreal ymk = b.y1 - a.y1; - qreal det = xnm * ylk - ynm * xlk; - if (1.0 + det == 1.0) { - return false; - } else { - qreal detinv = 1.0 / det; - qreal rs = (xnm * ymk - ynm *xmk) * detinv; - qreal rt = (xlk * ymk - ylk * xmk) * detinv; - if ((rs < 0.0) || (rs > 1.0) || (rt < 0.0) || (rt > 1.0)) - return false; - - if (t) { - const qreal alpha_a = t0 + rs * (t1 - t0); - const qreal alpha_b = u0 + rt * (u1 - u0); - - *t << qMakePair(alpha_a, alpha_b); - } - - return true; - } - } - } -} - -QVector< QPair > QBezier::findIntersections(const QBezier &a, const QBezier &b) -{ - QVector< QPair > v(2); - findIntersections(a, b, &v); - return v; -} - -bool QBezier::findIntersections(const QBezier &a, const QBezier &b, - QVector > *t) -{ - if (IntersectBB(a, b)) { - QPointF la1(qFabs((a.x3 - a.x2) - (a.x2 - a.x1)), - qFabs((a.y3 - a.y2) - (a.y2 - a.y1))); - QPointF la2(qFabs((a.x4 - a.x3) - (a.x3 - a.x2)), - qFabs((a.y4 - a.y3) - (a.y3 - a.y2))); - QPointF la; - if (la1.x() > la2.x()) la.setX(la1.x()); else la.setX(la2.x()); - if (la1.y() > la2.y()) la.setY(la1.y()); else la.setY(la2.y()); - QPointF lb1(qFabs((b.x3 - b.x2) - (b.x2 - b.x1)), - qFabs((b.y3 - b.y2) - (b.y2 - b.y1))); - QPointF lb2(qFabs((b.x4 - b.x3) - (b.x3 - b.x2)), - qFabs((b.y4 - b.y3) - (b.y3 - b.y2))); - QPointF lb; - if (lb1.x() > lb2.x()) lb.setX(lb1.x()); else lb.setX(lb2.x()); - if (lb1.y() > lb2.y()) lb.setY(lb1.y()); else lb.setY(lb2.y()); - qreal l0; - if (la.x() > la.y()) - l0 = la.x(); - else - l0 = la.y(); - int ra; - if (l0 * 0.75 * M_SQRT2 + 1.0 == 1.0) - ra = 0; - else - ra = qCeil(log4(M_SQRT2 * 6.0 / 8.0 * INV_EPS * l0)); - if (lb.x() > lb.y()) - l0 = lb.x(); - else - l0 = lb.y(); - int rb; - if (l0 * 0.75 * M_SQRT2 + 1.0 == 1.0) - rb = 0; - else - rb = qCeil(log4(M_SQRT2 * 6.0 / 8.0 * INV_EPS * l0)); - - // if qreal is float then halve the number of subdivisions - if (sizeof(qreal) == 4) { - ra /= 2; - rb /= 2; - } - - return RecursivelyIntersect(a, 0., 1., ra, b, 0., 1., rb, t); - } - - //Don't sort here because it breaks the orders of corresponding - // intersections points. this way t's at the same locations correspond - // to the same intersection point. - //qSort(parameters[0].begin(), parameters[0].end(), qLess()); - //qSort(parameters[1].begin(), parameters[1].end(), qLess()); - - return false; -} - static inline void splitBezierAt(const QBezier &bez, qreal t, QBezier *left, QBezier *right) { @@ -920,42 +651,6 @@ static inline void splitBezierAt(const QBezier &bez, qreal t, right->y4 = bez.y4; } -QVector< QList > QBezier::splitAtIntersections(QBezier &b) -{ - QVector< QList > curves(2); - - QVector< QPair > allInters = findIntersections(*this, b); - - QList inters1; - QList inters2; - - for (int i = 0; i < allInters.size(); ++i) { - inters1 << allInters[i].first; - inters2 << allInters[i].second; - } - - qSort(inters1.begin(), inters1.end(), qLess()); - qSort(inters2.begin(), inters2.end(), qLess()); - - Q_ASSERT(inters1.count() == inters2.count()); - - int i; - for (i = 0; i < inters1.count(); ++i) { - qreal t1 = inters1.at(i); - qreal t2 = inters2.at(i); - - QBezier curve1, curve2; - parameterSplitLeft(t1, &curve1); - b.parameterSplitLeft(t2, &curve2); - curves[0].append(curve1); - curves[0].append(curve2); - } - curves[0].append(*this); - curves[1].append(b); - - return curves; -} - qreal QBezier::length(qreal error) const { qreal length = 0.0; diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h index f015ea8..846635f 100644 --- a/src/gui/painting/qbezier_p.h +++ b/src/gui/painting/qbezier_p.h @@ -111,16 +111,7 @@ public: int shifted(QBezier *curveSegments, int maxSegmets, qreal offset, float threshold) const; - QVector< QList > splitAtIntersections(QBezier &a); - QBezier bezierOnInterval(qreal t0, qreal t1) const; - - static QVector< QPair > findIntersections(const QBezier &a, - const QBezier &b); - - static bool findIntersections(const QBezier &a, const QBezier &b, - QVector > *t); - QBezier getSubRange(qreal t0, qreal t1) const; qreal x1, y1, x2, y2, x3, y3, x4, y4; diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 965b84c..f5a698e 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -3167,6 +3167,8 @@ void QPainterPath::addRoundRect(const QRectF &r, int xRnd, int yRnd) Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed. + Bezier curves may be flattened to line segments due to numerical instability of + doing bezier curve intersections. \sa intersected(), subtracted() */ @@ -3182,6 +3184,8 @@ QPainterPath QPainterPath::united(const QPainterPath &p) const \since 4.3 Returns a path which is the intersection of this path's fill area and \a p's fill area. + Bezier curves may be flattened to line segments due to numerical instability of + doing bezier curve intersections. */ QPainterPath QPainterPath::intersected(const QPainterPath &p) const { @@ -3198,7 +3202,8 @@ QPainterPath QPainterPath::intersected(const QPainterPath &p) const Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed. - + Bezier curves may be flattened to line segments due to numerical instability of + doing bezier curve intersections. */ QPainterPath QPainterPath::subtracted(const QPainterPath &p) const { @@ -3227,6 +3232,8 @@ QPainterPath QPainterPath::subtractedInverted(const QPainterPath &p) const Returns a simplified version of this path. This implies merging all subpaths that intersect, and returning a path containing no intersecting edges. Consecutive parallel lines will also be merged. The simplified path will always use the default fill rule, Qt::OddEvenFill. + Bezier curves may be flattened to line segments due to numerical instability of + doing bezier curve intersections. */ QPainterPath QPainterPath::simplified() const { diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 00e74ba..4d319a4 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -105,22 +105,10 @@ public: bool hasIntersections(const QPathSegments &a, const QPathSegments &b) const; private: - void intersectBeziers(const QBezier &one, const QBezier &two, QVector > &t, QDataBuffer &intersections); void intersectLines(const QLineF &a, const QLineF &b, QDataBuffer &intersections); - - bool beziersIntersect(const QBezier &one, const QBezier &two) const; bool linesIntersect(const QLineF &a, const QLineF &b) const; }; -bool QIntersectionFinder::beziersIntersect(const QBezier &one, const QBezier &two) const -{ - return (comparePoints(one.pt1(), two.pt1()) && comparePoints(one.pt2(), two.pt2()) - && comparePoints(one.pt3(), two.pt3()) && comparePoints(one.pt4(), two.pt4())) - || (comparePoints(one.pt1(), two.pt4()) && comparePoints(one.pt2(), two.pt3()) - && comparePoints(one.pt3(), two.pt2()) && comparePoints(one.pt4(), two.pt1())) - || QBezier::findIntersections(one, two, 0); -} - bool QIntersectionFinder::linesIntersect(const QLineF &a, const QLineF &b) const { const QPointF p1 = a.p1(); @@ -193,48 +181,6 @@ bool QIntersectionFinder::linesIntersect(const QLineF &a, const QLineF &b) const return tq >= 0 && tq <= 1; } -void QIntersectionFinder::intersectBeziers(const QBezier &one, const QBezier &two, QVector > &t, QDataBuffer &intersections) -{ - if ((comparePoints(one.pt1(), two.pt1()) && comparePoints(one.pt2(), two.pt2()) - && comparePoints(one.pt3(), two.pt3()) && comparePoints(one.pt4(), two.pt4())) - || (comparePoints(one.pt1(), two.pt4()) && comparePoints(one.pt2(), two.pt3()) - && comparePoints(one.pt3(), two.pt2()) && comparePoints(one.pt4(), two.pt1()))) { - - return; - } - - t.clear(); - - if (!QBezier::findIntersections(one, two, &t)) - return; - - int count = t.size(); - - for (int i = 0; i < count; ++i) { - qreal alpha_p = t.at(i).first; - qreal alpha_q = t.at(i).second; - - QPointF pt; - if (qFuzzyIsNull(alpha_p)) { - pt = one.pt1(); - } else if (qFuzzyIsNull(alpha_p - 1)) { - pt = one.pt4(); - } else if (qFuzzyIsNull(alpha_q)) { - pt = two.pt1(); - } else if (qFuzzyIsNull(alpha_q - 1)) { - pt = two.pt4(); - } else { - pt = one.pointAt(alpha_p); - } - - QIntersection intersection; - intersection.alphaA = alpha_p; - intersection.alphaB = alpha_q; - intersection.pos = pt; - intersections.add(intersection); - } -} - void QIntersectionFinder::intersectLines(const QLineF &a, const QLineF &b, QDataBuffer &intersections) { const QPointF p1 = a.p1(); @@ -357,19 +303,8 @@ void QIntersectionFinder::intersectLines(const QLineF &a, const QLineF &b, QData intersections.add(intersection); } -static const QBezier bezierFromLine(const QLineF &line) -{ - const QPointF p1 = line.p1(); - const QPointF p2 = line.p2(); - const QPointF delta = (p2 - p1) / 3; - return QBezier::fromPoints(p1, p1 + delta, p1 + 2 * delta, p2); -} - bool QIntersectionFinder::hasIntersections(const QPathSegments &a, const QPathSegments &b) const { - QBezier tempA; - QBezier tempB; - if (a.segments() == 0 || b.segments() == 0) return false; @@ -391,9 +326,6 @@ bool QIntersectionFinder::hasIntersections(const QPathSegments &a, const QPathSe QRectF rb(minX, minY, maxX - minX, maxY - minY); for (int i = 0; i < a.segments(); ++i) { - const QBezier *bezierA = a.bezierAt(i); - bool isBezierA = bezierA != 0; - const QRectF &r1 = a.elementBounds(i); if (r1.left() > rb.right() || rb.left() > r1.right()) @@ -409,28 +341,8 @@ bool QIntersectionFinder::hasIntersections(const QPathSegments &a, const QPathSe if (r1.top() > r2.bottom() || r2.top() > r1.bottom()) continue; - bool isBezierB = b.bezierAt(j) != 0; - - if (isBezierA || isBezierB) { - const QBezier *bezierB; - if (isBezierB) { - bezierB = b.bezierAt(j); - } else { - tempB = bezierFromLine(b.lineAt(j)); - bezierB = &tempB; - } - - if (!bezierA) { - tempA = bezierFromLine(a.lineAt(i)); - bezierA = &tempA; - } - - if (beziersIntersect(*bezierA, *bezierB)) - return true; - } else { - if (linesIntersect(a.lineAt(i), b.lineAt(j))) - return true; - } + if (linesIntersect(a.lineAt(i), b.lineAt(j))) + return true; } } @@ -439,16 +351,10 @@ bool QIntersectionFinder::hasIntersections(const QPathSegments &a, const QPathSe void QIntersectionFinder::produceIntersections(QPathSegments &segments) { - QBezier tempA; - QBezier tempB; - QVector > t; QDataBuffer intersections; for (int i = 0; i < segments.segments(); ++i) { - const QBezier *bezierA = segments.bezierAt(i); - bool isBezierA = bezierA != 0; - const QRectF &r1 = segments.elementBounds(i); for (int j = 0; j < i; ++j) { @@ -461,29 +367,10 @@ void QIntersectionFinder::produceIntersections(QPathSegments &segments) intersections.reset(); - bool isBezierB = segments.bezierAt(j) != 0; - - if (isBezierA || isBezierB) { - const QBezier *bezierB; - if (isBezierB) { - bezierB = segments.bezierAt(j); - } else { - tempB = bezierFromLine(segments.lineAt(j)); - bezierB = &tempB; - } - - if (!bezierA) { - tempA = bezierFromLine(segments.lineAt(i)); - bezierA = &tempA; - } + const QLineF lineA = segments.lineAt(i); + const QLineF lineB = segments.lineAt(j); - intersectBeziers(*bezierA, *bezierB, t, intersections); - } else { - const QLineF lineA = segments.lineAt(i); - const QLineF lineB = segments.lineAt(j); - - intersectLines(lineA, lineB, intersections); - } + intersectLines(lineA, lineB, intersections); for (int k = 0; k < intersections.size(); ++k) { QPathSegments::Intersection i_isect, j_isect; @@ -731,53 +618,34 @@ void QWingedEdge::intersectAndAdd() qSort(intersections.data(), intersections.data() + intersections.size()); - const QBezier *bezier = m_segments.bezierAt(i); - if (bezier) { - int first = m_segments.segmentAt(i).va; - int second = m_segments.segmentAt(i).vb; + int first = m_segments.segmentAt(i).va; + int second = m_segments.segmentAt(i).vb; - qreal alpha = 0.0; - int last = first; - for (int j = 0; j < intersections.size(); ++j) { - const QPathSegments::Intersection &isect = intersections.at(j); + int last = first; + for (int j = 0; j < intersections.size(); ++j) { + const QPathSegments::Intersection &isect = intersections.at(j); - addBezierEdge(bezier, last, isect.vertex, alpha, isect.t, pathId); - - alpha = isect.t; - last = isect.vertex; - } - - addBezierEdge(bezier, last, second, alpha, 1.0, pathId); - } else { - int first = m_segments.segmentAt(i).va; - int second = m_segments.segmentAt(i).vb; - - int last = first; - for (int j = 0; j < intersections.size(); ++j) { - const QPathSegments::Intersection &isect = intersections.at(j); - - QPathEdge *ep = edge(addEdge(last, isect.vertex)); - - if (ep) { - const int dir = m_segments.pointAt(last).y() < m_segments.pointAt(isect.vertex).y() ? 1 : -1; - if (pathId == 0) - ep->windingA += dir; - else - ep->windingB += dir; - } - - last = isect.vertex; - } - - QPathEdge *ep = edge(addEdge(last, second)); + QPathEdge *ep = edge(addEdge(last, isect.vertex)); if (ep) { - const int dir = m_segments.pointAt(last).y() < m_segments.pointAt(second).y() ? 1 : -1; + const int dir = m_segments.pointAt(last).y() < m_segments.pointAt(isect.vertex).y() ? 1 : -1; if (pathId == 0) ep->windingA += dir; else ep->windingB += dir; } + + last = isect.vertex; + } + + QPathEdge *ep = edge(addEdge(last, second)); + + if (ep) { + const int dir = m_segments.pointAt(last).y() < m_segments.pointAt(second).y() ? 1 : -1; + if (pathId == 0) + ep->windingA += dir; + else + ep->windingB += dir; } } } @@ -832,7 +700,6 @@ static bool isLine(const QBezier &bezier) void QPathSegments::setPath(const QPainterPath &path) { m_points.reset(); - m_beziers.reset(); m_intersections.reset(); m_segments.reset(); @@ -845,6 +712,9 @@ void QPathSegments::addPath(const QPainterPath &path) { int firstSegment = m_segments.size(); + QRectF pathBounds = path.boundingRect(); + qreal invPathScale = 1 / qMax(pathBounds.width(), pathBounds.height()); + bool hasMoveTo = false; int lastMoveTo = 0; int last = 0; @@ -879,8 +749,26 @@ void QPathSegments::addPath(const QPainterPath &path) if (isLine(bezier)) { m_segments << Segment(m_pathId, last, current); } else { - m_segments << Segment(m_pathId, last, current, m_beziers.size()); - m_beziers << bezier; + QRectF bounds = bezier.bounds(); + + qreal segmentScale = qMax(bounds.width(), bounds.height()); + + // threshold based on same algorithm as in qtriangulatingstroker.cpp + int threshold = qMin(64, segmentScale * invPathScale * (512 * 3.14f / 6)); + if (threshold < 3) threshold = 3; + qreal one_over_threshold_minus_1 = qreal(1) / (threshold - 1); + + for (int t = 1; t < threshold - 1; ++t) { + currentPoint = bezier.pointAt(t * one_over_threshold_minus_1); + + int index = m_points.size(); + m_segments << Segment(m_pathId, last, index); + last = index; + + m_points << currentPoint; + } + + m_segments << Segment(m_pathId, last, current); } } last = current; @@ -896,24 +784,19 @@ void QPathSegments::addPath(const QPainterPath &path) m_segments << Segment(m_pathId, last, lastMoveTo); for (int i = firstSegment; i < m_segments.size(); ++i) { - const QBezier *bezier = bezierAt(i); - if (bezier) { - m_segments.at(i).bounds = bezier->bounds(); - } else { - const QLineF line = lineAt(i); + const QLineF line = lineAt(i); - qreal x1 = line.p1().x(); - qreal y1 = line.p1().y(); - qreal x2 = line.p2().x(); - qreal y2 = line.p2().y(); + qreal x1 = line.p1().x(); + qreal y1 = line.p1().y(); + qreal x2 = line.p2().x(); + qreal y2 = line.p2().y(); - if (x2 < x1) - qSwap(x1, x2); - if (y2 < y1) - qSwap(y1, y2); + if (x2 < x1) + qSwap(x1, x2); + if (y2 < y1) + qSwap(y1, y2); - m_segments.at(i).bounds = QRectF(x1, y1, x2 - x1, y2 - y1); - } + m_segments.at(i).bounds = QRectF(x1, y1, x2 - x1, y2 - y1); } ++m_pathId; @@ -948,28 +831,17 @@ static inline QPointF tangentAt(const QWingedEdge &list, int vi, int ei) const QPathEdge *ep = list.edge(ei); Q_ASSERT(ep); - qreal t; qreal sign; if (ep->first == vi) { - t = ep->t0; sign = 1; } else { - t = ep->t1; sign = -1; } - QPointF normal; - if (ep->bezier) { - normal = ep->bezier->derivedAt(t); - - if (qFuzzyIsNull(normal.x()) && qFuzzyIsNull(normal.y())) - normal = ep->bezier->secondDerivedAt(t); - } else { - const QPointF a = *list.vertex(ep->first); - const QPointF b = *list.vertex(ep->second); - normal = b - a; - } + const QPointF a = *list.vertex(ep->first); + const QPointF b = *list.vertex(ep->second); + QPointF normal = b - a; return normalize(sign * normal); } @@ -979,83 +851,9 @@ static inline QPointF midPoint(const QWingedEdge &list, int ei) const QPathEdge *ep = list.edge(ei); Q_ASSERT(ep); - if (ep->bezier) { - return ep->bezier->pointAt(0.5 * (ep->t0 + ep->t1)); - } else { - const QPointF a = *list.vertex(ep->first); - const QPointF b = *list.vertex(ep->second); - return a + 0.5 * (b - a); - } -} - -static QBezier transform(const QBezier &bezier, const QPointF &xAxis, const QPointF &yAxis, const QPointF &origin) -{ - QPointF points[4] = { - bezier.pt1(), - bezier.pt2(), - bezier.pt3(), - bezier.pt4() - }; - - for (int i = 0; i < 4; ++i) { - const QPointF p = points[i] - origin; - - points[i].rx() = dot(xAxis, p); - points[i].ry() = dot(yAxis, p); - } - - return QBezier::fromPoints(points[0], points[1], points[2], points[3]); -} - -static bool isLeftOf(const QWingedEdge &list, int vi, int ai, int bi) -{ - const QPathEdge *ap = list.edge(ai); - const QPathEdge *bp = list.edge(bi); - - Q_ASSERT(ap); - Q_ASSERT(bp); - - if (!(ap->bezier || bp->bezier)) - return false; - - const QPointF tangent = tangentAt(list, vi, ai); - const QPointF normal(tangent.y(), -tangent.x()); - - const QPointF origin = *list.vertex(vi); - - const QPointF dpA = midPoint(list, ai) - origin; - const QPointF dpB = midPoint(list, bi) - origin; - - qreal xA = dot(normal, dpA); - qreal xB = dot(normal, dpB); - - if (xA <= 0 && xB >= 0) - return true; - - if (xA >= 0 && xB <= 0) - return false; - - if (!ap->bezier) - return xB > 0; - - if (!bp->bezier) - return xA < 0; - - // both are beziers on the same side of the tangent - - // transform the beziers into the local coordinate system - // such that positive y is along the tangent, and positive x is along the normal - - QBezier bezierA = transform(*ap->bezier, normal, tangent, origin); - QBezier bezierB = transform(*bp->bezier, normal, tangent, origin); - - qreal y = qMin(bezierA.pointAt(0.5 * (ap->t0 + ap->t1)).y(), - bezierB.pointAt(0.5 * (bp->t0 + bp->t1)).y()); - - xA = bezierA.pointAt(bezierA.tForY(ap->t0, ap->t1, y)).x(); - xB = bezierB.pointAt(bezierB.tForY(bp->t0, bp->t1, y)).x(); - - return xA < xB; + const QPointF a = *list.vertex(ep->first); + const QPointF b = *list.vertex(ep->second); + return a + 0.5 * (b - a); } QWingedEdge::TraversalStatus QWingedEdge::findInsertStatus(int vi, int ei) const @@ -1084,7 +882,6 @@ QWingedEdge::TraversalStatus QWingedEdge::findInsertStatus(int vi, int ei) const status.flip(); Q_ASSERT(edge(status.edge)->vertex(status.direction) == vi); - qreal d2 = delta(vi, ei, status.edge); #ifdef QDEBUG_CLIPPER @@ -1092,8 +889,7 @@ QWingedEdge::TraversalStatus QWingedEdge::findInsertStatus(int vi, int ei) const qDebug() << "Delta to edge" << status.edge << d2 << ", angles: " << op->angle << op->invAngle; #endif - if (!(qFuzzyIsNull(d2) && isLeftOf(*this, vi, status.edge, ei)) - && (d2 < d || (qFuzzyCompare(d2, d) && isLeftOf(*this, vi, status.edge, position)))) { + if (d2 < d) { position = status.edge; d = d2; } @@ -1210,15 +1006,15 @@ static qreal computeAngle(const QPointF &v) #endif } -int QWingedEdge::addEdge(const QPointF &a, const QPointF &b, const QBezier *bezier, qreal t0, qreal t1) +int QWingedEdge::addEdge(const QPointF &a, const QPointF &b) { int fi = insert(a); int si = insert(b); - return addEdge(fi, si, bezier, t0, t1); + return addEdge(fi, si); } -int QWingedEdge::addEdge(int fi, int si, const QBezier *bezier, qreal t0, qreal t1) +int QWingedEdge::addEdge(int fi, int si) { if (fi == si) return -1; @@ -1236,29 +1032,11 @@ int QWingedEdge::addEdge(int fi, int si, const QBezier *bezier, qreal t0, qreal QPathEdge *ep = edge(ei); - ep->bezier = bezier; - ep->t0 = t0; - ep->t1 = t1; - - if (bezier) { - QPointF aTangent = bezier->derivedAt(t0); - QPointF bTangent = -bezier->derivedAt(t1); - - if (qFuzzyIsNull(aTangent.x()) && qFuzzyIsNull(aTangent.y())) - aTangent = bezier->secondDerivedAt(t0); - - if (qFuzzyIsNull(bTangent.x()) && qFuzzyIsNull(bTangent.y())) - bTangent = bezier->secondDerivedAt(t1); - - ep->angle = computeAngle(aTangent); - ep->invAngle = computeAngle(bTangent); - } else { - const QPointF tangent = QPointF(*sp) - QPointF(*fp); - ep->angle = computeAngle(tangent); - ep->invAngle = ep->angle + 64; - if (ep->invAngle >= 128) - ep->invAngle -= 128; - } + const QPointF tangent = QPointF(*sp) - QPointF(*fp); + ep->angle = computeAngle(tangent); + ep->invAngle = ep->angle + 64; + if (ep->invAngle >= 128) + ep->invAngle -= 128; QPathVertex *vertices[2] = { fp, sp }; QPathEdge::Direction dirs[2] = { QPathEdge::Backward, QPathEdge::Forward }; @@ -1313,74 +1091,6 @@ int QWingedEdge::addEdge(int fi, int si, const QBezier *bezier, qreal t0, qreal return ei; } -void QWingedEdge::addBezierEdge(const QBezier *bezier, int vertexA, int vertexB, qreal alphaA, qreal alphaB, int path) -{ - if (qFuzzyCompare(alphaA, alphaB)) - return; - - qreal alphaMid = (alphaA + alphaB) * 0.5; - - qreal s0 = 0; - qreal s1 = 1; - int count = bezier->stationaryYPoints(s0, s1); - - m_splitPoints.clear(); - m_splitPoints << alphaA; - m_splitPoints << alphaMid; - m_splitPoints << alphaB; - - if (count > 0 && !qFuzzyCompare(s0, alphaA) && !qFuzzyCompare(s0, alphaMid) && !qFuzzyCompare(s0, alphaB) && s0 > alphaA && s0 < alphaB) - m_splitPoints << s0; - - if (count > 1 && !qFuzzyCompare(s1, alphaA) && !qFuzzyCompare(s1, alphaMid) && !qFuzzyCompare(s1, alphaB) && s1 > alphaA && s1 < alphaB) - m_splitPoints << s1; - - if (count > 0) - qSort(m_splitPoints.begin(), m_splitPoints.end()); - - int last = vertexA; - for (int i = 0; i < m_splitPoints.size() - 1; ++i) { - const qreal t0 = m_splitPoints[i]; - const qreal t1 = m_splitPoints[i+1]; - - int current; - if ((i + 1) == (m_splitPoints.size() - 1)) { - current = vertexB; - } else { - current = insert(bezier->pointAt(t1)); - } - - QPathEdge *ep = edge(addEdge(last, current, bezier, t0, t1)); - - if (ep) { - const int dir = m_vertices.at(last).y < m_vertices.at(current).y ? 1 : -1; - if (path == 0) - ep->windingA += dir; - else - ep->windingB += dir; - } - - last = current; - } -} - -void QWingedEdge::addBezierEdge(const QBezier *bezier, const QPointF &a, const QPointF &b, qreal alphaA, qreal alphaB, int path) -{ - if (qFuzzyCompare(alphaA, alphaB)) - return; - - if (comparePoints(a, b)) { - int v = insert(a); - - addBezierEdge(bezier, v, v, alphaA, alphaB, path); - } else { - int va = insert(a); - int vb = insert(b); - - addBezierEdge(bezier, va, vb, alphaA, alphaB, path); - } -} - int QWingedEdge::insert(const QPathVertex &vertex) { if (!m_vertices.isEmpty()) { @@ -1429,37 +1139,12 @@ static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge status.traversal = traversal; status.direction = QPathEdge::Forward; - const QBezier *bezier = 0; - qreal t0 = 1; - qreal t1 = 0; - bool forward = true; - path.moveTo(*list.vertex(list.edge(edge)->first)); do { const QPathEdge *ep = list.edge(status.edge); - if (ep->bezier != bezier || (bezier && t0 != ep->t1 && t1 != ep->t0)) { - if (bezier) { - QBezier sub = bezier->bezierOnInterval(t0, t1); - - if (forward) - path.cubicTo(sub.pt2(), sub.pt3(), sub.pt4()); - else - path.cubicTo(sub.pt3(), sub.pt2(), sub.pt1()); - } - - bezier = ep->bezier; - t0 = 1; - t1 = 0; - forward = status.direction == QPathEdge::Forward; - } - - if (ep->bezier) { - t0 = qMin(t0, ep->t0); - t1 = qMax(t1, ep->t1); - } else - addLineTo(path, *list.vertex(ep->vertex(status.direction))); + addLineTo(path, *list.vertex(ep->vertex(status.direction))); if (status.traversal == QPathEdge::LeftTraversal) ep->flag &= ~16; @@ -1468,14 +1153,6 @@ static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge status = list.next(status); } while (status.edge != edge); - - if (bezier) { - QBezier sub = bezier->bezierOnInterval(t0, t1); - if (forward) - path.cubicTo(sub.pt2(), sub.pt3(), sub.pt4()); - else - path.cubicTo(sub.pt3(), sub.pt2(), sub.pt1()); - } } void QWingedEdge::simplify() @@ -1559,7 +1236,7 @@ bool QPathClipper::intersect() } } - return false; + return !clipPath.intersected(subjectPath).isEmpty(); } bool QPathClipper::contains() @@ -1596,7 +1273,7 @@ bool QPathClipper::contains() } } - return true; + return clipPath.subtracted(subjectPath).isEmpty(); } QPathClipper::QPathClipper(const QPainterPath &subject, @@ -1937,25 +1614,10 @@ bool QWingedEdge::isInside(qreal x, qreal y) const QPointF b = *vertex(ep->second); if ((a.y() < y && b.y() > y) || (a.y() > y && b.y() < y)) { - if (ep->bezier) { - qreal maxX = qMax(a.x(), qMax(b.x(), qMax(ep->bezier->x2, ep->bezier->x3))); - qreal minX = qMin(a.x(), qMin(b.x(), qMin(ep->bezier->x2, ep->bezier->x3))); - - if (minX > x) { - winding += w; - } else if (maxX > x) { - const qreal t = ep->bezier->tForY(ep->t0, ep->t1, y); - const qreal intersection = ep->bezier->pointAt(t).x(); - - if (intersection > x) - winding += w; - } - } else { - qreal intersectionX = a.x() + (b.x() - a.x()) * (y - a.y()) / (b.y() - a.y()); + qreal intersectionX = a.x() + (b.x() - a.x()) * (y - a.y()) / (b.y() - a.y()); - if (intersectionX > x) - winding += w; - } + if (intersectionX > x) + winding += w; } } @@ -1971,17 +1633,9 @@ static QVector findCrossings(const QWingedEdge &list, qreal y) QPointF b = *list.vertex(edge->second); if ((a.y() < y && b.y() > y) || (a.y() > y && b.y() < y)) { - if (edge->bezier) { - const qreal t = edge->bezier->tForY(edge->t0, edge->t1, y); - const qreal intersection = edge->bezier->pointAt(t).x(); - - const QCrossingEdge edge = { i, intersection }; - crossings << edge; - } else { - const qreal intersection = a.x() + (b.x() - a.x()) * (y - a.y()) / (b.y() - a.y()); - const QCrossingEdge edge = { i, intersection }; - crossings << edge; - } + const qreal intersection = a.x() + (b.x() - a.x()) * (y - a.y()) / (b.y() - a.y()); + const QCrossingEdge edge = { i, intersection }; + crossings << edge; } } return crossings; diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h index b42dc1d..7962400 100644 --- a/src/gui/painting/qpathclipper_p.h +++ b/src/gui/painting/qpathclipper_p.h @@ -151,10 +151,6 @@ public: qreal angle; qreal invAngle; - const QBezier *bezier; - qreal t0; - qreal t1; - int next(Traversal traversal, Direction direction) const; void setNext(Traversal traversal, Direction direction, int next); @@ -182,9 +178,8 @@ public: }; struct Segment { - Segment(int pathId, int vertexA, int vertexB, int bezierIndex = -1) + Segment(int pathId, int vertexA, int vertexB) : path(pathId) - , bezier(bezierIndex) , va(vertexA) , vb(vertexB) , intersection(-1) @@ -192,7 +187,6 @@ public: } int path; - int bezier; // vertices int va; @@ -216,7 +210,6 @@ public: const Segment &segmentAt(int index) const; const QLineF lineAt(int index) const; - const QBezier *bezierAt(int index) const; const QRectF &elementBounds(int index) const; int pathId(int index) const; @@ -231,7 +224,6 @@ public: private: QDataBuffer m_points; QDataBuffer m_segments; - QDataBuffer m_beziers; QDataBuffer m_intersections; int m_pathId; @@ -272,8 +264,8 @@ public: TraversalStatus next(const TraversalStatus &status) const; - int addEdge(const QPointF &a, const QPointF &b, const QBezier *bezier = 0, qreal t0 = 0, qreal t1 = 1); - int addEdge(int vertexA, int vertexB, const QBezier *bezier = 0, qreal t0 = 0, qreal t1 = 1); + int addEdge(const QPointF &a, const QPointF &b); + int addEdge(int vertexA, int vertexB); bool isInside(qreal x, qreal y) const; @@ -285,11 +277,7 @@ private: void printNode(int i, FILE *handle); - QBezier bezierFromIndex(int index) const; - void removeEdge(int ei); - void addBezierEdge(const QBezier *bezier, const QPointF &a, const QPointF &b, qreal alphaA, qreal alphaB, int path); - void addBezierEdge(const QBezier *bezier, int vertexA, int vertexB, qreal alphaA, qreal alphaB, int path); int insert(const QPathVertex &vertex); TraversalStatus findInsertStatus(int vertex, int edge) const; @@ -312,9 +300,6 @@ inline QPathEdge::QPathEdge(int a, int b) , second(b) , angle(0) , invAngle(0) - , bezier(0) - , t0(0) - , t1(0) { m_next[0][0] = -1; m_next[1][0] = -1; @@ -396,15 +381,6 @@ inline const QLineF QPathSegments::lineAt(int index) const return QLineF(m_points.at(segment.va), m_points.at(segment.vb)); } -inline const QBezier *QPathSegments::bezierAt(int index) const -{ - const Segment &segment = m_segments.at(index); - if (segment.bezier >= 0) - return &m_beziers.at(segment.bezier); - else - return 0; -} - inline const QRectF &QPathSegments::elementBounds(int index) const { return m_segments.at(index).bounds; diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index a948f73..1bcc619 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -4417,8 +4417,8 @@ EXPORTS ?findData@QComboBox@@QBEHABVQVariant@@HV?$QFlags@W4MatchFlag@Qt@@@@@Z @ 4416 NONAME ; int QComboBox::findData(class QVariant const &, int, class QFlags) const ?findFont@QFontDatabase@@CAPAVQFontEngine@@HPBVQFontPrivate@@ABUQFontDef@@@Z @ 4417 NONAME ; class QFontEngine * QFontDatabase::findFont(int, class QFontPrivate const *, struct QFontDef const &) ?findInMask@QLineControl@@ABEHH_N0VQChar@@@Z @ 4418 NONAME ; int QLineControl::findInMask(int, bool, bool, class QChar) const - ?findIntersections@QBezier@@SA?AV?$QVector@U?$QPair@MM@@@@ABV1@0@Z @ 4419 NONAME ; class QVector > QBezier::findIntersections(class QBezier const &, class QBezier const &) - ?findIntersections@QBezier@@SA_NABV1@0PAV?$QVector@U?$QPair@MM@@@@@Z @ 4420 NONAME ; bool QBezier::findIntersections(class QBezier const &, class QBezier const &, class QVector > *) + ?findIntersections@QBezier@@SA?AV?$QVector@U?$QPair@MM@@@@ABV1@0@Z @ 4419 NONAME ABSENT ; class QVector > QBezier::findIntersections(class QBezier const &, class QBezier const &) + ?findIntersections@QBezier@@SA_NABV1@0PAV?$QVector@U?$QPair@MM@@@@@Z @ 4420 NONAME ABSENT ; bool QBezier::findIntersections(class QBezier const &, class QBezier const &, class QVector > *) ?findItem@QTextEngine@@QBEHH@Z @ 4421 NONAME ; int QTextEngine::findItem(int) const ?findItems@QListWidget@@QBE?AV?$QList@PAVQListWidgetItem@@@@ABVQString@@V?$QFlags@W4MatchFlag@Qt@@@@@Z @ 4422 NONAME ; class QList QListWidget::findItems(class QString const &, class QFlags) const ?findItems@QStandardItemModel@@QBE?AV?$QList@PAVQStandardItem@@@@ABVQString@@V?$QFlags@W4MatchFlag@Qt@@@@H@Z @ 4423 NONAME ; class QList QStandardItemModel::findItems(class QString const &, class QFlags, int) const @@ -10501,7 +10501,7 @@ EXPORTS ?speed@QMovie@@QBEHXZ @ 10500 NONAME ; int QMovie::speed(void) const ?split@QBezier@@QBEXPAV1@0@Z @ 10501 NONAME ; void QBezier::split(class QBezier *, class QBezier *) const ?split@QItemSelection@@SAXABVQItemSelectionRange@@0PAV1@@Z @ 10502 NONAME ; void QItemSelection::split(class QItemSelectionRange const &, class QItemSelectionRange const &, class QItemSelection *) - ?splitAtIntersections@QBezier@@QAE?AV?$QVector@V?$QList@VQBezier@@@@@@AAV1@@Z @ 10503 NONAME ; class QVector > QBezier::splitAtIntersections(class QBezier &) + ?splitAtIntersections@QBezier@@QAE?AV?$QVector@V?$QList@VQBezier@@@@@@AAV1@@Z @ 10503 NONAME ABSENT ; class QVector > QBezier::splitAtIntersections(class QBezier &) ?splitCell@QTextTable@@QAEXHHHH@Z @ 10504 NONAME ; void QTextTable::splitCell(int, int, int, int) ?splitDockWidget@QMainWindow@@QAEXPAVQDockWidget@@0W4Orientation@Qt@@@Z @ 10505 NONAME ; void QMainWindow::splitDockWidget(class QDockWidget *, class QDockWidget *, enum Qt::Orientation) ?splitItem@QTextEngine@@ABEXHH@Z @ 10506 NONAME ; void QTextEngine::splitItem(int, int) const diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index cadcf59..a735de1 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -5907,9 +5907,9 @@ EXPORTS _ZN7QActionD1Ev @ 5906 NONAME _ZN7QActionD2Ev @ 5907 NONAME _ZN7QBezier10fromPointsERK7QPointFS2_S2_S2_ @ 5908 NONAME - _ZN7QBezier17findIntersectionsERKS_S1_ @ 5909 NONAME - _ZN7QBezier17findIntersectionsERKS_S1_P7QVectorI5QPairIffEE @ 5910 NONAME - _ZN7QBezier20splitAtIntersectionsERS_ @ 5911 NONAME + _ZN7QBezier17findIntersectionsERKS_S1_ @ 5909 NONAME ABSENT + _ZN7QBezier17findIntersectionsERKS_S1_P7QVectorI5QPairIffEE @ 5910 NONAME ABSENT + _ZN7QBezier20splitAtIntersectionsERS_ @ 5911 NONAME ABSENT _ZN7QBitmap8fromDataERK5QSizePKhN6QImage6FormatE @ 5912 NONAME _ZN7QBitmap9fromImageERK6QImage6QFlagsIN2Qt19ImageConversionFlagEE @ 5913 NONAME _ZN7QBitmapC1ERK5QSize @ 5914 NONAME diff --git a/tests/auto/qpathclipper/tst_qpathclipper.cpp b/tests/auto/qpathclipper/tst_qpathclipper.cpp index db5a13e..4dc12cb 100644 --- a/tests/auto/qpathclipper/tst_qpathclipper.cpp +++ b/tests/auto/qpathclipper/tst_qpathclipper.cpp @@ -285,46 +285,6 @@ static QPainterPath samplePath10() return path; } -static QPainterPath samplePath11() -{ - QPainterPath path; - path.moveTo(QPointF(165.71429, 338.79076)); - path.lineTo(QPointF(227.74288, 338.79076)); - path.cubicTo(QPointF(232.95048, 338.79076), - QPointF(237.14288, 342.88102), - QPointF(237.14288, 347.96176)); - path.lineTo(QPointF(237.14288, 366.76261)); - path.cubicTo(QPointF(237.14288, 371.84335), - QPointF(232.95048, 375.93361), - QPointF(227.74288, 375.93361)); - path.lineTo(QPointF(165.7142905131896, 375.93361)); - path.lineTo(QPointF(165.71429, 338.79076)); - return path; -} -static QPainterPath samplePath12() -{ - QPainterPath path; - path.moveTo(QPointF(333.297085225735, 61.53486494396167)); - path.cubicTo(QPointF(339.851755668807, 65.26555884471786), - QPointF(346.7164458828328, 69.04482864715078), - QPointF(353.4159970843586, 72.56059416636147)); - path.cubicTo(QPointF(353.4166971116034, 72.56155590850551), - QPointF(353.4173961086004, 72.56251809989483), - QPointF(353.4180950127331, 72.56348028832946)); - path.cubicTo(QPointF(342.4340366381152, 76.42344228577481), - QPointF(317.0596805768079, 94.67086588954379), - QPointF(309.78055, 101.00195)); - path.cubicTo(QPointF(286.0370715501102, 121.6530659984711), - QPointF(272.7748256344584, 134.1525788344904), - QPointF(250.7436468364447, 150.4434491585085)); - path.lineTo(QPointF(247.03629, 146.56585)); - path.lineTo(QPointF(240.71086, 91.501867)); - path.cubicTo(QPointF(240.71086, 91.501867), - QPointF(305.6382515924416, 62.21715375368672), - QPointF(333.297085225735, 61.53486494396167)); - return path; -} - static QPainterPath samplePath13() { QPainterPath path; @@ -412,16 +372,6 @@ void tst_QPathClipper::clip_data() << QPathClipper::BoolAnd << samplePath10(); - QTest::newRow( "simple11" ) << Paths::frame2()*QTransform().translate(40, 235) - << Paths::frame1() - << QPathClipper::BoolAnd - << samplePath11(); - - QTest::newRow( "intersection_at_edge" ) << Paths::lips() - << Paths::mailbox()*QTransform().translate(-85, 34) - << QPathClipper::BoolAnd - << samplePath12(); - QTest::newRow( "simple_move_to1" ) << Paths::rect4() << Paths::rect2() * QTransform().translate(-20, 50) << QPathClipper::BoolAnd -- cgit v0.12 From 9cc9da431fd99869a83b91f5be4911e0ead2f15f Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Thu, 22 Apr 2010 15:01:58 +0300 Subject: QtWebkit WINS DEF file freeze Freeze against previous release 4.6.2 to maintain BC. Reviewed-by: Miikka Heikkinen --- .../webkit/WebKit/qt/symbian/bwins/QtWebKitu.def | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def index 086e986..1442795 100644 --- a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def +++ b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def @@ -623,5 +623,31 @@ EXPORTS ?qt_networkAccessAllowed@@YAX_N@Z @ 622 NONAME ; void qt_networkAccessAllowed(bool) ?qt_resumeActiveDOMObjects@@YAXPAVQWebFrame@@@Z @ 623 NONAME ; void qt_resumeActiveDOMObjects(class QWebFrame *) ?qt_suspendActiveDOMObjects@@YAXPAVQWebFrame@@@Z @ 624 NONAME ; void qt_suspendActiveDOMObjects(class QWebFrame *) - ?qtwebkit_webframe_scrollRecursively@@YA_NPAVQWebFrame@@HH@Z @ 625 NONAME ; bool qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int) + ?qtwebkit_webframe_scrollRecursively@@YA_NPAVQWebFrame@@HH@Z @ 625 NONAME ABSENT ; bool qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int) + ?closeEvent@QWebInspector@@MAEXPAVQCloseEvent@@@Z @ 626 NONAME ; void QWebInspector::closeEvent(class QCloseEvent *) + ?getloc@ios_base@std@@QBE?AVlocale@2@XZ @ 627 NONAME ; class std::locale std::ios_base::getloc(void) const + ?inspectorUrl@QWebSettings@@QBE?AVQUrl@@XZ @ 628 NONAME ; class QUrl QWebSettings::inspectorUrl(void) const + ?isTiledBackingStoreFrozen@QGraphicsWebView@@QBE_NXZ @ 629 NONAME ; bool QGraphicsWebView::isTiledBackingStoreFrozen(void) const + ?pageChanged@QWebFrame@@IAEXXZ @ 630 NONAME ; void QWebFrame::pageChanged(void) + ?qt_drt_enableCaretBrowsing@@YAXPAVQWebPage@@_N@Z @ 631 NONAME ; void qt_drt_enableCaretBrowsing(class QWebPage *, bool) + ?qt_drt_evaluateScriptInIsolatedWorld@@YAXPAVQWebFrame@@HABVQString@@@Z @ 632 NONAME ; void qt_drt_evaluateScriptInIsolatedWorld(class QWebFrame *, int, class QString const &) + ?qt_drt_hasDocumentElement@@YA_NPAVQWebFrame@@@Z @ 633 NONAME ; bool qt_drt_hasDocumentElement(class QWebFrame *) + ?qt_drt_numberOfPages@@YAHPAVQWebFrame@@MM@Z @ 634 NONAME ; int qt_drt_numberOfPages(class QWebFrame *, float, float) + ?qt_drt_pageNumberForElementById@@YAHPAVQWebFrame@@ABVQString@@MM@Z @ 635 NONAME ; int qt_drt_pageNumberForElementById(class QWebFrame *, class QString const &, float, float) + ?qt_drt_pauseSVGAnimation@@YA_NPAVQWebFrame@@ABVQString@@N1@Z @ 636 NONAME ; bool qt_drt_pauseSVGAnimation(class QWebFrame *, class QString const &, double, class QString const &) + ?qt_drt_setDomainRelaxationForbiddenForURLScheme@@YAX_NABVQString@@@Z @ 637 NONAME ; void qt_drt_setDomainRelaxationForbiddenForURLScheme(bool, class QString const &) + ?qt_drt_setFrameFlatteningEnabled@@YAXPAVQWebPage@@_N@Z @ 638 NONAME ; void qt_drt_setFrameFlatteningEnabled(class QWebPage *, bool) + ?qt_drt_setMediaType@@YAXPAVQWebFrame@@ABVQString@@@Z @ 639 NONAME ; void qt_drt_setMediaType(class QWebFrame *, class QString const &) + ?qt_drt_setTimelineProfilingEnabled@@YAXPAVQWebPage@@_N@Z @ 640 NONAME ; void qt_drt_setTimelineProfilingEnabled(class QWebPage *, bool) + ?qt_drt_webinspector_close@@YAXPAVQWebPage@@@Z @ 641 NONAME ; void qt_drt_webinspector_close(class QWebPage *) + ?qt_drt_webinspector_executeScript@@YAXPAVQWebPage@@JABVQString@@@Z @ 642 NONAME ; void qt_drt_webinspector_executeScript(class QWebPage *, long, class QString const &) + ?qt_drt_webinspector_show@@YAXPAVQWebPage@@@Z @ 643 NONAME ; void qt_drt_webinspector_show(class QWebPage *) + ?qt_drt_workerThreadCount@@YAHXZ @ 644 NONAME ; int qt_drt_workerThreadCount(void) + ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 645 NONAME ; void qt_wrt_setViewMode(class QWebPage *, class QString const &) + ?qtwebkit_webframe_scrollRecursively@@YAXPAVQWebFrame@@HHABVQPoint@@@Z @ 646 NONAME ; void qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int, class QPoint const &) + ?resizesToContents@QGraphicsWebView@@QBE_NXZ @ 647 NONAME ; bool QGraphicsWebView::resizesToContents(void) const + ?scrollToAnchor@QWebFrame@@QAEXABVQString@@@Z @ 648 NONAME ; void QWebFrame::scrollToAnchor(class QString const &) + ?setInspectorUrl@QWebSettings@@QAEXABVQUrl@@@Z @ 649 NONAME ; void QWebSettings::setInspectorUrl(class QUrl const &) + ?setResizesToContents@QGraphicsWebView@@QAEX_N@Z @ 650 NONAME ; void QGraphicsWebView::setResizesToContents(bool) + ?setTiledBackingStoreFrozen@QGraphicsWebView@@QAEX_N@Z @ 651 NONAME ; void QGraphicsWebView::setTiledBackingStoreFrozen(bool) -- cgit v0.12 From d7b4d694214d1dd8ef84ac2ae69c94b8564fd8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 22 Apr 2010 16:04:09 +0200 Subject: Fixed autotest failures in tst_QPainterPath. The simplified test failed because the ellipse was flattened into line segment. The other tests were due to a behavioral change in contains() and intersect() caused by using fill based intersection in change f7d61dab69308f0993c8a5f2232226d1713ac4a7. This needs to be reverted, since it will return false for a rect containing a line (with no fill area). Instead a different fix was needed in linesIntersect() to prevent testIntersections() in tst_QPathClipper from failing. Reviewed-by: Trond --- src/gui/painting/qpathclipper.cpp | 9 ++------- tests/auto/qpainterpath/tst_qpainterpath.cpp | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 4d319a4..9dedf3a 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -162,11 +162,6 @@ bool QIntersectionFinder::linesIntersect(const QLineF &a, const QLineF &b) const return false; } - // if the lines are not parallel and share a common end point, then they - // don't intersect - if (p1_equals_q1 || p1_equals_q2 || p2_equals_q1 || p2_equals_q2) - return false; - const qreal invPar = 1 / par; const qreal tp = (qDelta.y() * (q1.x() - p1.x()) - @@ -1236,7 +1231,7 @@ bool QPathClipper::intersect() } } - return !clipPath.intersected(subjectPath).isEmpty(); + return false; } bool QPathClipper::contains() @@ -1273,7 +1268,7 @@ bool QPathClipper::contains() } } - return clipPath.subtracted(subjectPath).isEmpty(); + return true; } QPathClipper::QPathClipper(const QPainterPath &subject, diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp index a40fe0f..d0cddda 100644 --- a/tests/auto/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/qpainterpath/tst_qpainterpath.cpp @@ -517,7 +517,6 @@ void tst_QPainterPath::testSimplified_data() QTest::addColumn("elements"); QTest::newRow("rect") << rectPath(0, 0, 10, 10) << 5; - QTest::newRow("ellipse") << ellipsePath(0, 0, 10, 10) << 13; QPainterPath twoRects = rectPath(0, 0, 10, 10); twoRects.addPath(rectPath(5, 0, 10, 10)); -- cgit v0.12 From e602ea2a7eee7ec427ba3faa7c450a29a75fb98b Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Mon, 19 Apr 2010 14:45:02 +0200 Subject: Remove dead code left after a merge conflict resolution Reviewed-By: Kim --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 21 --------------------- .../gl2paintengineex/qpaintengineex_opengl2_p.h | 1 - 2 files changed, 22 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 955a129..8460430 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1807,27 +1807,6 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) d->dirtyStencilRegion = QRect(0, 0, d->width, d->height); d->stencilClean = true; - switch (pdev->devType()) { - case QInternal::Pixmap: - d->deviceHasAlpha = static_cast(pdev)->hasAlphaChannel(); - break; - case QInternal::FramebufferObject: - { - GLenum f = static_cast(pdev)->format().internalTextureFormat(); -#ifndef QT_OPENGL_ES - d->deviceHasAlpha = (f != GL_RGB && f != GL_RGB5 && f != GL_RGB8); -#else - d->deviceHasAlpha = (f == GL_RGBA); -#endif - } - break; - default: - // widget, pbuffer - d->deviceHasAlpha = d->ctx->d_func()->reqFormat.alpha(); - break; - } - - // Calling begin paint should make the correct context current. So, any // code which calls into GL or otherwise needs a current context *must* // go after beginPaint: diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 2ac2ca4..30f6634 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -290,7 +290,6 @@ public: bool needsSync; bool multisamplingAlwaysEnabled; - bool deviceHasAlpha; GLfloat depthRange[2]; -- cgit v0.12 From 4cb45486f952f5d9df7a2d954073bdbc5c5ee893 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Tue, 20 Apr 2010 11:09:32 +0200 Subject: Implement QGLPaintDevice::metric() Reviewed-By: TrustMe --- src/opengl/qglpaintdevice.cpp | 16 ++++++++++++++++ src/opengl/qglpaintdevice_p.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp index 2d82222..e874e85 100644 --- a/src/opengl/qglpaintdevice.cpp +++ b/src/opengl/qglpaintdevice.cpp @@ -63,6 +63,22 @@ QGLPaintDevice::~QGLPaintDevice() { } +int QGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const +{ + switch(metric) { + case PdmWidth: + return size().width(); + case PdmHeight: + return size().height(); + case PdmDepth: { + const QGLFormat f = format(); + return f.redBufferSize() + f.greenBufferSize() + f.blueBufferSize() + f.alphaBufferSize(); + } + default: + qWarning("QGLPaintDevice::metric() - metric %d not known", metric); + return 0; + } +} void QGLPaintDevice::beginPaint() { diff --git a/src/opengl/qglpaintdevice_p.h b/src/opengl/qglpaintdevice_p.h index 3d669da..04f9c3c 100644 --- a/src/opengl/qglpaintdevice_p.h +++ b/src/opengl/qglpaintdevice_p.h @@ -81,6 +81,7 @@ public: static QGLPaintDevice* getDevice(QPaintDevice*); protected: + int metric(QPaintDevice::PaintDeviceMetric metric) const; GLuint m_previousFBO; GLuint m_thisFBO; }; -- cgit v0.12 From 71d6e5a73b6e4434c47194d938a8b74c92170644 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Wed, 21 Apr 2010 10:41:15 +0200 Subject: QX11GL: Don't do glFinish in endPaint It's better to defer the synchronisation to just before the point it is actually needed. When used as a window surface, this is in flush and scroll. If the QX11GLPixmapData is used as the defaut backend for QPixmaps, it might need to be put back into endPaint. However, the GL driver will hopefully make sure rendering to the pixmap is complete before binding it as a texture via texture-from-pixmap. Also, it's probably better to use eglWaitClient rather than glFinish for synchronisation as it is potentially slightly more optimal. Reviewed-By: TrustMe --- src/opengl/qpixmapdata_x11gl_egl.cpp | 6 ------ src/opengl/qpixmapdata_x11gl_p.h | 1 - 2 files changed, 7 deletions(-) diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp index 4d726b6..3b11749 100644 --- a/src/opengl/qpixmapdata_x11gl_egl.cpp +++ b/src/opengl/qpixmapdata_x11gl_egl.cpp @@ -336,12 +336,6 @@ void QX11GLPixmapData::beginPaint() QGLPaintDevice::beginPaint(); } -void QX11GLPixmapData::endPaint() -{ - glFinish(); - QGLPaintDevice::endPaint(); -} - QGLContext* QX11GLPixmapData::context() const { return ctx; diff --git a/src/opengl/qpixmapdata_x11gl_p.h b/src/opengl/qpixmapdata_x11gl_p.h index 8681336..b613eba 100644 --- a/src/opengl/qpixmapdata_x11gl_p.h +++ b/src/opengl/qpixmapdata_x11gl_p.h @@ -79,7 +79,6 @@ public: // Re-implemented from QGLPaintDevice QPaintEngine* paintEngine() const; // Also re-implements QX11PixmapData::paintEngine void beginPaint(); - void endPaint(); QGLContext* context() const; QSize size() const; -- cgit v0.12 From 1a00c7dec743c05b0f64bcacc03b3d2c90ac881d Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Wed, 21 Apr 2010 17:40:04 +0200 Subject: QX11GL: Move the shared context ownership into a seperate class This patch moves initialisation into a new QX11GLSharedContexts class which is created as a Q_GLOBAL_STATIC. This class owns both the RGB/ARGB EGL contexts and the QGLContext used for sharing. Finally, the shared QGLContext is make a valid context wrapping the RGB EGL context and a small pixmap surface. This makes the shared QGLContext the QGLContextGroup master, so when it is deleted, it can be made current to delete the GL resources. Among other benefits, this patch stops apps seg-faulting when they gracefully quit. Reviewed-By: TrustMe --- src/opengl/qgl.h | 1 + src/opengl/qpixmapdata_x11gl_egl.cpp | 241 +++++++++++++++++++++-------------- src/opengl/qpixmapdata_x11gl_p.h | 7 +- 3 files changed, 148 insertions(+), 101 deletions(-) diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index b1e2ede..92a064f 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -432,6 +432,7 @@ private: friend class QGLFBOGLPaintDevice; friend class QGLPaintDevice; friend class QX11GLPixmapData; + friend class QX11GLSharedContexts; private: Q_DISABLE_COPY(QGLContext) }; diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp index 3b11749..58d34fc 100644 --- a/src/opengl/qpixmapdata_x11gl_egl.cpp +++ b/src/opengl/qpixmapdata_x11gl_egl.cpp @@ -62,123 +62,170 @@ QT_BEGIN_NAMESPACE -// On 16bpp systems, RGB & ARGB pixmaps are different bit-depths and therefore need -// different contexts: - -Q_GLOBAL_STATIC(QEglContext, qt_x11gl_rgbContext); -Q_GLOBAL_STATIC(QEglContext, qt_x11gl_argbContext); -Q_GLOBAL_STATIC_WITH_ARGS(QGLContext, qt_x11gl_fake_shared_context, (QX11GLPixmapData::glFormat())); +class QX11GLSharedContexts +{ +public: + QX11GLSharedContexts() + : rgbContext(0) + , argbContext(0) + , sharedQGLContext(0) + , sharePixmap(0) + { + EGLint rgbConfigId; + EGLint argbConfigId; + + + do { + EGLConfig rgbConfig = QEgl::defaultConfig(QInternal::Pixmap, QEgl::OpenGL, QEgl::Renderable); + EGLConfig argbConfig = QEgl::defaultConfig(QInternal::Pixmap, QEgl::OpenGL, + QEgl::Renderable | QEgl::Translucent); + + eglGetConfigAttrib(QEgl::display(), rgbConfig, EGL_CONFIG_ID, &rgbConfigId); + eglGetConfigAttrib(QEgl::display(), argbConfig, EGL_CONFIG_ID, &argbConfigId); + + rgbContext = new QEglContext; + rgbContext->setConfig(rgbConfig); + rgbContext->createContext(); -QEglContext* QX11GLPixmapData::rgbContext = 0; -QEglContext* QX11GLPixmapData::argbContext = 0; + if (!rgbContext->isValid()) + break; + // If the RGB & ARGB configs are the same, use the same egl context for both: + if (rgbConfig == argbConfig) + argbContext = rgbContext; + + // Otherwise, create a seperate context to be used for ARGB pixmaps: + if (!argbContext) { + argbContext = new QEglContext; + argbContext->setConfig(argbConfig); + bool success = argbContext->createContext(rgbContext); + if (!success) { + qWarning("QX11GLPixmapData - RGB & ARGB contexts aren't shared"); + success = argbContext->createContext(); + if (!success) + argbContext = rgbContext; // Might work, worth a shot at least. + } + } -bool QX11GLPixmapData::hasX11GLPixmaps() -{ - static bool checkedForX11Pixmaps = false; - static bool haveX11Pixmaps = false; + if (!argbContext->isValid()) + break; - if (checkedForX11Pixmaps) - return haveX11Pixmaps; + // Create the pixmap which will be used to create the egl surface for the share QGLContext + QX11PixmapData *rgbPixmapData = new QX11PixmapData(QPixmapData::PixmapType); + rgbPixmapData->resize(8, 8); + rgbPixmapData->fill(Qt::red); + sharePixmap = new QPixmap(rgbPixmapData); + EGLSurface sharePixmapSurface = QEgl::createSurface(sharePixmap, rgbConfig); + rgbPixmapData->gl_surface = (void*)sharePixmapSurface; + + // Create the actual QGLContext which will be used for sharing + sharedQGLContext = new QGLContext(QX11GLPixmapData::glFormat()); + sharedQGLContext->d_func()->eglContext = rgbContext; + sharedQGLContext->d_func()->eglSurface = sharePixmapSurface; + sharedQGLContext->d_func()->valid = true; + qt_glformat_from_eglconfig(sharedQGLContext->d_func()->glFormat, rgbConfig); + + + valid = rgbContext->makeCurrent(sharePixmapSurface); + + // If the ARGB & RGB configs are different, check ARGB works too: + if (argbConfig != rgbConfig) { + QX11PixmapData *argbPixmapData = new QX11PixmapData(QPixmapData::PixmapType); + argbPixmapData->resize(8, 8); + argbPixmapData->fill(Qt::transparent); // Force ARGB + QPixmap argbPixmap(argbPixmapData); // destroys pixmap data when goes out of scope + EGLSurface argbPixmapSurface = QEgl::createSurface(&argbPixmap, argbConfig); + valid = argbContext->makeCurrent(argbPixmapSurface); + argbContext->doneCurrent(); + eglDestroySurface(QEgl::display(), argbPixmapSurface); + } - checkedForX11Pixmaps = true; + if (!valid) { + qWarning() << "Unable to make pixmap surface current:" << QEgl::errorString(); + break; + } - EGLint rgbConfigId; - EGLint argbConfigId; + // The pixmap surface destruction hooks are installed by QGLTextureCache, so we + // must make sure this is instanciated: + QGLTextureCache::instance(); + } while(0); - do { - if (qgetenv("QT_USE_X11GL_PIXMAPS").isEmpty()) - break; - EGLConfig rgbConfig = QEgl::defaultConfig(QInternal::Pixmap, QEgl::OpenGL, QEgl::Renderable); - EGLConfig argbConfig = QEgl::defaultConfig(QInternal::Pixmap, QEgl::OpenGL, - QEgl::Renderable | QEgl::Translucent); + if (!valid) + cleanup(); + else + qDebug("Using QX11GLPixmapData with EGL config %d for ARGB and config %d for RGB", argbConfigId, rgbConfigId); - eglGetConfigAttrib(QEgl::display(), rgbConfig, EGL_CONFIG_ID, &rgbConfigId); - eglGetConfigAttrib(QEgl::display(), argbConfig, EGL_CONFIG_ID, &argbConfigId); + } - if (!rgbContext) { - rgbContext = qt_x11gl_rgbContext(); - rgbContext->setConfig(rgbConfig); - rgbContext->createContext(); + void cleanup() { + if (sharedQGLContext) { + delete sharedQGLContext; + sharedQGLContext = 0; } + if (argbContext && argbContext != rgbContext) + delete argbContext; + argbContext = 0; - if (!rgbContext->isValid()) - break; - - // If the configs are the same, use the same egl contexts: - if (rgbConfig == argbConfig) - argbContext = rgbContext; - - if (!argbContext) { - argbContext = qt_x11gl_argbContext(); - argbContext->setConfig(argbConfig); - bool success = argbContext->createContext(rgbContext); - if (!success) { - qWarning("QX11GLPixmapData - RGB & ARGB contexts aren't shared"); - success = argbContext->createContext(); - if (!success) - argbContext = rgbContext; // Might work, worth a shot at least. - } + if (rgbContext) { + delete rgbContext; + rgbContext = 0; } - if (!argbContext->isValid()) - break; - - { - QX11PixmapData *argbPixmapData = new QX11PixmapData(QPixmapData::PixmapType); - argbPixmapData->resize(100, 100); - argbPixmapData->fill(Qt::transparent); // Force ARGB - QPixmap argbPixmap(argbPixmapData); - EGLSurface argbPixmapSurface = QEgl::createSurface(&argbPixmap, argbConfig); - haveX11Pixmaps = argbContext->makeCurrent(argbPixmapSurface); - argbContext->doneCurrent(); - eglDestroySurface(QEgl::display(), argbPixmapSurface); + // Deleting the QPixmap will fire the pixmap destruction cleanup hooks which in turn + // will destroy the egl surface: + if (sharePixmap) { + delete sharePixmap; + sharePixmap = 0; } + } - if (!haveX11Pixmaps) { - qWarning() << "Unable to make pixmap surface current:" << QEgl::errorString(); - break; - } + bool isValid() { return valid;} - // If the ARGB & RGB configs are different, check RGB too: - if (argbConfig != rgbConfig) { - QX11PixmapData *rgbPixmapData = new QX11PixmapData(QPixmapData::PixmapType); - rgbPixmapData->resize(100, 100); - rgbPixmapData->fill(Qt::red); + // On 16bpp systems, RGB & ARGB pixmaps are different bit-depths and therefore need + // different contexts: + QEglContext *rgbContext; + QEglContext *argbContext; - QPixmap rgbPixmap(rgbPixmapData); - EGLSurface rgbPixmapSurface = QEgl::createSurface(&rgbPixmap, rgbConfig); - haveX11Pixmaps = rgbContext->makeCurrent(rgbPixmapSurface); - rgbContext->doneCurrent(); - eglDestroySurface(QEgl::display(), rgbPixmapSurface); + // The share context wraps the rgbContext and is used as the master of the context share + // group. As all other contexts will have the same egl context (or a shared one if rgb != argb) + // all QGLContexts will actually be sharing and can be in the same context group. + QGLContext *sharedQGLContext; +private: + QPixmap *sharePixmap; + bool valid; +}; - if (!haveX11Pixmaps) { - qWarning() << "Unable to make pixmap config current:" << QEgl::errorString(); - break; - } - } +static void qt_cleanup_x11gl_share_contexts(); - // The pixmap surface destruction hooks are installed by QGLTextureCache, so we - // must make sure this is instanciated: - QGLTextureCache::instance(); - } while (0); +Q_GLOBAL_STATIC_WITH_INITIALIZER(QX11GLSharedContexts, qt_x11gl_share_contexts, + { + qAddPostRoutine(qt_cleanup_x11gl_share_contexts); + }) - if (!haveX11Pixmaps) { - if (argbContext && (argbContext != rgbContext)) { - delete argbContext; - argbContext = 0; - } - if (rgbContext) { - delete rgbContext; - rgbContext = 0; - } - } +static void qt_cleanup_x11gl_share_contexts() +{ + qt_x11gl_share_contexts()->cleanup(); +} - if (haveX11Pixmaps) - qDebug("Using QX11GLPixmapData with EGL config %d for ARGB and config %d for RGB", argbConfigId, rgbConfigId); - else - qDebug("QX11GLPixmapData is *NOT* being used"); + +QX11GLSharedContexts* QX11GLPixmapData::sharedContexts() +{ + return qt_x11gl_share_contexts(); +} + +bool QX11GLPixmapData::hasX11GLPixmaps() +{ + static bool checkedForX11Pixmaps = false; + static bool haveX11Pixmaps = false; + + if (checkedForX11Pixmaps) + return haveX11Pixmaps; + + checkedForX11Pixmaps = true; + + if (!qgetenv("QT_USE_X11GL_PIXMAPS").isEmpty() && sharedContexts()->isValid()) + haveX11Pixmaps = true; return haveX11Pixmaps; } @@ -264,14 +311,14 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const if (!ctx) { ctx = new QGLContext(glFormat()); Q_ASSERT(ctx->d_func()->eglContext == 0); - ctx->d_func()->eglContext = hasAlphaChannel() ? argbContext : rgbContext; + ctx->d_func()->eglContext = hasAlphaChannel() ? sharedContexts()->argbContext : sharedContexts()->rgbContext; // While we use a seperate QGLContext for each pixmap, the underlying QEglContext is // the same. So we must use a "fake" QGLContext and fool the texture cache into thinking // each pixmap's QGLContext is sharing with this central one. The only place this is // going to fail is where we the underlying EGL RGB and ARGB contexts aren't sharing. ctx->d_func()->sharing = true; - QGLContextGroup::addShare(ctx, qt_x11gl_fake_shared_context()); + QGLContextGroup::addShare(ctx, sharedContexts()->sharedQGLContext); // Update the glFormat for the QGLContext: qt_glformat_from_eglconfig(ctx->d_func()->glFormat, ctx->d_func()->eglContext->config()); diff --git a/src/opengl/qpixmapdata_x11gl_p.h b/src/opengl/qpixmapdata_x11gl_p.h index b613eba..2d1336b 100644 --- a/src/opengl/qpixmapdata_x11gl_p.h +++ b/src/opengl/qpixmapdata_x11gl_p.h @@ -65,6 +65,8 @@ QT_BEGIN_NAMESPACE +class QX11GLSharedContexts; + class QX11GLPixmapData : public QX11PixmapData, public QGLPaintDevice { public: @@ -84,11 +86,8 @@ public: static bool hasX11GLPixmaps(); static QGLFormat glFormat(); + static QX11GLSharedContexts* sharedContexts(); -#ifndef QT_NO_EGL - static QEglContext* rgbContext; - static QEglContext* argbContext; -#endif private: mutable QGLContext* ctx; }; -- cgit v0.12 From 0c77187652b976c3b9a17e95311bda3e3d8a6fbe Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Wed, 21 Apr 2010 17:59:40 +0200 Subject: QX11GL: Cleanup the window surface & remove some synchronisation Previously we were calling all manor of synchronisation calls to make sure there were no issues. These have been sanitised to just use eglWaitClient and eglWaitNative and only in places which need it. There is still a bug where small updates will sometimes result in small horizontal streaks. However, this has been confirmed to be a cache flush bug in the X server 2D driver. The driver bug is tracked in Meamo bugzilla as bug 164941. Hopefully it will be fixed soon. Reviewed-By: TrustMe --- src/gui/painting/qwindowsurface_p.h | 8 +++- src/opengl/qwindowsurface_x11gl.cpp | 92 +++++++++++++++++-------------------- 2 files changed, 47 insertions(+), 53 deletions(-) diff --git a/src/gui/painting/qwindowsurface_p.h b/src/gui/painting/qwindowsurface_p.h index e6ee5f6..6171ae8 100644 --- a/src/gui/painting/qwindowsurface_p.h +++ b/src/gui/painting/qwindowsurface_p.h @@ -73,8 +73,12 @@ public: QWidget *window() const; virtual QPaintDevice *paintDevice() = 0; - virtual void flush(QWidget *widget, const QRegion ®ion, - const QPoint &offset) = 0; + + // 'widget' can be a child widget, in which case 'region' is in child widget coordinates and + // offset is the (child) widget's offset in relation to the window surface. On QWS, 'offset' + // can be larger than just the offset from the top-level widget as there may also be window + // decorations which are painted into the window surface. + virtual void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset) = 0; virtual void setGeometry(const QRect &rect); QRect geometry() const; diff --git a/src/opengl/qwindowsurface_x11gl.cpp b/src/opengl/qwindowsurface_x11gl.cpp index 7befe03..e5a1760 100644 --- a/src/opengl/qwindowsurface_x11gl.cpp +++ b/src/opengl/qwindowsurface_x11gl.cpp @@ -72,63 +72,66 @@ extern void *qt_getClipRects(const QRegion &r, int &num); // in qpaintengine_x11 void QX11GLWindowSurface::flush(QWidget *widget, const QRegion &widgetRegion, const QPoint &offset) { -// qDebug("QX11GLWindowSurface::flush()"); - QTime startTime = QTime::currentTime(); + // We don't need to know the widget which initiated the flush. Instead we just use the offset + // to translate the widgetRegion: + Q_UNUSED(widget); + if (m_backBuffer.isNull()) { - qDebug("QHarmattanWindowSurface::flush() - backBuffer is null, not flushing anything"); + qDebug("QX11GLWindowSurface::flush() - backBuffer is null, not flushing anything"); return; } - QPoint widgetOffset = qt_qwidget_data(widget)->wrect.topLeft(); - QRegion windowRegion(widgetRegion); - QRect boundingRect = widgetRegion.boundingRect(); - if (!widgetOffset.isNull()) - windowRegion.translate(-widgetOffset); - QRect windowBoundingRect = windowRegion.boundingRect(); + Q_ASSERT(window()->size() != m_backBuffer.size()); - int rectCount; - XRectangle *rects = (XRectangle *)qt_getClipRects(windowRegion, rectCount); - if (rectCount <= 0) - return; -// qDebug() << "XSetClipRectangles"; -// for (int i = 0; i < num; ++i) -// qDebug() << ' ' << i << rects[i].x << rects[i].x << rects[i].y << rects[i].width << rects[i].height; + // Wait for all GL rendering to the back buffer pixmap to complete before trying to + // copy it to the window. We do this by making sure the pixmap's context is current + // and then call eglWaitClient. The EGL 1.4 spec says eglWaitClient doesn't have to + // block, just that "All rendering calls...are guaranteed to be executed before native + // rendering calls". This makes it potentially less expensive than glFinish. + QGLContext* ctx = static_cast(m_backBuffer.data_ptr().data())->context(); + if (QGLContext::currentContext() != ctx && ctx && ctx->isValid()) + ctx->makeCurrent(); + eglWaitClient(); if (m_windowGC == 0) { - m_windowGC = XCreateGC(X11->display, m_window->handle(), 0, 0); - XSetGraphicsExposures(X11->display, m_windowGC, False); + XGCValues attribs; + attribs.graphics_exposures = False; + m_windowGC = XCreateGC(X11->display, m_window->handle(), GCGraphicsExposures, &attribs); } + int rectCount; + XRectangle *rects = (XRectangle *)qt_getClipRects(widgetRegion, rectCount); + if (rectCount <= 0) + return; + XSetClipRectangles(X11->display, m_windowGC, 0, 0, rects, rectCount, YXBanded); + + QRect dirtyRect = widgetRegion.boundingRect().translated(-offset); XCopyArea(X11->display, m_backBuffer.handle(), m_window->handle(), m_windowGC, - boundingRect.x() + offset.x(), boundingRect.y() + offset.y(), - boundingRect.width(), boundingRect.height(), - windowBoundingRect.x(), windowBoundingRect.y()); - - QX11GLPixmapData* pmd = static_cast(m_backBuffer.data_ptr().data()); - Q_ASSERT(pmd->context()); - pmd->context()->makeCurrent(); - XSync(X11->display, False); + dirtyRect.x(), dirtyRect.y(), dirtyRect.width(), dirtyRect.height(), + dirtyRect.x(), dirtyRect.y()); + + // Make sure the blit of the update from the back buffer to the window completes + // before allowing rendering to start again to the back buffer. Otherwise the GPU + // might start rendering to the back buffer again while the blit takes place. eglWaitNative(EGL_CORE_NATIVE_ENGINE); } void QX11GLWindowSurface::setGeometry(const QRect &rect) { if (rect.width() > m_backBuffer.size().width() || rect.height() > m_backBuffer.size().height()) { - QSize newSize = rect.size(); -// QSize newSize(1024,512); - qDebug() << "QX11GLWindowSurface::setGeometry() - creating a pixmap of size" << newSize; QX11GLPixmapData *pd = new QX11GLPixmapData; + QSize newSize = rect.size(); pd->resize(newSize.width(), newSize.height()); m_backBuffer = QPixmap(pd); if (window()->testAttribute(Qt::WA_TranslucentBackground)) m_backBuffer.fill(Qt::transparent); + if (m_pixmapGC) { + XFreeGC(X11->display, m_pixmapGC); + m_pixmapGC = 0; + } } -// if (gc) -// XFreeGC(X11->display, gc); -// gc = XCreateGC(X11->display, d_ptr->device.handle(), 0, 0); -// XSetGraphicsExposures(X11->display, gc, False); QWindowSurface::setGeometry(rect); } @@ -139,10 +142,10 @@ bool QX11GLWindowSurface::scroll(const QRegion &area, int dx, int dy) Q_ASSERT(m_backBuffer.data_ptr()->classId() == QPixmapData::X11Class); - QX11GLPixmapData* pmd = static_cast(m_backBuffer.data_ptr().data()); - Q_ASSERT(pmd->context()); - pmd->context()->makeCurrent(); - glFinish(); + // Make sure all GL rendering is complete before starting the scroll operation: + QGLContext* ctx = static_cast(m_backBuffer.data_ptr().data())->context(); + if (QGLContext::currentContext() != ctx && ctx && ctx->isValid()) + ctx->makeCurrent(); eglWaitClient(); if (!m_pixmapGC) @@ -154,24 +157,11 @@ bool QX11GLWindowSurface::scroll(const QRegion &area, int dx, int dy) rect.x()+dx, rect.y()+dy); } - XSync(X11->display, False); + // Make sure the scroll operation is complete before allowing GL rendering to resume eglWaitNative(EGL_CORE_NATIVE_ENGINE); return true; } -/* -void QX11GLWindowSurface::beginPaint(const QRegion ®ion) -{ -} - -void QX11GLWindowSurface::endPaint(const QRegion ®ion) -{ -} - -QImage *QX11GLWindowSurface::buffer(const QWidget *widget) -{ -} -*/ QT_END_NAMESPACE -- cgit v0.12 From 9f101a33b44424e22f50dcd01eeb90ac7c835f21 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 22 Apr 2010 08:42:35 +0200 Subject: QX11GL: Implement QX11GLWindowSurface::grabWidget Now all the window surface autotests pass. Reviewed-By: TrustMe --- src/opengl/qwindowsurface_x11gl.cpp | 46 +++++++++++++++++++++++++++++++++++++ src/opengl/qwindowsurface_x11gl_p.h | 1 + 2 files changed, 47 insertions(+) diff --git a/src/opengl/qwindowsurface_x11gl.cpp b/src/opengl/qwindowsurface_x11gl.cpp index e5a1760..3de6cae 100644 --- a/src/opengl/qwindowsurface_x11gl.cpp +++ b/src/opengl/qwindowsurface_x11gl.cpp @@ -164,4 +164,50 @@ bool QX11GLWindowSurface::scroll(const QRegion &area, int dx, int dy) } +QPixmap QX11GLWindowSurface::grabWidget(const QWidget *widget, const QRect& rect) const +{ + if (!widget || m_backBuffer.isNull()) + return QPixmap(); + + QRect srcRect; + + // make sure the rect is inside the widget & clip to widget's rect + if (!rect.isEmpty()) + srcRect = rect & widget->rect(); + else + srcRect = widget->rect(); + + if (srcRect.isEmpty()) + return QPixmap(); + + // If it's a child widget we have to translate the coordinates + if (widget != window()) + srcRect.translate(widget->mapTo(window(), QPoint(0, 0))); + + QPixmap::x11SetDefaultScreen(widget->x11Info().screen()); + + QX11PixmapData *pmd = new QX11PixmapData(QPixmapData::PixmapType); + pmd->resize(srcRect.width(), srcRect.height()); + QPixmap px(pmd); + + GC tmpGc = XCreateGC(X11->display, m_backBuffer.handle(), 0, 0); + + // Make sure all GL rendering is complete before copying the window + QGLContext* ctx = static_cast(m_backBuffer.pixmapData())->context(); + if (QGLContext::currentContext() != ctx && ctx && ctx->isValid()) + ctx->makeCurrent(); + eglWaitClient(); + + // Copy srcRect from the backing store to the new pixmap + XSetGraphicsExposures(X11->display, tmpGc, False); + XCopyArea(X11->display, m_backBuffer.handle(), px.handle(), tmpGc, + srcRect.x(), srcRect.y(), srcRect.width(), srcRect.height(), 0, 0); + XFreeGC(X11->display, tmpGc); + + // Wait until the copy has finised before allowing more rendering into the back buffer + eglWaitNative(EGL_CORE_NATIVE_ENGINE); + + return px; +} + QT_END_NAMESPACE diff --git a/src/opengl/qwindowsurface_x11gl_p.h b/src/opengl/qwindowsurface_x11gl_p.h index 3a952e8..4d493d0 100644 --- a/src/opengl/qwindowsurface_x11gl_p.h +++ b/src/opengl/qwindowsurface_x11gl_p.h @@ -68,6 +68,7 @@ public: void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); void setGeometry(const QRect &rect); bool scroll(const QRegion &area, int dx, int dy); + QPixmap grabWidget(const QWidget *widget, const QRect& rectangle = QRect()) const; private: GC m_windowGC; -- cgit v0.12 From 8f34510750bb125ae749863d0174d96c9e0aabb2 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 22 Apr 2010 16:16:31 +0200 Subject: Make sure recreateEglSurface creates a surface if there isn't one If QGLWidgetPrivate::recreateEglSurface is called after a surface has been deleted, it should always create a new surface and ignore the fact that the window ID may not have changed. Reviewed-By: Trond --- src/opengl/qgl.cpp | 2 +- src/opengl/qgl_p.h | 2 +- src/opengl/qgl_x11egl.cpp | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 394bcbc..72ed6be 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3984,7 +3984,7 @@ bool QGLWidget::event(QEvent *e) if ((e->type() == QEvent::ParentChange) || (e->type() == QEvent::WindowStateChange)) { // The window may have been re-created during re-parent or state change - if so, the EGL // surface will need to be re-created. - d->recreateEglSurface(false); + d->recreateEglSurface(); } #endif #elif defined(Q_WS_WIN) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index ee580a6..f19e394 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -195,7 +195,7 @@ public: #elif defined(Q_WS_X11) QGLOverlayWidget *olw; #ifndef QT_NO_EGL - void recreateEglSurface(bool force); + void recreateEglSurface(); WId eglSurfaceWindowId; #endif #elif defined(Q_WS_MAC) diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index d67a3ea..c0b1515 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -335,24 +335,24 @@ void QGLWidget::setColormap(const QGLColormap &) { } -// Re-creates the EGL surface if the window ID has changed or if force is true -void QGLWidgetPrivate::recreateEglSurface(bool force) +// Re-creates the EGL surface if the window ID has changed or if there isn't a surface +void QGLWidgetPrivate::recreateEglSurface() { Q_Q(QGLWidget); Window currentId = q->winId(); - if ( force || (currentId != eglSurfaceWindowId) ) { - // The window id has changed so we need to re-create the EGL surface - QEglContext *ctx = glcx->d_func()->eglContext; - EGLSurface surface = glcx->d_func()->eglSurface; - if (surface != EGL_NO_SURFACE) - ctx->destroySurface(surface); // Will force doneCurrent() if nec. - surface = ctx->createSurface(q); - if (surface == EGL_NO_SURFACE) - qWarning("Error creating EGL window surface: 0x%x", eglGetError()); - glcx->d_func()->eglSurface = surface; + // If the window ID has changed since the surface was created, we need to delete the + // old surface before re-creating a new one. Note: This should not be the case as the + // surface should be deleted before the old window id. + if (glcx->d_func()->eglSurface != EGL_NO_SURFACE && (currentId != eglSurfaceWindowId)) { + qWarning("EGL surface for deleted window %x was not destroyed", eglSurfaceWindowId); + glcx->d_func()->destroyEglSurfaceForDevice(); + } + if (glcx->d_func()->eglSurface == EGL_NO_SURFACE) { + qDebug("Re-creating the surface"); + glcx->d_func()->eglSurface = glcx->d_func()->eglContext->createSurface(q); eglSurfaceWindowId = currentId; } } -- cgit v0.12 From 5f63f95def838ce72af99dc697ecce092fe7eb69 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 22 Apr 2010 16:20:50 +0200 Subject: Try to use multisampled opengl graphicssystem on all platforms Reviewed-By: Samuel --- src/opengl/qwindowsurface_gl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index ca88de3..b693245 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -97,6 +97,7 @@ extern Q_GUI_EXPORT bool qt_win_owndc_required; QGLGraphicsSystem::QGLGraphicsSystem() : QGraphicsSystem() { + QGLWindowSurface::surfaceFormat.setSampleBuffers(true); #if defined(Q_WS_X11) && !defined(QT_OPENGL_ES) // only override the system defaults if the user hasn't already // picked a visual -- cgit v0.12 From 5184278e6042b7414a38c89f7aeee8c71e9c772d Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 13:09:23 +1000 Subject: Doc. --- src/declarative/qml/qdeclarativecomponent.cpp | 38 ++++++++++++++------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index c86f089..3899e73 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -67,14 +67,14 @@ int statusId = qRegisterMetaType("QDeclarativeCom /*! \class QDeclarativeComponent - \since 4.7 + \since 4.7 \brief The QDeclarativeComponent class encapsulates a QML component description. \mainclass */ /*! \qmlclass Component QDeclarativeComponent - \since 4.7 + \since 4.7 \brief The Component element encapsulates a QML component description. Components are reusable, encapsulated Qml element with a well-defined interface. @@ -86,26 +86,26 @@ int statusId = qRegisterMetaType("QDeclarativeCom file containing it. \qml -Item { - Component { - id: redSquare - Rectangle { - color: "red" - width: 10 - height: 10 + Item { + Component { + id: redSquare + Rectangle { + color: "red" + width: 10 + height: 10 + } } + Loader { sourceComponent: redSquare } + Loader { sourceComponent: redSquare; x: 20 } } - Loader { sourceComponent: redSquare } - Loader { sourceComponent: redSquare; x: 20 } -} \endqml +*/ - \section1 Attached Properties - - \e onCompleted +/*! + \qmlattachedsignal Component::onCompleted() Emitted after component "startup" has completed. This can be used to - execute script code at startup, once the full QML environment has been + execute script code at startup, once the full QML environment has been established. The \c {Component::onCompleted} attached property can be applied to @@ -120,8 +120,10 @@ Item { } } \endqml +*/ - \e onDestruction +/*! + \qmlattachedsignal Component::onDestruction() Emitted as the component begins destruction. This can be used to undo work done in the onCompleted signal, or other imperative code in your @@ -129,7 +131,7 @@ Item { The \c {Component::onDestruction} attached property can be applied to any element. However, it applies to the destruction of the component as - a whole, and not the destruction of the specific object. The order of + a whole, and not the destruction of the specific object. The order of running the \c onDestruction scripts is undefined. \qml -- cgit v0.12 From 02a7574f213901d98766f717d0135685da139d38 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 14:40:56 +1000 Subject: Continue to register base type. --- src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 4238c53..2945b6c 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -143,6 +143,7 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); + qmlRegisterType(); qmlRegisterUncreatableType("Qt",4,7,"KeyNavigation",QDeclarativeKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); qmlRegisterUncreatableType("Qt",4,7,"Keys",QDeclarativeKeysAttached::tr("Keys is only available via attached properties")); -- cgit v0.12 From 64d384e4ec8d9cac98dba3feaab96658b1e27e87 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 14:58:56 +1000 Subject: Rename QDeclarativeExpression::value() to evaluate(). QDeclarativeExpression can be used to evaluate any sort of expression, not just those returning a value. --- src/declarative/QmlChanges.txt | 31 ++++++++++-------- .../graphicsitems/qdeclarativevisualitemmodel.cpp | 6 ++-- src/declarative/qml/qdeclarativeboundsignal.cpp | 4 --- src/declarative/qml/qdeclarativeenginedebug.cpp | 2 +- src/declarative/qml/qdeclarativeexpression.cpp | 16 ++++----- src/declarative/qml/qdeclarativeexpression.h | 2 +- src/declarative/qml/qdeclarativewatcher.cpp | 2 +- src/declarative/util/qdeclarativeanimation.cpp | 2 +- .../util/qdeclarativepropertychanges.cpp | 2 +- src/declarative/util/qdeclarativestategroup.cpp | 2 +- .../util/qdeclarativestateoperations.cpp | 2 +- .../tst_qdeclarativeecmascript.cpp | 38 +++++++++++----------- .../qdeclarativeimage/tst_qdeclarativeimage.cpp | 2 +- .../tst_qdeclarativelistmodel.cpp | 6 ++-- .../tst_qdeclarativelistview.cpp | 2 +- .../tst_qdeclarativepathview.cpp | 2 +- 16 files changed, 61 insertions(+), 60 deletions(-) diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index 55f7b21..9c46467 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -3,6 +3,11 @@ The changes below are pre Qt 4.7.0 RC Flickable: overShoot is replaced by boundsBehavior enumeration. +C++ API +------- +QDeclarativeExpression::value() has been renamed to +QDeclarativeExpression::evaluate() + ============================================================================= The changes below are pre Qt 4.7.0 beta @@ -62,22 +67,22 @@ automatically 'followed' anymore. If you want to follow an hypothetical rect1, you should do now: -     Rectangle { -         color: "green" -         width: 60; height: 60; -         x: rect1.x - 5; y: rect1.y - 5; -         Behavior on x { SmoothedAnimation { velocity: 200 } } -         Behavior on y { SmoothedAnimation { velocity: 200 } } -     } + Rectangle { + color: "green" + width: 60; height: 60; + x: rect1.x - 5; y: rect1.y - 5; + Behavior on x { SmoothedAnimation { velocity: 200 } } + Behavior on y { SmoothedAnimation { velocity: 200 } } + } instead of the old automatic source changed tracking: -     Rectangle { -         color: "green" -         width: 60; height: 60; -         EaseFollow on x { source: rect1.x - 5; velocity: 200 } -         EaseFollow on y { source: rect1.y - 5; velocity: 200 } -    } + Rectangle { + color: "green" + width: 60; height: 60; + EaseFollow on x { source: rect1.x - 5; velocity: 200 } + EaseFollow on y { source: rect1.y - 5; velocity: 200 } + } This is a syntax and behavior change. diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 7fa8cc4..e2d8bc7 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -198,7 +198,7 @@ QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &express QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext); ctxt->setContextObject(d->children.at(index)); QDeclarativeExpression e(ctxt, expression, objectContext); - QVariant value = e.value(); + QVariant value = e.evaluate(); delete ctxt; return value; } @@ -1138,7 +1138,7 @@ QVariant QDeclarativeVisualDataModel::evaluate(int index, const QString &express QDeclarativeItem *item = qobject_cast(nobj); if (item) { QDeclarativeExpression e(qmlContext(item), expression, objectContext); - value = e.value(); + value = e.evaluate(); } } else { QDeclarativeContext *ccontext = d->m_context; @@ -1147,7 +1147,7 @@ QVariant QDeclarativeVisualDataModel::evaluate(int index, const QString &express QDeclarativeVisualDataModelData *data = new QDeclarativeVisualDataModelData(index, this); ctxt->setContextObject(data); QDeclarativeExpression e(ctxt, expression, objectContext); - value = e.value(); + value = e.evaluate(); delete data; delete ctxt; } diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 00a93cc..a10e013 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -97,8 +97,6 @@ QDeclarativeBoundSignal::QDeclarativeBoundSignal(QObject *scope, const QMetaMeth QObject *parent) : m_expression(0), m_signal(signal), m_paramsValid(false), m_params(0) { - // A cached evaluation of the QDeclarativeExpression::value() slot index. - // // This is thread safe. Although it may be updated by two threads, they // will both set it to the same value - so the worst thing that can happen // is that they both do the work to figure it out. Boo hoo. @@ -113,8 +111,6 @@ QDeclarativeBoundSignal::QDeclarativeBoundSignal(QDeclarativeContext *ctxt, cons QObject *parent) : m_expression(0), m_signal(signal), m_paramsValid(false), m_params(0) { - // A cached evaluation of the QDeclarativeExpression::value() slot index. - // // This is thread safe. Although it may be updated by two threads, they // will both set it to the same value - so the worst thing that can happen // is that they both do the work to figure it out. Boo hoo. diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index 264fd8d..69e42f8 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -416,7 +416,7 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message) if (object && context) { QDeclarativeExpression exprObj(context, expr, object); bool undefined = false; - QVariant value = exprObj.value(&undefined); + QVariant value = exprObj.evaluate(&undefined); if (undefined) result = QLatin1String(""); else diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp index 8b5a62f..238beb8 100644 --- a/src/declarative/qml/qdeclarativeexpression.cpp +++ b/src/declarative/qml/qdeclarativeexpression.cpp @@ -479,18 +479,18 @@ QVariant QDeclarativeExpressionPrivate::value(QObject *secondaryScope, bool *isU } /*! - Returns the value of the expression, or an invalid QVariant if the - expression is invalid or has an error. + Evaulates the expression, returning the result of the evaluation, + or an invalid QVariant if the expression is invalid or has an error. - \a isUndefined is set to true if the expression resulted in an + \a valueIsUndefined is set to true if the expression resulted in an undefined value. \sa hasError(), error() */ -QVariant QDeclarativeExpression::value(bool *isUndefined) +QVariant QDeclarativeExpression::evaluate(bool *valueIsUndefined) { Q_D(QDeclarativeExpression); - return d->value(0, isUndefined); + return d->value(0, valueIsUndefined); } /*! @@ -569,7 +569,7 @@ QObject *QDeclarativeExpression::scopeObject() const } /*! - Returns true if the last call to value() resulted in an error, + Returns true if the last call to evaluate() resulted in an error, otherwise false. \sa error(), clearError() @@ -593,7 +593,7 @@ void QDeclarativeExpression::clearError() } /*! - Return any error from the last call to value(). If there was no error, + Return any error from the last call to evaluate(). If there was no error, this returns an invalid QDeclarativeError instance. \sa hasError(), clearError() @@ -711,7 +711,7 @@ void QDeclarativeExpressionPrivate::updateGuards(const QPODVectorvalue(); + v = m_expr->evaluate(); else v = m_property.read(m_object); diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 4f7719b..3b0d264 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -780,7 +780,7 @@ void QDeclarativeScriptActionPrivate::execute() QDeclarativeData *ddata = QDeclarativeData::get(q); if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); - expr.value(); + expr.evaluate(); if (expr.hasError()) qmlInfo(q) << expr.error(); } diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 8a6937d..2641dcf 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -434,7 +434,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() a.specifiedProperty = QString::fromUtf8(property); if (d->isExplicit) { - a.toValue = d->expressions.at(ii).second->value(); + a.toValue = d->expressions.at(ii).second->evaluate(); } else { QDeclarativeBinding *newBinding = new QDeclarativeBinding(d->expressions.at(ii).second->expression(), object(), qmlContext(this)); diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp index 81f4230..2349ce1 100644 --- a/src/declarative/util/qdeclarativestategroup.cpp +++ b/src/declarative/util/qdeclarativestategroup.cpp @@ -288,7 +288,7 @@ bool QDeclarativeStateGroupPrivate::updateAutoState() QDeclarativeState *state = states.at(ii); if (state->isWhenKnown()) { if (!state->name().isEmpty()) { - if (state->when() && state->when()->value().toBool()) { + if (state->when() && state->when()->evaluate().toBool()) { if (stateChangeDebug()) qWarning() << "Setting auto state due to:" << state->when()->expression(); diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 0aad498..9049b83 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -579,7 +579,7 @@ void QDeclarativeStateChangeScript::execute(Reason) QDeclarativeData *ddata = QDeclarativeData::get(this); if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber); - expr.value(); + expr.evaluate(); if (expr.hasError()) qmlInfo(this, expr.error()); } diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 6939290..97fced4 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -381,7 +381,7 @@ void tst_qdeclarativeecmascript::basicExpressions() nestedContext.setContextProperty("millipedeLegs", QVariant(100)); MyExpression expr(nest?&nestedContext:&context, expression); - QCOMPARE(expr.value(), result); + QCOMPARE(expr.evaluate(), result); } void tst_qdeclarativeecmascript::arrayExpressions() @@ -396,7 +396,7 @@ void tst_qdeclarativeecmascript::arrayExpressions() context.setContextProperty("c", &obj3); MyExpression expr(&context, "[a, b, c, 10]"); - QVariant result = expr.value(); + QVariant result = expr.evaluate(); QCOMPARE(result.userType(), qMetaTypeId >()); QList list = qvariant_cast >(result); QCOMPARE(list.count(), 4); @@ -424,47 +424,47 @@ void tst_qdeclarativeecmascript::contextPropertiesTriggerReeval() { MyExpression expr(&context, "testProp + 1"); QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant(2)); + QCOMPARE(expr.evaluate(), QVariant(2)); context.setContextProperty("testProp", QVariant(2)); QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant(3)); + QCOMPARE(expr.evaluate(), QVariant(3)); } { MyExpression expr(&context, "testProp + testProp + testProp"); QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant(6)); + QCOMPARE(expr.evaluate(), QVariant(6)); context.setContextProperty("testProp", QVariant(4)); QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant(12)); + QCOMPARE(expr.evaluate(), QVariant(12)); } { MyExpression expr(&context, "testObj.stringProperty"); QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant("Hello")); + QCOMPARE(expr.evaluate(), QVariant("Hello")); context.setContextProperty("testObj", &object2); QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant("World")); + QCOMPARE(expr.evaluate(), QVariant("World")); } { MyExpression expr(&context, "testObj.stringProperty /**/"); QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant("World")); + QCOMPARE(expr.evaluate(), QVariant("World")); context.setContextProperty("testObj", &object1); QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant("Hello")); + QCOMPARE(expr.evaluate(), QVariant("Hello")); } { MyExpression expr(&context, "testObj2"); QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant::fromValue((QObject *)object3)); + QCOMPARE(expr.evaluate(), QVariant::fromValue((QObject *)object3)); } } @@ -484,42 +484,42 @@ void tst_qdeclarativeecmascript::objectPropertiesTriggerReeval() { MyExpression expr(&context, "testObj.stringProperty"); QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant("Hello")); + QCOMPARE(expr.evaluate(), QVariant("Hello")); object1.setStringProperty(QLatin1String("World")); QCOMPARE(expr.changed, true); - QCOMPARE(expr.value(), QVariant("World")); + QCOMPARE(expr.evaluate(), QVariant("World")); } { MyExpression expr(&context, "testObj.objectProperty.stringProperty"); QCOMPARE(expr.changed, false); - QCOMPARE(expr.value(), QVariant()); + QCOMPARE(expr.evaluate(), QVariant()); object1.setObjectProperty(&object2); QCOMPARE(expr.changed, true); expr.changed = false; - QCOMPARE(expr.value(), QVariant("Dog")); + QCOMPARE(expr.evaluate(), QVariant("Dog")); object1.setObjectProperty(&object3); QCOMPARE(expr.changed, true); expr.changed = false; - QCOMPARE(expr.value(), QVariant("Cat")); + QCOMPARE(expr.evaluate(), QVariant("Cat")); object1.setObjectProperty(0); QCOMPARE(expr.changed, true); expr.changed = false; - QCOMPARE(expr.value(), QVariant()); + QCOMPARE(expr.evaluate(), QVariant()); object1.setObjectProperty(&object3); QCOMPARE(expr.changed, true); expr.changed = false; - QCOMPARE(expr.value(), QVariant("Cat")); + QCOMPARE(expr.evaluate(), QVariant("Cat")); object3.setStringProperty("Donkey"); QCOMPARE(expr.changed, true); expr.changed = false; - QCOMPARE(expr.value(), QVariant("Donkey")); + QCOMPARE(expr.evaluate(), QVariant("Donkey")); } } diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 73aefaf..e0143a6 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -401,7 +401,7 @@ T *tst_qdeclarativeimage::findItem(QGraphicsObject *parent, const QString &objec if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { if (index != -1) { QDeclarativeExpression e(qmlContext(item), "index", item); - if (e.value().toInt() == index) + if (e.evaluate().toInt() == index) return static_cast(item); } else { return static_cast(item); diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index e4c296f..ec97461 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -279,7 +279,7 @@ void tst_qdeclarativelistmodel::dynamic() if (!warning.isEmpty()) QTest::ignoreMessage(QtWarningMsg, warning.toLatin1()); - int actual = e.value().toInt(); + int actual = e.evaluate().toInt(); if (e.hasError()) qDebug() << e.error(); // errors not expected QVERIFY(!e.hasError()); @@ -338,9 +338,9 @@ void tst_qdeclarativelistmodel::dynamic_worker() QDeclarativeExpression e(eng.rootContext(), operations.last().toString(), &model); if (QByteArray(QTest::currentDataTag()).startsWith("nested")) - QVERIFY(e.value().toInt() != result); + QVERIFY(e.evaluate().toInt() != result); else - QCOMPARE(e.value().toInt(), result); + QCOMPARE(e.evaluate().toInt(), result); } delete item; diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 6b7a361..cab4d52 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -1551,7 +1551,7 @@ T *tst_QDeclarativeListView::findItem(QGraphicsObject *parent, const QString &ob if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { if (index != -1) { QDeclarativeExpression e(qmlContext(item), "index", item); - if (e.value().toInt() == index) + if (e.evaluate().toInt() == index) return static_cast(item); } else { return static_cast(item); diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index df7c511..0e3a74d 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -697,7 +697,7 @@ T *tst_QDeclarativePathView::findItem(QGraphicsObject *parent, const QString &ob if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { if (index != -1) { QDeclarativeExpression e(qmlContext(item), "index", item); - if (e.value().toInt() == index) + if (e.evaluate().toInt() == index) return static_cast(item); } else { return static_cast(item); -- cgit v0.12 From 05873d7662947ef59f429f5e3b63c1b7a3d71cd3 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 15:53:44 +1000 Subject: Workaround no longer needed. --- src/declarative/graphicsitems/qdeclarativerectangle.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 3daa83f..0328f91 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -357,9 +357,7 @@ void QDeclarativeRectangle::generateBorderedRect() Q_D(QDeclarativeRectangle); if (d->rectImage.isNull()) { const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0; - // Adding 5 here makes qDrawBorderPixmap() paint correctly with smooth: true - // Ideally qDrawBorderPixmap() would be fixed - QTBUG-7999 - d->rectImage = QPixmap(pw*2 + 5, pw*2 + 5); + d->rectImage = QPixmap(pw*2 + 3, pw*2 + 3); d->rectImage.fill(Qt::transparent); QPainter p(&(d->rectImage)); p.setRenderHint(QPainter::Antialiasing); -- cgit v0.12 From 5fc042155015f39b1c26ac7700e7d1b6346e79e2 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 15:59:29 +1000 Subject: Use Q_DECLARE_PRIVATE for private slot. --- src/declarative/qml/qdeclarativeexpression.cpp | 8 ++++---- src/declarative/qml/qdeclarativeexpression.h | 5 ++--- src/declarative/qml/qdeclarativeexpression_p.h | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp index 238beb8..f561a7e 100644 --- a/src/declarative/qml/qdeclarativeexpression.cpp +++ b/src/declarative/qml/qdeclarativeexpression.cpp @@ -606,10 +606,9 @@ QDeclarativeError QDeclarativeExpression::error() const } /*! \internal */ -void QDeclarativeExpression::__q_notify() +void QDeclarativeExpressionPrivate::_q_notify() { - Q_D(QDeclarativeExpression); - d->emitValueChanged(); + emitValueChanged(); } void QDeclarativeExpressionPrivate::clearGuards() @@ -625,7 +624,7 @@ void QDeclarativeExpressionPrivate::updateGuards(const QPODVectorguardListLength) { QDeclarativeNotifierEndpoint *newGuardList = @@ -771,3 +770,4 @@ bool QDeclarativeAbstractExpression::isValid() const QT_END_NAMESPACE +#include diff --git a/src/declarative/qml/qdeclarativeexpression.h b/src/declarative/qml/qdeclarativeexpression.h index c283dd9..6c72e4d 100644 --- a/src/declarative/qml/qdeclarativeexpression.h +++ b/src/declarative/qml/qdeclarativeexpression.h @@ -97,13 +97,12 @@ protected: QDeclarativeExpression(QDeclarativeContextData *, void *, QDeclarativeRefCount *rc, QObject *me, const QString &, int, QDeclarativeExpressionPrivate &dd); -private Q_SLOTS: - void __q_notify(); - private: QDeclarativeExpression(QDeclarativeContextData *, const QString &, QObject *); + Q_DISABLE_COPY(QDeclarativeExpression) Q_DECLARE_PRIVATE(QDeclarativeExpression) + Q_PRIVATE_SLOT(d_func(), void _q_notify()) friend class QDeclarativeDebugger; friend class QDeclarativeContext; friend class QDeclarativeVME; diff --git a/src/declarative/qml/qdeclarativeexpression_p.h b/src/declarative/qml/qdeclarativeexpression_p.h index d39aa2c..4ff3162 100644 --- a/src/declarative/qml/qdeclarativeexpression_p.h +++ b/src/declarative/qml/qdeclarativeexpression_p.h @@ -164,6 +164,7 @@ public: return expr->q_func(); } + void _q_notify(); virtual void emitValueChanged(); static void exceptionToError(QScriptEngine *, QDeclarativeError &); -- cgit v0.12 From e3d525487cf07358502e419a4d4560996d4fccf4 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 16:10:26 +1000 Subject: Add missing Q_DISABLE_COPYs. --- src/declarative/qml/qdeclarativecomponent.h | 1 + src/declarative/qml/qdeclarativecontext.h | 1 + src/declarative/qml/qdeclarativeengine.h | 1 + src/declarative/qml/qdeclarativeextensionplugin.h | 3 +++ src/declarative/util/qdeclarativeview.h | 2 ++ 5 files changed, 8 insertions(+) diff --git a/src/declarative/qml/qdeclarativecomponent.h b/src/declarative/qml/qdeclarativecomponent.h index 526a319..f3cfe3c 100644 --- a/src/declarative/qml/qdeclarativecomponent.h +++ b/src/declarative/qml/qdeclarativecomponent.h @@ -117,6 +117,7 @@ protected: private: QDeclarativeComponent(QDeclarativeEngine *, QDeclarativeCompiledData *, int, int, QObject *parent); + Q_DISABLE_COPY(QDeclarativeComponent) friend class QDeclarativeVME; friend class QDeclarativeCompositeTypeData; }; diff --git a/src/declarative/qml/qdeclarativecontext.h b/src/declarative/qml/qdeclarativecontext.h index 94c9f4a..548869c 100644 --- a/src/declarative/qml/qdeclarativecontext.h +++ b/src/declarative/qml/qdeclarativecontext.h @@ -103,6 +103,7 @@ private: friend class QDeclarativeContextData; QDeclarativeContext(QDeclarativeContextData *); QDeclarativeContext(QDeclarativeEngine *, bool); + Q_DISABLE_COPY(QDeclarativeContext) }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h index e161cd9..01487f5 100644 --- a/src/declarative/qml/qdeclarativeengine.h +++ b/src/declarative/qml/qdeclarativeengine.h @@ -118,6 +118,7 @@ Q_SIGNALS: void warnings(const QList &warnings); private: + Q_DISABLE_COPY(QDeclarativeEngine) Q_DECLARE_PRIVATE(QDeclarativeEngine) }; diff --git a/src/declarative/qml/qdeclarativeextensionplugin.h b/src/declarative/qml/qdeclarativeextensionplugin.h index 8095ec7..8a9378a 100644 --- a/src/declarative/qml/qdeclarativeextensionplugin.h +++ b/src/declarative/qml/qdeclarativeextensionplugin.h @@ -64,6 +64,9 @@ public: virtual void registerTypes(const char *uri) = 0; virtual void initializeEngine(QDeclarativeEngine *engine, const char *uri); + +private: + Q_DISABLE_COPY(QDeclarativeExtensionPlugin) }; QT_END_NAMESPACE diff --git a/src/declarative/util/qdeclarativeview.h b/src/declarative/util/qdeclarativeview.h index 1807758..3513c04 100644 --- a/src/declarative/util/qdeclarativeview.h +++ b/src/declarative/util/qdeclarativeview.h @@ -105,8 +105,10 @@ protected: virtual void setRootObject(QObject *obj); virtual bool eventFilter(QObject *watched, QEvent *e); +private: friend class QDeclarativeViewPrivate; QDeclarativeViewPrivate *d; + Q_DISABLE_COPY(QDeclarativeView) }; QT_END_NAMESPACE -- cgit v0.12 From f6f247737c15e8180299b1c1c3f3704434a9b29a Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 22 Apr 2010 16:45:48 +1000 Subject: Update visual tests after some painter updates. --- .../qdeclarativeborderimage/data/borders.0.png | Bin 23029 -> 22832 bytes .../qdeclarativepositioners/data/usingRepeater.qml | 166 ++++++++++----------- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.0.png b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.0.png index 80cbd26..bb9dfbb 100644 Binary files a/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.0.png and b/tests/auto/declarative/qmlvisual/qdeclarativeborderimage/data/borders.0.png differ diff --git a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml index a4036fe..b293d70 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.qml @@ -6,334 +6,334 @@ VisualTest { } Frame { msec: 16 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 32 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 48 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 64 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 80 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 96 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 112 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 128 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 144 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 160 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 176 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 192 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 208 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 224 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 240 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 256 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 272 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 288 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 304 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 320 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 336 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 352 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 368 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 384 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 400 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 416 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 432 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 448 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 464 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 480 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 496 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 512 - hash: "0273c293855f2b2bdbf579fc5cdce63f" + hash: "b72bfb206ae52e0e4fb8927b82d64b64" } Frame { msec: 528 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 544 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 560 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 576 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 592 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 608 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 624 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 640 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 656 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 672 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 688 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 704 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 720 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 736 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 752 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 768 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 784 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 800 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 816 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 832 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 848 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 864 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 880 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 896 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 912 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 928 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 944 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 960 - image: "repeater.0.png" + image: "usingRepeater.0.png" } Frame { msec: 976 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 992 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1008 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1024 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1040 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1056 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1072 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1088 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1104 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1120 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1136 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1152 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1168 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1184 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1200 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1216 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1232 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1248 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1264 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1280 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1296 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1312 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } Frame { msec: 1328 - hash: "53a01771047c8ec806a335a1a3d6af71" + hash: "f2de1f70c5f242604beb4ee0251c8032" } } -- cgit v0.12 From 92e7f06b3690e6e39af8fac7af6c101b416b0f4c Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 23 Apr 2010 11:52:06 +1000 Subject: Don't crash if Connections::target is changed by one of its signal handlers Reviewed-by: Michael Brasser --- src/declarative/qml/qdeclarativeboundsignal.cpp | 6 +++-- src/declarative/qml/qdeclarativeboundsignal_p.h | 5 ++++- src/declarative/util/qdeclarativeconnections.cpp | 10 +++++++-- .../data/connection-targetchange.qml | 25 +++++++++++++++++++++ .../tst_qdeclarativeconnection.cpp | 26 ++++++++++++++++++++++ 5 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 00a93cc..eb352a2 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -95,7 +95,7 @@ QDeclarativeAbstractBoundSignal::~QDeclarativeAbstractBoundSignal() QDeclarativeBoundSignal::QDeclarativeBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *parent) -: m_expression(0), m_signal(signal), m_paramsValid(false), m_params(0) +: m_expression(0), m_signal(signal), m_paramsValid(false), m_isEvaluating(false), m_params(0) { // A cached evaluation of the QDeclarativeExpression::value() slot index. // @@ -111,7 +111,7 @@ QDeclarativeBoundSignal::QDeclarativeBoundSignal(QObject *scope, const QMetaMeth QDeclarativeBoundSignal::QDeclarativeBoundSignal(QDeclarativeContext *ctxt, const QString &val, QObject *scope, const QMetaMethod &signal, QObject *parent) -: m_expression(0), m_signal(signal), m_paramsValid(false), m_params(0) +: m_expression(0), m_signal(signal), m_paramsValid(false), m_isEvaluating(false), m_params(0) { // A cached evaluation of the QDeclarativeExpression::value() slot index. // @@ -169,6 +169,7 @@ QDeclarativeBoundSignal *QDeclarativeBoundSignal::cast(QObject *o) int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) { if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) { + m_isEvaluating = true; if (!m_paramsValid) { if (!m_signal.parameterTypes().isEmpty()) m_params = new QDeclarativeBoundSignalParameters(m_signal, this); @@ -182,6 +183,7 @@ int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) QDeclarativeEnginePrivate::warning(m_expression->engine(), m_expression->error()); } if (m_params) m_params->clearValues(); + m_isEvaluating = false; return -1; } else { return QObject::qt_metacall(c, id, a); diff --git a/src/declarative/qml/qdeclarativeboundsignal_p.h b/src/declarative/qml/qdeclarativeboundsignal_p.h index bba4eec..06900d7 100644 --- a/src/declarative/qml/qdeclarativeboundsignal_p.h +++ b/src/declarative/qml/qdeclarativeboundsignal_p.h @@ -83,6 +83,8 @@ public: QDeclarativeExpression *expression() const; QDeclarativeExpression *setExpression(QDeclarativeExpression *); + bool isEvaluating() const { return m_isEvaluating; } + static QDeclarativeBoundSignal *cast(QObject *); protected: @@ -91,7 +93,8 @@ protected: private: QDeclarativeExpression *m_expression; QMetaMethod m_signal; - bool m_paramsValid; + bool m_paramsValid : 1; + bool m_isEvaluating : 1; QDeclarativeBoundSignalParameters *m_params; }; diff --git a/src/declarative/util/qdeclarativeconnections.cpp b/src/declarative/util/qdeclarativeconnections.cpp index 596b306..c188521 100644 --- a/src/declarative/util/qdeclarativeconnections.cpp +++ b/src/declarative/util/qdeclarativeconnections.cpp @@ -150,8 +150,14 @@ void QDeclarativeConnections::setTarget(QObject *obj) Q_D(QDeclarativeConnections); if (d->target == obj) return; - foreach (QDeclarativeBoundSignal *s, d->boundsignals) - delete s; + foreach (QDeclarativeBoundSignal *s, d->boundsignals) { + // It is possible that target is being changed due to one of our signal + // handlers -> use deleteLater(). + if (s->isEvaluating()) + s->deleteLater(); + else + delete s; + } d->boundsignals.clear(); d->target = obj; connectSignals(); diff --git a/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml b/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml new file mode 100644 index 0000000..bb9a3bc --- /dev/null +++ b/tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml @@ -0,0 +1,25 @@ +import Qt 4.7 + +Item { + Component { + id: item1 + Item { + objectName: "item1" + } + } + Component { + id: item2 + Item { + objectName: "item2" + } + } + Loader { + id: loader + sourceComponent: item1 + } + Connections { + objectName: "connections" + target: loader.item + onWidthChanged: loader.sourceComponent = item2 + } +} diff --git a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp index f4914e1..0efae3b 100644 --- a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp +++ b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp @@ -58,6 +58,7 @@ private slots: void properties(); void connection(); void trimming(); + void targetChanged(); private: QDeclarativeEngine engine; @@ -130,6 +131,31 @@ void tst_qdeclarativeconnection::trimming() delete item; } +// Confirm that target can be changed by one of our signal handlers +void tst_qdeclarativeconnection::targetChanged() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/connection-targetchange.qml")); + QDeclarativeItem *item = qobject_cast(c.create()); + QVERIFY(item != 0); + + QDeclarativeConnections *connections = item->findChild("connections"); + QVERIFY(connections); + + QDeclarativeItem *item1 = item->findChild("item1"); + QVERIFY(item1); + + item1->setWidth(200); + + QDeclarativeItem *item2 = item->findChild("item2"); + QVERIFY(item2); + QVERIFY(connections->target() == item2); + + // If we don't crash then we're OK + + delete item; +} + QTEST_MAIN(tst_qdeclarativeconnection) #include "tst_qdeclarativeconnection.moc" -- cgit v0.12 From 6a56b0222c15116150dd78883204f65708a927ca Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Fri, 23 Apr 2010 16:08:55 +1000 Subject: Remove trace code from directshowaudioendpointcontrol.h. Quack. Reviewed-by: Justin McPherson --- .../directshow/mediaplayer/directshowaudioendpointcontrol.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h index 5dd36c3..8d23751 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.h @@ -82,11 +82,6 @@ private: #define QAudioEndpointSelector_iid "com.nokia.Qt.QAudioEndpointSelector/1.0" -class Duck -{ - uint quack; -}; - QT_END_NAMESPACE QT_END_HEADER -- cgit v0.12 From 41b110e17b3deb102c7521d19964896228fcc8c6 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 23 Apr 2010 09:39:40 +0200 Subject: Stub implementations for EGL for symbian This is done to keep binary compatibility between Qt built with openvg vs Qt built without openvg support. The problem is that Symbian uses .def files to map between exported symbol names and ordinals in the DLL export table. The alternative of manually maintaining two versions of the QtGui def files proved to be too error prone and time consuming. Note that the EGL exports are defined in a private header, for use by the openvg and opengl graphics system plugins. These plugins should always be compiled against Qt configured with support for the graphics system, as the headers contain default parameters which are inlined into the plugin binary. Task-number: QTBUG-7870 Reviewed-by: Tom Cooksey --- src/gui/egl/egl.pri | 43 +++--- src/gui/egl/qegl_p.h | 28 +++- src/gui/egl/qegl_stub.cpp | 292 ++++++++++++++++++++++++++++++++++++ src/gui/egl/qeglproperties_stub.cpp | 148 ++++++++++++++++++ src/gui/gui.pro | 3 +- src/s60installs/bwins/QtGuiu.def | 106 ++++++------- src/s60installs/eabi/QtGuiu.def | 88 +++++------ 7 files changed, 587 insertions(+), 121 deletions(-) create mode 100644 src/gui/egl/qegl_stub.cpp create mode 100644 src/gui/egl/qeglproperties_stub.cpp diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri index b90b9b0..9ca1f0a 100644 --- a/src/gui/egl/egl.pri +++ b/src/gui/egl/egl.pri @@ -1,24 +1,29 @@ -CONFIG += egl +contains(QT_CONFIG, egl): { + CONFIG += egl -HEADERS += \ - egl/qegl_p.h \ - egl/qeglcontext_p.h \ - egl/qeglproperties_p.h + HEADERS += \ + egl/qegl_p.h \ + egl/qeglcontext_p.h \ + egl/qeglproperties_p.h -SOURCES += \ - egl/qegl.cpp \ - egl/qeglproperties.cpp + SOURCES += \ + egl/qegl.cpp \ + egl/qeglproperties.cpp -wince*: SOURCES += egl/qegl_wince.cpp + wince*: SOURCES += egl/qegl_wince.cpp -unix { - embedded { - SOURCES += egl/qegl_qws.cpp - } else { - symbian { - SOURCES += egl/qegl_symbian.cpp - } else { - SOURCES += egl/qegl_x11.cpp - } - } + unix { + embedded { + SOURCES += egl/qegl_qws.cpp + } else { + symbian { + SOURCES += egl/qegl_symbian.cpp + } else { + SOURCES += egl/qegl_x11.cpp + } + } + } +} else:symbian { + SOURCES += egl/qegl_stub.cpp + SOURCES += egl/qeglproperties_stub.cpp } diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h index 83bdb5e..6c562ef 100644 --- a/src/gui/egl/qegl_p.h +++ b/src/gui/egl/qegl_p.h @@ -55,6 +55,7 @@ QT_BEGIN_INCLUDE_NAMESPACE +#ifndef QT_NO_EGL #if defined(QT_OPENGL_ES_2) # include #endif @@ -64,6 +65,23 @@ QT_BEGIN_INCLUDE_NAMESPACE #else # include #endif +#else + +//types from egltypes.h for compiling stub without EGL headers +typedef int EGLBoolean; +typedef int EGLint; +typedef int EGLenum; +typedef int NativeDisplayType; +typedef void* NativeWindowType; +typedef void* NativePixmapType; +typedef int EGLDisplay; +typedef int EGLConfig; +typedef int EGLSurface; +typedef int EGLContext; +typedef int EGLClientBuffer; +#define EGL_NONE 0x3038 /* Attrib list terminator */ + +#endif #if defined(Q_WS_X11) // If included , then the global namespace @@ -169,7 +187,7 @@ namespace QEgl { Translucent = 0x01, Renderable = 0x02 // Config will be compatable with the paint engines (VG or GL) }; - Q_DECLARE_FLAGS(ConfigOptions, ConfigOption); + Q_DECLARE_FLAGS(ConfigOptions, ConfigOption) // Most of the time we use the same config for things like widgets & pixmaps, so rather than // go through the eglChooseConfig loop every time, we use defaultConfig, which will return @@ -182,7 +200,11 @@ namespace QEgl { Q_GUI_EXPORT void dumpAllConfigs(); +#ifdef QT_NO_EGL + Q_GUI_EXPORT QString errorString(EGLint code = 0); +#else Q_GUI_EXPORT QString errorString(EGLint code = eglGetError()); +#endif Q_GUI_EXPORT QString extensions(); Q_GUI_EXPORT bool hasExtension(const char* extensionName); @@ -200,9 +222,9 @@ namespace QEgl { #ifdef Q_WS_X11 Q_GUI_EXPORT VisualID getCompatibleVisualId(EGLConfig config); #endif -}; +} -Q_DECLARE_OPERATORS_FOR_FLAGS(QEgl::ConfigOptions); +Q_DECLARE_OPERATORS_FOR_FLAGS(QEgl::ConfigOptions) QT_END_NAMESPACE diff --git a/src/gui/egl/qegl_stub.cpp b/src/gui/egl/qegl_stub.cpp new file mode 100644 index 0000000..0bd3451 --- /dev/null +++ b/src/gui/egl/qegl_stub.cpp @@ -0,0 +1,292 @@ +/**************************************************************************** +** +** 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 QtGui 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 + +#include "qegl_p.h" +#include "qeglcontext_p.h" + + +QT_BEGIN_NAMESPACE + +static void noegl(const char *fn) +{ + qWarning() << fn << " called, but Qt configured without EGL" << endl; +} + +#define NOEGL noegl(__FUNCTION__); + +QEglContext::QEglContext() + : apiType(QEgl::OpenGL) + , ctx(0) + , cfg(QEGL_NO_CONFIG) + , currentSurface(0) + , current(false) + , ownsContext(true) + , sharing(false) +{ + NOEGL +} + +QEglContext::~QEglContext() +{ + NOEGL +} + +bool QEglContext::isValid() const +{ + NOEGL + return false; +} + +bool QEglContext::isCurrent() const +{ + NOEGL + return false; +} + +EGLConfig QEgl::defaultConfig(int devType, API api, ConfigOptions options) +{ + Q_UNUSED(devType) + Q_UNUSED(api) + Q_UNUSED(options) + NOEGL + return QEGL_NO_CONFIG; +} + + +// Choose a configuration that matches "properties". +EGLConfig QEgl::chooseConfig(const QEglProperties* properties, QEgl::PixelFormatMatch match) +{ + Q_UNUSED(properties) + Q_UNUSED(match) + NOEGL + return QEGL_NO_CONFIG; +} + +bool QEglContext::chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match) +{ + Q_UNUSED(properties) + Q_UNUSED(match) + NOEGL + return false; +} + +EGLSurface QEglContext::createSurface(QPaintDevice* device, const QEglProperties *properties) +{ + Q_UNUSED(device) + Q_UNUSED(properties) + NOEGL + return 0; +} + + +// Create the EGLContext. +bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties *properties) +{ + Q_UNUSED(shareContext) + Q_UNUSED(properties) + NOEGL + return false; +} + +// Destroy an EGL surface object. If it was current on this context +// then call doneCurrent() for it first. +void QEglContext::destroySurface(EGLSurface surface) +{ + Q_UNUSED(surface) + NOEGL +} + +// Destroy the context. Note: this does not destroy the surface. +void QEglContext::destroyContext() +{ + NOEGL +} + +bool QEglContext::makeCurrent(EGLSurface surface) +{ + Q_UNUSED(surface) + NOEGL + return false; +} + +bool QEglContext::doneCurrent() +{ + NOEGL + return false; +} + +// Act as though doneCurrent() was called, but keep the context +// and the surface active for the moment. This allows makeCurrent() +// to skip a call to eglMakeCurrent() if we are using the same +// surface as the last set of painting operations. We leave the +// currentContext() pointer as-is for now. +bool QEglContext::lazyDoneCurrent() +{ + NOEGL + return false; +} + +bool QEglContext::swapBuffers(EGLSurface surface) +{ + Q_UNUSED(surface) + NOEGL + return false; +} + +int QEglContext::configAttrib(int name) const +{ + Q_UNUSED(name) + NOEGL + return 0; +} + +typedef EGLImageKHR (EGLAPIENTRY *_eglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, const EGLint*); +typedef EGLBoolean (EGLAPIENTRY *_eglDestroyImageKHR)(EGLDisplay, EGLImageKHR); + +// Defined in qegl.cpp: +static _eglCreateImageKHR qt_eglCreateImageKHR = 0; +static _eglDestroyImageKHR qt_eglDestroyImageKHR = 0; + + +EGLDisplay QEgl::display() +{ + NOEGL + return 0; +} + +EGLImageKHR QEgl::eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) +{ + Q_UNUSED(dpy) + Q_UNUSED(ctx) + Q_UNUSED(target) + Q_UNUSED(buffer) + Q_UNUSED(attrib_list) + NOEGL + return 0; +} + +EGLBoolean QEgl::eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) +{ + Q_UNUSED(dpy) + Q_UNUSED(img) + NOEGL + return 0; +} + + +#ifndef Q_WS_X11 +EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *properties) +{ + Q_UNUSED(device) + Q_UNUSED(cfg) + Q_UNUSED(properties) + NOEGL + return 0; +} +#endif + + +// Return the error string associated with a specific code. +QString QEgl::errorString(EGLint code) +{ + Q_UNUSED(code) + NOEGL + return QString(); +} + +// Dump all of the EGL configurations supported by the system. +void QEgl::dumpAllConfigs() +{ + NOEGL +} + +QString QEgl::extensions() +{ + NOEGL + return QString(); +} + +bool QEgl::hasExtension(const char* extensionName) +{ + Q_UNUSED(extensionName) + NOEGL + return false; +} + +QEglContext *QEglContext::currentContext(QEgl::API api) +{ + Q_UNUSED(api) + NOEGL + return false; +} + +void QEglContext::setCurrentContext(QEgl::API api, QEglContext *context) +{ + Q_UNUSED(api) + Q_UNUSED(context) + NOEGL +} + +EGLNativeDisplayType QEgl::nativeDisplay() +{ + NOEGL + return 0; +} + +EGLNativeWindowType QEgl::nativeWindow(QWidget* widget) +{ + Q_UNUSED(widget) + NOEGL + return (EGLNativeWindowType)0; +} + +EGLNativePixmapType QEgl::nativePixmap(QPixmap*) +{ + NOEGL + return (EGLNativePixmapType)0; +} + +QT_END_NAMESPACE diff --git a/src/gui/egl/qeglproperties_stub.cpp b/src/gui/egl/qeglproperties_stub.cpp new file mode 100644 index 0000000..2012ebd --- /dev/null +++ b/src/gui/egl/qeglproperties_stub.cpp @@ -0,0 +1,148 @@ +/**************************************************************************** +** +** 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 QtGui 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 "qeglproperties_p.h" +#include "qeglcontext_p.h" + +QT_BEGIN_NAMESPACE + +static void noegl(const char *fn) +{ + qWarning() << fn << " called, but Qt configured without EGL" << endl; +} + +#define NOEGL noegl(__FUNCTION__); + +// Initialize a property block. +QEglProperties::QEglProperties() +{ + NOEGL +} + +QEglProperties::QEglProperties(EGLConfig cfg) +{ + Q_UNUSED(cfg) + NOEGL +} + +// Fetch the current value associated with a property. +int QEglProperties::value(int name) const +{ + Q_UNUSED(name) + NOEGL + return 0; +} + +// Set the value associated with a property, replacing an existing +// value if there is one. +void QEglProperties::setValue(int name, int value) +{ + Q_UNUSED(name) + Q_UNUSED(value) + NOEGL +} + +// Remove a property value. Returns false if the property is not present. +bool QEglProperties::removeValue(int name) +{ + Q_UNUSED(name) + NOEGL + return false; +} + +void QEglProperties::setDeviceType(int devType) +{ + Q_UNUSED(devType) + NOEGL +} + + +// Sets the red, green, blue, and alpha sizes based on a pixel format. +// Normally used to match a configuration request to the screen format. +void QEglProperties::setPixelFormat(QImage::Format pixelFormat) +{ + Q_UNUSED(pixelFormat) + NOEGL + +} + +void QEglProperties::setRenderableType(QEgl::API api) +{ + Q_UNUSED(api); + NOEGL +} + +// Reduce the complexity of a configuration request to ask for less +// because the previous request did not result in success. Returns +// true if the complexity was reduced, or false if no further +// reductions in complexity are possible. +bool QEglProperties::reduceConfiguration() +{ + NOEGL + return false; +} + +static void addTag(QString& str, const QString& tag) +{ + Q_UNUSED(str) + Q_UNUSED(tag) + NOEGL +} + +// Convert a property list to a string suitable for debug output. +QString QEglProperties::toString() const +{ + NOEGL + return QString(); +} + +void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev) +{ + Q_UNUSED(dev) + NOEGL +} + +QT_END_NAMESPACE + + diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 300a03f..a6370b2 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -40,9 +40,8 @@ include(statemachine/statemachine.pri) include(math3d/math3d.pri) include(effects/effects.pri) -contains(QT_CONFIG, egl): include(egl/egl.pri) +include(egl/egl.pri) win32:!wince*: DEFINES += QT_NO_EGL - embedded: QT += network QMAKE_LIBS += $$QMAKE_LIBS_GUI diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index a948f73..d99a6e4 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12551,56 +12551,56 @@ EXPORTS ?isOpacityNull@QGraphicsItemPrivate@@SA_NM@Z @ 12550 NONAME ; bool QGraphicsItemPrivate::isOpacityNull(float) ?isOpacityNull@QGraphicsItemPrivate@@QBE_NXZ @ 12551 NONAME ; bool QGraphicsItemPrivate::isOpacityNull(void) const ?api@QEglContext@@QBE?AW4API@QEgl@@XZ @ 12552 NONAME ABSENT ; enum QEgl::API QEglContext::api(void) const - ?chooseConfig@QEglContext@@QAE_NABVQEglProperties@@W4PixelFormatMatch@QEgl@@@Z @ 12553 NONAME ABSENT ; bool QEglContext::chooseConfig(class QEglProperties const &, enum QEgl::PixelFormatMatch) - ?destroySurface@QEglContext@@QAEXH@Z @ 12554 NONAME ABSENT ; void QEglContext::destroySurface(int) - ?lazyDoneCurrent@QEglContext@@QAE_NXZ @ 12555 NONAME ABSENT ; bool QEglContext::lazyDoneCurrent(void) + ?chooseConfig@QEglContext@@QAE_NABVQEglProperties@@W4PixelFormatMatch@QEgl@@@Z @ 12553 NONAME ; bool QEglContext::chooseConfig(class QEglProperties const &, enum QEgl::PixelFormatMatch) + ?destroySurface@QEglContext@@QAEXH@Z @ 12554 NONAME ; void QEglContext::destroySurface(int) + ?lazyDoneCurrent@QEglContext@@QAE_NXZ @ 12555 NONAME ; bool QEglContext::lazyDoneCurrent(void) ?waitNative@QEglContext@@QAEXXZ @ 12556 NONAME ABSENT ; void QEglContext::waitNative(void) ?context@QEglContext@@QBEHXZ @ 12557 NONAME ABSENT ; int QEglContext::context(void) const ?configAttrib@QEglContext@@QBE_NHPAH@Z @ 12558 NONAME ABSENT ; bool QEglContext::configAttrib(int, int *) const - ??0QEglProperties@@QAE@ABV0@@Z @ 12559 NONAME ABSENT ; QEglProperties::QEglProperties(class QEglProperties const &) + ??0QEglProperties@@QAE@ABV0@@Z @ 12559 NONAME ; QEglProperties::QEglProperties(class QEglProperties const &) ?config@QEglContext@@QBEHXZ @ 12560 NONAME ABSENT ; int QEglContext::config(void) const ?openDisplay@QEglContext@@QAE_NPAVQPaintDevice@@@Z @ 12561 NONAME ABSENT ; bool QEglContext::openDisplay(class QPaintDevice *) ?error@QEglContext@@SAHXZ @ 12562 NONAME ABSENT ; int QEglContext::error(void) - ?swapBuffers@QEglContext@@QAE_NH@Z @ 12563 NONAME ABSENT ; bool QEglContext::swapBuffers(int) - ?setApi@QEglContext@@QAEXW4API@QEgl@@@Z @ 12564 NONAME ABSENT ; void QEglContext::setApi(enum QEgl::API) - ?makeCurrent@QEglContext@@QAE_NH@Z @ 12565 NONAME ABSENT ; bool QEglContext::makeCurrent(int) - ?createSurface@QEglContext@@QAEHPAVQPaintDevice@@PBVQEglProperties@@@Z @ 12566 NONAME ABSENT ; int QEglContext::createSurface(class QPaintDevice *, class QEglProperties const *) - ?dumpAllConfigs@QEglContext@@QAEXXZ @ 12567 NONAME ABSENT ; void QEglContext::dumpAllConfigs(void) - ?reduceConfiguration@QEglProperties@@QAE_NXZ @ 12568 NONAME ABSENT ; bool QEglProperties::reduceConfiguration(void) - ?removeValue@QEglProperties@@QAE_NH@Z @ 12569 NONAME ABSENT ; bool QEglProperties::removeValue(int) - ?toString@QEglProperties@@QBE?AVQString@@XZ @ 12570 NONAME ABSENT ; class QString QEglProperties::toString(void) const - ?dumpAllConfigs@QEglProperties@@SAXXZ @ 12571 NONAME ABSENT ; void QEglProperties::dumpAllConfigs(void) + ?swapBuffers@QEglContext@@QAE_NH@Z @ 12563 NONAME ; bool QEglContext::swapBuffers(int) + ?setApi@QEglContext@@QAEXW4API@QEgl@@@Z @ 12564 NONAME ; void QEglContext::setApi(enum QEgl::API) + ?makeCurrent@QEglContext@@QAE_NH@Z @ 12565 NONAME ; bool QEglContext::makeCurrent(int) + ?createSurface@QEglContext@@QAEHPAVQPaintDevice@@PBVQEglProperties@@@Z @ 12566 NONAME ; int QEglContext::createSurface(class QPaintDevice *, class QEglProperties const *) + ?dumpAllConfigs@QEglContext@@QAEXXZ @ 12567 NONAME ; void QEglContext::dumpAllConfigs(void) + ?reduceConfiguration@QEglProperties@@QAE_NXZ @ 12568 NONAME ; bool QEglProperties::reduceConfiguration(void) + ?removeValue@QEglProperties@@QAE_NH@Z @ 12569 NONAME ; bool QEglProperties::removeValue(int) + ?toString@QEglProperties@@QBE?AVQString@@XZ @ 12570 NONAME ; class QString QEglProperties::toString(void) const + ?dumpAllConfigs@QEglProperties@@SAXXZ @ 12571 NONAME ; void QEglProperties::dumpAllConfigs(void) ?defaultDisplay@QEglContext@@SAHPAVQPaintDevice@@@Z @ 12572 NONAME ABSENT ; int QEglContext::defaultDisplay(class QPaintDevice *) ?configProperties@QEglContext@@QBE?AVQEglProperties@@H@Z @ 12573 NONAME ABSENT ; class QEglProperties QEglContext::configProperties(int) const - ?properties@QEglProperties@@QBEPBHXZ @ 12574 NONAME ABSENT ; int const * QEglProperties::properties(void) const - ??0QEglContext@@QAE@XZ @ 12575 NONAME ABSENT ; QEglContext::QEglContext(void) - ??1QEglContext@@QAE@XZ @ 12576 NONAME ABSENT ; QEglContext::~QEglContext(void) - ?isValid@QEglContext@@QBE_NXZ @ 12577 NONAME ABSENT ; bool QEglContext::isValid(void) const - ?value@QEglProperties@@QBEHH@Z @ 12578 NONAME ABSENT ; int QEglProperties::value(int) const + ?properties@QEglProperties@@QBEPBHXZ @ 12574 NONAME ; int const * QEglProperties::properties(void) const + ??0QEglContext@@QAE@XZ @ 12575 NONAME ; QEglContext::QEglContext(void) + ??1QEglContext@@QAE@XZ @ 12576 NONAME ; QEglContext::~QEglContext(void) + ?isValid@QEglContext@@QBE_NXZ @ 12577 NONAME ; bool QEglContext::isValid(void) const + ?value@QEglProperties@@QBEHH@Z @ 12578 NONAME ; int QEglProperties::value(int) const ?clearError@QEglContext@@SAXXZ @ 12579 NONAME ABSENT ; void QEglContext::clearError(void) - ??0QEglProperties@@QAE@H@Z @ 12580 NONAME ABSENT ; QEglProperties::QEglProperties(int) - ?setValue@QEglProperties@@QAEXHH@Z @ 12581 NONAME ABSENT ; void QEglProperties::setValue(int, int) - ?setPaintDeviceFormat@QEglProperties@@QAEXPAVQPaintDevice@@@Z @ 12582 NONAME ABSENT ; void QEglProperties::setPaintDeviceFormat(class QPaintDevice *) + ??0QEglProperties@@QAE@H@Z @ 12580 NONAME ; QEglProperties::QEglProperties(int) + ?setValue@QEglProperties@@QAEXHH@Z @ 12581 NONAME ; void QEglProperties::setValue(int, int) + ?setPaintDeviceFormat@QEglProperties@@QAEXPAVQPaintDevice@@@Z @ 12582 NONAME ; void QEglProperties::setPaintDeviceFormat(class QPaintDevice *) ?destroy@QEglContext@@QAEXXZ @ 12583 NONAME ABSENT ; void QEglContext::destroy(void) - ?setRenderableType@QEglProperties@@QAEXW4API@QEgl@@@Z @ 12584 NONAME ABSENT ; void QEglProperties::setRenderableType(enum QEgl::API) - ?setContext@QEglContext@@QAEXH@Z @ 12585 NONAME ABSENT ; void QEglContext::setContext(int) + ?setRenderableType@QEglProperties@@QAEXW4API@QEgl@@@Z @ 12584 NONAME ; void QEglProperties::setRenderableType(enum QEgl::API) + ?setContext@QEglContext@@QAEXH@Z @ 12585 NONAME ; void QEglContext::setContext(int) ?waitClient@QEglContext@@QAEXXZ @ 12586 NONAME ABSENT ; void QEglContext::waitClient(void) - ?isEmpty@QEglProperties@@QBE_NXZ @ 12587 NONAME ABSENT ; bool QEglProperties::isEmpty(void) const + ?isEmpty@QEglProperties@@QBE_NXZ @ 12587 NONAME ; bool QEglProperties::isEmpty(void) const ?getDisplay@QEglContext@@CAHPAVQPaintDevice@@@Z @ 12588 NONAME ABSENT ; int QEglContext::getDisplay(class QPaintDevice *) - ?isSharing@QEglContext@@QBE_NXZ @ 12589 NONAME ABSENT ; bool QEglContext::isSharing(void) const - ?isCurrent@QEglContext@@QBE_NXZ @ 12590 NONAME ABSENT ; bool QEglContext::isCurrent(void) const - ??0QEglProperties@@QAE@XZ @ 12591 NONAME ABSENT ; QEglProperties::QEglProperties(void) + ?isSharing@QEglContext@@QBE_NXZ @ 12589 NONAME ; bool QEglContext::isSharing(void) const + ?isCurrent@QEglContext@@QBE_NXZ @ 12590 NONAME ; bool QEglContext::isCurrent(void) const + ??0QEglProperties@@QAE@XZ @ 12591 NONAME ; QEglProperties::QEglProperties(void) ?extensions@QEglContext@@SA?AVQString@@XZ @ 12592 NONAME ABSENT ; class QString QEglContext::extensions(void) - ?setCurrentContext@QEglContext@@CAXW4API@QEgl@@PAV1@@Z @ 12593 NONAME ABSENT ; void QEglContext::setCurrentContext(enum QEgl::API, class QEglContext *) - ??1QEglProperties@@QAE@XZ @ 12594 NONAME ABSENT ; QEglProperties::~QEglProperties(void) - ?createContext@QEglContext@@QAE_NPAV1@PBVQEglProperties@@@Z @ 12595 NONAME ABSENT ; bool QEglContext::createContext(class QEglContext *, class QEglProperties const *) - ?setConfig@QEglContext@@QAEXH@Z @ 12596 NONAME ABSENT ; void QEglContext::setConfig(int) + ?setCurrentContext@QEglContext@@CAXW4API@QEgl@@PAV1@@Z @ 12593 NONAME ; void QEglContext::setCurrentContext(enum QEgl::API, class QEglContext *) + ??1QEglProperties@@QAE@XZ @ 12594 NONAME ; QEglProperties::~QEglProperties(void) + ?createContext@QEglContext@@QAE_NPAV1@PBVQEglProperties@@@Z @ 12595 NONAME ; bool QEglContext::createContext(class QEglContext *, class QEglProperties const *) + ?setConfig@QEglContext@@QAEXH@Z @ 12596 NONAME ; void QEglContext::setConfig(int) ?hasExtension@QEglContext@@SA_NPBD@Z @ 12597 NONAME ABSENT ; bool QEglContext::hasExtension(char const *) - ?doneCurrent@QEglContext@@QAE_NXZ @ 12598 NONAME ABSENT ; bool QEglContext::doneCurrent(void) - ?display@QEglContext@@QBEHXZ @ 12599 NONAME ABSENT ; int QEglContext::display(void) const - ?setPixelFormat@QEglProperties@@QAEXW4Format@QImage@@@Z @ 12600 NONAME ABSENT ; void QEglProperties::setPixelFormat(enum QImage::Format) - ?currentContext@QEglContext@@CAPAV1@W4API@QEgl@@@Z @ 12601 NONAME ABSENT ; class QEglContext * QEglContext::currentContext(enum QEgl::API) - ?errorString@QEglContext@@SA?AVQString@@H@Z @ 12602 NONAME ABSENT ; class QString QEglContext::errorString(int) + ?doneCurrent@QEglContext@@QAE_NXZ @ 12598 NONAME ; bool QEglContext::doneCurrent(void) + ?display@QEglContext@@QBEHXZ @ 12599 NONAME ; int QEglContext::display(void) const + ?setPixelFormat@QEglProperties@@QAEXW4Format@QImage@@@Z @ 12600 NONAME ; void QEglProperties::setPixelFormat(enum QImage::Format) + ?currentContext@QEglContext@@CAPAV1@W4API@QEgl@@@Z @ 12601 NONAME ; class QEglContext * QEglContext::currentContext(enum QEgl::API) + ?errorString@QEglContext@@SA?AVQString@@H@Z @ 12602 NONAME ; class QString QEglContext::errorString(int) ?removeAllApplicationFonts@QFontDatabase@@SA_NXZ @ 12603 NONAME ; bool QFontDatabase::removeAllApplicationFonts() ??0FileInfo@QZipReader@@QAE@XZ @ 12604 NONAME ; QZipReader::FileInfo::FileInfo(void) ??0QAbstractScrollAreaPrivate@@QAE@XZ @ 12605 NONAME ; QAbstractScrollAreaPrivate::QAbstractScrollAreaPrivate(void) @@ -12770,27 +12770,27 @@ EXPORTS ?children_append@QGraphicsItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQGraphicsObject@@@@PAVQGraphicsObject@@@Z @ 12769 NONAME ; void QGraphicsItemPrivate::children_append(class QDeclarativeListProperty *, class QGraphicsObject *) ?children_at@QGraphicsItemPrivate@@SAPAVQGraphicsObject@@PAV?$QDeclarativeListProperty@VQGraphicsObject@@@@H@Z @ 12770 NONAME ; class QGraphicsObject * QGraphicsItemPrivate::children_at(class QDeclarativeListProperty *, int) ?children_count@QGraphicsItemPrivate@@SAHPAV?$QDeclarativeListProperty@VQGraphicsObject@@@@@Z @ 12771 NONAME ; int QGraphicsItemPrivate::children_count(class QDeclarativeListProperty *) - ?display@QEglContext@@QAEHXZ @ 12772 NONAME ABSENT ; int QEglContext::display(void) - ?defaultConfig@QEgl@@YAHHW4API@1@V?$QFlags@W4ConfigOption@QEgl@@@@@Z @ 12773 NONAME ABSENT ; int QEgl::defaultConfig(int, enum QEgl::API, class QFlags) - ?configAttrib@QEglContext@@QBEHH@Z @ 12774 NONAME ABSENT ; int QEglContext::configAttrib(int) const + ?display@QEglContext@@QAEHXZ @ 12772 NONAME ; int QEglContext::display(void) + ?defaultConfig@QEgl@@YAHHW4API@1@V?$QFlags@W4ConfigOption@QEgl@@@@@Z @ 12773 NONAME ; int QEgl::defaultConfig(int, enum QEgl::API, class QFlags) + ?configAttrib@QEglContext@@QBEHH@Z @ 12774 NONAME ; int QEglContext::configAttrib(int) const ?error@QEgl@@YAHXZ @ 12775 NONAME ABSENT ; int QEgl::error(void) ?errorString@QEgl@@YA?AVQString@@XZ @ 12776 NONAME ABSENT ; class QString QEgl::errorString(void) ?configProperties@QEglContext@@QBE?AVQEglProperties@@XZ @ 12777 NONAME ABSENT ; class QEglProperties QEglContext::configProperties(void) const - ?extensions@QEgl@@YA?AVQString@@XZ @ 12778 NONAME ABSENT ; class QString QEgl::extensions(void) - ?nativePixmap@QEgl@@YAPAXPAVQPixmap@@@Z @ 12779 NONAME ABSENT ; void * QEgl::nativePixmap(class QPixmap *) - ?display@QEgl@@YAHXZ @ 12780 NONAME ABSENT ; int QEgl::display(void) - ?eglCreateImageKHR@QEgl@@YAHHHHHPBH@Z @ 12781 NONAME ABSENT ; int QEgl::eglCreateImageKHR(int, int, int, int, int const *) - ?hasExtension@QEgl@@YA_NPBD@Z @ 12782 NONAME ABSENT ; bool QEgl::hasExtension(char const *) - ?destroyContext@QEglContext@@QAEXXZ @ 12783 NONAME ABSENT ; void QEglContext::destroyContext(void) - ?nativeWindow@QEgl@@YAPAXPAVQWidget@@@Z @ 12784 NONAME ABSENT ; void * QEgl::nativeWindow(class QWidget *) - ?errorString@QEgl@@YA?AVQString@@H@Z @ 12785 NONAME ABSENT ; class QString QEgl::errorString(int) - ?chooseConfig@QEgl@@YAHPBVQEglProperties@@W4PixelFormatMatch@1@@Z @ 12786 NONAME ABSENT ; int QEgl::chooseConfig(class QEglProperties const *, enum QEgl::PixelFormatMatch) - ?eglDestroyImageKHR@QEgl@@YAHHH@Z @ 12787 NONAME ABSENT ; int QEgl::eglDestroyImageKHR(int, int) + ?extensions@QEgl@@YA?AVQString@@XZ @ 12778 NONAME ; class QString QEgl::extensions(void) + ?nativePixmap@QEgl@@YAPAXPAVQPixmap@@@Z @ 12779 NONAME ; void * QEgl::nativePixmap(class QPixmap *) + ?display@QEgl@@YAHXZ @ 12780 NONAME ; int QEgl::display(void) + ?eglCreateImageKHR@QEgl@@YAHHHHHPBH@Z @ 12781 NONAME ; int QEgl::eglCreateImageKHR(int, int, int, int, int const *) + ?hasExtension@QEgl@@YA_NPBD@Z @ 12782 NONAME ; bool QEgl::hasExtension(char const *) + ?destroyContext@QEglContext@@QAEXXZ @ 12783 NONAME ; void QEglContext::destroyContext(void) + ?nativeWindow@QEgl@@YAPAXPAVQWidget@@@Z @ 12784 NONAME ; void * QEgl::nativeWindow(class QWidget *) + ?errorString@QEgl@@YA?AVQString@@H@Z @ 12785 NONAME ; class QString QEgl::errorString(int) + ?chooseConfig@QEgl@@YAHPBVQEglProperties@@W4PixelFormatMatch@1@@Z @ 12786 NONAME ; int QEgl::chooseConfig(class QEglProperties const *, enum QEgl::PixelFormatMatch) + ?eglDestroyImageKHR@QEgl@@YAHHH@Z @ 12787 NONAME ; int QEgl::eglDestroyImageKHR(int, int) ?isEmpty@QItemSelectionRange@@QBE_NXZ @ 12788 NONAME ; bool QItemSelectionRange::isEmpty(void) const ?clearError@QEgl@@YAXXZ @ 12789 NONAME ABSENT ; void QEgl::clearError(void) - ?nativeDisplay@QEgl@@YAHXZ @ 12790 NONAME ABSENT ; int QEgl::nativeDisplay(void) - ?dumpAllConfigs@QEgl@@YAXXZ @ 12791 NONAME ABSENT ; void QEgl::dumpAllConfigs(void) - ?setDeviceType@QEglProperties@@QAEXH@Z @ 12792 NONAME ABSENT ; void QEglProperties::setDeviceType(int) + ?nativeDisplay@QEgl@@YAHXZ @ 12790 NONAME ; int QEgl::nativeDisplay(void) + ?dumpAllConfigs@QEgl@@YAXXZ @ 12791 NONAME ; void QEgl::dumpAllConfigs(void) + ?setDeviceType@QEglProperties@@QAEXH@Z @ 12792 NONAME ; void QEglProperties::setDeviceType(int) ?glyphPadding@QTextureGlyphCache@@UBEHXZ @ 12793 NONAME ; int QTextureGlyphCache::glyphPadding(void) const - ?createSurface@QEgl@@YAHPAVQPaintDevice@@HPBVQEglProperties@@@Z @ 12794 NONAME ABSENT ; int QEgl::createSurface(class QPaintDevice *, int, class QEglProperties const *) + ?createSurface@QEgl@@YAHPAVQPaintDevice@@HPBVQEglProperties@@@Z @ 12794 NONAME ; int QEgl::createSurface(class QPaintDevice *, int, class QEglProperties const *) diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index cadcf59..daceee3 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -11745,43 +11745,43 @@ EXPORTS _ZN11QEglContext10getDisplayEP12QPaintDevice @ 11744 NONAME ABSENT _ZN11QEglContext10waitClientEv @ 11745 NONAME ABSENT _ZN11QEglContext10waitNativeEv @ 11746 NONAME ABSENT - _ZN11QEglContext11doneCurrentEv @ 11747 NONAME ABSENT + _ZN11QEglContext11doneCurrentEv @ 11747 NONAME _ZN11QEglContext11errorStringEi @ 11748 NONAME ABSENT - _ZN11QEglContext11makeCurrentEi @ 11749 NONAME ABSENT + _ZN11QEglContext11makeCurrentEi @ 11749 NONAME _ZN11QEglContext11openDisplayEP12QPaintDevice @ 11750 NONAME ABSENT - _ZN11QEglContext11swapBuffersEi @ 11751 NONAME ABSENT - _ZN11QEglContext12chooseConfigERK14QEglPropertiesN4QEgl16PixelFormatMatchE @ 11752 NONAME ABSENT + _ZN11QEglContext11swapBuffersEi @ 11751 NONAME + _ZN11QEglContext12chooseConfigERK14QEglPropertiesN4QEgl16PixelFormatMatchE @ 11752 NONAME _ZN11QEglContext12hasExtensionEPKc @ 11753 NONAME ABSENT - _ZN11QEglContext13createContextEPS_PK14QEglProperties @ 11754 NONAME ABSENT - _ZN11QEglContext13createSurfaceEP12QPaintDevicePK14QEglProperties @ 11755 NONAME ABSENT - _ZN11QEglContext14currentContextEN4QEgl3APIE @ 11756 NONAME ABSENT + _ZN11QEglContext13createContextEPS_PK14QEglProperties @ 11754 NONAME + _ZN11QEglContext13createSurfaceEP12QPaintDevicePK14QEglProperties @ 11755 NONAME + _ZN11QEglContext14currentContextEN4QEgl3APIE @ 11756 NONAME _ZN11QEglContext14defaultDisplayEP12QPaintDevice @ 11757 NONAME ABSENT - _ZN11QEglContext14destroySurfaceEi @ 11758 NONAME ABSENT + _ZN11QEglContext14destroySurfaceEi @ 11758 NONAME _ZN11QEglContext14dumpAllConfigsEv @ 11759 NONAME ABSENT - _ZN11QEglContext15lazyDoneCurrentEv @ 11760 NONAME ABSENT - _ZN11QEglContext17setCurrentContextEN4QEgl3APIEPS_ @ 11761 NONAME ABSENT + _ZN11QEglContext15lazyDoneCurrentEv @ 11760 NONAME + _ZN11QEglContext17setCurrentContextEN4QEgl3APIEPS_ @ 11761 NONAME _ZN11QEglContext7destroyEv @ 11762 NONAME ABSENT - _ZN11QEglContextC1Ev @ 11763 NONAME ABSENT - _ZN11QEglContextC2Ev @ 11764 NONAME ABSENT - _ZN11QEglContextD1Ev @ 11765 NONAME ABSENT - _ZN11QEglContextD2Ev @ 11766 NONAME ABSENT - _ZN14QEglProperties11removeValueEi @ 11767 NONAME ABSENT + _ZN11QEglContextC1Ev @ 11763 NONAME + _ZN11QEglContextC2Ev @ 11764 NONAME + _ZN11QEglContextD1Ev @ 11765 NONAME + _ZN11QEglContextD2Ev @ 11766 NONAME + _ZN14QEglProperties11removeValueEi @ 11767 NONAME _ZN14QEglProperties14dumpAllConfigsEv @ 11768 NONAME ABSENT - _ZN14QEglProperties14setPixelFormatEN6QImage6FormatE @ 11769 NONAME ABSENT - _ZN14QEglProperties17setRenderableTypeEN4QEgl3APIE @ 11770 NONAME ABSENT - _ZN14QEglProperties19reduceConfigurationEv @ 11771 NONAME ABSENT - _ZN14QEglProperties20setPaintDeviceFormatEP12QPaintDevice @ 11772 NONAME ABSENT - _ZN14QEglProperties8setValueEii @ 11773 NONAME ABSENT - _ZN14QEglPropertiesC1Ei @ 11774 NONAME ABSENT - _ZN14QEglPropertiesC1Ev @ 11775 NONAME ABSENT - _ZN14QEglPropertiesC2Ei @ 11776 NONAME ABSENT - _ZN14QEglPropertiesC2Ev @ 11777 NONAME ABSENT + _ZN14QEglProperties14setPixelFormatEN6QImage6FormatE @ 11769 NONAME + _ZN14QEglProperties17setRenderableTypeEN4QEgl3APIE @ 11770 NONAME + _ZN14QEglProperties19reduceConfigurationEv @ 11771 NONAME + _ZN14QEglProperties20setPaintDeviceFormatEP12QPaintDevice @ 11772 NONAME + _ZN14QEglProperties8setValueEii @ 11773 NONAME + _ZN14QEglPropertiesC1Ei @ 11774 NONAME + _ZN14QEglPropertiesC1Ev @ 11775 NONAME + _ZN14QEglPropertiesC2Ei @ 11776 NONAME + _ZN14QEglPropertiesC2Ev @ 11777 NONAME _ZNK11QEglContext12configAttribEiPi @ 11778 NONAME ABSENT _ZNK11QEglContext16configPropertiesEi @ 11779 NONAME ABSENT - _ZNK11QEglContext7isValidEv @ 11780 NONAME ABSENT - _ZNK11QEglContext9isCurrentEv @ 11781 NONAME ABSENT - _ZNK14QEglProperties5valueEi @ 11782 NONAME ABSENT - _ZNK14QEglProperties8toStringEv @ 11783 NONAME ABSENT + _ZNK11QEglContext7isValidEv @ 11780 NONAME + _ZNK11QEglContext9isCurrentEv @ 11781 NONAME + _ZNK14QEglProperties5valueEi @ 11782 NONAME + _ZNK14QEglProperties8toStringEv @ 11783 NONAME _ZNK11QFontEngine10glyphCacheEPvN21QFontEngineGlyphCache4TypeERK10QTransform @ 11784 NONAME _ZNK20QGraphicsItemPrivate21effectiveBoundingRectERK6QRectF @ 11785 NONAME _Z12qt_blurImageP8QPainterR6QImagefbbi @ 11786 NONAME @@ -11973,25 +11973,25 @@ EXPORTS _ZN20QGraphicsItemPrivate11children_atEP24QDeclarativeListPropertyI15QGraphicsObjectEi @ 11972 NONAME _ZN20QGraphicsItemPrivate14children_countEP24QDeclarativeListPropertyI15QGraphicsObjectE @ 11973 NONAME _ZN20QGraphicsItemPrivate15children_appendEP24QDeclarativeListPropertyI15QGraphicsObjectEPS1_ @ 11974 NONAME - _ZN11QEglContext14destroyContextEv @ 11975 NONAME ABSENT - _ZN14QEglProperties13setDeviceTypeEi @ 11976 NONAME ABSENT + _ZN11QEglContext14destroyContextEv @ 11975 NONAME + _ZN14QEglProperties13setDeviceTypeEi @ 11976 NONAME _ZN4QEgl10clearErrorEv @ 11977 NONAME ABSENT - _ZN4QEgl10extensionsEv @ 11978 NONAME ABSENT - _ZN4QEgl11errorStringEi @ 11979 NONAME ABSENT + _ZN4QEgl10extensionsEv @ 11978 NONAME + _ZN4QEgl11errorStringEi @ 11979 NONAME _ZN4QEgl11errorStringEv @ 11980 NONAME ABSENT - _ZN4QEgl12chooseConfigEPK14QEglPropertiesNS_16PixelFormatMatchE @ 11981 NONAME ABSENT - _ZN4QEgl12hasExtensionEPKc @ 11982 NONAME ABSENT - _ZN4QEgl12nativePixmapEP7QPixmap @ 11983 NONAME ABSENT - _ZN4QEgl12nativeWindowEP7QWidget @ 11984 NONAME ABSENT - _ZN4QEgl13createSurfaceEP12QPaintDeviceiPK14QEglProperties @ 11985 NONAME ABSENT - _ZN4QEgl13defaultConfigEiNS_3APIE6QFlagsINS_12ConfigOptionEE @ 11986 NONAME ABSENT - _ZN4QEgl13nativeDisplayEv @ 11987 NONAME ABSENT - _ZN4QEgl14dumpAllConfigsEv @ 11988 NONAME ABSENT - _ZN4QEgl17eglCreateImageKHREiiiiPKi @ 11989 NONAME ABSENT - _ZN4QEgl18eglDestroyImageKHREii @ 11990 NONAME ABSENT + _ZN4QEgl12chooseConfigEPK14QEglPropertiesNS_16PixelFormatMatchE @ 11981 NONAME + _ZN4QEgl12hasExtensionEPKc @ 11982 NONAME + _ZN4QEgl12nativePixmapEP7QPixmap @ 11983 NONAME + _ZN4QEgl12nativeWindowEP7QWidget @ 11984 NONAME + _ZN4QEgl13createSurfaceEP12QPaintDeviceiPK14QEglProperties @ 11985 NONAME + _ZN4QEgl13defaultConfigEiNS_3APIE6QFlagsINS_12ConfigOptionEE @ 11986 NONAME + _ZN4QEgl13nativeDisplayEv @ 11987 NONAME + _ZN4QEgl14dumpAllConfigsEv @ 11988 NONAME + _ZN4QEgl17eglCreateImageKHREiiiiPKi @ 11989 NONAME + _ZN4QEgl18eglDestroyImageKHREii @ 11990 NONAME _ZN4QEgl5errorEv @ 11991 NONAME ABSENT - _ZN4QEgl7displayEv @ 11992 NONAME ABSENT - _ZNK11QEglContext12configAttribEi @ 11993 NONAME ABSENT + _ZN4QEgl7displayEv @ 11992 NONAME + _ZNK11QEglContext12configAttribEi @ 11993 NONAME _ZNK11QEglContext16configPropertiesEv @ 11994 NONAME ABSENT _ZNK19QItemSelectionRange7isEmptyEv @ 11995 NONAME -- cgit v0.12 From 4743831d128dfad4ac9fbafa6e7544dbe7fb7ed2 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 23 Apr 2010 10:22:44 +0200 Subject: QTabBar: Widgets inside the tab bar where not properly laid out after moveTab() Only the leftmost tab was being correctly laid out after the move due to a mistake in QTabBarPrivate::layoutTab(). Auto-test included. Reviewed-by: Thierry Task-number: QTBUG-10052 --- src/gui/widgets/qtabbar.cpp | 15 +++++---------- src/gui/widgets/qtabbar_p.h | 2 +- tests/auto/qtabbar/tst_qtabbar.cpp | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index 7559311..d03a2f4 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -580,16 +580,10 @@ void QTabBarPrivate::layoutTab(int index) } } -void QTabBarPrivate::layoutWidgets(int index) +void QTabBarPrivate::layoutWidgets(int start) { Q_Q(QTabBar); - int start = 0; - int end = q->count(); - if (index != -1) { - start = qMax(index, 0); - end = qMin(end, start + 1); - } - for (int i = start; i < end; ++i) { + for (int i = start; i < q->count(); ++i) { layoutTab(i); } } @@ -1171,8 +1165,9 @@ void QTabBar::setCurrentIndex(int index) update(); d->makeVisible(index); d->tabList[index].lastTab = oldIndex; - d->layoutWidgets(oldIndex); - d->layoutWidgets(index); + if (oldIndex >= 0 && oldIndex < count()) + d->layoutTab(oldIndex); + d->layoutTab(index); #ifdef QT3_SUPPORT emit selected(index); #endif diff --git a/src/gui/widgets/qtabbar_p.h b/src/gui/widgets/qtabbar_p.h index 83636e6..37741f7 100644 --- a/src/gui/widgets/qtabbar_p.h +++ b/src/gui/widgets/qtabbar_p.h @@ -178,7 +178,7 @@ public: void refresh(); void layoutTabs(); - void layoutWidgets(int index = -1); + void layoutWidgets(int start = 0); void layoutTab(int index); void updateMacBorderMetrics(); void setupMovableTab(); diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp index 72f9dd3..ac3de20 100644 --- a/tests/auto/qtabbar/tst_qtabbar.cpp +++ b/tests/auto/qtabbar/tst_qtabbar.cpp @@ -95,6 +95,8 @@ private slots: void task251184_removeTab(); void changeTitleWhileDoubleClickingTab(); + + void taskQTBUG_10052_widgetLayoutWhenMoving(); }; // Testing get/set functions @@ -576,5 +578,38 @@ void tst_QTabBar::changeTitleWhileDoubleClickingTab() QTest::mouseDClick(&bar, Qt::LeftButton, 0, tabPos); } +class Widget10052 : public QWidget +{ +public: + Widget10052(QWidget *parent) : QWidget(parent), moved(false) + { } + + void moveEvent(QMoveEvent *e) + { + moved = e->oldPos() != e->pos(); + QWidget::moveEvent(e); + } + + bool moved; +}; + +void tst_QTabBar::taskQTBUG_10052_widgetLayoutWhenMoving() +{ + QTabBar tabBar; + tabBar.insertTab(0, "My first tab"); + Widget10052 w1(&tabBar); + tabBar.setTabButton(0, QTabBar::RightSide, &w1); + tabBar.insertTab(1, "My other tab"); + Widget10052 w2(&tabBar); + tabBar.setTabButton(1, QTabBar::RightSide, &w2); + + tabBar.show(); + QTest::qWaitForWindowShown(&tabBar); + w1.moved = w2.moved = false; + tabBar.moveTab(0, 1); + QTRY_VERIFY(w1.moved); + QVERIFY(w2.moved); +} + QTEST_MAIN(tst_QTabBar) #include "tst_qtabbar.moc" -- cgit v0.12 From c1431e6daa5f0e229c2e79a945f28d00d70b0978 Mon Sep 17 00:00:00 2001 From: aavit Date: Fri, 9 Apr 2010 15:30:04 +0200 Subject: Optimization: Avoid data copy when reading jpegs from memory If the iodevice is actually a qbuffer, avoid read() and just give libjpeg a pointer to the contained data directly. Related to QTBUG-9095. Reviewed-by: Kim --- src/plugins/imageformats/jpeg/qjpeghandler.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 93b7cc6..1c6a289 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include // jpeglib needs this to be pre-included #include @@ -102,6 +103,7 @@ struct my_jpeg_source_mgr : public jpeg_source_mgr { // Nothing dynamic - cannot rely on destruction over longjump QIODevice *device; JOCTET buffer[max_buf]; + const QBuffer *memDevice; public: my_jpeg_source_mgr(QIODevice *device); @@ -117,10 +119,14 @@ static void qt_init_source(j_decompress_ptr) static boolean qt_fill_input_buffer(j_decompress_ptr cinfo) { - int num_read; my_jpeg_source_mgr* src = (my_jpeg_source_mgr*)cinfo->src; + if (src->memDevice) { + src->next_input_byte = (const JOCTET *)src->memDevice->data().constData(); + src->bytes_in_buffer = (size_t)src->memDevice->data().size(); + return true; + } src->next_input_byte = src->buffer; - num_read = src->device->read((char*)src->buffer, max_buf); + int num_read = src->device->read((char*)src->buffer, max_buf); if (num_read <= 0) { // Insert a fake EOI marker - as per jpeglib recommendation src->buffer[0] = (JOCTET) 0xFF; @@ -147,7 +153,7 @@ static void qt_skip_input_data(j_decompress_ptr cinfo, long num_bytes) * any trouble anyway --- large skips are infrequent. */ if (num_bytes > 0) { - while (num_bytes > (long) src->bytes_in_buffer) { + while (num_bytes > (long) src->bytes_in_buffer) { // Should not happen in case of memDevice num_bytes -= (long) src->bytes_in_buffer; (void) qt_fill_input_buffer(cinfo); /* note we assume that qt_fill_input_buffer will never return false, @@ -178,6 +184,7 @@ inline my_jpeg_source_mgr::my_jpeg_source_mgr(QIODevice *device) jpeg_source_mgr::resync_to_restart = jpeg_resync_to_restart; jpeg_source_mgr::term_source = qt_term_source; this->device = device; + memDevice = qobject_cast(device); bytes_in_buffer = 0; next_input_byte = buffer; } -- cgit v0.12 From ffb5db8aafbe2b49be5cd454841a2af8acc426ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 23 Apr 2010 10:51:31 +0200 Subject: Avoided O(n^2) behavior in painter path clipper. Use a binary tree when producing the line vs line intersections to get O(n * log n) behavior instead. Also tweak the threshold a bit to avoid tessellating the bezier curves too finely. Reviewed-by: Gunnar Sletta --- src/gui/painting/qpathclipper.cpp | 344 ++++++++++++++++++++++++++++++-------- 1 file changed, 276 insertions(+), 68 deletions(-) diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 9dedf3a..c910024 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -43,6 +43,7 @@ #include #include +#include #include /** @@ -105,7 +106,6 @@ public: bool hasIntersections(const QPathSegments &a, const QPathSegments &b) const; private: - void intersectLines(const QLineF &a, const QLineF &b, QDataBuffer &intersections); bool linesIntersect(const QLineF &a, const QLineF &b) const; }; @@ -176,7 +176,223 @@ bool QIntersectionFinder::linesIntersect(const QLineF &a, const QLineF &b) const return tq >= 0 && tq <= 1; } -void QIntersectionFinder::intersectLines(const QLineF &a, const QLineF &b, QDataBuffer &intersections) +bool QIntersectionFinder::hasIntersections(const QPathSegments &a, const QPathSegments &b) const +{ + if (a.segments() == 0 || b.segments() == 0) + return false; + + const QRectF &rb0 = b.elementBounds(0); + + qreal minX = rb0.left(); + qreal minY = rb0.top(); + qreal maxX = rb0.right(); + qreal maxY = rb0.bottom(); + + for (int i = 1; i < b.segments(); ++i) { + const QRectF &r = b.elementBounds(i); + minX = qMin(minX, r.left()); + minY = qMin(minY, r.top()); + maxX = qMax(maxX, r.right()); + maxY = qMax(maxY, r.bottom()); + } + + QRectF rb(minX, minY, maxX - minX, maxY - minY); + + for (int i = 0; i < a.segments(); ++i) { + const QRectF &r1 = a.elementBounds(i); + + if (r1.left() > rb.right() || rb.left() > r1.right()) + continue; + if (r1.top() > rb.bottom() || rb.top() > r1.bottom()) + continue; + + for (int j = 0; j < b.segments(); ++j) { + const QRectF &r2 = b.elementBounds(j); + + if (r1.left() > r2.right() || r2.left() > r1.right()) + continue; + if (r1.top() > r2.bottom() || r2.top() > r1.bottom()) + continue; + + if (linesIntersect(a.lineAt(i), b.lineAt(j))) + return true; + } + } + + return false; +} + +namespace { +struct TreeNode +{ + qreal splitLeft; + qreal splitRight; + bool leaf; + + int lowestLeftIndex; + int lowestRightIndex; + + union { + struct { + int first; + int last; + } interval; + struct { + int left; + int right; + } children; + } index; +}; + +struct RectF +{ + qreal x1; + qreal y1; + qreal x2; + qreal y2; +}; + +class SegmentTree +{ +public: + SegmentTree(QPathSegments &segments); + + QRectF boundingRect() const; + + void produceIntersections(int segment); + +private: + TreeNode buildTree(int first, int last, int depth, const RectF &bounds); + + void produceIntersectionsLeaf(const TreeNode &node, int segment); + void produceIntersections(const TreeNode &node, int segment, const RectF &segmentBounds, const RectF &nodeBounds, int axis); + void intersectLines(const QLineF &a, const QLineF &b, QDataBuffer &intersections); + + QPathSegments &m_segments; + QVector m_index; + + RectF m_bounds; + + QVector m_tree; + QDataBuffer m_intersections; +}; + +SegmentTree::SegmentTree(QPathSegments &segments) + : m_segments(segments) +{ + m_bounds.x1 = qt_inf(); + m_bounds.y1 = qt_inf(); + m_bounds.x2 = -qt_inf(); + m_bounds.y2 = -qt_inf(); + + m_index.resize(m_segments.segments()); + + for (int i = 0; i < m_index.size(); ++i) { + m_index[i] = i; + + const QRectF &segmentBounds = m_segments.elementBounds(i); + + if (segmentBounds.left() < m_bounds.x1) + m_bounds.x1 = segmentBounds.left(); + if (segmentBounds.top() < m_bounds.y1) + m_bounds.y1 = segmentBounds.top(); + if (segmentBounds.right() > m_bounds.x2) + m_bounds.x2 = segmentBounds.right(); + if (segmentBounds.bottom() > m_bounds.y2) + m_bounds.y2 = segmentBounds.bottom(); + } + + m_tree.resize(1); + + TreeNode root = buildTree(0, m_index.size(), 0, m_bounds); + m_tree[0] = root; +} + +QRectF SegmentTree::boundingRect() const +{ + return QRectF(QPointF(m_bounds.x1, m_bounds.y1), + QPointF(m_bounds.x2, m_bounds.y2)); +} + +static inline qreal coordinate(const QPointF &pos, int axis) +{ + return axis == 0 ? pos.x() : pos.y(); +} + +TreeNode SegmentTree::buildTree(int first, int last, int depth, const RectF &bounds) +{ + if (depth >= 24 || (last - first) <= 10) { + TreeNode node; + node.leaf = true; + node.index.interval.first = first; + node.index.interval.last = last; + + return node; + } + + int splitAxis = (depth & 1); + + TreeNode node; + node.leaf = false; + + qreal split = 0.5f * ((&bounds.x1)[splitAxis] + (&bounds.x2)[splitAxis]); + + node.splitLeft = (&bounds.x1)[splitAxis]; + node.splitRight = (&bounds.x2)[splitAxis]; + + node.lowestLeftIndex = INT_MAX; + node.lowestRightIndex = INT_MAX; + + const int treeSize = m_tree.size(); + + node.index.children.left = treeSize; + node.index.children.right = treeSize + 1; + + m_tree.resize(treeSize + 2); + + int l = first; + int r = last - 1; + + // partition into left and right sets + while (l <= r) { + const int index = m_index.at(l); + const QRectF &segmentBounds = m_segments.elementBounds(index); + + qreal lowCoordinate = coordinate(segmentBounds.topLeft(), splitAxis); + + if (coordinate(segmentBounds.center(), splitAxis) < split) { + qreal highCoordinate = coordinate(segmentBounds.bottomRight(), splitAxis); + if (highCoordinate > node.splitLeft) + node.splitLeft = highCoordinate; + if (index < node.lowestLeftIndex) + node.lowestLeftIndex = index; + ++l; + } else { + if (lowCoordinate < node.splitRight) + node.splitRight = lowCoordinate; + if (index < node.lowestRightIndex) + node.lowestRightIndex = index; + qSwap(m_index[l], m_index[r]); + --r; + } + } + + RectF lbounds = bounds; + (&lbounds.x2)[splitAxis] = node.splitLeft; + + RectF rbounds = bounds; + (&rbounds.x1)[splitAxis] = node.splitRight; + + TreeNode left = buildTree(first, l, depth + 1, lbounds); + m_tree[node.index.children.left] = left; + + TreeNode right = buildTree(l, last, depth + 1, rbounds); + m_tree[node.index.children.right] = right; + + return node; +} + +void SegmentTree::intersectLines(const QLineF &a, const QLineF &b, QDataBuffer &intersections) { const QPointF p1 = a.p1(); const QPointF p2 = a.p2(); @@ -298,90 +514,86 @@ void QIntersectionFinder::intersectLines(const QLineF &a, const QLineF &b, QData intersections.add(intersection); } -bool QIntersectionFinder::hasIntersections(const QPathSegments &a, const QPathSegments &b) const +void SegmentTree::produceIntersections(int segment) { - if (a.segments() == 0 || b.segments() == 0) - return false; + const QRectF &segmentBounds = m_segments.elementBounds(segment); - const QRectF &rb0 = b.elementBounds(0); + RectF sbounds; + sbounds.x1 = segmentBounds.left(); + sbounds.y1 = segmentBounds.top(); + sbounds.x2 = segmentBounds.right(); + sbounds.y2 = segmentBounds.bottom(); - qreal minX = rb0.left(); - qreal minY = rb0.top(); - qreal maxX = rb0.right(); - qreal maxY = rb0.bottom(); + produceIntersections(m_tree.at(0), segment, sbounds, m_bounds, 0); +} - for (int i = 1; i < b.segments(); ++i) { - const QRectF &r = b.elementBounds(i); - minX = qMin(minX, r.left()); - minY = qMin(minY, r.top()); - maxX = qMax(maxX, r.right()); - maxY = qMax(maxY, r.bottom()); - } +void SegmentTree::produceIntersectionsLeaf(const TreeNode &node, int segment) +{ + const QRectF &r1 = m_segments.elementBounds(segment); + const QLineF lineA = m_segments.lineAt(segment); - QRectF rb(minX, minY, maxX - minX, maxY - minY); + for (int i = node.index.interval.first; i < node.index.interval.last; ++i) { + const int other = m_index.at(i); + if (other >= segment) + continue; - for (int i = 0; i < a.segments(); ++i) { - const QRectF &r1 = a.elementBounds(i); + const QRectF &r2 = m_segments.elementBounds(other); - if (r1.left() > rb.right() || rb.left() > r1.right()) + if (r1.left() > r2.right() || r2.left() > r1.right()) continue; - if (r1.top() > rb.bottom() || rb.top() > r1.bottom()) + if (r1.top() > r2.bottom() || r2.top() > r1.bottom()) continue; - for (int j = 0; j < b.segments(); ++j) { - const QRectF &r2 = b.elementBounds(j); + m_intersections.reset(); - if (r1.left() > r2.right() || r2.left() > r1.right()) - continue; - if (r1.top() > r2.bottom() || r2.top() > r1.bottom()) - continue; + const QLineF lineB = m_segments.lineAt(other); - if (linesIntersect(a.lineAt(i), b.lineAt(j))) - return true; - } - } + intersectLines(lineA, lineB, m_intersections); - return false; -} + for (int k = 0; k < m_intersections.size(); ++k) { + QPathSegments::Intersection i_isect, j_isect; + i_isect.vertex = j_isect.vertex = m_segments.addPoint(m_intersections.at(k).pos); -void QIntersectionFinder::produceIntersections(QPathSegments &segments) -{ - QVector > t; - QDataBuffer intersections; + i_isect.t = m_intersections.at(k).alphaA; + j_isect.t = m_intersections.at(k).alphaB; - for (int i = 0; i < segments.segments(); ++i) { - const QRectF &r1 = segments.elementBounds(i); + i_isect.next = 0; + j_isect.next = 0; - for (int j = 0; j < i; ++j) { - const QRectF &r2 = segments.elementBounds(j); + m_segments.addIntersection(segment, i_isect); + m_segments.addIntersection(other, j_isect); + } + } +} - if (r1.left() > r2.right() || r2.left() > r1.right()) - continue; - if (r1.top() > r2.bottom() || r2.top() > r1.bottom()) - continue; +void SegmentTree::produceIntersections(const TreeNode &node, int segment, const RectF &segmentBounds, const RectF &nodeBounds, int axis) +{ + if (node.leaf) { + produceIntersectionsLeaf(node, segment); + return; + } - intersections.reset(); + RectF lbounds = nodeBounds; + (&lbounds.x2)[axis] = node.splitLeft; - const QLineF lineA = segments.lineAt(i); - const QLineF lineB = segments.lineAt(j); + RectF rbounds = nodeBounds; + (&rbounds.x1)[axis] = node.splitRight; - intersectLines(lineA, lineB, intersections); + if (segment > node.lowestLeftIndex && (&segmentBounds.x1)[axis] <= node.splitLeft) + produceIntersections(m_tree.at(node.index.children.left), segment, segmentBounds, lbounds, !axis); - for (int k = 0; k < intersections.size(); ++k) { - QPathSegments::Intersection i_isect, j_isect; - i_isect.vertex = j_isect.vertex = segments.addPoint(intersections.at(k).pos); + if (segment > node.lowestRightIndex && (&segmentBounds.x2)[axis] >= node.splitRight) + produceIntersections(m_tree.at(node.index.children.right), segment, segmentBounds, rbounds, !axis); +} - i_isect.t = intersections.at(k).alphaA; - j_isect.t = intersections.at(k).alphaB; +} - i_isect.next = 0; - j_isect.next = 0; +void QIntersectionFinder::produceIntersections(QPathSegments &segments) +{ + SegmentTree tree(segments); - segments.addIntersection(i, i_isect); - segments.addIntersection(j, j_isect); - } - } - } + for (int i = 0; i < segments.segments(); ++i) + tree.produceIntersections(i); } class QKdPointTree @@ -707,9 +919,6 @@ void QPathSegments::addPath(const QPainterPath &path) { int firstSegment = m_segments.size(); - QRectF pathBounds = path.boundingRect(); - qreal invPathScale = 1 / qMax(pathBounds.width(), pathBounds.height()); - bool hasMoveTo = false; int lastMoveTo = 0; int last = 0; @@ -746,10 +955,9 @@ void QPathSegments::addPath(const QPainterPath &path) } else { QRectF bounds = bezier.bounds(); - qreal segmentScale = qMax(bounds.width(), bounds.height()); + // threshold based on similar algorithm as in qtriangulatingstroker.cpp + int threshold = qMin(64, qMax(bounds.width(), bounds.height()) * (2 * qreal(3.14) / 6)); - // threshold based on same algorithm as in qtriangulatingstroker.cpp - int threshold = qMin(64, segmentScale * invPathScale * (512 * 3.14f / 6)); if (threshold < 3) threshold = 3; qreal one_over_threshold_minus_1 = qreal(1) / (threshold - 1); -- cgit v0.12 From 02c65146610cdd5bfe1f3ee4656ba07af82afcc7 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Fri, 23 Apr 2010 16:59:18 +0300 Subject: DEF file fix Open C unnecessarily exports inlined getloc. entry removed. Reviewed-by: Shane Kearns --- .../webkit/WebKit/qt/symbian/bwins/QtWebKitu.def | 49 +++++++++++----------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def index 1442795..a450f9e 100644 --- a/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def +++ b/src/3rdparty/webkit/WebKit/qt/symbian/bwins/QtWebKitu.def @@ -625,29 +625,28 @@ EXPORTS ?qt_suspendActiveDOMObjects@@YAXPAVQWebFrame@@@Z @ 624 NONAME ; void qt_suspendActiveDOMObjects(class QWebFrame *) ?qtwebkit_webframe_scrollRecursively@@YA_NPAVQWebFrame@@HH@Z @ 625 NONAME ABSENT ; bool qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int) ?closeEvent@QWebInspector@@MAEXPAVQCloseEvent@@@Z @ 626 NONAME ; void QWebInspector::closeEvent(class QCloseEvent *) - ?getloc@ios_base@std@@QBE?AVlocale@2@XZ @ 627 NONAME ; class std::locale std::ios_base::getloc(void) const - ?inspectorUrl@QWebSettings@@QBE?AVQUrl@@XZ @ 628 NONAME ; class QUrl QWebSettings::inspectorUrl(void) const - ?isTiledBackingStoreFrozen@QGraphicsWebView@@QBE_NXZ @ 629 NONAME ; bool QGraphicsWebView::isTiledBackingStoreFrozen(void) const - ?pageChanged@QWebFrame@@IAEXXZ @ 630 NONAME ; void QWebFrame::pageChanged(void) - ?qt_drt_enableCaretBrowsing@@YAXPAVQWebPage@@_N@Z @ 631 NONAME ; void qt_drt_enableCaretBrowsing(class QWebPage *, bool) - ?qt_drt_evaluateScriptInIsolatedWorld@@YAXPAVQWebFrame@@HABVQString@@@Z @ 632 NONAME ; void qt_drt_evaluateScriptInIsolatedWorld(class QWebFrame *, int, class QString const &) - ?qt_drt_hasDocumentElement@@YA_NPAVQWebFrame@@@Z @ 633 NONAME ; bool qt_drt_hasDocumentElement(class QWebFrame *) - ?qt_drt_numberOfPages@@YAHPAVQWebFrame@@MM@Z @ 634 NONAME ; int qt_drt_numberOfPages(class QWebFrame *, float, float) - ?qt_drt_pageNumberForElementById@@YAHPAVQWebFrame@@ABVQString@@MM@Z @ 635 NONAME ; int qt_drt_pageNumberForElementById(class QWebFrame *, class QString const &, float, float) - ?qt_drt_pauseSVGAnimation@@YA_NPAVQWebFrame@@ABVQString@@N1@Z @ 636 NONAME ; bool qt_drt_pauseSVGAnimation(class QWebFrame *, class QString const &, double, class QString const &) - ?qt_drt_setDomainRelaxationForbiddenForURLScheme@@YAX_NABVQString@@@Z @ 637 NONAME ; void qt_drt_setDomainRelaxationForbiddenForURLScheme(bool, class QString const &) - ?qt_drt_setFrameFlatteningEnabled@@YAXPAVQWebPage@@_N@Z @ 638 NONAME ; void qt_drt_setFrameFlatteningEnabled(class QWebPage *, bool) - ?qt_drt_setMediaType@@YAXPAVQWebFrame@@ABVQString@@@Z @ 639 NONAME ; void qt_drt_setMediaType(class QWebFrame *, class QString const &) - ?qt_drt_setTimelineProfilingEnabled@@YAXPAVQWebPage@@_N@Z @ 640 NONAME ; void qt_drt_setTimelineProfilingEnabled(class QWebPage *, bool) - ?qt_drt_webinspector_close@@YAXPAVQWebPage@@@Z @ 641 NONAME ; void qt_drt_webinspector_close(class QWebPage *) - ?qt_drt_webinspector_executeScript@@YAXPAVQWebPage@@JABVQString@@@Z @ 642 NONAME ; void qt_drt_webinspector_executeScript(class QWebPage *, long, class QString const &) - ?qt_drt_webinspector_show@@YAXPAVQWebPage@@@Z @ 643 NONAME ; void qt_drt_webinspector_show(class QWebPage *) - ?qt_drt_workerThreadCount@@YAHXZ @ 644 NONAME ; int qt_drt_workerThreadCount(void) - ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 645 NONAME ; void qt_wrt_setViewMode(class QWebPage *, class QString const &) - ?qtwebkit_webframe_scrollRecursively@@YAXPAVQWebFrame@@HHABVQPoint@@@Z @ 646 NONAME ; void qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int, class QPoint const &) - ?resizesToContents@QGraphicsWebView@@QBE_NXZ @ 647 NONAME ; bool QGraphicsWebView::resizesToContents(void) const - ?scrollToAnchor@QWebFrame@@QAEXABVQString@@@Z @ 648 NONAME ; void QWebFrame::scrollToAnchor(class QString const &) - ?setInspectorUrl@QWebSettings@@QAEXABVQUrl@@@Z @ 649 NONAME ; void QWebSettings::setInspectorUrl(class QUrl const &) - ?setResizesToContents@QGraphicsWebView@@QAEX_N@Z @ 650 NONAME ; void QGraphicsWebView::setResizesToContents(bool) - ?setTiledBackingStoreFrozen@QGraphicsWebView@@QAEX_N@Z @ 651 NONAME ; void QGraphicsWebView::setTiledBackingStoreFrozen(bool) + ?inspectorUrl@QWebSettings@@QBE?AVQUrl@@XZ @ 627 NONAME ; class QUrl QWebSettings::inspectorUrl(void) const + ?isTiledBackingStoreFrozen@QGraphicsWebView@@QBE_NXZ @ 628 NONAME ; bool QGraphicsWebView::isTiledBackingStoreFrozen(void) const + ?pageChanged@QWebFrame@@IAEXXZ @ 629 NONAME ; void QWebFrame::pageChanged(void) + ?qt_drt_enableCaretBrowsing@@YAXPAVQWebPage@@_N@Z @ 630 NONAME ; void qt_drt_enableCaretBrowsing(class QWebPage *, bool) + ?qt_drt_evaluateScriptInIsolatedWorld@@YAXPAVQWebFrame@@HABVQString@@@Z @ 631 NONAME ; void qt_drt_evaluateScriptInIsolatedWorld(class QWebFrame *, int, class QString const &) + ?qt_drt_hasDocumentElement@@YA_NPAVQWebFrame@@@Z @ 632 NONAME ; bool qt_drt_hasDocumentElement(class QWebFrame *) + ?qt_drt_numberOfPages@@YAHPAVQWebFrame@@MM@Z @ 633 NONAME ; int qt_drt_numberOfPages(class QWebFrame *, float, float) + ?qt_drt_pageNumberForElementById@@YAHPAVQWebFrame@@ABVQString@@MM@Z @ 634 NONAME ; int qt_drt_pageNumberForElementById(class QWebFrame *, class QString const &, float, float) + ?qt_drt_pauseSVGAnimation@@YA_NPAVQWebFrame@@ABVQString@@N1@Z @ 635 NONAME ; bool qt_drt_pauseSVGAnimation(class QWebFrame *, class QString const &, double, class QString const &) + ?qt_drt_setDomainRelaxationForbiddenForURLScheme@@YAX_NABVQString@@@Z @ 636 NONAME ; void qt_drt_setDomainRelaxationForbiddenForURLScheme(bool, class QString const &) + ?qt_drt_setFrameFlatteningEnabled@@YAXPAVQWebPage@@_N@Z @ 637 NONAME ; void qt_drt_setFrameFlatteningEnabled(class QWebPage *, bool) + ?qt_drt_setMediaType@@YAXPAVQWebFrame@@ABVQString@@@Z @ 638 NONAME ; void qt_drt_setMediaType(class QWebFrame *, class QString const &) + ?qt_drt_setTimelineProfilingEnabled@@YAXPAVQWebPage@@_N@Z @ 639 NONAME ; void qt_drt_setTimelineProfilingEnabled(class QWebPage *, bool) + ?qt_drt_webinspector_close@@YAXPAVQWebPage@@@Z @ 640 NONAME ; void qt_drt_webinspector_close(class QWebPage *) + ?qt_drt_webinspector_executeScript@@YAXPAVQWebPage@@JABVQString@@@Z @ 641 NONAME ; void qt_drt_webinspector_executeScript(class QWebPage *, long, class QString const &) + ?qt_drt_webinspector_show@@YAXPAVQWebPage@@@Z @ 642 NONAME ; void qt_drt_webinspector_show(class QWebPage *) + ?qt_drt_workerThreadCount@@YAHXZ @ 643 NONAME ; int qt_drt_workerThreadCount(void) + ?qt_wrt_setViewMode@@YAXPAVQWebPage@@ABVQString@@@Z @ 644 NONAME ; void qt_wrt_setViewMode(class QWebPage *, class QString const &) + ?qtwebkit_webframe_scrollRecursively@@YAXPAVQWebFrame@@HHABVQPoint@@@Z @ 645 NONAME ; void qtwebkit_webframe_scrollRecursively(class QWebFrame *, int, int, class QPoint const &) + ?resizesToContents@QGraphicsWebView@@QBE_NXZ @ 646 NONAME ; bool QGraphicsWebView::resizesToContents(void) const + ?scrollToAnchor@QWebFrame@@QAEXABVQString@@@Z @ 647 NONAME ; void QWebFrame::scrollToAnchor(class QString const &) + ?setInspectorUrl@QWebSettings@@QAEXABVQUrl@@@Z @ 648 NONAME ; void QWebSettings::setInspectorUrl(class QUrl const &) + ?setResizesToContents@QGraphicsWebView@@QAEX_N@Z @ 649 NONAME ; void QGraphicsWebView::setResizesToContents(bool) + ?setTiledBackingStoreFrozen@QGraphicsWebView@@QAEX_N@Z @ 650 NONAME ; void QGraphicsWebView::setTiledBackingStoreFrozen(bool) -- cgit v0.12 From a1839a7a067c47a328c1bdb651a89dc325cb0691 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Fri, 23 Apr 2010 23:57:11 +0200 Subject: Fix for EGL for symbian on 3.1/3.2/5.0, define QT_NO_EGL. Reviewed-by: Jason Barron --- src/gui/egl/egl.pri | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri index 9ca1f0a..c6c020d 100644 --- a/src/gui/egl/egl.pri +++ b/src/gui/egl/egl.pri @@ -24,6 +24,7 @@ contains(QT_CONFIG, egl): { } } } else:symbian { + DEFINES += QT_NO_EGL SOURCES += egl/qegl_stub.cpp SOURCES += egl/qeglproperties_stub.cpp } -- cgit v0.12 From 9af9e1d92504647e41d27c1229a2572a90bf4fd7 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Fri, 23 Apr 2010 08:10:12 +0200 Subject: Fix all qmake Makefiles to include the MSBuild backend Reviewed-by: trustme --- qmake/Makefile.unix | 10 ++++++++-- qmake/Makefile.win32-g++ | 10 ++++++++-- qmake/Makefile.win32-g++-sh | 10 ++++++++-- qmake/generators/win32/msbuild_objectmodel.cpp | 4 ++-- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 875b9d1..8d56fc8 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -9,7 +9,7 @@ LFLAGS = @QMAKE_LFLAGS@ OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \ mingw_make.o option.o winmakefile.o projectgenerator.o \ meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ - borland_bmake.o msvc_vcproj.o msvc_nmake.o msvc_objectmodel.o \ + borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o \ symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o \ symbiancommon.o registry.o epocroot.o @@ -31,7 +31,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge generators/unix/unixmake.cpp generators/win32/winmakefile.cpp generators/projectgenerator.cpp \ generators/mac/pbuilder_pbx.cpp generators/mac/xmloutput.cpp generators/metamakefile.cpp \ generators/makefiledeps.cpp option.cpp generators/win32/mingw_make.cpp generators/makefile.cpp \ - generators/win32/msvc_objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \ + generators/win32/msvc_vcproj.cpp generators/win32/msvc_vcxproj.cpp generators/win32/msvc_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \ generators/symbian/symmake.cpp generators/symbian/initprojectdeploy_symbian.cpp \ $(SOURCE_PATH)/tools/shared/windows/registry.cpp \ $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp \ @@ -265,6 +265,12 @@ msvc_objectmodel.o: generators/win32/msvc_objectmodel.cpp msvc_vcproj.o: generators/win32/msvc_vcproj.cpp $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_vcproj.cpp +msbuild_objectmodel.o: generators/win32/msbuild_objectmodel.cpp + $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp + +msvc_vcxproj.o: generators/win32/msvc_vcxproj.cpp + $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp + msvc_nmake.o: generators/win32/msvc_nmake.cpp $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_nmake.cpp diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index ab7d558..477203d 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -37,8 +37,8 @@ ADDCLEAN = OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \ option.o winmakefile.o projectgenerator.o property.o meta.o \ makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ - borland_bmake.o msvc_nmake.o msvc_vcproj.o \ - msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \ + borland_bmake.o msvc_nmake.o msvc_vcproj.o msvc_vcxproj.o \ + msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o \ symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o ifdef QMAKE_OPENSOURCE_EDITION @@ -264,6 +264,12 @@ msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp msvc_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp $(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp +msvc_vcxproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcxproj.cpp + $(CXX) $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp + +msbuild_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msbuild_objectmodel.cpp + $(CXX) $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp + symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index 755d046..6aac39f 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -37,8 +37,8 @@ ADDCLEAN = OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \ option.o winmakefile.o projectgenerator.o property.o meta.o \ makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ - borland_bmake.o msvc_nmake.o msvc_vcproj.o \ - msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \ + borland_bmake.o msvc_nmake.o msvc_vcproj.o msvc_vcxproj.o \ + msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o \ symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o ifdef QMAKE_OPENSOURCE_EDITION @@ -263,6 +263,12 @@ msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp msvc_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp $(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp +msvc_vcxproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcxproj.cpp + $(CXX) $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp + +msbuild_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msbuild_objectmodel.cpp + $(CXX) $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp + symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index f459885..d011c5c 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -2705,13 +2705,13 @@ bool VCXFilter::outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QSt // VCXProjectSingleConfig -------------------------------------------- -VCXFilter nullFilter; +VCXFilter nullVCXFilter; VCXFilter& VCXProjectSingleConfig::filterForExtraCompiler(const QString &compilerName) { for (int i = 0; i < ExtraCompilersFiles.count(); ++i) if (ExtraCompilersFiles.at(i).Name == compilerName) return ExtraCompilersFiles[i]; - return nullFilter; + return nullVCXFilter; } -- cgit v0.12 From 7bee9774dfe4b09ca8c8e6a63d0de34737a1aaa0 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 26 Apr 2010 10:51:49 +0200 Subject: Doc: correcting a character bug in the footer. Changed "subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation>\n" \ into "subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ Reviewed-by: trust me --- tools/qdoc3/test/qt-html-templates.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 158aef3..8253c45 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -113,7 +113,7 @@ HTML.footer = " \n" \ "
\n" \ "

\n" \ " © 2008-2010 Nokia Corporation and/or its\n" \ - " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation>\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ " in Finland and/or other countries worldwide.

\n" \ "

\n" \ " All other trademarks are property of their respective owners. Date: Mon, 26 Apr 2010 12:47:50 +0200 Subject: Improved workaround for new qt documentation, base on dboddie's work. Make the check more generic, to also work for all other Qt namespaces than qt.ver.s.ion. Still there's something broken in Qt webkit or so. Backported from Qt Creator code. Reviewed-by: ck --- tools/assistant/tools/assistant/helpviewer.cpp | 10 ++++------ tools/assistant/tools/assistant/helpviewer.h | 8 ++++---- tools/assistant/tools/assistant/helpviewer_qwv.cpp | 7 ++++--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 22b3f30..6499139 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -52,17 +52,15 @@ QT_BEGIN_NAMESPACE -QString AbstractHelpViewer::DocPath = QString::fromLatin1("qthelp://com." - "trolltech.qt.%1/").arg(QString(QLatin1String(QT_VERSION_STR)) - .replace(QLatin1String("."), QLatin1String(""))); +const QLatin1String AbstractHelpViewer::DocPath("qthelp://com.trolltech."); -QString AbstractHelpViewer::AboutBlank = +const QString AbstractHelpViewer::AboutBlank = QCoreApplication::translate("HelpViewer", "about:blank"); -QString AbstractHelpViewer::LocalHelpFile = QLatin1String("qthelp://" +const QString AbstractHelpViewer::LocalHelpFile = QLatin1String("qthelp://" "com.trolltech.com.assistantinternal-1.0.0/assistant/assistant.html"); -QString AbstractHelpViewer::PageNotFoundMessage = +const QString AbstractHelpViewer::PageNotFoundMessage = QCoreApplication::translate("HelpViewer", "Error 404...

"); diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index 80a6f87..def9418 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -67,10 +67,10 @@ public: virtual bool handleForwardBackwardMouseButtons(QMouseEvent *e) = 0; - static QString DocPath; - static QString AboutBlank; - static QString LocalHelpFile; - static QString PageNotFoundMessage; + static const QLatin1String DocPath; + static const QString AboutBlank; + static const QString LocalHelpFile; + static const QString PageNotFoundMessage; static bool isLocalUrl(const QUrl &url); static bool canOpenPage(const QString &url); diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp index a19b29a..adaa45b 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp @@ -139,9 +139,10 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, // the virtual folder if (!helpEngine.findFile(url).isValid()) { if (url.startsWith(AbstractHelpViewer::DocPath)) { - if (!url.startsWith(AbstractHelpViewer::DocPath + QLatin1String("qdoc/"))) { - url = url.replace(AbstractHelpViewer::DocPath, - AbstractHelpViewer::DocPath + QLatin1String("qdoc/")); + QUrl newUrl = request.url(); + if (!newUrl.path().startsWith(QLatin1String("/qdoc/"))) { + newUrl.setPath(QLatin1String("qdoc") + newUrl.path()); + url = newUrl.toString(); } } } -- cgit v0.12
" - << "default