Skip to content

Commit 26d7235

Browse files
authored
Merge pull request #3480 from nyalldawson/symbol
Remove deprecated members from symbology
2 parents 9215fca + ffa10a1 commit 26d7235

File tree

63 files changed

+159
-1567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+159
-1567
lines changed

doc/api_break.dox

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ variant instead.</li>
304304
<li>GenericDataSourceURI has been renamed to GenericDataSourceUri</li>
305305
</ul>
306306

307+
\subsection qgis_api_break_3_0_QgsCategorizedSymbolRendererWidget QgsCategorizedSymbolRendererWidget
308+
<ul>
309+
<li>sizeScaleFieldChanged() and scaleMethodChanged() were removed. These settings are no longer exposed in the widget's GUI.</li>
310+
</ul>
311+
307312
\subsection qgis_api_break_3_0_QgsClipper QgsClipper
308313

309314
<ul>
@@ -552,7 +557,17 @@ None will need to be modified, as the method will return an empty geometry if th
552557
\subsection qgis_api_break_3_0_QgsFeatureRendererV2 QgsFeatureRendererV2
553558

554559
<ul>
555-
<li>The method capabilities() returns QgsFeatureRendererV2::Capabilities flags instead of an integer. The two are binary compatible.
560+
<li>The method capabilities() returns QgsFeatureRendererV2::Capabilities flags instead of an integer. The two are binary compatible.</li>
561+
<li>symbolForFeature( QgsFeature& feature ) has been removed. The symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) method should be used instead (previously available as symbolForFeature2 in PyQGIS bindings). symbolForFeature has been made pure virtual.</li>
562+
<li>originalSymbolForFeature( QgsFeature& feature ) has been removed. The symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) method should be used instead (previously available as originalSymbolForFeature2 in PyQGIS bindings).</li>
563+
<li>startRender( QgsRenderContext& context, const QgsVectorLayer *vlayer ) was removed. This function has had no effect since QGIS 2.4</li>
564+
<li>symbols() has been removed. The symbols( QgsRenderContext& context ) method should be used instead (previously available as symbols2 in PyQGIS bindings).</li>
565+
<li>writeSld( QDomDocument& doc, const QgsVectorLayer &layer ) was removed. writeSld( QDomDocument& doc, const QgsVectorLayer &layer ) should be used instead.</li>
566+
<li>rotationField() and setRotationField() were removed. Data defined properties for QgsSymbolLayer should be used instead.</li>
567+
<li>willRenderFeature( QgsFeature& feat ) has been removed. The willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) method should be used instead (previously available as willRenderFeature2 in PyQGIS bindings).</li>
568+
<li>symbolsForFeature( QgsFeature& feat ) has been removed. The symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) method should be used instead (previously available as symbolsForFeature2 in PyQGIS bindings).</li>
569+
<li>originalSymbolsForFeature( QgsFeature& feat ) has been removed. The originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) method should be used instead (previously available as originalSymbolsForFeature2 in PyQGIS bindings).</li>
570+
<li>copyPaintEffect() was removed. copyRendererData() should be used instead.</li>
556571
</ul>
557572

558573
\subsection qgis_api_break_3_0_QgsFields QgsFields
@@ -609,6 +624,18 @@ and the new ramp can be retrieved after executing the dialog by calling ramp().<
609624
<li>Some internal methods which were previously public or protected were made private.</li>
610625
</ul>
611626

627+
\subsection qgis_api_break_3_0_QgsGraduatedSymbolRenderer QgsGraduatedSymbolRenderer
628+
629+
<ul>
630+
<li>getDataValues() has been removed - use QgsVectorLayer::getDoubleValues() instead</li>
631+
</ul>
632+
633+
\subsection qgis_api_break_3_0_QgsGraduatedSymbolRendererWidget QgsGraduatedSymbolRenderer
634+
<ul>
635+
<li>sizeScaleFieldChanged() and scaleMethodChanged() were removed. These settings are no longer exposed in the widget's GUI.</li>
636+
</ul>
637+
638+
612639
\subsection qgis_api_break_3_0_QgsGraphBuilderInterface QgsGraphBuilderInterface
613640

614641
<ul>
@@ -883,27 +910,58 @@ be returned instead of a null pointer if no transformation is required.</li>
883910
<li>QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon ) constructor and reset( bool isPolygon) have been removed, use constructor and function with Qgis::GeometryType as argument instead.</li>
884911
</ul>
885912

913+
\subsection qgis_api_break_3_0_QgsRuleBasedRenderer QgsRuleBasedRenderer
914+
915+
<ul>
916+
<li>QgsRuleBasedRenderer.Rule checkState() and setCheckState() were removed. Use active() and setActive() instead.</li>
917+
<li>startRender( QgsRenderContext& context, const QgsFields& fields ) was removed. Use startRender( QgsRenderContext& context, const QgsFields& fields, QString& filter ) instead.</li>
918+
</ul>
919+
920+
\subsection qgis_api_break_3_0_QgsSimpleMarkerSymbolLayer QgsSimpleMarkerSymbolLayer
921+
922+
<ul>
923+
<li>The constructor variant with a string for the shape name has been removed. Use the variant which accepts a QgsSimpleMarkerSymbolLayerBase.Shape enum instead.</li>
924+
<li>name() and setName() have been removed. Use shape() and setShape() instead.</li>
925+
<li>prepareShape() and preparePath() were removed. Calling these methods manually should no longer be required.</li>
926+
</ul>
927+
928+
\subsection qgis_api_break_3_0_QgsSingleSymbolRendererWidget QgsSingleSymbolRendererWidget
929+
<ul>
930+
<li>sizeScaleFieldChanged() and scaleMethodChanged() were removed. These settings are no longer exposed in the widget's GUI.</li>
931+
</ul>
886932

887933
\subsection qgis_api_break_3_0_QgsSnapper QgsSnapper
888934

889935
<ul>
890936
<li>Constructor variant with QgsMapRenderer has been removed. Use the variant with QgsMapSettings.</li>
891937
</ul>
892938

939+
\subsection qgis_api_break_3_0_QgsSvgCache QgsSvgCache
940+
941+
<ul>
942+
<li>containsParamsV2() was removed. Use containsParamsV3() instead.</li>
943+
</ul>
944+
893945
\subsection qgis_api_break_3_0_QgsSymbol QgsSymbol (renamed from QgsSymbolV2)
894946

895947
<ul>
896948
<li>The OutputUnit enum, including QgsSymbol::MM, QgsSymbol::MapUnit, QgsSymbol::Mixed, QgsSymbol::Pixel and QgsSymbol::Percentage has been moved to QgsUnitTypes
897949
and renamed to RenderUnit. QgsSymbol::OutputUnitList was renamed to QgsUnitTypes::RenderUnitList. All methods which previously accepted QgsSymbol::OutputUnit
898950
parameters or QgsSymbol::OutputUnitList parameters now take QgsUnitTypes::RenderUnit or QgsUnitTypes::RenderUnitList parameters respectively.</li>
899951
<li>startRender() now accepts a QgsFields reference, not a pointer.</li>
952+
<li>isSymbolLayerCompatible() was removed. Use QgsSymbolLayer::isCompatibleWithSymbol() instead.</li>
953+
<li>The DataDefinedSizeScale flag has been removed. This is no longer used and data defined scaling on a symbol layer level should be used instead.</li>
900954
</ul>
901955

902956
\subsection qgis_api_break_3_0_QgsSymbolLayer QgsSymbolLayer (renamed from QgsSymbolLayerV2)
903957

904958
<ul>
905959
<li>The deprecated prepareExpressions( const QgsFields* fields, double scale = -1.0 ) method has been removed. Use
906960
the variant which takes QgsSymbolRenderContext instead.</li>
961+
<li>The deprecated methods dataDefinedProperty( const QString& property ) and dataDefinedPropertyString() were removed. Use getDataDefinedProperty() instead.</li>
962+
<li>setDataDefinedProperty( const QString& property, const QString& expressionString ) was removed. Use setDataDefinedProperty( const QString& property, QgsDataDefined* dataDefined ) instead.</li>
963+
<li>evaluateDataDefinedProperty( const QString& property, const QgsFeature* feature ) was removed. Use the variant which takes QgsSymbolRenderContext instead.</li>
964+
<li>expression() was removed. Use getDataDefinedProperty or evaluateDataDefinedProperty instead.</li>
907965
</ul>
908966

909967
\subsection qgis_api_break_3_0_QgsSymbolRenderContext QgsSymbolRenderContext (renamed from QgsSymbolV2RenderContext)
@@ -917,6 +975,19 @@ the variant which takes QgsSymbolRenderContext instead.</li>
917975

918976
<ul>
919977
<li>encodeOutputUnit() and decodeOutputUnit() were removed. QgsUnitTypes::encodeUnit() and QgsUnitTypes::decodeRenderUnit() should be used instead.</li>
978+
<li>The signatures for wellKnownMarkerToSld() and wellKnownMarkerFromSld() were changed.</li>
979+
</ul>
980+
981+
\subsection qgis_api_break_3_0_QgsSymbolSelectorDialog QgsSymbolSelectorDialog
982+
983+
<ul>
984+
<li>saveSymbol() was removed.</li>
985+
</ul>
986+
987+
\subsection qgis_api_break_3_0_QgsSymbolSelectorWidget QgsSymbolSelectorWidget
988+
989+
<ul>
990+
<li>saveSymbol() was removed.</li>
920991
</ul>
921992

922993
\subsection qgis_api_break_3_0_QgsTolerance QgsTolerance
@@ -1053,7 +1124,9 @@ in code which previously passed a null pointer to QgsVectorFileWriter.</li>
10531124
<ul>
10541125
<li>New virtual method <code>bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage, QgsStringMap props = QgsStringMap() )</code> accepts an
10551126
optional property map passing down layer level properties to the SLD encoders. If scale based visibility is enabled, it will contain the
1056-
<code>scaleMinDenom</code> and <code>scaleMaxDenom</code> properties.
1127+
<code>scaleMinDenom</code> and <code>scaleMaxDenom</code> properties.</li>
1128+
<li>The RotationField capabitity was removed. This is now handled using data defined rotation at a symbol layer level</li>
1129+
<li>setScaleMethodToSymbol was removed. This is now handled using data defined scaling at a symbol layer level</li>
10571130
</ul>
10581131

10591132

python/core/symbology-ng/qgscategorizedsymbolrenderer.sip

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ class QgsCategorizedSymbolRenderer : QgsFeatureRenderer
5050
virtual ~QgsCategorizedSymbolRenderer();
5151

5252
//! @note available in python as symbolForFeature2
53-
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
53+
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
5454

5555
//! @note available in python as originalSymbolForFeature2
56-
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
56+
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context );
5757

5858
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
5959

@@ -73,7 +73,7 @@ class QgsCategorizedSymbolRenderer : QgsFeatureRenderer
7373
virtual QString filter( const QgsFields& fields = QgsFields() );
7474

7575
//! @note available in python as symbols2
76-
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
76+
virtual QgsSymbolList symbols( QgsRenderContext& context );
7777

7878
/** Update all the symbols but leave categories and colors. This method also sets the source
7979
* symbol for the renderer.
@@ -168,15 +168,6 @@ class QgsCategorizedSymbolRenderer : QgsFeatureRenderer
168168
*/
169169
void updateColorRamp( QgsColorRamp* ramp /Transfer/, bool inverted = false );
170170

171-
void setRotationField( const QString& fieldOrExpression ) /Deprecated/;
172-
QString rotationField() const /Deprecated/;
173-
174-
void setSizeScaleField( const QString& fieldOrExpression );
175-
QString sizeScaleField() const;
176-
177-
void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
178-
QgsSymbol::ScaleMethod scaleMethod() const;
179-
180171
//! items of symbology items in legend should be checkable
181172
//! @note added in 2.5
182173
virtual bool legendSymbolItemsCheckable() const;

