[processing] Destroy widgets from an algorithm dialog as soon as it is rejected

This commit is contained in:
gacarrillor 2020-03-17 22:18:49 -05:00 committed by Nyall Dawson
parent 576c2f3ff8
commit 8a7feeddbb
3 changed files with 14 additions and 0 deletions

View File

@ -182,6 +182,9 @@ Copies the current log contents to the clipboard.
Switches the dialog to the parameters page.
%End
virtual void reject();
protected:
virtual void closeEvent( QCloseEvent *e );

View File

@ -662,6 +662,15 @@ void QgsProcessingAlgorithmDialogBase::setInfo( const QString &message, bool isE
processEvents();
}
void QgsProcessingAlgorithmDialogBase::reject()
{
if ( !mAlgorithmTask )
{
setAttribute( Qt::WA_DeleteOnClose );
}
QDialog::reject();
}
//
// QgsProcessingAlgorithmProgressDialog
//

View File

@ -230,6 +230,8 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, public QgsPr
*/
void showParameters();
void reject() override;
protected:
void closeEvent( QCloseEvent *e ) override;