Skip to content
Permalink
Browse files

[ui][processing] Fix model designer dialog not remember panel state

(cherry picked from commit 77580e3)
  • Loading branch information
nirvn authored and nyalldawson committed Dec 21, 2020
1 parent 0b91451 commit cdf03a7f8bd6df6c09ded01c27f0b442e3cce51d
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/gui/processing/models/qgsmodeldesignerdialog.cpp
@@ -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" ) ) );

@@ -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
}

0 comments on commit cdf03a7

Please sign in to comment.
You can’t perform that action at this time.