当前位置: 首页>>代码示例>>Python>>正文


Python ModelerParameterDefinitionDialog.exec_方法代码示例

本文整理汇总了Python中processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog.exec_方法的典型用法代码示例。如果您正苦于以下问题:Python ModelerParameterDefinitionDialog.exec_方法的具体用法?Python ModelerParameterDefinitionDialog.exec_怎么用?Python ModelerParameterDefinitionDialog.exec_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog的用法示例。


在下文中一共展示了ModelerParameterDefinitionDialog.exec_方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: editElement

# 需要导入模块: from processing.modeler.ModelerParameterDefinitionDialog import ModelerParameterDefinitionDialog [as 别名]
# 或者: from processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog import exec_ [as 别名]
 def editElement(self):
     if isinstance(self.element, QgsProcessingModelParameter):
         dlg = ModelerParameterDefinitionDialog(self.model,
                                                param=self.model.parameterDefinition(self.element.parameterName()))
         dlg.exec_()
         if dlg.param is not None:
             self.model.removeModelParameter(self.element.parameterName())
             self.element.setParameterName(dlg.param.name())
             self.element.setDescription(dlg.param.name())
             self.model.addModelParameter(dlg.param, self.element)
             self.text = dlg.param.description()
             self.scene.dialog.repaintModel()
     elif isinstance(self.element, QgsProcessingModelChildAlgorithm):
         dlg = None
         try:
             dlg = self.element.algorithm().getCustomModelerParametersDialog(self.model, self.element.childId())
         except:
             pass
         if not dlg:
             dlg = ModelerParametersDialog(self.element.algorithm(), self.model, self.element.childId())
         dlg.exec_()
         if dlg.alg is not None:
             dlg.alg.setChildId(self.element.childId())
             self.updateAlgorithm(dlg.alg)
             self.scene.dialog.repaintModel()
开发者ID:timlinux,项目名称:QGIS,代码行数:27,代码来源:ModelerGraphicItem.py

示例2: editElement

# 需要导入模块: from processing.modeler.ModelerParameterDefinitionDialog import ModelerParameterDefinitionDialog [as 别名]
# 或者: from processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog import exec_ [as 别名]
    def editElement(self):
        if isinstance(self.element, QgsProcessingModelParameter):
            dlg = ModelerParameterDefinitionDialog(self.model,
                                                   param=self.model.parameterDefinition(self.element.parameterName()))
            if dlg.exec_() and dlg.param is not None:
                self.model.removeModelParameter(self.element.parameterName())
                self.element.setParameterName(dlg.param.name())
                self.element.setDescription(dlg.param.name())
                self.model.addModelParameter(dlg.param, self.element)
                self.text = dlg.param.description()
                self.scene.dialog.repaintModel()
        elif isinstance(self.element, QgsProcessingModelChildAlgorithm):
            elemAlg = self.element.algorithm()
            dlg = ModelerParametersDialog(elemAlg, self.model, self.element.childId(), self.element.configuration())
            if dlg.exec_():
                alg = dlg.createAlgorithm()
                alg.setChildId(self.element.childId())
                self.updateAlgorithm(alg)
                self.scene.dialog.repaintModel()

        elif isinstance(self.element, QgsProcessingModelOutput):
            child_alg = self.model.childAlgorithm(self.element.childId())
            param_name = '{}:{}'.format(self.element.childId(), self.element.name())
            dlg = ModelerParameterDefinitionDialog(self.model,
                                                   param=self.model.parameterDefinition(param_name))
            if dlg.exec_() and dlg.param is not None:
                model_output = child_alg.modelOutput(self.element.name())
                model_output.setDescription(dlg.param.description())
                model_output.setDefaultValue(dlg.param.defaultValue())
                model_output.setMandatory(not (dlg.param.flags() & QgsProcessingParameterDefinition.FlagOptional))
                self.model.updateDestinationParameters()
开发者ID:blazek,项目名称:QGIS,代码行数:33,代码来源:ModelerGraphicItem.py

示例3: addInputOfType

# 需要导入模块: from processing.modeler.ModelerParameterDefinitionDialog import ModelerParameterDefinitionDialog [as 别名]
# 或者: from processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog import exec_ [as 别名]
 def addInputOfType(self, paramType, pos=None):
     if paramType in ModelerParameterDefinitionDialog.paramTypes:
         dlg = ModelerParameterDefinitionDialog(self.alg, paramType)
         dlg.exec_()
         if dlg.param is not None:
             if pos is None:
                 pos = self.getPositionForParameterItem()
             if isinstance(pos, QPoint):
                 pos = QPointF(pos)
             self.alg.addParameter(ModelerParameter(dlg.param, pos))
             self.repaintModel()
             #self.view.ensureVisible(self.scene.getLastParameterItem())
             self.hasChanged = True
