QgsMapToolSimplify::QgsMapToolSimplify( QgsMapCanvas* canvas ) : QgsMapToolEdit( canvas ), mRubberBand( 0 ) { mSimplifyDialog = new QgsSimplifyDialog( canvas->topLevelWidget() ); connect( mSimplifyDialog, SIGNAL( toleranceChanged( int ) ), this, SLOT( toleranceChanged( int ) ) ); connect( mSimplifyDialog, SIGNAL( storeSimplified() ), this, SLOT( storeSimplified() ) ); connect( mSimplifyDialog, SIGNAL( finished( int ) ), this, SLOT( removeRubberBand() ) ); }
QgsSimplifyDialog::QgsSimplifyDialog( QgsMapToolSimplify* tool, QWidget* parent ) : QDialog( parent ) , mTool( tool ) { setupUi( this ); spinTolerance->setValue( mTool->tolerance() ); cboToleranceUnits->setCurrentIndex(( int ) mTool->toleranceUnits() ); // communication with map tool connect( spinTolerance, SIGNAL( valueChanged( double ) ), mTool, SLOT( setTolerance( double ) ) ); connect( cboToleranceUnits, SIGNAL( currentIndexChanged( int ) ), mTool, SLOT( setToleranceUnits( int ) ) ); connect( okButton, SIGNAL( clicked() ), mTool, SLOT( storeSimplified() ) ); }
void QgsSimplifyDialog::simplify() { emit storeSimplified(); }