diff data/fileio/FileFinder.cpp @ 302:726b32522e3f

* Phase 1 of an image layer.
author Chris Cannam
date Thu, 04 Oct 2007 16:34:11 +0000
parents 73537d900d4b
children fc656505c573
line wrap: on
line diff
--- a/data/fileio/FileFinder.cpp	Thu Oct 04 11:52:38 2007 +0000
+++ b/data/fileio/FileFinder.cpp	Thu Oct 04 16:34:11 2007 +0000
@@ -22,6 +22,7 @@
 #include <QMessageBox>
 #include <QFileDialog>
 #include <QInputDialog>
+#include <QImageReader>
 #include <QSettings>
 
 #include <iostream>
@@ -89,7 +90,16 @@
 
     case ImageFile:
         settingsKey = "imagepath";
-        filter = tr("Portable Network Graphics files (*.png)\nAll files (*.*)");
+        {
+            QStringList fmts;
+            QList<QByteArray> formats = QImageReader::supportedImageFormats();
+            for (QList<QByteArray>::iterator i = formats.begin();
+                 i != formats.end(); ++i) {
+                fmts.push_back(QString("*.%1")
+                               .arg(QString::fromLocal8Bit(*i).toLower()));
+            }
+            filter = tr("Image files (%1)\nAll files (*.*)").arg(fmts.join(" "));
+        }
         break;
 
     case AnyFile: