Skip to content

Commit

Permalink
Fix exception when opening gdal algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 24, 2020
1 parent 2913beb commit 9500020
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Expand Up @@ -44,8 +44,7 @@ Constructor for QgsProcessingParametersWidget, for the specified ``algorithm``.
void addOutputLabel( QWidget *label /Transfer/ );
void addOutputWidget( QWidget *widget /Transfer/ );

QLayout *mainLayout();

void addExtraWidget( QWidget *widget /Transfer/ );

};

Expand Down
5 changes: 3 additions & 2 deletions python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py
Expand Up @@ -64,6 +64,7 @@ class GdalParametersPanel(ParametersPanel):
def __init__(self, parent, alg):
super().__init__(parent, alg)

self.dialog = parent
w = QWidget()
layout = QVBoxLayout()
layout.setMargin(0)
Expand All @@ -75,7 +76,7 @@ def __init__(self, parent, alg):
self.text.setReadOnly(True)
layout.addWidget(self.text)
w.setLayout(layout)
self.mainLayout().addWidget(w)
self.addExtraWidget(w)

self.connectParameterSignals()
self.parametersHaveChanged()
Expand Down Expand Up @@ -122,7 +123,7 @@ def parametersHaveChanged(self):
context = createContext()
feedback = QgsProcessingFeedback()
try:
parameters = self.parent().getParameterValues()
parameters = self.dialog.getParameterValues()
for output in self.algorithm().destinationParameterDefinitions():
if not output.name() in parameters or parameters[output.name()] is None:
parameters[output.name()] = self.tr("[temporary file]")
Expand Down
4 changes: 2 additions & 2 deletions src/gui/processing/qgsprocessingparameterswidget.cpp
Expand Up @@ -76,9 +76,9 @@ void QgsProcessingParametersWidget::addOutputWidget( QWidget *widget )
mScrollAreaLayout->insertWidget( mScrollAreaLayout->count() - 1, widget );
}

QLayout *QgsProcessingParametersWidget::mainLayout()
void QgsProcessingParametersWidget::addExtraWidget( QWidget *widget )
{
return mScrollAreaLayout;
mScrollAreaLayout->addWidget( widget );
}

///@endcond
3 changes: 1 addition & 2 deletions src/gui/processing/qgsprocessingparameterswidget.h
Expand Up @@ -55,8 +55,7 @@ class GUI_EXPORT QgsProcessingParametersWidget : public QgsPanelWidget, private
void addOutputLabel( QWidget *label SIP_TRANSFER );
void addOutputWidget( QWidget *widget SIP_TRANSFER );

QLayout *mainLayout();

void addExtraWidget( QWidget *widget SIP_TRANSFER );

private:

Expand Down

0 comments on commit 9500020

Please sign in to comment.