@@ -104,15 +104,14 @@ void QgsDistanceWidget::distanceSpinBoxValueChanged( double distance )
104
104
105
105
QgsMapToolSelectRadius::QgsMapToolSelectRadius ( QgsMapCanvas *canvas )
106
106
: QgsMapTool( canvas )
107
- , mSnapIndicator( new QgsSnapIndicator( canvas ) )
107
+ , mSnapIndicator( qgis::make_unique< QgsSnapIndicator > ( canvas ) )
108
108
{
109
109
mCursor = Qt::ArrowCursor;
110
110
}
111
111
112
112
QgsMapToolSelectRadius::~QgsMapToolSelectRadius ()
113
113
{
114
114
deleteRotationWidget ();
115
- deleteRubberband ();
116
115
}
117
116
118
117
void QgsMapToolSelectRadius::canvasMoveEvent ( QgsMapMouseEvent *e )
@@ -125,7 +124,7 @@ void QgsMapToolSelectRadius::canvasMoveEvent( QgsMapMouseEvent *e )
125
124
126
125
if ( !mRubberBand )
127
126
{
128
- mRubberBand = new QgsRubberBand ( mCanvas , QgsWkbTypes::PolygonGeometry );
127
+ mRubberBand = qgis::make_unique< QgsRubberBand > ( mCanvas , QgsWkbTypes::PolygonGeometry );
129
128
mRubberBand ->setFillColor ( mFillColor );
130
129
mRubberBand ->setStrokeColor ( mStrokeColor );
131
130
}
@@ -157,7 +156,7 @@ void QgsMapToolSelectRadius::canvasReleaseEvent( QgsMapMouseEvent *e )
157
156
{
158
157
if ( !mRubberBand )
159
158
{
160
- mRubberBand = new QgsRubberBand ( mCanvas , QgsWkbTypes::PolygonGeometry );
159
+ mRubberBand = qgis::make_unique< QgsRubberBand > ( mCanvas , QgsWkbTypes::PolygonGeometry );
161
160
mRubberBand ->setFillColor ( mFillColor );
162
161
mRubberBand ->setStrokeColor ( mStrokeColor );
163
162
}
@@ -242,11 +241,9 @@ void QgsMapToolSelectRadius::cancel()
242
241
243
242
void QgsMapToolSelectRadius::deleteRubberband ()
244
243
{
245
- delete mRubberBand ;
246
- mRubberBand = nullptr ;
244
+ mRubberBand .reset ();
247
245
}
248
246
249
-
250
247
void QgsMapToolSelectRadius::createRotationWidget ()
251
248
{
252
249
if ( !mCanvas )
0 commit comments