本文整理匯總了Python中qgis.core.QgsProcessingParameterVectorDestination.setParentParameterName方法的典型用法代碼示例。如果您正苦於以下問題:Python QgsProcessingParameterVectorDestination.setParentParameterName方法的具體用法?Python QgsProcessingParameterVectorDestination.setParentParameterName怎麽用?Python QgsProcessingParameterVectorDestination.setParentParameterName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qgis.core.QgsProcessingParameterVectorDestination
的用法示例。
在下文中一共展示了QgsProcessingParameterVectorDestination.setParentParameterName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ModelerParameterDefinitionDialog
# 需要導入模塊: from qgis.core import QgsProcessingParameterVectorDestination [as 別名]
# 或者: from qgis.core.QgsProcessingParameterVectorDestination import setParentParameterName [as 別名]
#.........這裏部分代碼省略.........
[self.shapetypeCombo.currentData()])
elif (self.paramType == parameters.PARAMETER_VECTOR or
isinstance(self.param, QgsProcessingParameterFeatureSource)):
self.param = QgsProcessingParameterFeatureSource(
name, description,
[self.shapetypeCombo.currentData()])
elif (self.paramType == parameters.PARAMETER_MULTIPLE or
isinstance(self.param, QgsProcessingParameterMultipleLayers)):
self.param = QgsProcessingParameterMultipleLayers(
name, description,
self.datatypeCombo.currentData())
elif (self.paramType == parameters.PARAMETER_DISTANCE or
isinstance(self.param, QgsProcessingParameterDistance)):
self.param = QgsProcessingParameterDistance(name, description,
self.defaultTextBox.text())
try:
vmin = self.minTextBox.text().strip()
if not vmin == '':
self.param.setMinimum(float(vmin))
vmax = self.maxTextBox.text().strip()
if not vmax == '':
self.param.setMaximum(float(vmax))
except:
QMessageBox.warning(self, self.tr('Unable to define parameter'),
self.tr('Wrong or missing parameter values'))
return
if self.parentCombo.currentIndex() < 0:
QMessageBox.warning(self, self.tr('Unable to define parameter'),
self.tr('Wrong or missing parameter values'))
return
parent = self.parentCombo.currentData()
if parent:
self.param.setParentParameterName(parent)
elif (self.paramType == parameters.PARAMETER_SCALE or
isinstance(self.param, QgsProcessingParameterScale)):
self.param = QgsProcessingParameterScale(name, description,
self.defaultTextBox.text())
elif (self.paramType == parameters.PARAMETER_NUMBER or
isinstance(self.param, QgsProcessingParameterNumber)):
type = self.type_combo.currentData()
self.param = QgsProcessingParameterNumber(name, description, type,
self.defaultTextBox.text())
try:
vmin = self.minTextBox.text().strip()
if not vmin == '':
self.param.setMinimum(float(vmin))
vmax = self.maxTextBox.text().strip()
if not vmax == '':
self.param.setMaximum(float(vmax))
except:
QMessageBox.warning(self, self.tr('Unable to define parameter'),
self.tr('Wrong or missing parameter values'))
return
elif (self.paramType == parameters.PARAMETER_EXPRESSION or
isinstance(self.param, QgsProcessingParameterExpression)):
parent = self.parentCombo.currentData()
self.param = QgsProcessingParameterExpression(name, description,
str(self.defaultEdit.expression()),
parent)
elif (self.paramType == parameters.PARAMETER_STRING or
isinstance(self.param, QgsProcessingParameterString)):
self.param = QgsProcessingParameterString(name, description,
str(self.defaultTextBox.text()))
elif (self.paramType == parameters.PARAMETER_EXTENT or