diff options
author | David Boddie <dboddie@trolltech.com> | 2010-06-18 15:38:40 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2010-06-18 15:38:40 (GMT) |
commit | fc0e74d5661da0a678a60082dae60d4564da94b0 (patch) | |
tree | 512256a8bfc49ed4a17a821b8e683662b65e6ddc /examples/multimedia | |
parent | e5302035d91f4337db25cf805c6b13339c552cbf (diff) | |
parent | b82466a64e305af8c557b2b7fdbb4a386e3d9cd7 (diff) | |
download | Qt-fc0e74d5661da0a678a60082dae60d4564da94b0.zip Qt-fc0e74d5661da0a678a60082dae60d4564da94b0.tar.gz Qt-fc0e74d5661da0a678a60082dae60d4564da94b0.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'examples/multimedia')
-rw-r--r-- | examples/multimedia/videographicsitem/videoplayer.cpp | 15 | ||||
-rw-r--r-- | examples/multimedia/videowidget/videoplayer.cpp | 15 |
2 files changed, 28 insertions, 2 deletions
diff --git a/examples/multimedia/videographicsitem/videoplayer.cpp b/examples/multimedia/videographicsitem/videoplayer.cpp index 281cd6e..f98f542 100644 --- a/examples/multimedia/videographicsitem/videoplayer.cpp +++ b/examples/multimedia/videographicsitem/videoplayer.cpp @@ -115,7 +115,20 @@ VideoPlayer::~VideoPlayer() void VideoPlayer::openFile() { - QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie")); + QStringList supportedFormats; + foreach (QString fmt, QMovie::supportedFormats()) + supportedFormats << fmt; + foreach (QString fmt, QImageReader::supportedImageFormats()) + supportedFormats << fmt; + + QString filter = "Images ("; + foreach ( QString fmt, supportedFormats) { + filter.append(QString("*.%1 ").arg(fmt)); + } + filter.append(")"); + + QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie"), + QDir::homePath(), filter); if (!fileName.isEmpty()) { videoItem->stop(); diff --git a/examples/multimedia/videowidget/videoplayer.cpp b/examples/multimedia/videowidget/videoplayer.cpp index 87a2621..ad12069 100644 --- a/examples/multimedia/videowidget/videoplayer.cpp +++ b/examples/multimedia/videowidget/videoplayer.cpp @@ -96,7 +96,20 @@ VideoPlayer::~VideoPlayer() void VideoPlayer::openFile() { - QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie")); + QStringList supportedFormats; + foreach (QString fmt, QMovie::supportedFormats()) + supportedFormats << fmt; + foreach (QString fmt, QImageReader::supportedImageFormats()) + supportedFormats << fmt; + + QString filter = "Images ("; + foreach ( QString fmt, supportedFormats) { + filter.append(QString("*.%1 ").arg(fmt)); + } + filter.append(")"); + + QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie"), + QDir::homePath(), filter); if (!fileName.isEmpty()) { surface->stop(); |