Skip to content

Commit 0c19945

Browse files
vmoranyalldawson
authored andcommittedApr 16, 2014
[composer] add svg export with layers
1 parent e6680a1 commit 0c19945

File tree

10 files changed

+409
-29
lines changed

10 files changed

+409
-29
lines changed
 

‎python/core/composer/qgscomposeritem.sip

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,16 @@ class QgsComposerItem : QObject, QGraphicsRectItem
401401
@note there is not setter since one can't manually set the id*/
402402
QString uuid() const;
403403

404+
/**Get the number of layers that this item exports
405+
@returns 0 if this item is to be placed on the same layer as the previous item
406+
@note this method was added in version 2.4 */
407+
int numberExportLayers() const;
408+
409+
/**Set the layer to export
410+
@param layerIdx can be set to -1 to export all layerr and must be less than numberExportLayers()
411+
@note this method was added in version 2.4 */
412+
void setCurrentExportLayer( int layerIdx = -1 );
413+
404414
public slots:
405415
/**Sets the item rotation
406416
* @deprecated Use setItemRotation( double rotation ) instead

‎python/core/composer/qgscomposermap.sip

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,11 @@ class QgsComposerMap : QgsComposerItem
407407
/** Returns whether updates to the composer map are enabled. */
408408
bool updatesEnabled() const;
409409

410+
/**Get the number of layers that this item exports
411+
@returns 0 if this item is to be placed on the same layer as the previous item
412+
@note this method was added in version 2.4 */
413+
int numberExportLayers() const;
414+
410415
signals:
411416
void extentChanged();
412417

‎python/core/composer/qgscomposition.sip

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,11 @@ class QgsComposition : QGraphicsScene
395395
/** Sets the current atlas mode of the composition. Returns false if the mode could not be changed. */
396396
bool setAtlasMode( QgsComposition::AtlasMode mode );
397397

398+
/** Return pages in the correct order
399+
@note composerItems(QList< QgsPaperItem* > &) may not return pages in the correct order
400+
@note added in version 2.4*/
401+
QList< QgsPaperItem* > pages();
402+
398403
public slots:
399404
/**Casts object to the proper subclass type and calls corresponding itemAdded signal*/
400405
void sendItemAddedSignal( QgsComposerItem* item );

‎src/app/composer/qgscomposer.cpp

Lines changed: 188 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
#include "qgscursors.h"
5656
#include "qgsmaplayeractionregistry.h"
5757
#include "qgsgeometry.h"
58+
#include "qgspaperitem.h"
59+
#include "qgsmaplayerregistry.h"
60+
#include "ui_qgssvgexportoptions.h"
5861

5962
#include <QCloseEvent>
6063
#include <QCheckBox>
@@ -1748,6 +1751,37 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
17481751
exportCompositionAsSVG( QgsComposer::Single );
17491752
}
17501753

