Skip to content
Permalink
Browse files

unique_str for QgsRubberBand

  • Loading branch information
lbartoletti committed Aug 28, 2018
1 parent 87fb27f commit e72879eebbd30c990d336fb6006303f825dd58fb
Showing with 3 additions and 9 deletions.
  1. +1 −7 src/app/qgsmaptoolreverseline.cpp
  2. +2 −2 src/app/qgsmaptoolreverseline.h
@@ -37,7 +37,6 @@ QgsMapToolReverseLine::QgsMapToolReverseLine( QgsMapCanvas *canvas )

QgsMapToolReverseLine::~QgsMapToolReverseLine()
{
delete mRubberBand;
}

void QgsMapToolReverseLine::canvasMoveEvent( QgsMapMouseEvent *e )
@@ -50,8 +49,6 @@ void QgsMapToolReverseLine::canvasPressEvent( QgsMapMouseEvent *e )
{
mPressedFid = -1;
mPressedPartNum = -1;
delete mRubberBand;
mRubberBand = nullptr;

QgsMapLayer *currentLayer = mCanvas->currentLayer();
if ( !currentLayer )
@@ -74,7 +71,7 @@ void QgsMapToolReverseLine::canvasPressEvent( QgsMapMouseEvent *e )

if ( mPressedFid != -1 )
{
mRubberBand = createRubberBand( vlayer->geometryType() );
mRubberBand.reset( createRubberBand( vlayer->geometryType() ) );

mRubberBand->setToGeometry( geomPart, vlayer );
mRubberBand->show();
@@ -86,9 +83,6 @@ void QgsMapToolReverseLine::canvasReleaseEvent( QgsMapMouseEvent *e )
{
Q_UNUSED( e );

delete mRubberBand;
mRubberBand = nullptr;

if ( !vlayer || !vlayer->isEditable() )
{
return;
@@ -44,8 +44,8 @@ class APP_EXPORT QgsMapToolReverseLine: public QgsMapToolEdit

QgsGeometry partUnderPoint( QPoint p, QgsFeatureId &fid, int &partNum );

/* Rubberband that shows the part being deleted*/
QgsRubberBand *mRubberBand = nullptr;
/* Rubberband that shows the part being reversed*/
std::unique_ptr<QgsRubberBand>mRubberBand;

//The feature and part where the mouse cursor was pressed
//This is used to check whether we are still in the same part at cursor release

0 comments on commit e72879e

Please sign in to comment.
You can’t perform that action at this time.