Skip to content
Permalink
Browse files

Merge pull request #4426 from wonder-sk/fix-relative-paths-svg

Fix relative paths to SVG files in embedded projects
  • Loading branch information
wonder-sk committed May 14, 2017
2 parents 93c59f4 + 590526e commit 2857ef59dc238ece3b3da005417d25ba0a011bf2
Showing with 1,334 additions and 931 deletions.
  1. +58 −2 doc/api_break.dox
  2. +4 −4 python/core/annotations/qgsannotation.sip
  3. +2 −2 python/core/annotations/qgsannotationmanager.sip
  4. +2 −2 python/core/annotations/qgshtmlannotation.sip
  5. +2 −2 python/core/annotations/qgssvgannotation.sip
  6. +2 −2 python/core/annotations/qgstextannotation.sip
  7. +1 −0 python/core/core.sip
  8. +4 −4 python/core/qgsconditionalstyle.sip
  9. +13 −13 python/core/qgsdiagramrenderer.sip
  10. +6 −6 python/core/qgslayerdefinition.sip
  11. +14 −10 python/core/qgsmaplayer.sip
  12. +2 −2 python/core/qgspallabeling.sip
  13. +44 −0 python/core/qgsreadwritecontext.sip
  14. +7 −7 python/core/qgstextrenderer.sip
  15. +10 −6 python/core/qgsvectorlayer.sip
  16. +6 −6 python/core/raster/qgsrasterlayer.sip
  17. +5 −5 python/core/symbology-ng/qgs25drenderer.sip
  18. +2 −2 python/core/symbology-ng/qgscategorizedsymbolrenderer.sip
  19. +5 −4 python/core/symbology-ng/qgsfillsymbollayer.sip
  20. +2 −2 python/core/symbology-ng/qgsgraduatedsymbolrenderer.sip
  21. +4 −4 python/core/symbology-ng/qgsheatmaprenderer.sip
  22. +2 −2 python/core/symbology-ng/qgsinvertedpolygonrenderer.sip
  23. +4 −3 python/core/symbology-ng/qgsmarkersymbollayer.sip
  24. +2 −2 python/core/symbology-ng/qgsnullsymbolrenderer.sip
  25. +6 −6 python/core/symbology-ng/qgspointclusterrenderer.sip
  26. +6 −6 python/core/symbology-ng/qgspointdisplacementrenderer.sip
  27. +2 −2 python/core/symbology-ng/qgsrenderer.sip
  28. +4 −4 python/core/symbology-ng/qgsrendererregistry.sip
  29. +2 −2 python/core/symbology-ng/qgsrulebasedrenderer.sip
  30. +2 −2 python/core/symbology-ng/qgssinglesymbolrenderer.sip
  31. +10 −62 python/core/symbology-ng/qgssvgcache.sip
  32. +8 −4 python/core/symbology-ng/qgssymbollayerregistry.sip
  33. +8 −13 python/core/symbology-ng/qgssymbollayerutils.sip
  34. +2 −2 python/gui/qgsformannotation.sip
  35. +0 −17 python/gui/symbology-ng/qgssvgselectorwidget.sip
  36. +3 −2 src/app/qgisapp.cpp
  37. +10 −4 src/app/qgsdecorationgrid.cpp
  38. +3 −2 src/app/qgslabelingwidget.cpp
  39. +5 −4 src/app/qgslayerstylingwidget.cpp
  40. +3 −2 src/app/qgsrulebasedlabelingwidget.cpp
  41. +2 −0 src/core/CMakeLists.txt
  42. +6 −7 src/core/annotations/qgsannotation.cpp
  43. +4 −4 src/core/annotations/qgsannotation.h
  44. +10 −10 src/core/annotations/qgsannotationmanager.cpp
  45. +4 −3 src/core/annotations/qgsannotationmanager.h
  46. +4 −4 src/core/annotations/qgshtmlannotation.cpp
  47. +2 −2 src/core/annotations/qgshtmlannotation.h
  48. +4 −4 src/core/annotations/qgssvgannotation.cpp
  49. +2 −2 src/core/annotations/qgssvgannotation.h
  50. +4 −4 src/core/annotations/qgstextannotation.cpp
  51. +2 −2 src/core/annotations/qgstextannotation.h
  52. +29 −6 src/core/composer/qgscomposerarrow.cpp
  53. +7 −2 src/core/composer/qgscomposermap.cpp
  54. +12 −4 src/core/composer/qgscomposermapgrid.cpp
  55. +10 −2 src/core/composer/qgscomposermapoverview.cpp
  56. +24 −4 src/core/composer/qgscomposerpicture.cpp
  57. +1 −0 src/core/composer/qgscomposerpicture.h
  58. +11 −2 src/core/composer/qgscomposerpolygon.cpp
  59. +11 −2 src/core/composer/qgscomposerpolyline.cpp
  60. +10 −2 src/core/composer/qgscomposershape.cpp
  61. +10 −2 src/core/composer/qgscomposition.cpp
  62. +10 −10 src/core/qgsconditionalstyle.cpp
  63. +5 −4 src/core/qgsconditionalstyle.h
  64. +26 −60 src/core/qgsdiagramrenderer.cpp
  65. +16 −13 src/core/qgsdiagramrenderer.h
  66. +20 −11 src/core/qgslayerdefinition.cpp
  67. +5 −5 src/core/qgslayerdefinition.h
  68. +33 −29 src/core/qgsmaplayer.cpp
  69. +15 −11 src/core/qgsmaplayer.h
  70. +4 −4 src/core/qgspallabeling.cpp
  71. +2 −2 src/core/qgspallabeling.h
  72. +23 −77 src/core/qgsproject.cpp
  73. +1 −1 src/core/qgsproject.h
  74. +5 −1 src/core/qgsprojectfiletransform.cpp
  75. +6 −0 src/core/qgsreadwritecontext.cpp
  76. +44 −0 src/core/qgsreadwritecontext.h
  77. +10 −10 src/core/qgsrulebasedlabeling.cpp
  78. +5 −4 src/core/qgsrulebasedlabeling.h
  79. +12 −10 src/core/qgstextrenderer.cpp
  80. +8 −7 src/core/qgstextrenderer.h
  81. +1 −1 src/core/qgstextrenderer_p.h
  82. +66 −21 src/core/qgsvectorlayer.cpp
  83. +10 −6 src/core/qgsvectorlayer.h
  84. +4 −3 src/core/qgsvectorlayerlabeling.cpp
  85. +4 −3 src/core/qgsvectorlayerlabeling.h
  86. +13 −11 src/core/raster/qgsrasterlayer.cpp
  87. +6 −6 src/core/raster/qgsrasterlayer.h
  88. +4 −4 src/core/symbology-ng/qgs25drenderer.cpp
  89. +3 −2 src/core/symbology-ng/qgs25drenderer.h
  90. +6 −6 src/core/symbology-ng/qgscategorizedsymbolrenderer.cpp
  91. +2 −2 src/core/symbology-ng/qgscategorizedsymbolrenderer.h
  92. +14 −4 src/core/symbology-ng/qgsfillsymbollayer.cpp
  93. +9 −1 src/core/symbology-ng/qgsfillsymbollayer.h
  94. +6 −6 src/core/symbology-ng/qgsgraduatedsymbolrenderer.cpp
  95. +2 −2 src/core/symbology-ng/qgsgraduatedsymbolrenderer.h
  96. +4 −2 src/core/symbology-ng/qgsheatmaprenderer.cpp
  97. +3 −2 src/core/symbology-ng/qgsheatmaprenderer.h
  98. +4 −4 src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp
  99. +2 −2 src/core/symbology-ng/qgsinvertedpolygonrenderer.h
  100. +16 −4 src/core/symbology-ng/qgsmarkersymbollayer.cpp
  101. +9 −2 src/core/symbology-ng/qgsmarkersymbollayer.h
  102. +4 −2 src/core/symbology-ng/qgsnullsymbolrenderer.cpp
  103. +3 −2 src/core/symbology-ng/qgsnullsymbolrenderer.h
  104. +6 −6 src/core/symbology-ng/qgspointclusterrenderer.cpp
  105. +2 −2 src/core/symbology-ng/qgspointclusterrenderer.h
  106. +6 −6 src/core/symbology-ng/qgspointdisplacementrenderer.cpp
  107. +2 −2 src/core/symbology-ng/qgspointdisplacementrenderer.h
  108. +4 −3 src/core/symbology-ng/qgsrenderer.cpp
  109. +3 −2 src/core/symbology-ng/qgsrenderer.h
  110. +5 −3 src/core/symbology-ng/qgsrendererregistry.h
  111. +4 −4 src/core/symbology-ng/qgsrulebasedrenderer.cpp
  112. +3 −2 src/core/symbology-ng/qgsrulebasedrenderer.h
  113. +4 −4 src/core/symbology-ng/qgssinglesymbolrenderer.cpp
  114. +2 −2 src/core/symbology-ng/qgssinglesymbolrenderer.h
  115. +7 −6 src/core/symbology-ng/qgsstyle.cpp
  116. +19 −23 src/core/symbology-ng/qgssvgcache.cpp
  117. +13 −17 src/core/symbology-ng/qgssvgcache.h
  118. +10 −2 src/core/symbology-ng/qgssymbollayerregistry.cpp
  119. +38 −17 src/core/symbology-ng/qgssymbollayerregistry.h
  120. +32 −39 src/core/symbology-ng/qgssymbollayerutils.cpp
  121. +19 −11 src/core/symbology-ng/qgssymbollayerutils.h
  122. +4 −4 src/gui/qgsformannotation.cpp
  123. +2 −2 src/gui/qgsformannotation.h
  124. +4 −2 src/gui/qgstextformatwidget.cpp
  125. +3 −2 src/gui/symbology-ng/qgsrulebasedrendererwidget.cpp
  126. +4 −30 src/gui/symbology-ng/qgssvgselectorwidget.cpp
  127. +2 −18 src/gui/symbology-ng/qgssvgselectorwidget.h
  128. +5 −5 src/plugins/grass/qgsgrasseditrenderer.cpp
  129. +2 −2 src/plugins/grass/qgsgrasseditrenderer.h
  130. +5 −1 src/server/qgsserverprojectparser.cpp
  131. +10 −12 src/ui/symbollayer/widget_svgselector.ui
  132. +4 −3 tests/src/core/testqgslabelingengine.cpp
  133. +2 −1 tests/src/core/testqgsmaprendererjob.cpp
  134. +159 −1 tests/src/core/testqgsproject.cpp
  135. +3 −2 tests/src/core/testqgsrulebasedrenderer.cpp
  136. +7 −2 tests/src/core/testqgssvgmarker.cpp
  137. +3 −3 tests/src/core/testqgsvectorlayerjoinbuffer.cpp
  138. +3 −3 tests/src/python/test_provider_memory.py
  139. +3 −2 tests/src/python/test_qgsgraduatedsymbolrenderer.py
  140. +3 −3 tests/src/python/test_qgsmaplayer.py
  141. +3 −2 tests/src/python/test_qgspointclusterrenderer.py
  142. +3 −2 tests/src/python/test_qgspointdisplacementrenderer.py
  143. +5 −4 tests/src/python/test_qgssymbollayer.py
  144. +8 −7 tests/src/python/test_qgstextrenderer.py
  145. +17 −16 tests/src/python/test_qgsvectorlayer.py
