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: Enums
Methods
Returns true if the parameter is valid, false otherwise.
Loads the data associated to the parameter converted into an url.
Raises an exception in case of an invalid parameters.
Converts the parameter into a boolean.
Converts the parameter into a color.
Converts the parameter into a list of colors.
Converts the parameter into a double.
Converts the parameter into a list of doubles.
Converts the parameter into a list of geometries.
Converts the parameter into an integer.
Converts the parameter into a list of integers.
Converts the parameter into a rectangle.
Converts the parameter into a string.
Converts the parameter into a list of strings
Converts the parameter into an url.
Returns the type of the parameter as a string.
Signals
Attributes
-
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 = ', ', skipEmptyParts: bool = True) → List[str]¶ Converts the parameter into a list of strings
- Parameters
delimiter – The character used for delimiting
skipEmptyParts – To use QString.SkipEmptyParts for splitting
- 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.