summaryrefslogtreecommitdiffstats
path: root/examples/multimedia
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2010-06-16 06:47:58 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2010-06-16 06:47:58 (GMT)
commit4ca1e4de66aebcaf0a9ed0b57cc7ab4a334757bb (patch)
tree5bb652dbdc4931dde4872303d6ebf95e161a3c09 /examples/multimedia
parent4f79cbb2b7923ff7f7cbc77dc6820d12f594311d (diff)
parenteb9d15004926848a21d46c4efbcc3882746b7f49 (diff)
downloadQt-4ca1e4de66aebcaf0a9ed0b57cc7ab4a334757bb.zip
Qt-4ca1e4de66aebcaf0a9ed0b57cc7ab4a334757bb.tar.gz
Qt-4ca1e4de66aebcaf0a9ed0b57cc7ab4a334757bb.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.6
Diffstat (limited to 'examples/multimedia')
-rw-r--r--examples/multimedia/videographicsitem/videoplayer.cpp15
-rw-r--r--examples/multimedia/videowidget/videoplayer.cpp15
2 files changed, 28 insertions, 2 deletions
diff --git a/examples/multimedia/videographicsitem/videoplayer.cpp b/examples/multimedia/videographicsitem/videoplayer.cpp
index 4e1f5ca..a08cc57 100644
--- a/examples/multimedia/videographicsitem/videoplayer.cpp
+++ b/examples/multimedia/videographicsitem/videoplayer.cpp
@@ -116,7 +116,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 12d17cf..9d79b70 100644
--- a/examples/multimedia/videowidget/videoplayer.cpp
+++ b/examples/multimedia/videowidget/videoplayer.cpp
@@ -97,7 +97,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();