本文整理汇总了Python中processing.gui.AlgorithmClassification.getDisplayGroup方法的典型用法代码示例。如果您正苦于以下问题:Python AlgorithmClassification.getDisplayGroup方法的具体用法?Python AlgorithmClassification.getDisplayGroup怎么用?Python AlgorithmClassification.getDisplayGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.gui.AlgorithmClassification
的用法示例。
在下文中一共展示了AlgorithmClassification.getDisplayGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: populate
# 需要导入模块: from processing.gui import AlgorithmClassification [as 别名]
# 或者: from processing.gui.AlgorithmClassification import getDisplayGroup [as 别名]
def populate(self):
groups = {}
count = 0
provider = Processing.algs[self.providerName]
algs = provider.values()
# Add algorithms
for alg in algs:
if not alg.showInToolbox:
continue
if alg.group in groups:
groupItem = groups[alg.group]
else:
groupItem = QTreeWidgetItem()
name = AlgorithmClassification.getDisplayGroup(alg.group)
groupItem.setText(0, name)
groupItem.setToolTip(0, name)
groups[alg.group] = groupItem
algItem = TreeAlgorithmItem(alg)
groupItem.addChild(algItem)
count += 1
actions = Processing.actions[self.providerName]
for action in actions:
if action.group in groups:
groupItem = groups[action.group]
else:
groupItem = QTreeWidgetItem()
groupItem.setText(0, action.group)
groups[action.group] = groupItem
algItem = TreeActionItem(action)
groupItem.addChild(algItem)
self.setText(0, self.provider.getDescription()
+ QCoreApplication.translate( "TreeProviderItem", " [{0} geoalgorithms]" ).format( count ) )
self.setToolTip(0, self.text(0))
for groupItem in groups.values():
self.addChild(groupItem)