diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2010-06-16 15:26:22 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2010-06-16 15:26:22 (GMT) |
commit | 8e59d3372d9ba18b48ae0b2271fa453332a1ac12 (patch) | |
tree | 61c3801151346b756c89040fa640ab1eb57d5f6e /examples | |
parent | 0b9638476c1a8bad4e33cbd20be1f6ff33935766 (diff) | |
parent | 90f2f19795a46f3ba1d46fd62f1cbe31072c2c53 (diff) | |
download | Qt-8e59d3372d9ba18b48ae0b2271fa453332a1ac12.zip Qt-8e59d3372d9ba18b48ae0b2271fa453332a1ac12.tar.gz Qt-8e59d3372d9ba18b48ae0b2271fa453332a1ac12.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into qt-4.7-from-4.6
Conflicts:
src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
src/3rdparty/webkit/VERSION
src/3rdparty/webkit/WebCore/ChangeLog
src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
src/corelib/global/qglobal.h
src/plugins/qpluginbase.pri
src/qbase.pri
tests/auto/selftests/expected_cmptest.txt
tests/auto/selftests/expected_crashes_3.txt
tests/auto/selftests/expected_longstring.txt
tests/auto/selftests/expected_maxwarnings.txt
tests/auto/selftests/expected_skip.txt
tools/assistant/tools/assistant/doc/assistant.qdocconf
tools/qdoc3/test/assistant.qdocconf
tools/qdoc3/test/designer.qdocconf
tools/qdoc3/test/linguist.qdocconf
tools/qdoc3/test/qmake.qdocconf
tools/qdoc3/test/qt-build-docs.qdocconf
tools/qdoc3/test/qt.qdocconf
Diffstat (limited to 'examples')
-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(); |