|
177 | 177 | #include "qgssinglebandgrayrenderer.h"
|
178 | 178 | #include "qgssnappingdialog.h"
|
179 | 179 | #include "qgssponsors.h"
|
| 180 | +#include "qgssvgannotationitem.h" |
180 | 181 | #include "qgstextannotationitem.h"
|
181 | 182 | #include "qgstipgui.h"
|
182 | 183 | #include "qgsundowidget.h"
|
|
233 | 234 | #include "qgsmaptoolselectfreehand.h"
|
234 | 235 | #include "qgsmaptoolselectpolygon.h"
|
235 | 236 | #include "qgsmaptoolselectradius.h"
|
| 237 | +#include "qgsmaptoolsvgannotation.h" |
236 | 238 | #include "qgsmaptoolreshape.h"
|
237 | 239 | #include "qgsmaptoolrotatepointsymbols.h"
|
238 | 240 | #include "qgsmaptoolsplitfeatures.h"
|
@@ -734,6 +736,7 @@ QgisApp::~QgisApp()
|
734 | 736 | delete mMapTools.mTextAnnotation;
|
735 | 737 | delete mMapTools.mFormAnnotation;
|
736 | 738 | delete mMapTools.mHtmlAnnotation;
|
| 739 | + delete mMapTools.mSvgAnnotation; |
737 | 740 | delete mMapTools.mAnnotation;
|
738 | 741 | delete mMapTools.mAddFeature;
|
739 | 742 | delete mMapTools.mMoveFeature;
|
@@ -938,6 +941,7 @@ void QgisApp::createActions()
|
938 | 941 | connect( mActionTextAnnotation, SIGNAL( triggered() ), this, SLOT( addTextAnnotation() ) );
|
939 | 942 | connect( mActionFormAnnotation, SIGNAL( triggered() ), this, SLOT( addFormAnnotation() ) );
|
940 | 943 | connect( mActionHtmlAnnotation, SIGNAL( triggered() ), this, SLOT( addHtmlAnnotation() ) );
|
| 944 | + connect( mActionSvgAnnotation, SIGNAL( triggered() ), this, SLOT( addSvgAnnotation() ) ); |
941 | 945 | connect( mActionAnnotation, SIGNAL( triggered() ), this, SLOT( modifyAnnotation() ) );
|
942 | 946 | connect( mActionLabeling, SIGNAL( triggered() ), this, SLOT( labeling() ) );
|
943 | 947 |
|
@@ -1402,6 +1406,7 @@ void QgisApp::createToolBars()
|
1402 | 1406 | bt->addAction( mActionTextAnnotation );
|
1403 | 1407 | bt->addAction( mActionFormAnnotation );
|
1404 | 1408 | bt->addAction( mActionHtmlAnnotation );
|
| 1409 | + bt->addAction( mActionSvgAnnotation ); |
1405 | 1410 | bt->addAction( mActionAnnotation );
|
1406 | 1411 |
|
1407 | 1412 | QAction* defAnnotationAction = mActionTextAnnotation;
|
@@ -1840,6 +1845,8 @@ void QgisApp::createCanvasTools()
|
1840 | 1845 | mMapTools.mFormAnnotation->setAction( mActionFormAnnotation );
|
1841 | 1846 | mMapTools.mHtmlAnnotation = new QgsMapToolHtmlAnnotation( mMapCanvas );
|
1842 | 1847 | mMapTools.mHtmlAnnotation->setAction( mActionHtmlAnnotation );
|
| 1848 | + mMapTools.mSvgAnnotation = new QgsMapToolSvgAnnotation( mMapCanvas ); |
| 1849 | + mMapTools.mSvgAnnotation->setAction( mActionSvgAnnotation ); |
1843 | 1850 | mMapTools.mAnnotation = new QgsMapToolAnnotation( mMapCanvas );
|
1844 | 1851 | mMapTools.mAnnotation->setAction( mActionAnnotation );
|
1845 | 1852 | mMapTools.mAddFeature = new QgsMapToolAddFeature( mMapCanvas );
|
@@ -3932,6 +3939,11 @@ void QgisApp::addTextAnnotation()
|
3932 | 3939 | mMapCanvas->setMapTool( mMapTools.mTextAnnotation );
|
3933 | 3940 | }
|
3934 | 3941 |
|
| 3942 | +void QgisApp::addSvgAnnotation() |
| 3943 | +{ |
| 3944 | + mMapCanvas->setMapTool( mMapTools.mSvgAnnotation ); |
| 3945 | +} |
| 3946 | + |
3935 | 3947 | void QgisApp::modifyAnnotation()
|
3936 | 3948 | {
|
3937 | 3949 | mMapCanvas->setMapTool( mMapTools.mAnnotation );
|
@@ -4468,6 +4480,13 @@ bool QgisApp::loadAnnotationItemsFromProject( const QDomDocument& doc )
|
4468 | 4480 | QgsHtmlAnnotationItem* newHtmlItem = new QgsHtmlAnnotationItem( mMapCanvas );
|
4469 | 4481 | newHtmlItem->readXML( doc, htmlItemList.at( i ).toElement() );
|
4470 | 4482 | }
|
| 4483 | + |
| 4484 | + QDomNodeList svgItemList = doc.elementsByTagName( "SVGAnnotationItem" ); |
| 4485 | + for ( int i = 0; i < svgItemList.size(); ++i ) |
| 4486 | + { |
| 4487 | + QgsSVGAnnotationItem* newSvgItem = new QgsSVGAnnotationItem( mMapCanvas ); |
| 4488 | + newSvgItem->readXML( doc, svgItemList.at( i ).toElement() ); |
| 4489 | + } |
4471 | 4490 | return true;
|
4472 | 4491 | }
|
4473 | 4492 |
|
|
0 commit comments