开发者ID:FrancisGauthier,项目名称:QGIS,代码行数:15,代码来源:ModelerDialog.py

示例4: addInputOfType

# 需要导入模块: from processing.modeler.ModelerParameterDefinitionDialog import ModelerParameterDefinitionDialog [as 别名]
# 或者: from processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog import exec_ [as 别名]
 def addInputOfType(self, paramType, pos=None):
     dlg = ModelerParameterDefinitionDialog(self.model, paramType)
     dlg.exec_()
     if dlg.param is not None:
         if pos is None:
             pos = self.getPositionForParameterItem()
         if isinstance(pos, QPoint):
             pos = QPointF(pos)
         component = QgsProcessingModelParameter(dlg.param.name())
         component.setDescription(dlg.param.name())
         component.setPosition(pos)
         self.model.addModelParameter(dlg.param, component)
         self.repaintModel()
         # self.view.ensureVisible(self.scene.getLastParameterItem())
         self.hasChanged = True
开发者ID:dwsilk,项目名称:QGIS,代码行数:17,代码来源:ModelerDialog.py

示例5: editElement

# 需要导入模块: from processing.modeler.ModelerParameterDefinitionDialog import ModelerParameterDefinitionDialog [as 别名]
# 或者: from processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog import exec_ [as 别名]
 def editElement(self):
     self.model.setPositions(self.scene().getParameterPositions(), self.scene().getAlgorithmPositions(), self.scene().getOutputPositions())
     if isinstance(self.element, Parameter):
         dlg = ModelerParameterDefinitionDialog(self.model, param = self.element)
         dlg.exec_()
         if dlg.param != None:
             self.model.updateParameter(self.elementIndex, dlg.param)
             self.element = dlg.param
             self.text = self.element.description
             self.update()
     elif isinstance(self.element, GeoAlgorithm):
         dlg = self.element.getCustomModelerParametersDialog(self.model, self.elementIndex)
         if not dlg:
             dlg = ModelerParametersDialog(self.element, self.model, self.elementIndex)
         dlg.exec_()
         if dlg.params != None:
             self.model.updateAlgorithm(self.elementIndex, dlg.params, dlg.values, dlg.outputs, dlg.dependencies)
开发者ID:ChowZenki,项目名称:QGIS,代码行数:19,代码来源:ModelerGraphicItem.py

示例6: editElement

# 需要导入模块: from processing.modeler.ModelerParameterDefinitionDialog import ModelerParameterDefinitionDialog [as 别名]
# 或者: from processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog import exec_ [as 别名]
 def editElement(self):
     if isinstance(self.element, ModelerParameter):
         dlg = ModelerParameterDefinitionDialog(self.model, param=self.element.param)
         dlg.exec_()
         if dlg.param is not None:
             self.model.updateParameter(dlg.param)
             self.element.param = dlg.param
             self.text = dlg.param.description
             self.update()
     elif isinstance(self.element, Algorithm):
         dlg = self.element.algorithm.getCustomModelerParametersDialog(self.model, self.element.name)
         if not dlg:
             dlg = ModelerParametersDialog(self.element.algorithm, self.model, self.element.name)
         dlg.exec_()
         if dlg.alg is not None:
             dlg.alg.name = self.element.name
             self.model.updateAlgorithm(dlg.alg)
             self.model.updateModelerView()
开发者ID:olivierdalang,项目名称:QGIS,代码行数:20,代码来源:ModelerGraphicItem.py

示例7: editElement

# 需要导入模块: from processing.modeler.ModelerParameterDefinitionDialog import ModelerParameterDefinitionDialog [as 别名]
# 或者: from processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog import exec_ [as 别名]
 def editElement(self):
     if isinstance(self.element, QgsProcessingModelParameter):
         dlg = ModelerParameterDefinitionDialog(self.model,
                                                param=self.model.parameterDefinition(self.element.parameterName()))
         if dlg.exec_() and dlg.param is not None:
             self.model.removeModelParameter(self.element.parameterName())
             self.element.setParameterName(dlg.param.name())
             self.element.setDescription(dlg.param.name())
             self.model.addModelParameter(dlg.param, self.element)
             self.text = dlg.param.description()
             self.scene.dialog.repaintModel()
     elif isinstance(self.element, QgsProcessingModelChildAlgorithm):
         elemAlg = self.element.algorithm()
         dlg = ModelerParametersDialog(elemAlg, self.model, self.element.childId(), self.element.configuration())
         if dlg.exec_():
             alg = dlg.createAlgorithm()
             alg.setChildId(self.element.childId())
             self.updateAlgorithm(alg)
             self.scene.dialog.repaintModel()
开发者ID:dbaston,项目名称:QGIS,代码行数:21,代码来源:ModelerGraphicItem.py


注:本文中的processing.modeler.ModelerParameterDefinitionDialog.ModelerParameterDefinitionDialog.exec_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。