@@ -762,6 +762,16 @@ all these item added events.
- addComposerMap no longer takes a setDefaultPreviewStyle argument.
- the mapsToRestore parameter has been removed from addItemsFromXml

QgsConditionalLayerStyle {#qgis_api_break_3_0_QgsConditionalLayerStyle}
------------------------

- readXml() and writeXml() require a new argument: a reference to QgsReadWriteContext

QgsConditionalStyle {#qgis_api_break_3_0_QgsConditionalStyle}
-------------------

- readXml() and writeXml() require a new argument: a reference to QgsReadWriteContext

QgsCoordinateReferenceSystem {#qgis_api_break_3_0_QgsCoordinateReferenceSystem}
----------------------------

@@ -920,6 +930,9 @@ QgsDiagramRenderer {#qgis_api_break_3_0_QgsDiagramRenderer}
- xform, fields were no longer required and are removed.
- referencedFields() no longer takes a QgsFields argument.
- renderDiagram() now takes an optional data defined overrides collection argument.
- readXml(), _readXml(), writeXml(), _writeXml() do not take QgsVectorLayer as an argument anymore.
- readXml(), _readXml(), writeXml(), _writeXml() require a new argument: a reference to QgsReadWriteContext



QgsDiagramLayerSettings {#qgis_api_break_3_0_QgsDiagramLayerSettings}
@@ -951,11 +964,13 @@ setting data defined properties instead.
- The renderer member variable was removed, and getRenderer() was renamed to renderer()
- The showAll member variable was removed. setShowAllDiagrams() and showAllDiagrams() should be used instead.
- referencedFields() no longer requires a QgsFields argument.
- readXml() and writeXml() do not take QgsVectorLayer as an argument anymore.

QgsDiagramSettings {#qgis_api_break_3_0_QgsDiagramSettings}
------------------

- The SizeType enum was removed. Use QgsUnitTypes.RenderUnit instead.
- readXml() and writeXml() do not take QgsVectorLayer as an argument anymore.

QgsDial {#qgis_api_break_3_0_QgsDial}
-------
@@ -1095,6 +1110,8 @@ QgsFeatureRendererV2 {#qgis_api_break_3_0_QgsFeatureRendererV2}
- originalSymbolsForFeature( QgsFeature& feat ) has been removed. The originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) method should be used instead (previously available as originalSymbolsForFeature2 in PyQGIS bindings).
- copyPaintEffect() was removed. copyRendererData() should be used instead.
- usedAttributes() now requires a QgsRenderContext argument.
- save() expects QgsReadWriteContext reference as the last argument
- static create() method in subclasses expects QgsReadWriteContext reference as the last argument


QgsFeatureRequest {#qgis_api_break_3_0_QgsFeatureRequest}
@@ -1280,7 +1297,7 @@ QgsLayerDefinition {#qgis_api_break_3_0_QgsLayerDefinition}
------------------

- loadLayerDefinition() now also requires QgsProject as the second argument
- loadLayerDefinition() and exportLayerDefinition() variants that take QDomDocument as the first argument now expect QgsPathResolver as the last argument
- loadLayerDefinition() and exportLayerDefinition() variants that take QDomDocument as the first argument now expect QgsReadWriteContext as the last argument


QgsLayerPropertiesWidget {#qgis_api_break_3_0_QgsLayerPropertiesWidget}
@@ -1413,7 +1430,10 @@ screenUpdateRequested() were removed. These members have had no effect for a num
- capitaliseLayerName() was renamed to capitalizeLayerName() <!--#spellok-->
- asLayerDefinition(), fromLayerDefinition(), fromLayerDefinitionFile() were moved to QgsLayerDefinition class and renamed to exportLayerDefinitionLayers() resp. loadLayerDefinitionLayers()
- loadNamedStyleFromDb() was renamed to loadNamedStyleFromDatabase()
- readLayerXml() and writeLayerXml() expect QgsPathResolver reference as the last argument
- readLayerXml() and writeLayerXml() expect QgsReadWriteContext reference as the last argument
- readSymbology() and writeSymbology() expect QgsReadWriteContext reference as the last argument
- readStyle() and writeStyle() expect QgsReadWriteContext reference as the last argument
- readXml() and writeXml() expect QgsReadWriteContext reference as the last argument
- the invalidTransformInput() slot was removed - calling this slot had no effect
- metadata() was renamed to htmlMetadata()

@@ -1624,6 +1644,7 @@ dataDefinedValue(), dataDefinedEvaluate(), dataDefinedIsActive(),
dataDefinedUseExpression(), dataDefinedProperties() and dataDefinedNames()
members were removed. Use the QgsProperty framework through dataDefinedProperties()
and setDataDefinedProperties() instead.
- readXml() and writeXml() now expect a reference to QgsReadWriteContext.


QgsPanelWidgetStack {#qgis_api_break_3_0_QgsPanelWidgetStack}
@@ -1941,11 +1962,39 @@ QgsSvgCache {#qgis_api_break_3_0_QgsSvgCache}
- This class is no longer a singleton and instance() has been removed. Instead use QgsApplication::svgCache() to access an application-wide cache.
- containsParamsV2() was removed. Use containsParamsV3() instead.
- The rasterScaleFactor parameter was removed from all methods
- svgAsImage(), svgAsPicture(), svgViewboxSize(), svgContent(), insertSvg(), cacheEntry() only accept absolute path to SVG file (relative paths will not be resolved).

QgsSvgCacheEntry {#qgis_api_break_3_0_QgsSvgCacheEntry}
----------------

- The rasterScaleFactor member was removed.
- The lookupKey member was removed.
- The "file" member has been renamed to "path".
- Constructor does not take lookup key as an optional last argument


QgsSVGFillSymbolLayer {#qgis_api_break_3_0_QgsSVGFillSymbolLayer}
---------------------

- The first argument of the constructor (svgFilePath) does not have default value anymore.

QgsSvgMarkerSymbolLayer {#qgis_api_break_3_0_QgsSvgMarkerSymbolLayer}
-----------------------

- The first argument of the constructor (path) does not have a default value anymore.

QgsSvgSelectorWidget {#qgis_api_break_3_0_QgsSvgSelectorWidget}
--------------------

- create() has been removed - use ordinary constructor instead.
- currentSvgPathToName() has been removed - absolute paths are always used.
- groupsTreeView(), imagesListView(), filePathLineEdit(), filePathButton(), relativePathCheckbox(), selectorLayout() have been removed as they were leaking implementation details.

QgsSvgSelectorDialog {#qgis_api_break_3_0_QgsSvgSelectorDialog}
--------------------

- layout(), buttonBox() has been removed as they were leaking implementation details.


QgsStyle (renamed from QgsStyleV2) {#qgis_api_break_3_0_QgsStyle}
----------------------------------
@@ -2022,6 +2071,8 @@ QgsSymbolLayerUtils (renamed from QgsSymbolLayerUtilsV2) {#qgis_api_break
- pixelSizeScaleFactor() was removed. Use QgsRenderContext::convertToPainterUnits() instead.
- mapUnitScaleFactor() was removed. Use QgsRenderContext::convertToMapUnits() instead.
- estimateMaxSymbolBleed() now requires a QgsRenderContext argument (since the bleed depends on render context for non-pixel units)
- loadSymbol(), saveSymbol(), loadSymbols(), saveSymbols(), loadSymbolLayer() now require a reference to QgsReadWriteContext
- symbolNameToPath() and symbolPathToName() have been renamed to svgSymbolNameToPath() and svgSymbolPathToName() and they require reference to QgsPathResolver


QgsSymbolSelectorWidget {#qgis_api_break_3_0_QgsSymbolSelectorWidget}
@@ -2251,6 +2302,11 @@ optional property map passing down layer level properties to the SLD encoders. I
- setScaleMethodToSymbol was removed. This is now handled using data defined scaling at a symbol layer level
- usedAttributes is now a const method and returns QSet<QString> instead of QStringList

QgsRendererAbstractMetadata {#qgis_api_break_3_0_QgsRendererAbstractMetadata}
---------------------------

- createRenderer() now expects a reference to QgsReadWriteContext as the second argument


Processing {#qgis_api_break_3_0_Processing}
----------
@@ -56,8 +56,8 @@ class QgsAnnotation : QObject

void render( QgsRenderContext &context ) const;

virtual void writeXml( QDomElement &elem, QDomDocument &doc ) const = 0;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc ) = 0;
virtual void writeXml( QDomElement& elem, QDomDocument & doc, const QgsReadWriteContext &context ) const = 0;
virtual void readXml( const QDomElement& itemElem, const QgsReadWriteContext &context ) = 0;

void setMarkerSymbol( QgsMarkerSymbol *symbol /Transfer/ );
QgsMarkerSymbol *markerSymbol() const;
@@ -80,8 +80,8 @@ class QgsAnnotation : QObject

virtual QSizeF minimumFrameSize() const;

void _writeXml( QDomElement &itemElem, QDomDocument &doc ) const;
void _readXml( const QDomElement &annotationElem, const QDomDocument &doc );
void _writeXml( QDomElement& itemElem, QDomDocument& doc, const QgsReadWriteContext &context ) const;
void _readXml( const QDomElement& annotationElem, const QgsReadWriteContext &context );

void copyCommonProperties( QgsAnnotation *target ) const;

@@ -81,15 +81,15 @@ class QgsAnnotationManager : QObject
:rtype: list of QgsAnnotation
%End

bool readXml( const QDomElement &element, const QDomDocument &doc );
bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
%Docstring
Reads the manager's state from a DOM element, restoring all annotations
present in the XML document.
.. seealso:: writeXml()
:rtype: bool
%End

QDomElement writeXml( QDomDocument &doc ) const;
QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Returns a DOM element representing the state of the manager.
.. seealso:: readXml()
@@ -50,8 +50,8 @@ class QgsHtmlAnnotation: QgsAnnotation
:rtype: str
%End

virtual void writeXml( QDomElement &elem, QDomDocument &doc ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc );
virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );

virtual void setAssociatedFeature( const QgsFeature &feature );

@@ -29,8 +29,8 @@ class QgsSvgAnnotation: QgsAnnotation
virtual QgsSvgAnnotation *clone() const /Factory/;


virtual void writeXml( QDomElement &elem, QDomDocument &doc ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc );
virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );

void setFilePath( const QString &file );
%Docstring
@@ -44,8 +44,8 @@ class QgsTextAnnotation: QgsAnnotation
.. seealso:: document()
%End

virtual void writeXml( QDomElement &elem, QDomDocument &doc ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc );
virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );

static QgsTextAnnotation *create() /Factory/;
%Docstring
@@ -136,6 +136,7 @@
%Include qgsproviderregistry.sip
%Include qgspythonrunner.sip
%Include qgsrange.sip
%Include qgsreadwritecontext.sip
%Include qgsrelation.sip
%Include qgsrelationmanager.sip
%Include qgsrenderchecker.sip
@@ -52,13 +52,13 @@ class QgsConditionalLayerStyles
:rtype: list of QgsConditionalStyle
%End

bool readXml( const QDomNode &node );
bool readXml( const QDomNode &node, const QgsReadWriteContext &context );
%Docstring
Reads field ui properties specific state from Dom node.
:rtype: bool
%End

bool writeXml( QDomNode &node, QDomDocument &doc ) const;
bool writeXml( QDomNode &node, QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Write field ui properties specific state from Dom node.
:rtype: bool
@@ -244,13 +244,13 @@ class QgsConditionalStyle
:rtype: QgsConditionalStyle
%End

bool readXml( const QDomNode &node );
bool readXml( const QDomNode &node, const QgsReadWriteContext &context );
%Docstring
Reads vector conditional style specific state from layer Dom node.
:rtype: bool
%End

bool writeXml( QDomNode &node, QDomDocument &doc ) const;
bool writeXml( QDomNode &node, QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Write vector conditional style specific state from layer Dom node.
:rtype: bool
@@ -199,9 +199,9 @@ class QgsDiagramLayerSettings
*/
void setShowAllDiagrams( bool showAllDiagrams );

void readXml( const QDomElement &elem, const QgsVectorLayer *layer );
void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer ) const;
bool prepare( const QgsExpressionContext &context = QgsExpressionContext() ) const;
void readXml( const QDomElement& elem );
void writeXml( QDomElement& layerElem, QDomDocument& doc ) const;
bool prepare( const QgsExpressionContext& context = QgsExpressionContext() ) const;

/** Returns the set of any fields referenced by the layer's diagrams.
* @param context expression context the diagrams will be drawn using
@@ -294,8 +294,8 @@ class QgsDiagramSettings
//! Scale diagrams smaller than mMinimumSize to mMinimumSize
double minimumSize;

void readXml( const QDomElement &elem, const QgsVectorLayer *layer );
void writeXml( QDomElement &rendererElem, QDomDocument &doc, const QgsVectorLayer *layer ) const;
void readXml( const QDomElement& elem );
void writeXml( QDomElement& rendererElem, QDomDocument& doc ) const;

/** Returns list of legend nodes for the diagram
* @note caller is responsible for deletion of QgsLayerTreeModelLegendNodes
@@ -365,8 +365,8 @@ class QgsDiagramRenderer
/** Returns list with all diagram settings in the renderer*/
virtual QList<QgsDiagramSettings> diagramSettings() const = 0;

virtual void readXml( const QDomElement &elem, const QgsVectorLayer *layer ) = 0;
virtual void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer ) const = 0;
virtual void readXml( const QDomElement& elem, const QgsReadWriteContext &context ) = 0;
virtual void writeXml( QDomElement& layerElem, QDomDocument& doc, const QgsReadWriteContext &context ) const = 0;

/** Returns list of legend nodes for the diagram
* @note caller is responsible for deletion of QgsLayerTreeModelLegendNodes
@@ -442,8 +442,8 @@ class QgsDiagramRenderer
static int dpiPaintDevice( const QPainter* );

//read / write diagram
void _readXml( const QDomElement &elem, const QgsVectorLayer *layer );
void _writeXml( QDomElement &rendererElem, QDomDocument &doc, const QgsVectorLayer *layer ) const;
void _readXml( const QDomElement& elem, const QgsReadWriteContext &context );
void _writeXml( QDomElement& rendererElem, QDomDocument& doc, const QgsReadWriteContext &context ) const;
};

/** Renders the diagrams for all features with the same settings*/
@@ -467,8 +467,8 @@ class QgsSingleCategoryDiagramRenderer : QgsDiagramRenderer

QList<QgsDiagramSettings> diagramSettings() const;

void readXml( const QDomElement &elem, const QgsVectorLayer *layer );
void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer ) const;
void readXml( const QDomElement& elem, const QgsReadWriteContext &context );
void writeXml( QDomElement& layerElem, QDomDocument& doc, const QgsReadWriteContext &context ) const;

virtual QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const /Factory/;

@@ -533,8 +533,8 @@ class QgsLinearlyInterpolatedDiagramRenderer : QgsDiagramRenderer
bool classificationAttributeIsExpression() const;
void setClassificationAttributeIsExpression( bool isExpression );

void readXml( const QDomElement &elem, const QgsVectorLayer *layer );
void writeXml( QDomElement &layerElem, QDomDocument &doc, const QgsVectorLayer *layer ) const;
void readXml( const QDomElement& elem, const QgsReadWriteContext &context );
void writeXml( QDomElement& layerElem, QDomDocument& doc, const QgsReadWriteContext &context ) const;

virtual QList< QgsLayerTreeModelLegendNode * > legendItems( QgsLayerTreeLayer *nodeLayer ) const /Factory/;

@@ -11,13 +11,13 @@ class QgsLayerDefinition
#include <qgslayerdefinition.h>
%End
public:
static bool loadLayerDefinition( const QString &path, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage /Out/ );
static bool loadLayerDefinition( QDomDocument doc, QgsProject *project, QgsLayerTreeGroup *rootGroup, QString &errorMessage /Out/, const QgsPathResolver &pathResolver );
static bool exportLayerDefinition( QString path, const QList<QgsLayerTreeNode*> &selectedTreeNodes, QString &errorMessage /Out/ );
static bool exportLayerDefinition( QDomDocument doc, const QList<QgsLayerTreeNode*> &selectedTreeNodes, QString &errorMessage /Out/, const QgsPathResolver &pathResolver );
static bool loadLayerDefinition( const QString & path, QgsProject* project, QgsLayerTreeGroup* rootGroup, QString &errorMessage /Out/ );
static bool loadLayerDefinition( QDomDocument doc, QgsProject* project, QgsLayerTreeGroup* rootGroup, QString &errorMessage /Out/, const QgsReadWriteContext &context );
static bool exportLayerDefinition( QString path, const QList<QgsLayerTreeNode*>& selectedTreeNodes, QString &errorMessage /Out/ );
static bool exportLayerDefinition( QDomDocument doc, const QList<QgsLayerTreeNode*>& selectedTreeNodes, QString &errorMessage /Out/, const QgsReadWriteContext &context );

static QDomDocument exportLayerDefinitionLayers( const QList<QgsMapLayer*> &layers, const QgsPathResolver &pathResolver );
static QList<QgsMapLayer*> loadLayerDefinitionLayers( QDomDocument &document, const QgsPathResolver &pathResolver ) /Factory/;
static QDomDocument exportLayerDefinitionLayers( const QList<QgsMapLayer*>& layers, const QgsReadWriteContext &context );
static QList<QgsMapLayer*> loadLayerDefinitionLayers( QDomDocument& document, const QgsReadWriteContext &context ) /Factory/;
static QList<QgsMapLayer*> loadLayerDefinitionLayers( const QString &qlrfile ) /Factory/;

/**

0 comments on commit 2857ef5

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