From b7f4fe36e7d0f987802dbc2d5c14e7d2645234fa Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Tue, 2 Aug 2016 13:56:02 +0200 Subject: [PATCH] QgsRubberBand: remove constructor and method with bool isPolygon use methods with Qgis::GeometryType instead --- doc/api_break.dox | 1 + python/gui/qgsrubberband.sip | 16 +--------------- src/gui/qgsrubberband.cpp | 24 ------------------------ src/gui/qgsrubberband.h | 16 +--------------- 4 files changed, 3 insertions(+), 54 deletions(-) diff --git a/doc/api_break.dox b/doc/api_break.dox index dacde1d50c7..df5f494c7e7 100644 --- a/doc/api_break.dox +++ b/doc/api_break.dox @@ -441,6 +441,7 @@ be returned instead of a null pointer if no transformation is required. \subsection qgis_api_break_3_0_QgsPalLayerSettings QgsPalLayerSettings diff --git a/python/gui/qgsrubberband.sip b/python/gui/qgsrubberband.sip index e8dece833b0..6326131e93a 100644 --- a/python/gui/qgsrubberband.sip +++ b/python/gui/qgsrubberband.sip @@ -41,13 +41,7 @@ class QgsRubberBand: QgsMapCanvasItem * @param geometryType Defines how the data should be drawn onto the screen. (Use Qgis::Line, Qgis::Polygon or Qgis::Point) */ QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, Qgis::GeometryType geometryType = Qgis::Line ); - /** - * Creates a new RubberBand. - * @deprecated Use the constructor which takes Qgis::GeometryType as second argument instead - * @param mapCanvas The map canvas to draw onto. It's CRS will be used map points onto screen coordinates. - * @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring - */ - QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, bool isPolygon ) /Deprecated/; + ~QgsRubberBand(); /** @@ -104,14 +98,6 @@ class QgsRubberBand: QgsMapCanvasItem */ void reset( Qgis::GeometryType geometryType = Qgis::Line ); - /** - * @deprecated Use the reset method which takes Qgis::GeometryType as second argument instead - * Clears all the geometries in this rubberband. - * Sets the representation type according to isPolygon. - * @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring - */ - void reset( bool isPolygon ) /Deprecated/; - /** * Add a vertex to the rubberband and update canvas. * The rendering of the vertex depends on the current GeometryType and icon. diff --git a/src/gui/qgsrubberband.cpp b/src/gui/qgsrubberband.cpp index 2323320dca5..3ef5ed9310e 100644 --- a/src/gui/qgsrubberband.cpp +++ b/src/gui/qgsrubberband.cpp @@ -43,22 +43,6 @@ QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, Qgis::GeometryType geomet setBrushStyle( Qt::SolidPattern ); } -QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon ) - : QgsMapCanvasItem( mapCanvas ) - , mIconSize( 5 ) - , mIconType( ICON_CIRCLE ) - , mTranslationOffsetX( 0.0 ) - , mTranslationOffsetY( 0.0 ) -{ - reset( isPolygon ? Qgis::Polygon : Qgis::Line ); - QColor color( Qt::lightGray ); - color.setAlpha( 63 ); - setColor( color ); - setWidth( 1 ); - setLineStyle( Qt::SolidLine ); - setBrushStyle( Qt::SolidPattern ); -} - QgsRubberBand::QgsRubberBand() : QgsMapCanvasItem( nullptr ) , mIconSize( 5 ) @@ -140,14 +124,6 @@ void QgsRubberBand::reset( Qgis::GeometryType geometryType ) update(); } -void QgsRubberBand::reset( bool isPolygon ) -{ - mPoints.clear(); - mGeometryType = isPolygon ? Qgis::Polygon : Qgis::Line; - updateRect(); - update(); -} - /*! Add a point to the shape being created. */ diff --git a/src/gui/qgsrubberband.h b/src/gui/qgsrubberband.h index 78d31ff0179..1366709e1e2 100644 --- a/src/gui/qgsrubberband.h +++ b/src/gui/qgsrubberband.h @@ -68,13 +68,7 @@ class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem * @param geometryType Defines how the data should be drawn onto the screen. (Use Qgis::Line, Qgis::Polygon or Qgis::Point) */ QgsRubberBand( QgsMapCanvas* mapCanvas, Qgis::GeometryType geometryType = Qgis::Line ); - /** - * Creates a new RubberBand. - * @deprecated Use the constructor which takes Qgis::GeometryType as second argument instead - * @param mapCanvas The map canvas to draw onto. It's CRS will be used map points onto screen coordinates. - * @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring - */ - Q_DECL_DEPRECATED QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon ); + ~QgsRubberBand(); /** @@ -131,14 +125,6 @@ class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem */ void reset( Qgis::GeometryType geometryType = Qgis::Line ); - /** - * @deprecated Use the reset method which takes Qgis::GeometryType as second argument instead - * Clears all the geometries in this rubberband. - * Sets the representation type according to isPolygon. - * @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring - */ - Q_DECL_DEPRECATED void reset( bool isPolygon ); - /** * Add a vertex to the rubberband and update canvas. * The rendering of the vertex depends on the current GeometryType and icon.