本文整理汇总了Python中processing.modeler.ModelerParametersDialog.ModelerParametersDialog.exec_方法的典型用法代码示例。如果您正苦于以下问题:Python ModelerParametersDialog.exec_方法的具体用法?Python ModelerParametersDialog.exec_怎么用?Python ModelerParametersDialog.exec_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.modeler.ModelerParametersDialog.ModelerParametersDialog
的用法示例。
在下文中一共展示了ModelerParametersDialog.exec_方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _addAlgorithm
# 需要导入模块: from processing.modeler.ModelerParametersDialog import ModelerParametersDialog [as 别名]
# 或者: from processing.modeler.ModelerParametersDialog.ModelerParametersDialog import exec_ [as 别名]
def _addAlgorithm(self, alg, pos=None):
dlg = alg.getCustomModelerParametersDialog(self.alg)
if not dlg:
dlg = ModelerParametersDialog(alg, self.alg)
dlg.exec_()
if dlg.alg is not None:
if pos is None:
dlg.alg.pos = self.getPositionForAlgorithmItem()
else:
dlg.alg.pos = pos
if isinstance(dlg.alg.pos, QPoint):
dlg.alg.pos = QPointF(pos)
from processing.modeler.ModelerGraphicItem import ModelerGraphicItem
for i, out in enumerate(dlg.alg.outputs):
dlg.alg.outputs[out].pos = dlg.alg.pos + QPointF(ModelerGraphicItem.BOX_WIDTH, (i + 1.5)
* ModelerGraphicItem.BOX_HEIGHT)
self.alg.addAlgorithm(dlg.alg)
self.repaintModel()
self.hasChanged = True
示例2: _addAlgorithm
# 需要导入模块: from processing.modeler.ModelerParametersDialog import ModelerParametersDialog [as 别名]
# 或者: from processing.modeler.ModelerParametersDialog.ModelerParametersDialog import exec_ [as 别名]
def _addAlgorithm(self, alg, pos=None):
dlg = None
try:
dlg = alg.getCustomModelerParametersDialog(self.model)
except:
pass
if not dlg:
dlg = ModelerParametersDialog(alg, self.model)
dlg.exec_()
if dlg.alg is not None:
if pos is None:
dlg.alg.setPosition(self.getPositionForAlgorithmItem())
else:
dlg.alg.setPosition(pos)
from processing.modeler.ModelerGraphicItem import ModelerGraphicItem
for i, out in enumerate(dlg.alg.modelOutputs()):
dlg.alg.modelOutput(out).setPosition(dlg.alg.position() + QPointF(ModelerGraphicItem.BOX_WIDTH, (i + 1.5) *
ModelerGraphicItem.BOX_HEIGHT))
self.model.addChildAlgorithm(dlg.alg)
self.repaintModel()
self.hasChanged = True
示例3: _addAlgorithm
# 需要导入模块: from processing.modeler.ModelerParametersDialog import ModelerParametersDialog [as 别名]
# 或者: from processing.modeler.ModelerParametersDialog.ModelerParametersDialog import exec_ [as 别名]
def _addAlgorithm(self, alg, pos=None):
dlg = ModelerParametersDialog(alg, self.model)
if dlg.exec_():
alg = dlg.createAlgorithm()
if pos is None:
alg.setPosition(self.getPositionForAlgorithmItem())
else:
alg.setPosition(pos)
from processing.modeler.ModelerGraphicItem import ModelerGraphicItem
for i, out in enumerate(alg.modelOutputs()):
alg.modelOutput(out).setPosition(alg.position() + QPointF(ModelerGraphicItem.BOX_WIDTH, (i + 1.5) *
ModelerGraphicItem.BOX_HEIGHT))
self.model.addChildAlgorithm(alg)
self.repaintModel()
self.hasChanged = True