QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
QgsServerParameterDefinition Class Reference

Definition of a parameter with basic conversion methods. More...

#include <qgsserverparameters.h>

Inheritance diagram for QgsServerParameterDefinition:
Inheritance graph
[legend]

Public Member Functions

 QgsServerParameterDefinition (const QVariant::Type type=QVariant::String, const QVariant defaultValue=QVariant(""))
 Constructor for QgsServerParameterDefinition. More...
 
virtual ~QgsServerParameterDefinition ()=default
 Default destructor for QgsServerParameterDefinition. More...
 
virtual bool isValid () const
 Returns true if the parameter is valid, false otherwise. More...
 
QString loadUrl (bool &ok) const
 Loads the data associated to the parameter converted into an url. More...
 
bool toBool () const
 Converts the parameter into a boolean. More...
 
QColor toColor (bool &ok) const
 Converts the parameter into a color. More...
 
QList< QColor > toColorList (bool &ok, char delimiter= ',') const
 Converts the parameter into a list of colors. More...
 
double toDouble (bool &ok) const
 Converts the parameter into a double. More...
 
QList< double > toDoubleList (bool &ok, char delimiter= ',') const
 Converts the parameter into a list of doubles. More...
 
QList< QgsGeometrytoGeomList (bool &ok, char delimiter= ',') const
 Converts the parameter into a list of geometries. More...
 
int toInt (bool &ok) const
 Converts the parameter into an integer. More...
 
QList< int > toIntList (bool &ok, char delimiter= ',') const
 Converts the parameter into a list of integers. More...
 
QgsRectangle toRectangle (bool &ok) const
 Converts the parameter into a rectangle. More...
 
QString toString () const
 Converts the parameter into a string. More...
 
QStringList toStringList (char delimiter= ',', bool skipEmptyParts=true) const
 Converts the parameter into a list of strings. More...
 
QUrl toUrl (bool &ok) const
 Converts the parameter into an url. More...
 
QString typeName () const
 Returns the type of the parameter as a string. More...
 

Static Public Member Functions

static void raiseError (const QString &msg)
 Raises an exception in case of an invalid parameters. More...
 

Public Attributes

QVariant mDefaultValue
 
QVariant::Type mType
 
QVariant mValue
 

Detailed Description

Definition of a parameter with basic conversion methods.

Since
QGIS 3.4

Definition at line 35 of file qgsserverparameters.h.

Constructor & Destructor Documentation

QgsServerParameterDefinition::QgsServerParameterDefinition ( const QVariant::Type  type = QVariant::String,
const QVariant  defaultValue = QVariant( "" ) 
)

Constructor for QgsServerParameterDefinition.

Parameters
typeThe type of the parameter
defaultValueThe default value of the parameter

Definition at line 30 of file qgsserverparameters.cpp.

virtual QgsServerParameterDefinition::~QgsServerParameterDefinition ( )
virtualdefault

Default destructor for QgsServerParameterDefinition.

Member Function Documentation

bool QgsServerParameterDefinition::isValid ( ) const
virtual

Returns true if the parameter is valid, false otherwise.

Reimplemented in QgsWms::QgsWmsParameter.

Definition at line 345 of file qgsserverparameters.cpp.

QString QgsServerParameterDefinition::loadUrl ( bool &  ok) const

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

Parameters
okTrue if there's no error during the load, false otherwise
Returns
The content loaded
Since
QGIS 3.4

Definition at line 221 of file qgsserverparameters.cpp.

void QgsServerParameterDefinition::raiseError ( const QString &  msg)
static

Raises an exception in case of an invalid parameters.

Parameters
msgThe message describing the exception
Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 350 of file qgsserverparameters.cpp.

bool QgsServerParameterDefinition::toBool ( ) const

Converts the parameter into a boolean.

Returns
A boolean

Definition at line 320 of file qgsserverparameters.cpp.

QColor QgsServerParameterDefinition::toColor ( bool &  ok) const

Converts the parameter into a color.

Parameters
okTrue if there's no error during the conversion, false otherwise
Returns
A color

Definition at line 42 of file qgsserverparameters.cpp.

QList< QColor > QgsServerParameterDefinition::toColorList ( bool &  ok,
char  delimiter = ',' 
) const

Converts the parameter into a list of colors.

Parameters
okTrue if there's no error during the conversion, false otherwise
delimiterThe character used for delimiting
Returns
A list of colors

Definition at line 109 of file qgsserverparameters.cpp.

double QgsServerParameterDefinition::toDouble ( bool &  ok) const

Converts the parameter into a double.

Parameters
okTrue if there's no error during the conversion, false otherwise
Returns
A double

Definition at line 332 of file qgsserverparameters.cpp.

QList< double > QgsServerParameterDefinition::toDoubleList ( bool &  ok,
char  delimiter = ',' 
) const

Converts the parameter into a list of doubles.

Parameters
okTrue if there's no error during the conversion, false otherwise
delimiterThe character used for delimiting
Returns
A list of doubles

Definition at line 160 of file qgsserverparameters.cpp.

QList< QgsGeometry > QgsServerParameterDefinition::toGeomList ( bool &  ok,
char  delimiter = ',' 
) const

Converts the parameter into a list of geometries.

Parameters
okTrue if there's no error during the conversion, false otherwise
delimiterThe character used for delimiting
Returns
A list of geometries

Definition at line 86 of file qgsserverparameters.cpp.

int QgsServerParameterDefinition::toInt ( bool &  ok) const

Converts the parameter into an integer.

Parameters
okTrue if there's no error during the conversion, false otherwise
Returns
An integer

Definition at line 307 of file qgsserverparameters.cpp.

QList< int > QgsServerParameterDefinition::toIntList ( bool &  ok,
char  delimiter = ',' 
) const

Converts the parameter into a list of integers.

Parameters
okTrue if there's no error during the conversion, false otherwise
delimiterThe character used for delimiting
Returns
A list of integers

Definition at line 140 of file qgsserverparameters.cpp.

QgsRectangle QgsServerParameterDefinition::toRectangle ( bool &  ok) const

Converts the parameter into a rectangle.

Parameters
okTrue if there's no error during the conversion, false otherwise
Returns
A rectangle

Definition at line 180 of file qgsserverparameters.cpp.

QString QgsServerParameterDefinition::toString ( ) const

Converts the parameter into a string.

Definition at line 64 of file qgsserverparameters.cpp.

QStringList QgsServerParameterDefinition::toStringList ( char  delimiter = ',',
bool  skipEmptyParts = true 
) const

Converts the parameter into a list of strings.

Parameters
delimiterThe character used for delimiting
skipEmptyPartsTo use QString::SkipEmptyParts for splitting
Returns
A list of strings

Definition at line 69 of file qgsserverparameters.cpp.

QUrl QgsServerParameterDefinition::toUrl ( bool &  ok) const

Converts the parameter into an url.

Parameters
okTrue if there's no error during the conversion, false otherwise
Returns
An url
Since
QGIS 3.4

Definition at line 293 of file qgsserverparameters.cpp.

QString QgsServerParameterDefinition::typeName ( ) const

Returns the type of the parameter as a string.

Definition at line 37 of file qgsserverparameters.cpp.

Member Data Documentation

QVariant QgsServerParameterDefinition::mDefaultValue

Definition at line 166 of file qgsserverparameters.h.

QVariant::Type QgsServerParameterDefinition::mType

Definition at line 164 of file qgsserverparameters.h.

QVariant QgsServerParameterDefinition::mValue

Definition at line 165 of file qgsserverparameters.h.


The documentation for this class was generated from the following files: