Skip to content

Commit

Permalink
Merge pull request #3480 from nyalldawson/symbol
Browse files Browse the repository at this point in the history
Remove deprecated members from symbology
  • Loading branch information
nyalldawson committed Sep 13, 2016
2 parents 9215fca + ffa10a1 commit 26d7235
Show file tree
Hide file tree
Showing 63 changed files with 159 additions and 1,567 deletions.
77 changes: 75 additions & 2 deletions doc/api_break.dox
Expand Up @@ -304,6 +304,11 @@ variant instead.</li>
<li>GenericDataSourceURI has been renamed to GenericDataSourceUri</li>
</ul>

\subsection qgis_api_break_3_0_QgsCategorizedSymbolRendererWidget QgsCategorizedSymbolRendererWidget
<ul>
<li>sizeScaleFieldChanged() and scaleMethodChanged() were removed. These settings are no longer exposed in the widget's GUI.</li>
</ul>

\subsection qgis_api_break_3_0_QgsClipper QgsClipper

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

<ul>
<li>The method capabilities() returns QgsFeatureRendererV2::Capabilities flags instead of an integer. The two are binary compatible.
<li>The method capabilities() returns QgsFeatureRendererV2::Capabilities flags instead of an integer. The two are binary compatible.</li>
<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>
<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>
<li>startRender( QgsRenderContext& context, const QgsVectorLayer *vlayer ) was removed. This function has had no effect since QGIS 2.4</li>
<li>symbols() has been removed. The symbols( QgsRenderContext& context ) method should be used instead (previously available as symbols2 in PyQGIS bindings).</li>
<li>writeSld( QDomDocument& doc, const QgsVectorLayer &layer ) was removed. writeSld( QDomDocument& doc, const QgsVectorLayer &layer ) should be used instead.</li>
<li>rotationField() and setRotationField() were removed. Data defined properties for QgsSymbolLayer should be used instead.</li>
<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>
<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>
<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>
<li>copyPaintEffect() was removed. copyRendererData() should be used instead.</li>
</ul>

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

\subsection qgis_api_break_3_0_QgsGraduatedSymbolRenderer QgsGraduatedSymbolRenderer

<ul>
<li>getDataValues() has been removed - use QgsVectorLayer::getDoubleValues() instead</li>
</ul>

\subsection qgis_api_break_3_0_QgsGraduatedSymbolRendererWidget QgsGraduatedSymbolRenderer
<ul>
<li>sizeScaleFieldChanged() and scaleMethodChanged() were removed. These settings are no longer exposed in the widget's GUI.</li>
</ul>


\subsection qgis_api_break_3_0_QgsGraphBuilderInterface QgsGraphBuilderInterface

<ul>
Expand Down Expand Up @@ -883,27 +910,58 @@ be returned instead of a null pointer if no transformation is required.</li>
<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>
</ul>

\subsection qgis_api_break_3_0_QgsRuleBasedRenderer QgsRuleBasedRenderer

<ul>
<li>QgsRuleBasedRenderer.Rule checkState() and setCheckState() were removed. Use active() and setActive() instead.</li>
<li>startRender( QgsRenderContext& context, const QgsFields& fields ) was removed. Use startRender( QgsRenderContext& context, const QgsFields& fields, QString& filter ) instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSimpleMarkerSymbolLayer QgsSimpleMarkerSymbolLayer

<ul>
<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>
<li>name() and setName() have been removed. Use shape() and setShape() instead.</li>
<li>prepareShape() and preparePath() were removed. Calling these methods manually should no longer be required.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSingleSymbolRendererWidget QgsSingleSymbolRendererWidget
<ul>
<li>sizeScaleFieldChanged() and scaleMethodChanged() were removed. These settings are no longer exposed in the widget's GUI.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSnapper QgsSnapper

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

\subsection qgis_api_break_3_0_QgsSvgCache QgsSvgCache

<ul>
<li>containsParamsV2() was removed. Use containsParamsV3() instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSymbol QgsSymbol (renamed from QgsSymbolV2)

