Skip to content

Commit 8a7feed

Browse files
gacarrillornyalldawson
authored andcommittedMay 17, 2020
[processing] Destroy widgets from an algorithm dialog as soon as it is rejected
1 parent 576c2f3 commit 8a7feed

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
 

‎python/gui/auto_generated/processing/qgsprocessingalgorithmdialogbase.sip.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ Copies the current log contents to the clipboard.
182182
Switches the dialog to the parameters page.
183183
%End
184184

185+
virtual void reject();
186+
187+
185188
protected:
186189

187190
virtual void closeEvent( QCloseEvent *e );

‎src/gui/processing/qgsprocessingalgorithmdialogbase.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,15 @@ void QgsProcessingAlgorithmDialogBase::setInfo( const QString &message, bool isE
662662
processEvents();
663663
}
664664

665+
void QgsProcessingAlgorithmDialogBase::reject()
666+
{
667+
if ( !mAlgorithmTask )
668+
{
669+
setAttribute( Qt::WA_DeleteOnClose );
670+
}
671+
QDialog::reject();
672+
}
673+
665674
//
666675
// QgsProcessingAlgorithmProgressDialog
667676
//

‎src/gui/processing/qgsprocessingalgorithmdialogbase.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, public QgsPr
230230
*/
231231
void showParameters();
232232

233+
void reject() override;
234+
233235
protected:
234236

235237
void closeEvent( QCloseEvent *e ) override;

0 commit comments

Comments
 (0)
Please sign in to comment.