Subgroup: Server

Class: QgsServerParameterDefinition

class qgis.server.QgsServerParameterDefinition(type: QVariant.Type = QVariant.String, defaultValue: Any = None)

Bases: sip.wrapper

Constructor for QgsServerParameterDefinition.

Parameters:
  • type – The type of the parameter
  • defaultValue – The default value of the parameter

QgsServerParameterDefinition(QgsServerParameterDefinition)

Definition of a parameter with basic conversion methods

New in version 3.4: Methods

isValid Returns true if the parameter is valid, false otherwise.
loadUrl Loads the data associated to the parameter converted into an url.
raiseError Raises an exception in case of an invalid parameters.
toBool Converts the parameter into a boolean.
toColor Converts the parameter into a color.
toColorList Converts the parameter into a list of colors.
toDouble Converts the parameter into a double.
toDoubleList Converts the parameter into a list of doubles.
toGeomList Converts the parameter into a list of geometries.
toInt Converts the parameter into an integer.
toIntList Converts the parameter into a list of integers.
toRectangle Converts the parameter into a rectangle.
toString Converts the parameter into a string.
toStringList Converts the parameter into a list of strings.
toUrl Converts the parameter into an url.
typeName Returns the type of the parameter as a string.

Signals

Attributes

qgis.server.QgsServerParameterDefinition.mDefaultValue
qgis.server.QgsServerParameterDefinition.mType
qgis.server.QgsServerParameterDefinition.mValue
isValid(self) → bool

Returns true if the parameter is valid, false otherwise.

loadUrl(self) → Tuple[str, bool]

Loads the data associated to the parameter converted into an url.

Parameters:ok – True if there’s no error during the load, false otherwise
Returns:The content loaded

New in version 3.4.

mDefaultValue
mType
mValue
raiseError(msg: str)

Raises an exception in case of an invalid parameters.

Parameters:msg – The message describing the exception throws QgsBadRequestException Invalid parameter exception
toBool(self) → bool

Converts the parameter into a boolean.

Returns:A boolean
toColor(self) → Tuple[QColor, bool]

Converts the parameter into a color.

Parameters:ok – True if there’s no error during the conversion, false otherwise
Returns:A color
toColorList(self, delimiter: str = ', ') → Tuple[List[QColor], bool]

Converts the parameter into a list of colors.

Parameters:
  • ok – True if there’s no error during the conversion, false otherwise
  • delimiter – The character used for delimiting
Returns:

A list of colors

toDouble(self) → Tuple[float, bool]

Converts the parameter into a double.

Parameters:ok – True if there’s no error during the conversion, false otherwise
Returns:A double
toDoubleList(self, delimiter: str = ', ') → Tuple[List[float], bool]

Converts the parameter into a list of doubles.

Parameters:
  • ok – True if there’s no error during the conversion, false otherwise
  • delimiter – The character used for delimiting
Returns:

A list of doubles

toGeomList(self, delimiter: str = ', ') → Tuple[object, bool]

Converts the parameter into a list of geometries.

Parameters:
  • ok – True if there’s no error during the conversion, false otherwise
  • delimiter – The character used for delimiting
Returns:

A list of geometries

toInt(self) → Tuple[int, bool]

Converts the parameter into an integer.

Parameters:ok – True if there’s no error during the conversion, false otherwise
Returns:An integer
toIntList(self, delimiter: str = ', ') → Tuple[List[int], bool]

Converts the parameter into a list of integers.

Parameters:
  • ok – True if there’s no error during the conversion, false otherwise
  • delimiter – The character used for delimiting
Returns:

A list of integers

toRectangle(self) → Tuple[QgsRectangle, bool]

Converts the parameter into a rectangle.

Parameters:ok – True if there’s no error during the conversion, false otherwise
Returns:A rectangle
toString(self) → str

Converts the parameter into a string.

toStringList(self, delimiter: str = ', ') → List[str]

Converts the parameter into a list of strings.

Parameters:delimiter – The character used for delimiting
Returns:A list of strings
toUrl(self) → Tuple[QUrl, bool]

Converts the parameter into an url.

Parameters:ok – True if there’s no error during the conversion, false otherwise
Returns:An url

New in version 3.4.

typeName(self) → str

Returns the type of the parameter as a string.