<ul>
<li>The OutputUnit enum, including QgsSymbol::MM, QgsSymbol::MapUnit, QgsSymbol::Mixed, QgsSymbol::Pixel and QgsSymbol::Percentage has been moved to QgsUnitTypes
and renamed to RenderUnit. QgsSymbol::OutputUnitList was renamed to QgsUnitTypes::RenderUnitList. All methods which previously accepted QgsSymbol::OutputUnit
parameters or QgsSymbol::OutputUnitList parameters now take QgsUnitTypes::RenderUnit or QgsUnitTypes::RenderUnitList parameters respectively.</li>
<li>startRender() now accepts a QgsFields reference, not a pointer.</li>
<li>isSymbolLayerCompatible() was removed. Use QgsSymbolLayer::isCompatibleWithSymbol() instead.</li>
<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>
</ul>

\subsection qgis_api_break_3_0_QgsSymbolLayer QgsSymbolLayer (renamed from QgsSymbolLayerV2)

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

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

<ul>
<li>encodeOutputUnit() and decodeOutputUnit() were removed. QgsUnitTypes::encodeUnit() and QgsUnitTypes::decodeRenderUnit() should be used instead.</li>
<li>The signatures for wellKnownMarkerToSld() and wellKnownMarkerFromSld() were changed.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSymbolSelectorDialog QgsSymbolSelectorDialog

<ul>
<li>saveSymbol() was removed.</li>
</ul>

\subsection qgis_api_break_3_0_QgsSymbolSelectorWidget QgsSymbolSelectorWidget

<ul>
<li>saveSymbol() was removed.</li>
</ul>

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


Expand Down
15 changes: 3 additions & 12 deletions python/core/symbology-ng/qgscategorizedsymbolrenderer.sip
Expand Up @@ -50,10 +50,10 @@ class QgsCategorizedSymbolRenderer : QgsFeatureRenderer
virtual ~QgsCategorizedSymbolRenderer();

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

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

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

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

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

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

void setRotationField( const QString& fieldOrExpression ) /Deprecated/;
QString rotationField() const /Deprecated/;

void setSizeScaleField( const QString& fieldOrExpression );
QString sizeScaleField() const;

void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
QgsSymbol::ScaleMethod scaleMethod() const;

//! items of symbology items in legend should be checkable
//! @note added in 2.5
virtual bool legendSymbolItemsCheckable() const;
Expand Down
21 changes: 3 additions & 18 deletions python/core/symbology-ng/qgsgraduatedsymbolrenderer.sip
Expand Up @@ -94,9 +94,9 @@ class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
virtual ~QgsGraduatedSymbolRenderer();

//! @note labelForLowerUpper in python bindings
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
//! @note originalSymbolForFeature2 in python bindings
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context );

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

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

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

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

//! Evaluates the data expression and returns the list of values from the layer
//! @param vlayer The layer for which to evaluate the expression
//! @note Added in 2.6
//! @deprecated use QgsVectorLayer::getDoubleValues instead
QList<double> getDataValues( QgsVectorLayer *vlayer ) /Deprecated/;

//! Return the label format used to generate default classification labels
//! @note Added in 2.6
const QgsRendererRangeLabelFormat &labelFormat() const;
Expand Down Expand Up @@ -299,15 +293,6 @@ class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
//! @note added in 2.10
void setGraduatedMethod( GraduatedMethod method );

void setRotationField( const QString& fieldOrExpression ) /Deprecated/;
QString rotationField() const /Deprecated/;

void setSizeScaleField( const QString& fieldOrExpression );
QString sizeScaleField() const;

void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
QgsSymbol::ScaleMethod scaleMethod() const;

//! items of symbology items in legend should be checkable
//! @note added in 2.5
virtual bool legendSymbolItemsCheckable() const;
Expand Down
4 changes: 2 additions & 2 deletions python/core/symbology-ng/qgsheatmaprenderer.sip
Expand Up @@ -14,9 +14,9 @@ class QgsHeatmapRenderer : QgsFeatureRenderer
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );
virtual void stopRender( QgsRenderContext& context );
//! @note symbolForFeature2 in python bindings
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
//! @note symbol2 in python bindings
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );
virtual QString dump() const;
virtual QList<QString> usedAttributes();
static QgsFeatureRenderer* create( QDomElement& element ) /Factory/;
Expand Down
12 changes: 6 additions & 6 deletions python/core/symbology-ng/qgsinvertedpolygonrenderer.sip
Expand Up @@ -45,23 +45,23 @@ class QgsInvertedPolygonRenderer : QgsFeatureRenderer
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as symbol2
*/
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as symbolForFeature2
*/
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as originalSymbolForFeature2
*/
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as symbolsForFeature
*/
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature/;
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as originalSymbolsForFeature2
*/
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer. */
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
/** Proxy that will call this method on the embedded renderer.
Expand All @@ -71,7 +71,7 @@ class QgsInvertedPolygonRenderer : QgsFeatureRenderer
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as willRenderFeature2
*/
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context );