1754+
// utility class that will hide all items until it's destroyed
1755+
struct QgsItemTempHider
1756+
{
1757+
explicit QgsItemTempHider( const QList<QGraphicsItem *> & items )
1758+
{
1759+
QList<QGraphicsItem *>::const_iterator it = items.begin();
1760+
for ( ; it != items.end(); ++it )
1761+
{
1762+
mItemVisibility[*it] = ( *it )->isVisible();
1763+
( *it )->hide();
1764+
}
1765+
}
1766+
void hideAll()
1767+
{
1768+
QgsItemVisibilityHash::iterator it = mItemVisibility.begin();
1769+
for ( ; it != mItemVisibility.end(); ++it ) it.key()->hide();
1770+
}
1771+
~QgsItemTempHider()
1772+
{
1773+
QgsItemVisibilityHash::iterator it = mItemVisibility.begin();
1774+
for ( ; it != mItemVisibility.end(); ++it )
1775+
{
1776+
it.key()->setVisible( it.value() );
1777+
}
1778+
}
1779+
private:
1780+
Q_DISABLE_COPY( QgsItemTempHider )
1781+
typedef QHash<QGraphicsItem*, bool> QgsItemVisibilityHash;
1782+
QgsItemVisibilityHash mItemVisibility;
1783+
};
1784+
17511785
void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
17521786
{
17531787
if ( containsWMSLayer() )
@@ -1785,6 +1819,7 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
17851819

17861820
QString outputFileName;
17871821
QString outputDir;
1822+
bool groupLayers = false;
17881823

17891824
if ( mode == QgsComposer::Single )
17901825
{
@@ -1800,14 +1835,25 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
18001835
outputFileName = file.path();
18011836
}
18021837

1838+
// open file dialog
18031839
outputFileName = QFileDialog::getSaveFileName(
18041840
this,
18051841
tr( "Choose a file name to save the map as" ),
18061842
outputFileName,
18071843
tr( "SVG Format" ) + " (*.svg *.SVG)" );
1844+
18081845
if ( outputFileName.isEmpty() )
18091846
return;
18101847

1848+
// open otions dialog
1849+
{
1850+
QDialog dialog;
1851+
Ui::QgsSvgExportOptionsDialog options;
1852+
options.setupUi( &dialog );
1853+
dialog.exec();
1854+
groupLayers = options.chkMapLayersAsGroup->isChecked();
1855+
}
1856+
18111857
if ( !outputFileName.endsWith( ".svg", Qt::CaseInsensitive ) )
18121858
{
18131859
outputFileName += ".svg";
@@ -1834,10 +1880,12 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
18341880
QSettings myQSettings;
18351881
QString lastUsedDir = myQSettings.value( "/UI/lastSaveAtlasAsSvgDir", "." ).toString();
18361882

1883+
// open file dialog
18371884
outputDir = QFileDialog::getExistingDirectory( this,
18381885
tr( "Directory where to save SVG files" ),
18391886
lastUsedDir,
18401887
QFileDialog::ShowDirsOnly );
1888+
18411889
if ( outputDir.isEmpty() )
18421890
{
18431891
return;
@@ -1852,6 +1900,16 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
18521900
return;
18531901
}
18541902

1903+
// open otions dialog
1904+
{
1905+
QDialog dialog;
1906+
Ui::QgsSvgExportOptionsDialog options;
1907+
options.setupUi( &dialog );
1908+
dialog.exec();
1909+
groupLayers = options.chkMapLayersAsGroup->isChecked();
1910+
}
1911+
1912+
18551913
myQSettings.setValue( "/UI/lastSaveAtlasAsSvgDir", outputDir );
18561914
}
18571915

@@ -1907,32 +1965,142 @@ void QgsComposer::exportCompositionAsSVG( QgsComposer::OutputMode mode )
19071965
outputFileName = QDir( outputDir ).filePath( atlasMap->currentFilename() ) + ".svg";
19081966
}
19091967

