Skip to content


Provide a warning to the user that the svg output may well be less
Browse files Browse the repository at this point in the history
than desired, and allow them to select whether to see that message in
the future.

git-svn-id: c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Sep 18, 2006
1 parent 0527a4b commit 6427612
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "qgscomposition.h"
#include "qgsexception.h"
#include "qgsproject.h"
#include "qgsmessageviewer.h"

#include <QDesktopWidget>
#include <QFileDialog>
Expand All @@ -37,6 +38,7 @@
#include <QPixmap>
#include <QToolBar>
#include <QImageWriter>
#include <QCheckBox>
#include <iostream>

Expand Down Expand Up @@ -634,6 +636,35 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
void QgsComposer::on_mActionExportAsSVG_activated(void)
QSettings myQSettings;

bool displaySVGWarning = myQSettings.value("/UI/displaySVGWarning", true).toBool();

if (displaySVGWarning)
QgsMessageViewer* m = new QgsMessageViewer(this);
m->setWindowTitle(tr("SVG warning"));
m->setCheckBoxText(tr("Don't show this message again"));
m->setMessageAsHtml(tr("<p>The SVG export function in Qgis has several "
"problems due to bugs and deficiencies in the "
"Qt4 svg code. Of note, text does not "
"appear in the SVG file and there are problems "
"with the map bounding box clipping other items "
"such as the legend or scale bar.</p>"
"If you require a vector-based output file from "
"Qgis it is suggested that you try exporting "
"to pdf if the SVG output is not satisfactory."

if (m->checkBoxState() == Qt::Checked)
myQSettings.setValue("/UI/displaySVGWarning", false);
myQSettings.setValue("/UI/displaySVGWarning", true);
delete m;

QString myLastUsedFile = myQSettings.readEntry("/UI/lastSaveAsSvgFile","qgis.svg");
QFileInfo file(myLastUsedFile);

Expand Down

0 comments on commit 6427612

Please sign in to comment.