Skip to content
Permalink
Browse files

Requests for QgsMapToolCircle2TangentsPoint

  • Loading branch information
lbartoletti committed Oct 9, 2017
1 parent d72eebd commit e3205654c7465fa16c2d83c34d2713f74926fbfc
Showing with 5 additions and 13 deletions.
  1. +4 −12 src/app/qgsmaptoolcircle2tangentspoint.cpp
  2. +1 −1 src/app/qgsmaptoolcircle2tangentspoint.h
@@ -24,20 +24,19 @@
#include "qgsstatusbar.h"
#include "qgslinestring.h"
#include "qgsmultipolygon.h"
#include "qgsspinbox.h"
#include <memory>
#include <QMouseEvent>

QgsMapToolCircle2TangentsPoint::QgsMapToolCircle2TangentsPoint( QgsMapToolCapture *parentTool,
QgsMapCanvas *canvas, CaptureMode mode )
: QgsMapToolAddCircle( parentTool, canvas, mode )
{
mCenters.clear();
}

QgsMapToolCircle2TangentsPoint::~QgsMapToolCircle2TangentsPoint()
{
deleteRadiusSpinBox();
mCenters.clear();
}

void QgsMapToolCircle2TangentsPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
@@ -83,10 +82,7 @@ void QgsMapToolCircle2TangentsPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e
mTempRubberBand = nullptr;
}

for ( int i = 0; i < mRubberBands.size() ; ++i )
{
delete mRubberBands.at( i );
}
qDeleteAll( mRubberBands );
mRubberBands.clear();

deactivate();
@@ -226,7 +222,7 @@ void QgsMapToolCircle2TangentsPoint::getPossibleCenter( )
void QgsMapToolCircle2TangentsPoint::createRadiusSpinBox()
{
deleteRadiusSpinBox();
mRadiusSpinBox = new QSpinBox();
mRadiusSpinBox = new QgsSpinBox();
mRadiusSpinBox->setMaximum( 99999999 );
mRadiusSpinBox->setMinimum( 0 );
mRadiusSpinBox->setPrefix( tr( "Radius of the circle: " ) );
@@ -240,7 +236,6 @@ void QgsMapToolCircle2TangentsPoint::deleteRadiusSpinBox()
{
if ( mRadiusSpinBox )
{
QgisApp::instance()->statusBarIface()->removeWidget( mRadiusSpinBox );
delete mRadiusSpinBox;
mRadiusSpinBox = nullptr;
}
@@ -251,10 +246,7 @@ void QgsMapToolCircle2TangentsPoint::radiusSpinBoxChanged( int radius )
mRadius = radius;
getPossibleCenter( );

for ( int i = 0; i < mRubberBands.size() ; ++i )
{
delete mRubberBands.at( i );
}
qDeleteAll( mRubberBands );
mRubberBands.clear();
if ( mTempRubberBand )
{
@@ -32,7 +32,7 @@ class QgsMapToolCircle2TangentsPoint: public QgsMapToolAddCircle
~QgsMapToolCircle2TangentsPoint();

void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
void cadCanvasMoveEvent( QgsMapMouseEvent *e );
void cadCanvasMoveEvent( QgsMapMouseEvent *e ) override;

public slots:
void radiusSpinBoxChanged( int radius );

0 comments on commit e320565

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