python/core/symbology-ng/qgsgraduatedsymbolrenderer.sip

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
9494
virtual ~QgsGraduatedSymbolRenderer();
9595

9696
//! @note labelForLowerUpper in python bindings
97-
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
97+
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
9898
//! @note originalSymbolForFeature2 in python bindings
99-
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
99+
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context );
100100

101101
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
102102

@@ -114,7 +114,7 @@ class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
114114
virtual QgsFeatureRenderer::Capabilities capabilities();
115115

116116
//! @note symbol2 in python bindings
117-
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
117+
virtual QgsSymbolList symbols( QgsRenderContext& context );
118118

119119
QString classAttribute() const;
120120
void setClassAttribute( const QString& attr );
@@ -183,12 +183,6 @@ class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
183183
//! @note Added in 2.6
184184
void updateClasses( QgsVectorLayer *vlayer, Mode mode, int nclasses );
185185

186-
//! Evaluates the data expression and returns the list of values from the layer
187-
//! @param vlayer The layer for which to evaluate the expression
188-
//! @note Added in 2.6
189-
//! @deprecated use QgsVectorLayer::getDoubleValues instead
190-
QList<double> getDataValues( QgsVectorLayer *vlayer ) /Deprecated/;
191-
192186
//! Return the label format used to generate default classification labels
193187
//! @note Added in 2.6
194188
const QgsRendererRangeLabelFormat &labelFormat() const;
@@ -299,15 +293,6 @@ class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
299293
//! @note added in 2.10
300294
void setGraduatedMethod( GraduatedMethod method );
301295

302-
void setRotationField( const QString& fieldOrExpression ) /Deprecated/;
303-
QString rotationField() const /Deprecated/;
304-
305-
void setSizeScaleField( const QString& fieldOrExpression );
306-
QString sizeScaleField() const;
307-
308-
void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
309-
QgsSymbol::ScaleMethod scaleMethod() const;
310-
311296
//! items of symbology items in legend should be checkable
312297
//! @note added in 2.5
313298
virtual bool legendSymbolItemsCheckable() const;

python/core/symbology-ng/qgsheatmaprenderer.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class QgsHeatmapRenderer : QgsFeatureRenderer
1414
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );
1515
virtual void stopRender( QgsRenderContext& context );
1616
//! @note symbolForFeature2 in python bindings
17-
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
17+
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
1818
//! @note symbol2 in python bindings
19-
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
19+
virtual QgsSymbolList symbols( QgsRenderContext& context );
2020
virtual QString dump() const;
2121
virtual QList<QString> usedAttributes();
2222
static QgsFeatureRenderer* create( QDomElement& element ) /Factory/;

python/core/symbology-ng/qgsinvertedpolygonrenderer.sip

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,23 @@ class QgsInvertedPolygonRenderer : QgsFeatureRenderer
4545
/** Proxy that will call this method on the embedded renderer.
4646
* @note available in python bindings as symbol2
4747
*/
48-
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
48+
virtual QgsSymbolList symbols( QgsRenderContext& context );
4949
/** Proxy that will call this method on the embedded renderer.
5050
* @note available in python bindings as symbolForFeature2
5151
*/
52-
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
52+
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
5353
/** Proxy that will call this method on the embedded renderer.
5454
* @note available in python bindings as originalSymbolForFeature2
5555
*/
56-
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
56+
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context );
5757
/** Proxy that will call this method on the embedded renderer.
5858
* @note available in python bindings as symbolsForFeature
5959
*/
60-
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature/;
60+
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
6161
/** Proxy that will call this method on the embedded renderer.
6262
* @note available in python bindings as originalSymbolsForFeature2
6363
*/
64-
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
64+
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
6565
/** Proxy that will call this method on the embedded renderer. */
6666
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
6767
/** Proxy that will call this method on the embedded renderer.
@@ -71,7 +71,7 @@ class QgsInvertedPolygonRenderer : QgsFeatureRenderer
7171
/** Proxy that will call this method on the embedded renderer.
7272
* @note available in python bindings as willRenderFeature2
7373
*/
74-
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;
74+
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context );
7575

