QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | List of all members
QgsDataDefined Class Reference

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. More...
 
 ~QgsDataDefined ()
 
QgsExpressionexpression ()
 
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. More...
 
void insertExpressionParam (QString key, QVariant param)
 
bool isActive () 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)
 
void setUseExpression (bool use)
 
QMap< QString, QString > toMap ()
 
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
activeWhether the current data defined is active
useexprWhether to use expression instead of field
exprExpression string
fieldField name string

Definition at line 23 of file qgsdatadefined.cpp.

QgsDataDefined::~QgsDataDefined ( )

Definition at line 36 of file qgsdatadefined.cpp.

Member Function Documentation

QgsExpression* QgsDataDefined::expression ( )
inline

Definition at line 74 of file qgsdatadefined.h.

bool QgsDataDefined::expressionIsPrepared ( ) const
inline

Definition at line 72 of file qgsdatadefined.h.

QMap<QString, QVariant> QgsDataDefined::expressionParams ( ) const
inline

Definition at line 66 of file qgsdatadefined.h.

QString QgsDataDefined::expressionString ( ) const
inline

Definition at line 62 of file qgsdatadefined.h.

QString QgsDataDefined::field ( ) const
inline

Definition at line 77 of file qgsdatadefined.h.

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 42 of file qgsdatadefined.cpp.

void QgsDataDefined::insertExpressionParam ( QString  key,
QVariant  param 
)

Definition at line 124 of file qgsdatadefined.cpp.

bool QgsDataDefined::isActive ( ) const
inline

Definition at line 56 of file qgsdatadefined.h.

bool QgsDataDefined::prepareExpression ( QgsVectorLayer layer)

Definition at line 53 of file qgsdatadefined.cpp.

QStringList QgsDataDefined::referencedColumns ( QgsVectorLayer layer)

Definition at line 102 of file qgsdatadefined.cpp.

void QgsDataDefined::setActive ( bool  active)
inline

Definition at line 57 of file qgsdatadefined.h.

void QgsDataDefined::setExpressionParams ( QMap< QString, QVariant >  params)
inline

Definition at line 68 of file qgsdatadefined.h.

void QgsDataDefined::setExpressionString ( const QString &  expr)

Definition at line 47 of file qgsdatadefined.cpp.

void QgsDataDefined::setField ( const QString &  field)
inline

Definition at line 78 of file qgsdatadefined.h.

void QgsDataDefined::setUseExpression ( bool  use)
inline

Definition at line 60 of file qgsdatadefined.h.

QMap< QString, QString > QgsDataDefined::toMap ( )

Definition at line 129 of file qgsdatadefined.cpp.

bool QgsDataDefined::useExpression ( ) const
inline

Definition at line 59 of file qgsdatadefined.h.


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