Skip to content

Commit 098f69d

Browse files
committed
Make QgsMarkerSymbolLayer::bounds pure virtual
1 parent e122546 commit 098f69d

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

doc/api_break.dox

+6
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,12 @@ be returned instead of a null pointer if no transformation is required.</li>
776776
plugins calling this method will need to be updated.</li>
777777
</ul>
778778

779+
\subsection qgis_api_break_3_0_QgsMarkerSymbolLayer QgsMarkerSymbolLayer
780+
781+
<ul>
782+
<li>bounds() is now pure virtual and must be implemented in all subclasses.</li>
783+
</ul>
784+
779785
\subsection qgis_api_break_3_0_QgsMimeDataUtils QgsMimeDataUtils
780786

781787
<ul>

python/core/symbology-ng/qgssymbollayer.sip

+1-3
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,8 @@ class QgsMarkerSymbolLayer : QgsSymbolLayer
516516
* any data defined overrides and offsets which are set for the marker layer.
517517
* @returns approximate symbol bounds, in painter units
518518
* @note added in QGIS 2.14
519-
* @note this method will become pure virtual in QGIS 3.0
520519
*/
521-
//TODO QGIS 3.0 - make pure virtual
522-
virtual QRectF bounds( QPointF point, QgsSymbolRenderContext& context );
520+
virtual QRectF bounds( QPointF point, QgsSymbolRenderContext& context ) = 0;
523521

524522
protected:
525523

python/core/symbology-ng/qgsvectorfieldsymbollayer.sip

+2
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,6 @@ class QgsVectorFieldSymbolLayer : QgsMarkerSymbolLayer
8383

8484
void setDistanceMapUnitScale( const QgsMapUnitScale& scale );
8585
const QgsMapUnitScale& distanceMapUnitScale() const;
86+
87+
QRectF bounds( QPointF point, QgsSymbolRenderContext& context );
8688
};

src/core/symbology-ng/qgssymbollayer.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -581,10 +581,8 @@ class CORE_EXPORT QgsMarkerSymbolLayer : public QgsSymbolLayer
581581
* any data defined overrides and offsets which are set for the marker layer.
582582
* @returns approximate symbol bounds, in painter units
583583
* @note added in QGIS 2.14
584-
* @note this method will become pure virtual in QGIS 3.0
585584
*/
586-
//TODO QGIS 3.0 - make pure virtual
587-
virtual QRectF bounds( QPointF point, QgsSymbolRenderContext& context ) { Q_UNUSED( context ); Q_UNUSED( point ); return QRectF(); }
585+
virtual QRectF bounds( QPointF point, QgsSymbolRenderContext& context ) = 0;
588586

589587
protected:
590588

src/core/symbology-ng/qgsvectorfieldsymbollayer.h

+3
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ class CORE_EXPORT QgsVectorFieldSymbolLayer: public QgsMarkerSymbolLayer
105105
void setDistanceMapUnitScale( const QgsMapUnitScale& scale ) { mDistanceMapUnitScale = scale; }
106106
const QgsMapUnitScale& distanceMapUnitScale() const { return mDistanceMapUnitScale; }
107107

108+
// TODO - implement properly
109+
virtual QRectF bounds( QPointF, QgsSymbolRenderContext& ) override { return QRectF(); }
110+
108111
private:
109112
QString mXAttribute;
110113
QString mYAttribute;

0 commit comments

Comments
 (0)