Skip to content
Permalink
Browse files

[processing] Set full context for QgsProcessingAlgorithmConfiguration…

…Widget in modeler config dialogs
  • Loading branch information
nyalldawson committed Feb 19, 2019
1 parent 24529b1 commit eb335c39737872f5e1a97bb5c42030797ee1784c
Showing with 8 additions and 4 deletions.
  1. +8 −4 python/plugins/processing/modeler/ModelerParametersDialog.py
@@ -140,17 +140,21 @@ def setupUi(self):
line.setFrameShape(QFrame.HLine)
line.setFrameShadow(QFrame.Sunken)
self.verticalLayout.addWidget(line)
self.algorithmItem = QgsGui.instance().processingGuiRegistry().algorithmConfigurationWidget(self._alg)
if self.configuration:
self.algorithmItem.setConfiguration(self.configuration)
self.verticalLayout.addWidget(self.algorithmItem)

widget_context = QgsProcessingParameterWidgetContext()
if iface is not None:
widget_context.setMapCanvas(iface.mapCanvas())
widget_context.setModel(self.model)
widget_context.setModelChildAlgorithmId(self.childId)

self.algorithmItem = QgsGui.instance().processingGuiRegistry().algorithmConfigurationWidget(self._alg)
if self.algorithmItem:
self.algorithmItem.setWidgetContext(widget_context)
self.algorithmItem.registerProcessingContextGenerator(self.context_generator)
if self.configuration:
self.algorithmItem.setConfiguration(self.configuration)
self.verticalLayout.addWidget(self.algorithmItem)

for param in self._alg.parameterDefinitions():
if param.flags() & QgsProcessingParameterDefinition.FlagAdvanced:
self.advancedButton = QPushButton()

0 comments on commit eb335c3

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