A container class for data source field mapping or expression.
More...
#include <qgsdatadefined.h>
Public Member Functions |
| | QgsDataDefined (bool active=false, bool useexpr=false, const QString &expr=QString(), const QString &field=QString()) |
| | Construct a new data defined object.
|
| | QgsDataDefined (const QgsExpression *expression) |
| | Construct a new data defined object, analyse the expression to determine if it's a simple field.
|
| | ~QgsDataDefined () |
| QgsExpression * | expression () |
| bool | expressionIsPrepared () const |
| QMap< QString, QVariant > | expressionParams () const |
| QString | expressionString () const |
| QString | field () const |
| bool | hasDefaultValues () const |
| | Returns whether the data defined container is set to all the default values, ie, disabled, with empty expression and no assigned field.
|
| void | insertExpressionParam (QString key, QVariant param) |
| bool | isActive () const |
| bool | operator!= (const QgsDataDefined &other) const |
| bool | operator== (const QgsDataDefined &other) const |
| bool | prepareExpression (QgsVectorLayer *layer) |
| QStringList | referencedColumns (QgsVectorLayer *layer) |
| void | setActive (bool active) |
| void | setExpressionParams (QMap< QString, QVariant > params) |
| void | setExpressionString (const QString &expr) |
| void | setField (const QString &field) |
| bool | setFromXmlElement (const QDomElement &element) |
| | Sets the properties of the data defined container from an XML element.
|
| void | setUseExpression (bool use) |
| QMap< QString, QString > | toMap () |
| QDomElement | toXmlElement (QDomDocument &document, const QString &elementName) const |
| | Returns a DOM element containing the properties of the data defined container.
|
| bool | useExpression () const |
Detailed Description
A container class for data source field mapping or expression.
Definition at line 31 of file qgsdatadefined.h.
Constructor & Destructor Documentation
| QgsDataDefined::QgsDataDefined |
( |
bool |
active = false, |
|
|
bool |
useexpr = false, |
|
|
const QString & |
expr = QString(), |
|
|
const QString & |
field = QString() |
|
) |
| |
Construct a new data defined object.
- Parameters
-
| active | Whether the current data defined is active |
| useexpr | Whether to use expression instead of field |
| expr | Expression string |
| field | Field name string |
Definition at line 23 of file qgsdatadefined.cpp.
| QgsDataDefined::QgsDataDefined |
( |
const QgsExpression * |
expression | ) |
|
|
explicit |
Construct a new data defined object, analyse the expression to determine if it's a simple field.
- Parameters
-
Definition at line 36 of file qgsdatadefined.cpp.
| QgsDataDefined::~QgsDataDefined |
( |
| ) |
|
Member Function Documentation
| bool QgsDataDefined::expressionIsPrepared |
( |
| ) |
const |
|
inline |
| QMap<QString, QVariant> QgsDataDefined::expressionParams |
( |
| ) |
const |
|
inline |
| QString QgsDataDefined::expressionString |
( |
| ) |
const |
|
inline |
| QString QgsDataDefined::field |
( |
| ) |
const |
|
inline |
| bool QgsDataDefined::hasDefaultValues |
( |
| ) |
const |
Returns whether the data defined container is set to all the default values, ie, disabled, with empty expression and no assigned field.
- Returns
- true if data defined container is set to default values
- Note
- added in QGIS 2.7
Definition at line 52 of file qgsdatadefined.cpp.
| void QgsDataDefined::insertExpressionParam |
( |
QString |
key, |
|
|
QVariant |
param |
|
) |
| |
| bool QgsDataDefined::isActive |
( |
| ) |
const |
|
inline |
| QStringList QgsDataDefined::referencedColumns |
( |
QgsVectorLayer * |
layer | ) |
|
| void QgsDataDefined::setActive |
( |
bool |
active | ) |
|
|
inline |
| void QgsDataDefined::setExpressionParams |
( |
QMap< QString, QVariant > |
params | ) |
|
|
inline |
| void QgsDataDefined::setExpressionString |
( |
const QString & |
expr | ) |
|
| void QgsDataDefined::setField |
( |
const QString & |
field | ) |
|
|
inline |
| bool QgsDataDefined::setFromXmlElement |
( |
const QDomElement & |
element | ) |
|
Sets the properties of the data defined container from an XML element.
Calling this will overwrite all the current properties of the container.
- Parameters
-
- Returns
- true if properties were successfully read from element
- Note
- added in QGIS 2.7
- See Also
- toXmlElement
Definition at line 160 of file qgsdatadefined.cpp.
| void QgsDataDefined::setUseExpression |
( |
bool |
use | ) |
|
|
inline |
| QMap< QString, QString > QgsDataDefined::toMap |
( |
| ) |
|
| QDomElement QgsDataDefined::toXmlElement |
( |
QDomDocument & |
document, |
|
|
const QString & |
elementName |
|
) |
| const |
Returns a DOM element containing the properties of the data defined container.
- Parameters
-
| document | DOM document |
| elementName | name for DOM element |
- Returns
- DOM element corresponding to data defined container
- Note
- added in QGIS 2.7
- See Also
- setFromXmlElement
Definition at line 150 of file qgsdatadefined.cpp.
| bool QgsDataDefined::useExpression |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: