Skip to content
Permalink
Browse files

Use qimagereader filters to show all available file types for save ma…

…p as image

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12313 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Dec 2, 2009
1 parent 5823e97 commit 78e8c4985e80dd8df69b54a8a1971e00179eb363
Showing with 5 additions and 9 deletions.
  1. +5 −9 src/app/qgisapp.cpp
@@ -37,6 +37,7 @@
#include <QEvent>
#include <QFile>
#include <QFileInfo>
#include <QImageReader>
#include <QInputDialog>
#include <QKeyEvent>
#include <QLabel>
@@ -62,11 +63,11 @@
#include <QStringList>
#include <QTcpSocket>
#include <QTextStream>
#include <QtGlobal>
#include <QTimer>
#include <QToolButton>
#include <QVBoxLayout>
#include <QWhatsThis>
#include <QtGlobal>
//
// Mac OS X Includes
// Must include before GEOS 3 due to unqualified use of 'Point'
@@ -3771,18 +3772,13 @@ void QgisApp::saveMapAsImage()
// get a list of supported output image types
int myCounterInt = 0;
QString myFilters;
QList<QByteArray> formats = QPictureIO::outputFormats();
// Workaround for a problem with Qt4 - calls to outputFormats tend
// to return nothing :(
if ( formats.count() == 0 )
{
formats.append( "png" );
formats.append( "jpg" );
}
QList<QByteArray> formats = QImageReader::supportedImageFormats();

for ( ; myCounterInt < formats.count(); myCounterInt++ )
{
QString myFormat = QString( formats.at( myCounterInt ) );
//svg doesnt work so skip it
if ( myFormat == "svg" ) continue;
QString myFilter = createFileFilter_( myFormat + " format", "*." + myFormat );
myFilters += myFilter;
myFilterMap[myFilter] = myFormat;

0 comments on commit 78e8c49

Please sign in to comment.
You can’t perform that action at this time.