Skip to content
Permalink
Browse files

Fix exception when opening gdal algorithms

  • Loading branch information
nyalldawson committed Mar 24, 2020
1 parent 2913beb commit 9500020b0f36e6245b5b370919f4537569766f18
@@ -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/ );

};

@@ -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)
@@ -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()
@@ -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]")
@@ -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
@@ -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:

0 comments on commit 9500020

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