QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
QgsDataDefined Class Reference

A container class for data source field mapping or expression. More...

#include <qgsdatadefined.h>

Collaboration diagram for QgsDataDefined:
Collaboration graph
[legend]

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 ()
 
bool isActive () const
 
void setActive (bool active)
 
bool useExpression () const
 
void setUseExpression (bool use)
 
QString expressionString () const
 
void setExpressionString (const QString &expr)
 
QMap< QString, QVariant > expressionParams () const
 
void setExpressionParams (QMap< QString, QVariant > params)
 
void insertExpressionParam (QString key, QVariant param)
 
bool prepareExpression (QgsVectorLayer *layer)
 
bool expressionIsPrepared () const
 
QgsExpressionexpression ()
 
QStringList referencedColumns (QgsVectorLayer *layer)
 
QString field () const
 
void setField (const QString &field)
 
QMap< QString, QString > toMap ()
 

Private Attributes

QgsExpressionmExpression
 
bool mActive
 
bool mUseExpression
 
QString mExpressionString
 
QString mField
 
QMap< QString, QVariant > mExpressionParams
 
bool mExpressionPrepared
 
QStringList mExprRefColmuns
 

Detailed Description

A container class for data source field mapping or expression.

Note
added in QGIS 1.9

Definition at line 32 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.

References mExpression, and mExpressionPrepared.

QgsDataDefined::~QgsDataDefined ( )

Definition at line 36 of file qgsdatadefined.cpp.

References mExpression, and mExpressionParams.

Member Function Documentation

QgsExpression* QgsDataDefined::expression ( )
inline
bool QgsDataDefined::expressionIsPrepared ( ) const
inline
QMap<QString, QVariant> QgsDataDefined::expressionParams ( ) const
inline

Definition at line 60 of file qgsdatadefined.h.

QString QgsDataDefined::expressionString ( ) const
inline
QString QgsDataDefined::field ( ) const
inline
void QgsDataDefined::insertExpressionParam ( QString  key,
QVariant  param 
)

Definition at line 119 of file qgsdatadefined.cpp.

References mExpressionParams.

bool QgsDataDefined::isActive ( ) const
inline
bool QgsDataDefined::prepareExpression ( QgsVectorLayer layer)
QStringList QgsDataDefined::referencedColumns ( QgsVectorLayer layer)
void QgsDataDefined::setActive ( bool  active)
inline
void QgsDataDefined::setExpressionParams ( QMap< QString, QVariant >  params)
inline

Definition at line 62 of file qgsdatadefined.h.

Referenced by QgsPalLabeling::prepareLayer().

void QgsDataDefined::setExpressionString ( const QString &  expr)
void QgsDataDefined::setField ( const QString &  field)
inline
void QgsDataDefined::setUseExpression ( bool  use)
inline
QMap< QString, QString > QgsDataDefined::toMap ( )

Definition at line 124 of file qgsdatadefined.cpp.

References mActive, mExpressionString, mField, and mUseExpression.

bool QgsDataDefined::useExpression ( ) const
inline

Member Data Documentation

bool QgsDataDefined::mActive
private

Definition at line 80 of file qgsdatadefined.h.

Referenced by toMap().

QgsExpression* QgsDataDefined::mExpression
private
QMap<QString, QVariant> QgsDataDefined::mExpressionParams
private

Definition at line 85 of file qgsdatadefined.h.

Referenced by insertExpressionParam(), prepareExpression(), and ~QgsDataDefined().

bool QgsDataDefined::mExpressionPrepared
private
QString QgsDataDefined::mExpressionString
private

Definition at line 82 of file qgsdatadefined.h.

Referenced by prepareExpression(), setExpressionString(), and toMap().

QStringList QgsDataDefined::mExprRefColmuns
private

Definition at line 87 of file qgsdatadefined.h.

Referenced by prepareExpression(), and referencedColumns().

QString QgsDataDefined::mField
private

Definition at line 83 of file qgsdatadefined.h.

Referenced by referencedColumns(), and toMap().

bool QgsDataDefined::mUseExpression
private

Definition at line 81 of file qgsdatadefined.h.

Referenced by prepareExpression(), referencedColumns(), and toMap().


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