mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-30 00:04:11 -04:00
Requests for QgsMapToolAddRegularPolygon
This commit is contained in:
parent
8ea5fe7d05
commit
d72eebd2ce
@ -22,6 +22,7 @@
|
||||
#include "qgspoint.h"
|
||||
#include "qgisapp.h"
|
||||
#include "qgsstatusbar.h"
|
||||
#include "qgsspinbox.h"
|
||||
|
||||
QgsMapToolAddRegularPolygon::QgsMapToolAddRegularPolygon( QgsMapToolCapture *parentTool, QgsMapCanvas *canvas, CaptureMode mode )
|
||||
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget(), mode )
|
||||
@ -38,7 +39,7 @@ QgsMapToolAddRegularPolygon::~QgsMapToolAddRegularPolygon()
|
||||
void QgsMapToolAddRegularPolygon::createNumberSidesSpinBox()
|
||||
{
|
||||
deleteNumberSidesSpinBox();
|
||||
mNumberSidesSpinBox = std::unique_ptr<QSpinBox>( new QSpinBox() );
|
||||
mNumberSidesSpinBox = std::unique_ptr<QgsSpinBox>( new QgsSpinBox() );
|
||||
mNumberSidesSpinBox->setMaximum( 99999999 );
|
||||
mNumberSidesSpinBox->setMinimum( 3 );
|
||||
mNumberSidesSpinBox->setPrefix( tr( "Number of sides: " ) );
|
||||
@ -51,7 +52,6 @@ void QgsMapToolAddRegularPolygon::deleteNumberSidesSpinBox()
|
||||
{
|
||||
if ( mNumberSidesSpinBox )
|
||||
{
|
||||
QgisApp::instance()->statusBarIface()->removeWidget( mNumberSidesSpinBox.get() );
|
||||
mNumberSidesSpinBox.reset( nullptr );
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class QgsMapToolAddRegularPolygon: public QgsMapToolCapture
|
||||
explicit QgsMapToolAddRegularPolygon( QgsMapCanvas *canvas ) = delete; //forbidden
|
||||
|
||||
std::unique_ptr<QSpinBox> mNumberSidesSpinBox;
|
||||
int mNumberSides;
|
||||
int mNumberSides = 6;
|
||||
|
||||
//! (re-)create the spin box to enter the number of sides
|
||||
void createNumberSidesSpinBox();
|
||||
|
Loading…
x
Reference in New Issue
Block a user