QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
QgsDataDefinedButton Class Reference

A button for defining data source field mappings or expressions. More...

#include <qgsdatadefinedbutton.h>

Public Types

enum  DataType { String = 1, Int = 2, Double = 4, AnyType = String | Int | Double }

Public Slots

void setActive (bool active)
 Set whether the current data definition or expression is to be used.
void disableEnabledWidgets (bool disable)
 Set siblings' enabled property when data definition or expression is set/unset.
void checkCheckedWidgets (bool check)
 Set siblings' checked property when data definition or expression is active.

Signals

void dataDefinedChanged (const QString &definition)
 Emitted when data definition or expression is changed.
void dataDefinedActivated (bool active)
 Emitted when active state changed.

Public Member Functions

 QgsDataDefinedButton (QWidget *parent=0, const QgsVectorLayer *vl=0, const QgsDataDefined *datadefined=0, DataTypes datatypes=AnyType, QString description=QString(""))
 Construct a new data defined button.
 ~QgsDataDefinedButton ()
void init (const QgsVectorLayer *vl, const QgsDataDefined *datadefined=0, DataTypes datatypes=AnyType, QString description=QString(""))
 Initialize a newly constructed data defined button (useful if button already included from form layout)
QMap< QString, QString > definedProperty () const
bool isActive ()
 Whether the current data definition or expression is to be used.
bool useExpression ()
 Whether the current expression is to be used instead of field mapping.
QString getExpression () const
 The current defined expression.
QString getField () const
 The current defined field.
QString currentDefinition () const
 The current definition.
const DataTypes & validDataTypes () const
 The valid data types that will work for the definition (QVariant-coercible to expected type) Compared against the variant type of the QgsField from data source and expression result.
QString fullDescription () const
 The full definition description and current definition (internally generated on a contextual basis)
QString usageInfo () const
 The usage information about this data definition.
void setUsageInfo (const QString &info)
 Set the usage information about this data definition.
void registerEnabledWidgets (QList< QWidget * > wdgts)
 Register list of sibling widgets that get disabled/enabled when data definition or expression is set/unset.
void registerEnabledWidget (QWidget *wdgt)
 Register a sibling widget that gets disabled/enabled when data definition or expression is set/unset.
QList< QWidget * > registeredEnabledWidgets ()
 Return widget siblings that get disabled/enabled when data definition or expression is set/unset.
void clearEnabledWidgets ()
 Clears list of sibling widgets.
void registerCheckedWidgets (QList< QWidget * > wdgts)
 Register list of sibling widgets that get checked when data definition or expression is active.
void registerCheckedWidget (QWidget *wdgt)
 Register a sibling widget that get checked when data definition or expression is active.
QList< QWidget * > registeredCheckedWidgets ()
 Return widget siblings that get checked when data definition or expression is active.
void clearCheckedWidgets ()
 Clears list of checkable sibling widgets.

Static Public Member Functions

static QString trString ()
 Common descriptions for expected input values.
static QString boolDesc ()
static QString anyStringDesc ()
static QString intDesc ()
static QString intPosDesc ()
static QString intPosOneDesc ()
static QString doubleDesc ()
static QString doublePosDesc ()
static QString doubleXYDesc ()
static QString double180RotDesc ()
static QString intTranspDesc ()
static QString unitsMmMuDesc ()
static QString unitsMmMuPercentDesc ()
static QString colorNoAlphaDesc ()
static QString colorAlphaDesc ()
static QString textHorzAlignDesc ()
static QString textVertAlignDesc ()
static QString penJoinStyleDesc ()
static QString blendModesDesc ()
static QString svgPathDesc ()
static QString paperSizeDesc ()
static QString paperOrientationDesc ()

Protected Member Functions

void mouseReleaseEvent (QMouseEvent *event)
void setUseExpression (bool use)
 Set whether the current expression is to be used instead of field mapping.
void setExpression (QString exp)
 Set the current defined expression.
void setField (QString field)
 Set the current defined field.

Properties

QString usageInfo

Detailed Description

A button for defining data source field mappings or expressions.

Member Enumeration Documentation

Enumerator:
String 
Int 
Double 
AnyType 

Constructor & Destructor Documentation

QgsDataDefinedButton::QgsDataDefinedButton ( QWidget *  parent = 0,
const QgsVectorLayer vl = 0,
const QgsDataDefined datadefined = 0,
DataTypes  datatypes = AnyType,
QString  description = QString( "" ) 
)

Construct a new data defined button.

Parameters
parentThe parent QWidget
vlPointer to the associated vector layer
datadefinedData defined property
datatypesThe expected data types to be compared against the variant type of the QgsField from data source and expression result
descriptionThe description of expected input data
QgsDataDefinedButton::~QgsDataDefinedButton ( )

Member Function Documentation

QString QgsDataDefinedButton::anyStringDesc ( )
static
QString QgsDataDefinedButton::blendModesDesc ( )
static
QString QgsDataDefinedButton::boolDesc ( )
static
void QgsDataDefinedButton::checkCheckedWidgets ( bool  check)
slot

Set siblings' checked property when data definition or expression is active.

void QgsDataDefinedButton::clearCheckedWidgets ( )
inline

Clears list of checkable sibling widgets.

void QgsDataDefinedButton::clearEnabledWidgets ( )
inline