1910-
for ( int i = 0; i < mComposition->numPages(); ++i )
1968+
if ( !groupLayers )
19111969
{
1912-
QSvgGenerator generator;
1913-
generator.setTitle( QgsProject::instance()->title() );
1914-
if ( i == 0 )
1915-
{
1916-
generator.setFileName( outputFileName );
1917-
}
1918-
else
1970+
for ( int i = 0; i < mComposition->numPages(); ++i )
19191971
{
1920-
QFileInfo fi( outputFileName );
1921-
generator.setFileName( fi.absolutePath() + "/" + fi.baseName() + "_" + QString::number( i + 1 ) + "." + fi.suffix() );
1972+
QSvgGenerator generator;
1973+
generator.setTitle( QgsProject::instance()->title() );
1974+
if ( i == 0 )
1975+
{
1976+
generator.setFileName( outputFileName );
1977+
}
1978+
else
1979+
{
1980+
QFileInfo fi( outputFileName );
1981+
generator.setFileName( fi.absolutePath() + "/" + fi.baseName() + "_" + QString::number( i + 1 ) + "." + fi.suffix() );
1982+
}
1983+
1984+
//width in pixel
1985+
int width = ( int )( mComposition->paperWidth() * mComposition->printResolution() / 25.4 );
1986+
//height in pixel
1987+
int height = ( int )( mComposition->paperHeight() * mComposition->printResolution() / 25.4 );
1988+
generator.setSize( QSize( width, height ) );
1989+
generator.setViewBox( QRect( 0, 0, width, height ) );
1990+
generator.setResolution( mComposition->printResolution() ); //because the rendering is done in mm, convert the dpi
1991+
1992+
QPainter p( &generator );
1993+
1994+
mComposition->renderPage( &p, i );
1995+
p.end();
19221996
}
1997+
}
1998+
else
1999+
{
2000+
//width and height in pixel
2001+
const int width = ( int )( mComposition->paperWidth() * mComposition->printResolution() / 25.4 );
2002+
const int height = ( int )( mComposition->paperHeight() * mComposition->printResolution() / 25.4 );
2003+
QList< QgsPaperItem* > paperItems( mComposition->pages() ) ;
19232004

1924-
//width in pixel
1925-
int width = ( int )( mComposition->paperWidth() * mComposition->printResolution() / 25.4 );
1926-
//height in pixel
1927-
int height = ( int )( mComposition->paperHeight() * mComposition->printResolution() / 25.4 );
1928-
generator.setSize( QSize( width, height ) );
1929-
generator.setViewBox( QRect( 0, 0, width, height ) );
1930-
generator.setResolution( mComposition->printResolution() ); //because the rendering is done in mm, convert the dpi
2005+
for ( int i = 0; i < mComposition->numPages(); ++i )
2006+
{
2007+
QDomDocument svg;
2008+
QDomNode svgDocRoot;
2009+
QgsPaperItem * paperItem = paperItems[i];
2010+
const QRectF paperRect = QRectF( paperItem->pos().x(),
2011+
paperItem->pos().y(),
2012+
paperItem->rect().width(),
2013+
paperItem->rect().height() );
2014+
2015+
QList<QGraphicsItem *> items = mComposition->items( paperRect,
2016+
Qt::IntersectsItemBoundingRect,
2017+
Qt::AscendingOrder );
2018+
if ( ! items.isEmpty()
2019+
&& dynamic_cast<QgsPaperGrid*>( items.last() )
2020+
&& !mComposition->gridVisible() ) items.pop_back();
2021+
QgsItemTempHider itemsHider( items );
2022+
int composerItemLayerIdx = 0;
2023+
QList<QGraphicsItem *>::const_iterator it = items.begin();
2024+
for ( unsigned svgLayerId = 1; it != items.end(); ++svgLayerId )
2025+
{
2026+
itemsHider.hideAll();
2027+
QgsComposerItem * composerItem = dynamic_cast<QgsComposerItem*>( *it );
2028+
QString layerName( "Layer " + QString::number( svgLayerId ) );
2029+
if ( composerItem && composerItem->numberExportLayers() )
2030+
{
2031+
composerItem->show();
2032+
composerItem->setCurrentExportLayer( composerItemLayerIdx );
2033+
++composerItemLayerIdx;
2034+
}
2035+
else
2036+
{
2037+
// show all items until the next item that renders on a separate layer
2038+
for ( ; it != items.end(); ++it )
2039+
{
2040+
composerItem = dynamic_cast<QgsComposerMap*>( *it );
2041+
if ( composerItem && composerItem->numberExportLayers() )
2042+
{
2043+
break;
2044+
}
2045+
else
2046+
{
2047+
( *it )->show();
2048+
}
2049+
}
2050+
}
19312051

1932-
QPainter p( &generator );
2052+
QBuffer svgBuffer;
2053+
{
2054+
QSvgGenerator generator;
2055+
generator.setTitle( QgsProject::instance()->title() );
2056+
generator.setOutputDevice( &svgBuffer );
2057+
generator.setSize( QSize( width, height ) );
2058+
generator.setViewBox( QRect( 0, 0, width, height ) );
2059+
generator.setResolution( mComposition->printResolution() ); //because the rendering is done in mm, convert the dpi
2060+
2061+
QPainter p( &generator );
2062+
mComposition->renderPage( &p, i );
2063+
}
2064+
// post-process svg output to create groups in a single svg file
2065+
// we create inkscape layers since it's nice and clean and free
2066+
// and fully svg compatible
2067+
{
2068+
svgBuffer.close();
2069+
svgBuffer.open( QIODevice::ReadOnly );
2070+
QDomDocument doc;
2071+
QString errorMsg;
2072+
int errorLine;
2073+
if ( ! doc.setContent( &svgBuffer, false, &errorMsg, &errorLine ) )
2074+
QMessageBox::warning( 0, tr( "Svg error" ), tr( "There was an error in svg ouput for svg layer " ) + layerName + tr( " on page " ) + QString::number( i + 1 ) + "(" + errorMsg + ")" );
2075+
if ( 1 == svgLayerId )
2076+
{
2077+
svg = QDomDocument( doc.doctype() );
2078+
svg.appendChild( svg.importNode( doc.firstChild(), false ) );
2079+
svgDocRoot = svg.importNode( doc.elementsByTagName( "svg" ).at( 0 ), false );
2080+
svgDocRoot.toElement().setAttribute( "xmlns:inkscape", "http://www.inkscape.org/namespaces/inkscape" );
2081+
svg.appendChild( svgDocRoot );
2082+
}
2083+
QDomNode mainGroup = svg.importNode( doc.elementsByTagName( "g" ).at( 0 ), true );
2084+
mainGroup.toElement().setAttribute( "id", layerName );
2085+
mainGroup.toElement().setAttribute( "inkscape:label", layerName );
2086+
mainGroup.toElement().setAttribute( "inkscape:groupmode", "layer" );
2087+
QDomNode defs = svg.importNode( doc.elementsByTagName( "defs" ).at( 0 ), true );
2088+
svgDocRoot.appendChild( defs );
2089+
svgDocRoot.appendChild( mainGroup );
2090+
}
19332091

1934-
mComposition->renderPage( &p, i );
1935-
p.end();
2092+
if ( composerItem && composerItem->numberExportLayers() && composerItem->numberExportLayers() == composerItemLayerIdx ) // restore and pass to next item
2093+
{
2094+
composerItem->setCurrentExportLayer();
2095+
composerItemLayerIdx = 0;
2096+
++it;
2097+
}
2098+
}
2099+
QFileInfo fi( outputFileName );
2100+
QFile out( i == 0 ? outputFileName : fi.absolutePath() + "/" + fi.baseName() + "_" + QString::number( i + 1 ) + "." + fi.suffix() );
2101+
out.open( QIODevice::WriteOnly | QIODevice::Text );
2102+
out.write( svg.toByteArray() );
2103+
}
19362104
}
19372105
featureI++;
19382106
}

