Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
unique_str for QgsRubberBand
- Loading branch information
Showing
with
3 additions
and
9 deletions.
-
+1
−7
src/app/qgsmaptoolreverseline.cpp
-
+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 |
|
|