Clears list of sibling widgets.

QString QgsDataDefinedButton::colorAlphaDesc ( )
static
QString QgsDataDefinedButton::colorNoAlphaDesc ( )
static
QString QgsDataDefinedButton::currentDefinition ( ) const
inline

The current definition.

Returns
empty QString if not active, otherwise currently defined expression or field name
void QgsDataDefinedButton::dataDefinedActivated ( bool  active)
signal

Emitted when active state changed.

Parameters
activeWhether the definition is active
void QgsDataDefinedButton::dataDefinedChanged ( const QString &  definition)
signal

Emitted when data definition or expression is changed.

Parameters
definitionThe current definition or expression (empty string if inactive)
QMap< QString, QString > QgsDataDefinedButton::definedProperty ( ) const
inline
void QgsDataDefinedButton::disableEnabledWidgets ( bool  disable)
slot

Set siblings' enabled property when data definition or expression is set/unset.

QString QgsDataDefinedButton::double180RotDesc ( )
static
QString QgsDataDefinedButton::doubleDesc ( )
static
QString QgsDataDefinedButton::doublePosDesc ( )
static
QString QgsDataDefinedButton::doubleXYDesc ( )
static
QString QgsDataDefinedButton::fullDescription ( ) const
inline

The full definition description and current definition (internally generated on a contextual basis)

QString QgsDataDefinedButton::getExpression ( ) const
inline

The current defined expression.

QString QgsDataDefinedButton::getField ( ) const
inline

The current defined field.

void QgsDataDefinedButton::init ( const QgsVectorLayer vl,
const QgsDataDefined datadefined = 0,
DataTypes  datatypes = AnyType,
QString  description = QString( "" ) 
)

Initialize a newly constructed data defined button (useful if button already included from form layout)

Parameters
vlPointer to the associated vector layer
datadefinedData defined property
datatypesThe expected data types to be compared against the variant type of the QgsField from data source and expression result
descriptionThe description of expected input data
QString QgsDataDefinedButton::intDesc ( )
static
QString QgsDataDefinedButton::intPosDesc ( )
static
QString QgsDataDefinedButton::intPosOneDesc ( )
static
QString QgsDataDefinedButton::intTranspDesc ( )
static
bool QgsDataDefinedButton::isActive ( )
inline

Whether the current data definition or expression is to be used.

void QgsDataDefinedButton::mouseReleaseEvent ( QMouseEvent *  event)
protected
QString QgsDataDefinedButton::paperOrientationDesc ( )
static
QString QgsDataDefinedButton::paperSizeDesc ( )
static
QString QgsDataDefinedButton::penJoinStyleDesc ( )
static
void QgsDataDefinedButton::registerCheckedWidget ( QWidget *  wdgt)

Register a sibling widget that get checked when data definition or expression is active.

void QgsDataDefinedButton::registerCheckedWidgets ( QList< QWidget * >  wdgts)

Register list of sibling widgets that get checked when data definition or expression is active.

QList< QWidget * > QgsDataDefinedButton::registeredCheckedWidgets ( )

Return widget siblings that get checked when data definition or expression is active.

Returns
unguarded pointers from guarded ones
QList< QWidget * > QgsDataDefinedButton::registeredEnabledWidgets ( )

Return widget siblings that get disabled/enabled when data definition or expression is set/unset.

Returns
unguarded pointers from guarded ones
void QgsDataDefinedButton::registerEnabledWidget ( QWidget *  wdgt)

Register a sibling widget that gets disabled/enabled when data definition or expression is set/unset.

void QgsDataDefinedButton::registerEnabledWidgets ( QList< QWidget * >  wdgts)

Register list of sibling widgets that get disabled/enabled when data definition or expression is set/unset.

void QgsDataDefinedButton::setActive ( bool  active)
slot

Set whether the current data definition or expression is to be used.

void QgsDataDefinedButton::setExpression ( QString  exp)
inlineprotected

Set the current defined expression.

void QgsDataDefinedButton::setField ( QString  field)
inlineprotected

Set the current defined field.

void QgsDataDefinedButton::setUsageInfo ( const QString &  info)
inline

Set the usage information about this data definition.

void QgsDataDefinedButton::setUseExpression ( bool  use)
inlineprotected

Set whether the current expression is to be used instead of field mapping.

QString QgsDataDefinedButton::svgPathDesc ( )
static
QString QgsDataDefinedButton::textHorzAlignDesc ( )
static
QString QgsDataDefinedButton::textVertAlignDesc ( )
static
QString QgsDataDefinedButton::trString ( )
static

Common descriptions for expected input values.

QString QgsDataDefinedButton::unitsMmMuDesc ( )
static
QString QgsDataDefinedButton::unitsMmMuPercentDesc ( )
static
QString QgsDataDefinedButton::usageInfo ( ) const
inline

The usage information about this data definition.

bool QgsDataDefinedButton::useExpression ( )
inline

Whether the current expression is to be used instead of field mapping.

const DataTypes& QgsDataDefinedButton::validDataTypes ( ) const
inline

The valid data types that will work for the definition (QVariant-coercible to expected type) Compared against the variant type of the QgsField from data source and expression result.

Property Documentation

QString QgsDataDefinedButton::usageInfo
readwrite

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