Skip to content

Commit b7f4fe3

Browse files
committedAug 2, 2016
QgsRubberBand: remove constructor and method with bool isPolygon
use methods with Qgis::GeometryType instead
1 parent 9db9304 commit b7f4fe3

File tree

4 files changed

+3
-54
lines changed

4 files changed

+3
-54
lines changed
 

‎doc/api_break.dox

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ be returned instead of a null pointer if no transformation is required.</li>
441441

442442
<ul>
443443
<li>setToGeometry() and addGeometry() now take geometry references, not pointers.</li>
444+
<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>
444445
</ul>
445446

446447
\subsection qgis_api_break_3_0_QgsPalLayerSettings QgsPalLayerSettings

‎python/gui/qgsrubberband.sip

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ class QgsRubberBand: QgsMapCanvasItem
4141
* @param geometryType Defines how the data should be drawn onto the screen. (Use Qgis::Line, Qgis::Polygon or Qgis::Point)
4242
*/
4343
QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, Qgis::GeometryType geometryType = Qgis::Line );
44-
/**
45-
* Creates a new RubberBand.
46-
* @deprecated Use the constructor which takes Qgis::GeometryType as second argument instead
47-
* @param mapCanvas The map canvas to draw onto. It's CRS will be used map points onto screen coordinates.
48-
* @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring
49-
*/
50-
QgsRubberBand( QgsMapCanvas* mapCanvas /TransferThis/, bool isPolygon ) /Deprecated/;
44+
5145
~QgsRubberBand();
5246

5347
/**
@@ -104,14 +98,6 @@ class QgsRubberBand: QgsMapCanvasItem
10498
*/
10599
void reset( Qgis::GeometryType geometryType = Qgis::Line );
106100

107-
/**
108-
* @deprecated Use the reset method which takes Qgis::GeometryType as second argument instead
109-
* Clears all the geometries in this rubberband.
110-
* Sets the representation type according to isPolygon.
111-
* @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring
112-
*/
113-
void reset( bool isPolygon ) /Deprecated/;
114-
115101
/**
116102
* Add a vertex to the rubberband and update canvas.
117103
* The rendering of the vertex depends on the current GeometryType and icon.

‎src/gui/qgsrubberband.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,6 @@ QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, Qgis::GeometryType geomet
4343
setBrushStyle( Qt::SolidPattern );
4444
}
4545

46-
QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon )
47-
: QgsMapCanvasItem( mapCanvas )
48-
, mIconSize( 5 )
49-
, mIconType( ICON_CIRCLE )
50-
, mTranslationOffsetX( 0.0 )
51-
, mTranslationOffsetY( 0.0 )
52-
{
53-
reset( isPolygon ? Qgis::Polygon : Qgis::Line );
54-
QColor color( Qt::lightGray );
55-
color.setAlpha( 63 );
56-
setColor( color );
57-
setWidth( 1 );
58-
setLineStyle( Qt::SolidLine );
59-
setBrushStyle( Qt::SolidPattern );
60-
}
61-
6246
QgsRubberBand::QgsRubberBand()
6347
: QgsMapCanvasItem( nullptr )
6448
, mIconSize( 5 )
@@ -140,14 +124,6 @@ void QgsRubberBand::reset( Qgis::GeometryType geometryType )
140124
update();
141125
}
142126

143-
void QgsRubberBand::reset( bool isPolygon )
144-
{
145-
mPoints.clear();
146-
mGeometryType = isPolygon ? Qgis::Polygon : Qgis::Line;
147-
updateRect();
148-
update();
149-
}
150-
151127
/*!
152128
Add a point to the shape being created.
153129
*/

‎src/gui/qgsrubberband.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,7 @@ class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem
6868
* @param geometryType Defines how the data should be drawn onto the screen. (Use Qgis::Line, Qgis::Polygon or Qgis::Point)
6969
*/
7070
QgsRubberBand( QgsMapCanvas* mapCanvas, Qgis::GeometryType geometryType = Qgis::Line );
71-
/**
72-
* Creates a new RubberBand.
73-
* @deprecated Use the constructor which takes Qgis::GeometryType as second argument instead
74-
* @param mapCanvas The map canvas to draw onto. It's CRS will be used map points onto screen coordinates.
75-
* @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring
76-
*/
77-
Q_DECL_DEPRECATED QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon );
71+
7872
~QgsRubberBand();
7973

8074
/**
@@ -131,14 +125,6 @@ class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem
131125
*/
132126
void reset( Qgis::GeometryType geometryType = Qgis::Line );
133127

134-
/**
135-
* @deprecated Use the reset method which takes Qgis::GeometryType as second argument instead
136-
* Clears all the geometries in this rubberband.
137-
* Sets the representation type according to isPolygon.
138-
* @param isPolygon true: draw as (multi-)polygon, false draw as (multi-)linestring
139-
*/
140-
Q_DECL_DEPRECATED void reset( bool isPolygon );
141-
142128
/**
143129
* Add a vertex to the rubberband and update canvas.
144130
* The rendering of the vertex depends on the current GeometryType and icon.

0 commit comments

Comments
 (0)
Please sign in to comment.