7676
/** Creates a renderer out of an XML, for loading*/
7777
static QgsFeatureRenderer* create( QDomElement& element ) /Factory/;

python/core/symbology-ng/qgsmarkersymbollayer.sip

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -148,28 +148,6 @@ class QgsSimpleMarkerSymbolLayer : QgsSimpleMarkerSymbolLayerBase
148148

149149
public:
150150

151-
/** Constructor for QgsSimpleMarkerSymbolLayer.
152-
* @param name symbol name, should be one of "square", "rectangle", "diamond",
153-
* "pentagon", "hexagon", "triangle", "equilateral_triangle", "star", "arrow",
154-
* "circle", "cross", "cross_fill", "cross2", "line", "x", "arrowhead", "filled_arrowhead",
155-
* "semi_circle", "third_circle", "quarter_circle", "quarter_square", "half_square",
156-
* "diagonal_half_square", "right_half_triangle", "left_half_triangle"
157-
* @param color fill color for symbol
158-
* @param borderColor border color for symbol
159-
* @param size symbol size (in mm)
160-
* @param angle symbol rotation angle
161-
* @param scaleMethod scaling method for data defined scaling
162-
* @param penJoinStyle join style for outline pen
163-
* @deprecated use variant which accepts QgsSimpleMarkerSymbolLayerBase::Shape instead
164-
*/
165-
QgsSimpleMarkerSymbolLayer( const QString& name,
166-
const QColor& color = DEFAULT_SIMPLEMARKER_COLOR,
167-
const QColor& borderColor = DEFAULT_SIMPLEMARKER_BORDERCOLOR,
168-
double size = DEFAULT_SIMPLEMARKER_SIZE,
169-
double angle = DEFAULT_SIMPLEMARKER_ANGLE,
170-
QgsSymbol::ScaleMethod scaleMethod = DEFAULT_SCALE_METHOD,
171-
Qt::PenJoinStyle penJoinStyle = DEFAULT_SIMPLEMARKER_JOINSTYLE ) /Deprecated/;
172-
173151
/** Constructor for QgsSimpleMarkerSymbolLayer.
174152
* @param shape symbol shape
175153
* @param size symbol size (in mm)
@@ -225,12 +203,6 @@ class QgsSimpleMarkerSymbolLayer : QgsSimpleMarkerSymbolLayerBase
225203

226204
// new methods
227205

228-
//! @deprecated use shape() instead
229-
QString name() const /Deprecated/;
230-
231-
//! @deprecated use setShape() instead
232-
void setName( const QString& name ) /Deprecated/;
233-
234206
/** Returns the marker's border color.
235207
* @see setBorderColor()
236208
* @see outlineStyle()
@@ -334,13 +306,6 @@ class QgsSimpleMarkerSymbolLayer : QgsSimpleMarkerSymbolLayerBase
334306
*/
335307
void drawMarker( QPainter* p, QgsSymbolRenderContext& context );
336308

337-
//! @deprecated will be removed in QGIS 3.0
338-
bool prepareShape( const QString& name = QString() ) /Deprecated/;
339-
//! @deprecated will be removed in QGIS 3.0
340-
bool prepareShape( const QString& name, QPolygonF &polygon ) const /Deprecated/;
341-
//! @deprecated will be removed in QGIS 3.0
342-
bool preparePath( QString name = QString() ) /Deprecated/;
343-
344309
/** Prepares cache image
345310
* @returns true in case of success, false if cache image size too large
346311
*/

python/core/symbology-ng/qgsnullsymbolrenderer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class QgsNullSymbolRenderer : QgsFeatureRenderer
2727
virtual QList<QString> usedAttributes();
2828
virtual QString dump() const;
2929
virtual QgsFeatureRenderer* clone() const /Factory/;
30-
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
30+
virtual QgsSymbolList symbols( QgsRenderContext& context );
3131

3232
/** Creates a null renderer from XML element.
3333
* @param element DOM element

0 commit comments

Comments
 (0)