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

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

#include <qgsdatadefinedbutton.h>

Inheritance diagram for QgsDataDefinedButton:
Inheritance graph
[legend]

Public Types

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

Public Slots

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

Signals

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

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. More...
 
 ~QgsDataDefinedButton ()
 
void clearCheckedWidgets ()
 Clears list of checkable sibling widgets. More...
 
void clearEnabledWidgets ()
 Clears list of sibling widgets. More...
 
QString currentDefinition () const
 The current definition. More...
 
QMap< QString, QString > definedProperty () const
 
QString fullDescription () const
 The full definition description and current definition (internally generated on a contextual basis) More...
 
QString getExpression () const
 The current defined expression. More...
 
QString getField () const
 The current defined field. More...
 
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) More...
 
bool isActive ()
 Whether the current data definition or expression is to be used. More...
 
void registerCheckedWidget (QWidget *wdgt)
 Register a sibling widget that get checked when data definition or expression is active. More...
 
void registerCheckedWidgets (QList< QWidget * > wdgts)
 Register list of sibling widgets that get checked when data definition or expression is active. More...
 
QList< QWidget * > registeredCheckedWidgets ()
 Return widget siblings that get checked when data definition or expression is active. More...
 
QList< QWidget * > registeredEnabledWidgets ()
 Return widget siblings that get disabled/enabled when data definition or expression is set/unset. More...
 
void registerEnabledWidget (QWidget *wdgt)
 Register a sibling widget that gets disabled/enabled when data definition or expression is set/unset. More...
 
void registerEnabledWidgets (QList< QWidget * > wdgts)
 Register list of sibling widgets that get disabled/enabled when data definition or expression is set/unset. More...
 
void setUsageInfo (const QString &info)
 Set the usage information about this data definition. More...
 
QString usageInfo () const
 The usage information about this data definition. More...
 
bool useExpression ()
 Whether the current expression is to be used instead of field mapping. More...
 
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. More...
 

Static Public Member Functions

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

Protected Member Functions

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

Detailed Description

A button for defining data source field mappings or expressions.

Definition at line 33 of file qgsdatadefinedbutton.h.

Member Enumeration Documentation

Enumerator
String 
Int 
Double 
AnyType 

Definition at line 39 of file qgsdatadefinedbutton.h.

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

Definition at line 38 of file qgsdatadefinedbutton.cpp.

QgsDataDefinedButton::~QgsDataDefinedButton ( )

Definition at line 95 of file qgsdatadefinedbutton.cpp.

Member Function Documentation

QString QgsDataDefinedButton::anyStringDesc ( )
static

Definition at line 613 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::blendModesDesc ( )
static

Definition at line 693 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::boolDesc ( )
static

Definition at line 608 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::checkCheckedWidgets ( bool  check)
slot

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

Definition at line 579 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::clearCheckedWidgets ( )
inline

Clears list of checkable sibling widgets.

Definition at line 168 of file qgsdatadefinedbutton.h.

void QgsDataDefinedButton::clearEnabledWidgets ( )
inline

Clears list of sibling widgets.

Definition at line 146 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::colorAlphaDesc ( )
static

Definition at line 673 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::colorNoAlphaDesc ( )
static

Definition at line 668 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::currentDefinition ( ) const
inline

The current definition.

Returns
empty QString if not active, otherwise currently defined expression or field name

Definition at line 103 of file qgsdatadefinedbutton.h.

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

Definition at line 77 of file qgsdatadefinedbutton.h.

void QgsDataDefinedButton::disableEnabledWidgets ( bool  disable)
slot

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

Definition at line 544 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::double180RotDesc ( )
static

Definition at line 648 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::doubleDesc ( )
static

Definition at line 633 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::doublePosDesc ( )
static

Definition at line 638 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::doubleXYDesc ( )
static

Definition at line 643 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::fullDescription ( ) const
inline

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

Definition at line 114 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::getExpression ( ) const
inline

The current defined expression.

Definition at line 92 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::getField ( ) const
inline

The current defined field.

Definition at line 97 of file qgsdatadefinedbutton.h.

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

Definition at line 101 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::intDesc ( )
static

Definition at line 618 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::intPosDesc ( )
static

Definition at line 623 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::intPosOneDesc ( )
static

Definition at line 628 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::intTranspDesc ( )
static

Definition at line 653 of file qgsdatadefinedbutton.cpp.

bool QgsDataDefinedButton::isActive ( )
inline

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

Definition at line 82 of file qgsdatadefinedbutton.h.

void QgsDataDefinedButton::mouseReleaseEvent ( QMouseEvent *  event)
protected

Definition at line 195 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::paperOrientationDesc ( )
static

Definition at line 716 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::paperSizeDesc ( )
static

Definition at line 707 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::penJoinStyleDesc ( )
static

Definition at line 688 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::registerCheckedWidget ( QWidget *  wdgt)

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

Definition at line 560 of file qgsdatadefinedbutton.cpp.

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

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

Definition at line 552 of file qgsdatadefinedbutton.cpp.

QList< QWidget * > QgsDataDefinedButton::registeredCheckedWidgets ( )

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

Returns
unguarded pointers from guarded ones

Definition at line 569 of file qgsdatadefinedbutton.cpp.

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

Definition at line 534 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::registerEnabledWidget ( QWidget *  wdgt)

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

Definition at line 525 of file qgsdatadefinedbutton.cpp.

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

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

Definition at line 517 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::setActive ( bool  active)
slot

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

Definition at line 508 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::setExpression ( QString  exp)
inlineprotected

Set the current defined expression.

Definition at line 236 of file qgsdatadefinedbutton.h.

void QgsDataDefinedButton::setField ( QString  field)
inlineprotected

Set the current defined field.

Definition at line 241 of file qgsdatadefinedbutton.h.

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

Set the usage information about this data definition.

Definition at line 124 of file qgsdatadefinedbutton.h.

void QgsDataDefinedButton::setUseExpression ( bool  use)
inlineprotected

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

Definition at line 231 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::svgPathDesc ( )
static

Definition at line 700 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::textHorzAlignDesc ( )
static

Definition at line 678 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::textVertAlignDesc ( )
static

Definition at line 683 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::trString ( )
static

Common descriptions for expected input values.

Definition at line 602 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::unitsMmMuDesc ( )
static

Definition at line 658 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::unitsMmMuPercentDesc ( )
static

Definition at line 663 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::usageInfo ( ) const
inline

The usage information about this data definition.

Definition at line 119 of file qgsdatadefinedbutton.h.

bool QgsDataDefinedButton::useExpression ( )
inline

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

Definition at line 87 of file qgsdatadefinedbutton.h.

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.

Definition at line 109 of file qgsdatadefinedbutton.h.


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