Class: QgsServerParameterDefinition¶
Definition of a parameter with basic conversion methods.
Added in version 3.4.
Class Hierarchy¶
Subclasses¶
Parameter common to all services (WMS, WFS, …). |
Methods
Loads the data associated to the parameter converted into an url. |
|
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 QGIS expressions. |
|
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 list of OGC filters. |
|
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. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsServerParameterDefinition. See the FAQ for more details.
Returns |
Static Methods
Raises an exception in case of an invalid parameters. |
Attributes
- class qgis.server.QgsServerParameterDefinition[source]¶
Bases:
object
- __init__(type: QMetaType.Type = QMetaType.Type.QString, defaultValue: Any = None)
Constructor for QgsServerParameterDefinition.
- Parameters:
type (QMetaType.Type = QMetaType.Type.QString) – The type of the parameter
defaultValue (Any = None) – The default value of the parameter
- __init__(type: QVariant.Type, defaultValue: Any = None)
Constructor for QgsServerParameterDefinition.
- Parameters:
type (QVariant.Type) – The type of the parameter
defaultValue (Any = None) – The default value of the parameter
Deprecated since version 3.38: Use the method with a QMetaType.Type argument instead.
- __init__(a0: QgsServerParameterDefinition)
- Parameters:
- virtual isValid(self) bool [source]¶
Returns
True
if the parameter is valid,False
otherwise.- Return type:
bool
- loadUrl(self)[source]¶
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
Added in version 3.4.
- mDefaultValue¶
- mType¶
- mValue¶
- static raiseError(msg: str | None)[source]¶
Raises an exception in case of an invalid parameters.
- Parameters:
msg (Optional[str]) – The message describing the exception
- Raises:
QgsBadRequestException – Invalid parameter exception
- toBool(self) bool [source]¶
Converts the parameter into a boolean.
- Return type:
bool
- Returns:
A boolean
- toColor(self)[source]¶
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 = ',', skipEmptyParts: bool = True)¶
Converts the parameter into a list of colors.
- Parameters:
ok –
True
if there’s no error during the conversion,False
otherwisedelimiter (str = ') – The character used for delimiting
skipEmptyParts (bool = True) -> (List[QColor]) – for splitting
- Returns:
A list of colors
- toDouble(self)[source]¶
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 = ',', skipEmptyParts: bool = True)¶
Converts the parameter into a list of doubles.
- Parameters:
ok –
True
if there’s no error during the conversion,False
otherwisedelimiter (str = ') – The character used for delimiting
skipEmptyParts (bool = True) -> (List[float]) – for splitting
- Returns:
A list of doubles
- toExpressionList(self) List[str] [source]¶
Converts the parameter into a list of QGIS expressions.
- Return type:
List[str]
- Returns:
A list of strings
Added in version 3.24.
- toGeomList(self, delimiter: str = ',', skipEmptyParts: bool = True)¶
Converts the parameter into a list of geometries.
- Parameters:
ok –
True
if there’s no error during the conversion,False
otherwisedelimiter (str = ') – The character used for delimiting
skipEmptyParts (bool = True) -> (List[QgsGeometry]) – for splitting
- Returns:
A list of geometries
- toInt(self)[source]¶
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 = ',', skipEmptyParts: bool = True)¶
Converts the parameter into a list of integers.
- Parameters:
ok –
True
if there’s no error during the conversion,False
otherwisedelimiter (str = ') – The character used for delimiting
skipEmptyParts (bool = True) -> (List[int]) – for splitting
- Returns:
A list of integers
- toOgcFilterList(self) List[str] [source]¶
Converts the parameter into a list of OGC filters.
- Return type:
List[str]
- Returns:
A list of strings
Added in version 3.24.
- toRectangle(self)[source]¶
Converts the parameter into a rectangle.
- Parameters:
ok –
True
if there’s no error during the conversion,False
otherwise- Returns:
A rectangle
- toString(self, defaultValue: bool = False) str [source]¶
Converts the parameter into a string. If
defaultValue
is true and current value is empty, then the default value is returned.- Parameters:
defaultValue (bool = False)
- Return type:
str
- toStringList(self, delimiter: str = ',', skipEmptyParts: bool = True) List[str] [source]¶
Converts the parameter into a list of strings
- Parameters:
delimiter (str = ') – The character used for delimiting
skipEmptyParts (bool = True) – To use QString.SkipEmptyParts for splitting
- Return type:
List[str]
- Returns:
A list of strings