Skip to content

Commit

Permalink
Hide measurement rubberband on dialog close
Browse files Browse the repository at this point in the history
Fix #12834
  • Loading branch information
m-kuhn committed May 27, 2015
1 parent c246fd8 commit f67a08a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 8 additions & 6 deletions src/app/qgsmeasuredialog.cpp
Expand Up @@ -55,6 +55,7 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool* tool, Qt::WindowFlags f )
updateSettings();

connect( mUnitsCombo, SIGNAL( currentIndexChanged( const QString & ) ), this, SLOT( unitsChanged( const QString & ) ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );

groupBox->setCollapsed( true );
}
Expand Down Expand Up @@ -204,12 +205,6 @@ void QgsMeasureDialog::removeLastPoint()
}
}

void QgsMeasureDialog::on_buttonBox_rejected( void )
{
restart();
QDialog::close();
}

void QgsMeasureDialog::closeEvent( QCloseEvent *e )
{
saveWindowLocation();
Expand Down Expand Up @@ -350,3 +345,10 @@ void QgsMeasureDialog::convertMeasurement( double &measure, QGis::UnitType &u, b
mDa.convertMeasurement( measure, myUnits, mDisplayUnits, isArea );
u = myUnits;
}


void QgsMeasureDialog::reject()
{
restart();
QDialog::close();
}
3 changes: 1 addition & 2 deletions src/app/qgsmeasuredialog.h
Expand Up @@ -51,8 +51,7 @@ class APP_EXPORT QgsMeasureDialog : public QDialog, private Ui::QgsMeasureBase
void removeLastPoint();

public slots:
//! Reject
void on_buttonBox_rejected( void );
virtual void reject() override;

//! Reset and start new
void restart();
Expand Down

3 comments on commit f67a08a

@slarosa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @m-kuhn, I still see the issue after this commit, the issue occurs when closing the dialog with x button (or Alt+F4), for me it is necessary to add restart() to QgsMeasureDialog::closeEvent( QCloseEvent *e ).
Thanks.

@m-kuhn
Copy link
Member Author

@m-kuhn m-kuhn commented on f67a08a May 27, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the X on my window manager, I tried with Esc, so that's what my first commit fixed. Can you verify the next one fixes it for you as well (works fine with Alt+F4 here)

@slarosa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with 6eb1404 all good. thanks.

Please sign in to comment.