/** Creates a renderer out of an XML, for loading*/
static QgsFeatureRenderer* create( QDomElement& element ) /Factory/;
Expand Down
35 changes: 0 additions & 35 deletions python/core/symbology-ng/qgsmarkersymbollayer.sip
Expand Up @@ -148,28 +148,6 @@ class QgsSimpleMarkerSymbolLayer : QgsSimpleMarkerSymbolLayerBase

public:

/** Constructor for QgsSimpleMarkerSymbolLayer.
* @param name symbol name, should be one of "square", "rectangle", "diamond",
* "pentagon", "hexagon", "triangle", "equilateral_triangle", "star", "arrow",
* "circle", "cross", "cross_fill", "cross2", "line", "x", "arrowhead", "filled_arrowhead",
* "semi_circle", "third_circle", "quarter_circle", "quarter_square", "half_square",
* "diagonal_half_square", "right_half_triangle", "left_half_triangle"
* @param color fill color for symbol
* @param borderColor border color for symbol
* @param size symbol size (in mm)
* @param angle symbol rotation angle
* @param scaleMethod scaling method for data defined scaling
* @param penJoinStyle join style for outline pen
* @deprecated use variant which accepts QgsSimpleMarkerSymbolLayerBase::Shape instead
*/
QgsSimpleMarkerSymbolLayer( const QString& name,
const QColor& color = DEFAULT_SIMPLEMARKER_COLOR,
const QColor& borderColor = DEFAULT_SIMPLEMARKER_BORDERCOLOR,
double size = DEFAULT_SIMPLEMARKER_SIZE,
double angle = DEFAULT_SIMPLEMARKER_ANGLE,
QgsSymbol::ScaleMethod scaleMethod = DEFAULT_SCALE_METHOD,
Qt::PenJoinStyle penJoinStyle = DEFAULT_SIMPLEMARKER_JOINSTYLE ) /Deprecated/;

/** Constructor for QgsSimpleMarkerSymbolLayer.
* @param shape symbol shape
* @param size symbol size (in mm)
Expand Down Expand Up @@ -225,12 +203,6 @@ class QgsSimpleMarkerSymbolLayer : QgsSimpleMarkerSymbolLayerBase

// new methods

//! @deprecated use shape() instead
QString name() const /Deprecated/;

//! @deprecated use setShape() instead
void setName( const QString& name ) /Deprecated/;

/** Returns the marker's border color.
* @see setBorderColor()
* @see outlineStyle()
Expand Down Expand Up @@ -334,13 +306,6 @@ class QgsSimpleMarkerSymbolLayer : QgsSimpleMarkerSymbolLayerBase
*/
void drawMarker( QPainter* p, QgsSymbolRenderContext& context );

//! @deprecated will be removed in QGIS 3.0
bool prepareShape( const QString& name = QString() ) /Deprecated/;
//! @deprecated will be removed in QGIS 3.0
bool prepareShape( const QString& name, QPolygonF &polygon ) const /Deprecated/;
//! @deprecated will be removed in QGIS 3.0
bool preparePath( QString name = QString() ) /Deprecated/;

/** Prepares cache image
* @returns true in case of success, false if cache image size too large
*/
Expand Down
2 changes: 1 addition & 1 deletion python/core/symbology-ng/qgsnullsymbolrenderer.sip
Expand Up @@ -27,7 +27,7 @@ class QgsNullSymbolRenderer : QgsFeatureRenderer
virtual QList<QString> usedAttributes();
virtual QString dump() const;
virtual QgsFeatureRenderer* clone() const /Factory/;
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );

/** Creates a null renderer from XML element.
* @param element DOM element
Expand Down

0 comments on commit 26d7235

Please sign in to comment.