Skip to content
Permalink
Browse files
Hide measurement rubberband on dialog close
Fix #12834
  • Loading branch information
m-kuhn committed May 27, 2015
1 parent c246fd8 commit f67a08aa7ecf0b13a77b7888c771b63975daed9e
Showing with 9 additions and 8 deletions.
  1. +8 −6 src/app/qgsmeasuredialog.cpp
  2. +1 −2 src/app/qgsmeasuredialog.h
@@ -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 );
}
@@ -204,12 +205,6 @@ void QgsMeasureDialog::removeLastPoint()
}
}

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

void QgsMeasureDialog::closeEvent( QCloseEvent *e )
{
saveWindowLocation();
@@ -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();
}
@@ -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();

3 comments on commit f67a08a

@slarosa

This comment has been minimized.

Copy link
Member

@slarosa slarosa replied May 27, 2015

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

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied May 27, 2015

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

This comment has been minimized.

Copy link
Member

@slarosa slarosa replied May 27, 2015

Yes, with 6eb1404 all good. thanks.

Please sign in to comment.