Skip to content

Commit

Permalink
[ui][processing] Fix model designer dialog not remember panel state
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Dec 13, 2020
1 parent 5deda1f commit c4b5710
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/processing/models/qgsmodeldesignerdialog.cpp
Expand Up @@ -77,14 +77,15 @@ QgsModelDesignerDialog::QgsModelDesignerDialog( QWidget *parent, Qt::WindowFlags
: QMainWindow( parent, flags )
{
setupUi( this );
QgsGui::enableAutoGeometryRestore( this );

setAttribute( Qt::WA_DeleteOnClose );
setDockOptions( dockOptions() | QMainWindow::GroupedDragging );
setWindowFlags( Qt::WindowMinimizeButtonHint |
Qt::WindowMaximizeButtonHint |
Qt::WindowCloseButtonHint );

QgsGui::enableAutoGeometryRestore( this );

mModel = qgis::make_unique< QgsProcessingModelAlgorithm >();
mModel->setProvider( QgsApplication::processingRegistry()->providerById( QStringLiteral( "model" ) ) );

Expand Down Expand Up @@ -339,11 +340,18 @@ QgsModelDesignerDialog::QgsModelDesignerDialog( QWidget *parent, Qt::WindowFlags
repaintModel();
endUndoCommand();
} );

updateWindowTitle();

// restore the toolbar and dock widgets positions using Qt settings API
restoreState( settings.value( QStringLiteral( "ModelDesigner/state" ), QByteArray(), QgsSettings::App ).toByteArray() );
}

QgsModelDesignerDialog::~QgsModelDesignerDialog()
{
// store the toolbar/dock widget settings using Qt settings API
QgsSettings().setValue( QStringLiteral( "ModelDesigner/state" ), saveState(), QgsSettings::App );

mIgnoreUndoStackChanges++;
delete mSelectTool; // delete mouse handles before everything else
}
Expand Down

0 comments on commit c4b5710

Please sign in to comment.