‎src/core/composer/qgscomposeritem.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ QgsComposerItem::QgsComposerItem( QgsComposition* composition, bool manageZValue
6464
, mEffectsEnabled( true )
6565
, mTransparency( 0 )
6666
, mLastUsedPositionMode( UpperLeft )
67+
, mCurrentExportLayer( -1 )
6768
, mId( "" )
6869
, mUuid( QUuid::createUuid().toString() )
6970
{
@@ -88,6 +89,7 @@ QgsComposerItem::QgsComposerItem( qreal x, qreal y, qreal width, qreal height, Q
8889
, mEffectsEnabled( true )
8990
, mTransparency( 0 )
9091
, mLastUsedPositionMode( UpperLeft )
92+
, mCurrentExportLayer( -1 )
9193
, mId( "" )
9294
, mUuid( QUuid::createUuid().toString() )
9395
{

‎src/core/composer/qgscomposeritem.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,16 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
361361
@note there is not setter since one can't manually set the id*/
362362
QString uuid() const { return mUuid; }
363363

364+
/**Get the number of layers that this item exports
365+
@returns 0 if this item is to be placed on the same layer as the previous item
366+
@note this method was added in version 2.4 */
367+
virtual int numberExportLayers() const { return 0; }
368+
369+
/**Set the layer to export
370+
@param layerIdx can be set to -1 to export all layerr and must be less than numberExportLayers()
371+
@note this method was added in version 2.4 */
372+
virtual void setCurrentExportLayer( int layerIdx = -1 ) { mCurrentExportLayer = layerIdx; }
373+
364374
public slots:
365375
/**Sets the item rotation
366376
* @deprecated Use setItemRotation( double rotation ) instead
@@ -423,6 +433,11 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
423433
@note: this member was added in version 2.0*/
424434
ItemPositionMode mLastUsedPositionMode;
425435

436+
/**The layer that needs to be exported
437+
@note: if -1, all layers are to be exported
438+
@note: this member was added in version 2.4*/
439+
int mCurrentExportLayer;
440+
426441
/**Draw selection boxes around item*/
427442
virtual void drawSelectionBoxes( QPainter* p );
428443

‎src/core/composer/qgscomposermap.cpp

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,16 @@ void QgsComposerMap::draw( QPainter *painter, const QgsRectangle& extent, const
182182
jobMapSettings.setBackgroundColor( Qt::transparent );
183183

184184
//set layers to render
185-
jobMapSettings.setLayers( layersToRender() );
185+
QStringList theLayerSet = layersToRender();
186+
if ( -1 != mCurrentExportLayer )
187+
{
188+
const int layerIdx = mCurrentExportLayer - ( hasBackground() ? 1 : 0 );
189+
theLayerSet =
190+
( layerIdx >= 0 && layerIdx < theLayerSet.length() )
191+
? QStringList( theLayerSet[ theLayerSet.length() - layerIdx - 1 ] )
192+
: QStringList();
193+
}
194+
jobMapSettings.setLayers( theLayerSet );
186195
jobMapSettings.setDestinationCrs( ms.destinationCrs() );
187196
jobMapSettings.setCrsTransformEnabled( ms.hasCrsTransformEnabled() );
188197
jobMapSettings.setFlags( ms.flags() );
@@ -355,7 +364,10 @@ void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* i
355364
}
356365

357366
// Fill with background color
358-
drawBackground( painter );
367+
if ( exportLayer( Background ) )
368+
{
369+
drawBackground( painter );
370+
}
359371

360372
QgsRectangle requestRectangle;
361373
requestedExtent( requestRectangle );
@@ -395,23 +407,70 @@ void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* i
395407

396408
painter->setClipRect( thisPaintRect , Qt::NoClip );
397409

398-
if ( mGridEnabled )
410+
if ( mGridEnabled && exportLayer( Grid ) )
399411
{
400412
drawGrid( painter );
401413
}
402-
if ( mOverviewFrameMapId != -1 )
414+
if ( mOverviewFrameMapId != -1 && exportLayer( OverviewMapExtent ) )
403415
{
404416
drawOverviewMapExtent( painter );
405417
}
406-
drawFrame( painter );
407-
if ( isSelected() )
418+
if ( exportLayer( Frame ) )
419+
{
420+
drawFrame( painter );
421+
}
422+
if ( isSelected() && exportLayer( SelectionBoxes ) )
408423
{
409424
drawSelectionBoxes( painter );
410425
}
411426

412427
painter->restore();
413428
}
414429

430+
int QgsComposerMap::numberExportLayers() const
431+
{
432+
return
433+
( hasBackground() ? 1 : 0 )
434+
+ layersToRender().length()
435+
+ ( mGridEnabled ? 1 : 0 )
436+
+ ( mOverviewFrameMapId != -1 ? 1 : 0 )
437+
+ ( hasFrame() ? 1 : 0 )
438+
+ ( isSelected() ? 1 : 0 )
439+
;
440+
}
441+
442+
bool QgsComposerMap::exportLayer( ItemType type ) const
443+
{
444+
if ( -1 == mCurrentExportLayer ) return true;
445+
int idx = numberExportLayers();
446+
if ( isSelected() )
447+
{
448+
--idx;
449+
if ( SelectionBoxes == type ) return mCurrentExportLayer == idx;
450+
}
451+
if ( hasFrame() )
452+
{
453+
--idx;
454+
if ( Frame == type ) return mCurrentExportLayer == idx;
455+
}
456+
if ( mOverviewFrameMapId )
457+
{
458+
--idx;
459+
if ( OverviewMapExtent == type ) return mCurrentExportLayer == idx;
460+
}
461+
if ( mGridEnabled )
462+
{
463+
--idx;
464+
if ( Grid == type ) return mCurrentExportLayer == idx;
465+
}
466+
if ( hasBackground() )
467+
{
468+
if ( Background == type ) return mCurrentExportLayer == 0;
469+
}
470+
return true; // for Layer
471+
}
472+
473+
415474
void QgsComposerMap::updateCachedImage( void )
416475
{
417476
syncLayerSet(); //layer list may have changed
@@ -440,7 +499,7 @@ const QgsMapRenderer *QgsComposerMap::mapRenderer() const
440499
Q_NOWARN_DEPRECATED_POP
441500
}
442501

443-
QStringList QgsComposerMap::layersToRender()
502+
QStringList QgsComposerMap::layersToRender() const
444503
{
445504
//use stored layer set or read current set from main canvas
446505
QStringList renderLayerSet;

‎src/core/composer/qgscomposermap.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,11 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
445445
/** Returns whether updates to the composer map are enabled. */
446446
bool updatesEnabled() const { return mUpdatesEnabled; }
447447

448+
/**Get the number of layers that this item exports
449+
@returns 0 if this item is to be placed on the same layer as the previous item
450+
@note this method was added in version 2.4 */
451+
int numberExportLayers() const;
452+
448453
signals:
449454
void extentChanged();
450455

@@ -606,7 +611,7 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
606611
double mAtlasMargin;
607612

608613
/**Returns a list of the layers to render for this map item*/
609-
QStringList layersToRender();
614+
QStringList layersToRender() const;
610615

611616
/**Draws the map grid*/
612617
void drawGrid( QPainter* p );
@@ -665,6 +670,18 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
665670
void createDefaultGridLineSymbol();
666671
void initGridAnnotationFormatFromProject();
667672

673+
enum ItemType
674+
{
675+
Background,
676+
Layer,
677+
Grid,
678+
OverviewMapExtent,
679+
Frame,
680+
SelectionBoxes
681+
};
682+
683+
/**Test if this item needs to be exported considering mCurrentExportLayer*/
684+
bool exportLayer( ItemType type ) const;
668685
};
669686

670687
#endif

‎src/core/composer/qgscomposition.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
#include "qgsaddremoveitemcommand.h"
3333
#include "qgscomposeritemcommand.h"
3434
#include "qgsatlascomposition.h"
35+
#include "qgspaperitem.h"
3536

3637
class QgisApp;
3738
class QgsComposerFrame;
3839
class QgsComposerMap;
39-
class QgsPaperItem;
4040
class QGraphicsRectItem;
4141
class QgsMapRenderer;
4242
class QDomElement;
@@ -451,6 +451,11 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
451451
/** Sets the current atlas mode of the composition. Returns false if the mode could not be changed. */
452452
bool setAtlasMode( QgsComposition::AtlasMode mode );
453453

454+
/** Return pages in the correct order
455+
@note composerItems(QList< QgsPaperItem* > &) may not return pages in the correct order
456+
@note added in version 2.4*/
457+
QList< QgsPaperItem* > pages() { return mPages; }
458+
454459
public slots:
455460
/**Casts object to the proper subclass type and calls corresponding itemAdded signal*/
456461
void sendItemAddedSignal( QgsComposerItem* item );

‎src/ui/qgssvgexportoptions.ui

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>QgsSvgExportOptionsDialog</class>
4+
<widget class="QDialog" name="QgsSvgExportOptionsDialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>675</width>
10+
<height>170</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>SVG export options</string>
15+
</property>
16+
<widget class="QWidget" name="layoutWidget">
17+
<property name="geometry">
18+
<rect>
19+
<x>10</x>
20+
<y>20</y>
21+
<width>604</width>
22+
<height>101</height>
23+
</rect>
24+
</property>
25+
<layout class="QVBoxLayout" name="verticalLayout">
26+
<item>
27+
<widget class="QCheckBox" name="chkMapLayersAsGroup">
28+
<property name="text">
29+
<string>Export map layers as svg groups (may affect label placement)</string>
30+
</property>
31+
</widget>
32+
</item>
33+
<item>
34+
<widget class="QCheckBox" name="chkTextAsOutline">
35+
<property name="enabled">
36+
<bool>false</bool>
37+
</property>
38+
<property name="text">
39+
<string>Render text as outline</string>
40+
</property>
41+
<property name="checked">
42+
<bool>true</bool>
43+
</property>
44+
</widget>
45+
</item>
46+
<item>
47+
<widget class="QDialogButtonBox" name="buttonBox">
48+
<property name="orientation">
49+
<enum>Qt::Horizontal</enum>
50+
</property>
51+
<property name="standardButtons">
52+
<set>QDialogButtonBox::Ok</set>
53+
</property>
54+
</widget>
55+
</item>
56+
</layout>
57+
</widget>
58+
</widget>
59+
<resources/>
60+
<connections>
61+
<connection>
62+
<sender>buttonBox</sender>
63+
<signal>accepted()</signal>
64+
<receiver>QgsSvgExportOptionsDialog</receiver>
65+
<slot>accept()</slot>
66+
<hints>
67+
<hint type="sourcelabel">
68+
<x>248</x>
69+
<y>254</y>
70+
</hint>
71+
<hint type="destinationlabel">
72+
<x>157</x>
73+
<y>274</y>
74+
</hint>
75+
</hints>
76+
</connection>
77+
<connection>
78+
<sender>buttonBox</sender>
79+
<signal>rejected()</signal>
80+
<receiver>QgsSvgExportOptionsDialog</receiver>
81+
<slot>reject()</slot>
82+
<hints>
83+
<hint type="sourcelabel">
84+
<x>316</x>
85+
<y>260</y>
86+
</hint>
87+
<hint type="destinationlabel">
88+
<x>286</x>
89+
<y>274</y>
90+
</hint>
91+
</hints>
92+
</connection>
93+
</connections>
94+
</ui>

0 commit comments

Comments
 (0)
Please sign in to comment.