QGIS API Documentation  2.9.0-Master
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>

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="")
 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...
 
QgsDataDefined currentDataDefined () const
 Returns a QgsDataDefined which reflects the current settings from the button. 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 () const
 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 setAssistant (QgsDataDefinedAssistant *assistant)
 Sets an assistant used to define the data defined object properties. More...
 
void setUsageInfo (const QString &info)
 Set the usage information about this data definition. More...
 
void updateDataDefined (QgsDataDefined *dd) const
 Updates a QgsDataDefined with the current settings from the button. More...
 
QString usageInfo () const
 The usage information about this data definition. More...
 
bool useExpression () const
 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 capStyleDesc ()
 
static QString charDesc ()
 
static QString colorAlphaDesc ()
 
static QString colorNoAlphaDesc ()
 
static QString customDashDesc ()
 
static QString double0to1Desc ()
 
static QString double180RotDesc ()
 
static QString doubleDesc ()
 
static QString doublePosDesc ()
 
static QString doubleXYDesc ()
 
static QString filePathDesc ()
 
static QString fillStyleDesc ()
 
static QString gradientCoordModeDesc ()
 
static QString gradientSpreadDesc ()
 
static QString gradientTypeDesc ()
 
static QString horizontalAnchorDesc ()
 
static QString intDesc ()
 
static QString intPosDesc ()
 
static QString intPosOneDesc ()
 
static QString intTranspDesc ()
 
static QString lineStyleDesc ()
 
static QString markerStyleDesc ()
 
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 ()
 
static QString verticalAnchorDesc ()
 

Protected Member Functions

void mouseReleaseEvent (QMouseEvent *event) override
 
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...
 

Properties

QString usageInfo
 

Detailed Description

A button for defining data source field mappings or expressions.

Definition at line 46 of file qgsdatadefinedbutton.h.

Member Enumeration Documentation

Enumerator
String 
Int 
Double 
AnyType 

Definition at line 52 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 = "" 
)

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 96 of file qgsdatadefinedbutton.cpp.

Member Function Documentation

QString QgsDataDefinedButton::anyStringDesc ( )
static

Definition at line 676 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::blendModesDesc ( )
static

Definition at line 761 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::boolDesc ( )
static

Definition at line 671 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::capStyleDesc ( )
static

Definition at line 824 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::charDesc ( )
static

Definition at line 666 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::checkCheckedWidgets ( bool  check)
slot

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

Definition at line 637 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::clearCheckedWidgets ( )
inline

Clears list of checkable sibling widgets.

Definition at line 195 of file qgsdatadefinedbutton.h.

void QgsDataDefinedButton::clearEnabledWidgets ( )
inline

Clears list of sibling widgets.

Definition at line 173 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::colorAlphaDesc ( )
static

Definition at line 741 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::colorNoAlphaDesc ( )
static

Definition at line 736 of file qgsdatadefinedbutton.cpp.

QgsDataDefined QgsDataDefinedButton::currentDataDefined ( ) const

Returns a QgsDataDefined which reflects the current settings from the button.

Note
added in QGIS 2.9
See also
updateDataDefined

Definition at line 207 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 130 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::customDashDesc ( )
static

Definition at line 841 of file qgsdatadefinedbutton.cpp.

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 90 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 596 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::double0to1Desc ( )
static

Definition at line 706 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::double180RotDesc ( )
static

Definition at line 716 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::doubleDesc ( )
static

Definition at line 696 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::doublePosDesc ( )
static

Definition at line 701 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::doubleXYDesc ( )
static

Definition at line 711 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::filePathDesc ( )
static

Definition at line 775 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::fillStyleDesc ( )
static

Definition at line 829 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 141 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::getExpression ( ) const
inline

The current defined expression.

Definition at line 119 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::getField ( ) const
inline

The current defined field.

Definition at line 124 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::gradientCoordModeDesc ( )
static

Definition at line 809 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::gradientSpreadDesc ( )
static

Definition at line 814 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::gradientTypeDesc ( )
static

Definition at line 804 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::horizontalAnchorDesc ( )
static

Definition at line 794 of file qgsdatadefinedbutton.cpp.

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 102 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::intDesc ( )
static

Definition at line 681 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::intPosDesc ( )
static

Definition at line 686 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::intPosOneDesc ( )
static

Definition at line 691 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::intTranspDesc ( )
static

Definition at line 721 of file qgsdatadefinedbutton.cpp.

bool QgsDataDefinedButton::isActive ( ) const
inline

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

Definition at line 109 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::lineStyleDesc ( )
static

Definition at line 819 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::markerStyleDesc ( )
static

Definition at line 836 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 214 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::paperOrientationDesc ( )
static

Definition at line 789 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::paperSizeDesc ( )
static

Definition at line 780 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::penJoinStyleDesc ( )
static

Definition at line 756 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 612 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 604 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 621 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 586 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 577 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 569 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 560 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::setAssistant ( QgsDataDefinedAssistant assistant)

Sets an assistant used to define the data defined object properties.

Ownership of the assistant is transferred to the widget.

Parameters
assistantdata defined assistant. Set to null to remove the assistant option from the button.
Note
added in 2.10

Definition at line 631 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::setExpression ( QString  exp)
inlineprotected

Set the current defined expression.

Definition at line 285 of file qgsdatadefinedbutton.h.

void QgsDataDefinedButton::setField ( QString  field)
inlineprotected

Set the current defined field.

Definition at line 290 of file qgsdatadefinedbutton.h.

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

Set the usage information about this data definition.

Definition at line 151 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 280 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::svgPathDesc ( )
static

Definition at line 768 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::textHorzAlignDesc ( )
static

Definition at line 746 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::textVertAlignDesc ( )
static

Definition at line 751 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::trString ( )
static

Common descriptions for expected input values.

Definition at line 660 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::unitsMmMuDesc ( )
static

Definition at line 726 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::unitsMmMuPercentDesc ( )
static

Definition at line 731 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::updateDataDefined ( QgsDataDefined dd) const

Updates a QgsDataDefined with the current settings from the button.

Parameters
ddQgsDataDefined to update
Note
added in QGIS 2.9
See also
currentDataDefined

Definition at line 196 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::usageInfo ( ) const
inline

The usage information about this data definition.

Definition at line 146 of file qgsdatadefinedbutton.h.

bool QgsDataDefinedButton::useExpression ( ) const
inline

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

Definition at line 114 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 136 of file qgsdatadefinedbutton.h.

QString QgsDataDefinedButton::verticalAnchorDesc ( )
static

Definition at line 799 of file qgsdatadefinedbutton.cpp.

Property Documentation

QString QgsDataDefinedButton::usageInfo
readwrite

Definition at line 49 of file qgsdatadefinedbutton.h.


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