Skip to content
Permalink
Browse files

use distance instead of number parameter, and set advanced flag

  • Loading branch information
raymondnijssen authored and m-kuhn committed May 2, 2019
1 parent a6d9d26 commit 95c8cfed5f62bbf7387c33e39b5390628cfd2763
Showing with 11 additions and 6 deletions.
  1. +11 −6 python/plugins/processing/algs/qgis/ExtentFromLayer.py
@@ -40,7 +40,8 @@
QgsProcessing,
QgsProcessingException,
QgsProcessingParameterMapLayer,
QgsProcessingParameterNumber,
QgsProcessingParameterDistance,
QgsProcessingParameterDefinition,
QgsProcessingParameterFeatureSink,
QgsFields)

@@ -77,11 +78,15 @@ def __init__(self):

def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterMapLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterNumber(self.ROUND_TO,
self.tr('Round values to'),
minValue=0,
defaultValue=0,
type=QgsProcessingParameterNumber.Double))

round_to_parameter = QgsProcessingParameterDistance(self.ROUND_TO,
self.tr('Round values to'),
parentParameterName=self.INPUT,
minValue=0,
defaultValue=0)
round_to_parameter.setFlags(round_to_parameter.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
self.addParameter(round_to_parameter)

self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Extent'), type=QgsProcessing.TypeVectorPolygon))

def name(self):

0 comments on commit 95c8cfe

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