Skip to content

Commit 78e8c49

Browse files
author
timlinux
committedDec 2, 2009
Use qimagereader filters to show all available file types for save map as image
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12313 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <QEvent>
3838
#include <QFile>
3939
#include <QFileInfo>
40+
#include <QImageReader>
4041
#include <QInputDialog>
4142
#include <QKeyEvent>
4243
#include <QLabel>
@@ -62,11 +63,11 @@
6263
#include <QStringList>
6364
#include <QTcpSocket>
6465
#include <QTextStream>
66+
#include <QtGlobal>
6567
#include <QTimer>
6668
#include <QToolButton>
6769
#include <QVBoxLayout>
6870
#include <QWhatsThis>
69-
#include <QtGlobal>
7071
//
7172
// Mac OS X Includes
7273
// Must include before GEOS 3 due to unqualified use of 'Point'
@@ -3771,18 +3772,13 @@ void QgisApp::saveMapAsImage()
37713772
// get a list of supported output image types
37723773
int myCounterInt = 0;
37733774
QString myFilters;
3774-
QList<QByteArray> formats = QPictureIO::outputFormats();
3775-
// Workaround for a problem with Qt4 - calls to outputFormats tend
3776-
// to return nothing :(
3777-
if ( formats.count() == 0 )
3778-
{
3779-
formats.append( "png" );
3780-
formats.append( "jpg" );
3781-
}
3775+
QList<QByteArray> formats = QImageReader::supportedImageFormats();
37823776

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

0 commit comments

Comments
 (0)
Please sign in to comment.