QGIS API Documentation  2.8.2-Wien
 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 checkCheckedWidgets (bool check)
 Set siblings' checked property when data definition or expression is active.
void disableEnabledWidgets (bool disable)
 Set siblings' enabled property when data definition or expression is set/unset.
void setActive (bool active)
 Set whether the current data definition or expression is to be used.

Signals

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

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

Static Public Member Functions

static QString anyStringDesc ()
static QString blendModesDesc ()
static QString boolDesc ()
static QString capStyleDesc ()
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.
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.
void setField (QString field)
 Set the current defined field.
void setUseExpression (bool use)
 Set whether the current expression is to be used instead of field mapping.

Properties

QString usageInfo

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 = "" 
)

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

QString QgsDataDefinedButton::boolDesc ( )
static

Definition at line 608 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::capStyleDesc ( )
static

Definition at line 761 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 678 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::colorNoAlphaDesc ( )
static

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

QString QgsDataDefinedButton::customDashDesc ( )
static

Definition at line 778 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 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::double0to1Desc ( )
static

Definition at line 643 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::double180RotDesc ( )
static

Definition at line 653 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 648 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::filePathDesc ( )
static

Definition at line 712 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::fillStyleDesc ( )
static

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

QString QgsDataDefinedButton::gradientCoordModeDesc ( )
static

Definition at line 746 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::gradientSpreadDesc ( )
static

Definition at line 751 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::gradientTypeDesc ( )
static

Definition at line 741 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::horizontalAnchorDesc ( )
static

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

QString QgsDataDefinedButton::lineStyleDesc ( )
static

Definition at line 756 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::markerStyleDesc ( )
static

Definition at line 773 of file qgsdatadefinedbutton.cpp.

void QgsDataDefinedButton::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 195 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::paperOrientationDesc ( )
static

Definition at line 726 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::paperSizeDesc ( )
static

Definition at line 717 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::penJoinStyleDesc ( )
static

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

void QgsDataDefinedButton::setField ( QString  field)
inlineprotected

Set the current defined field.

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

QString QgsDataDefinedButton::svgPathDesc ( )
static

Definition at line 705 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::textHorzAlignDesc ( )
static

Definition at line 683 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::textVertAlignDesc ( )
static

Definition at line 688 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 663 of file qgsdatadefinedbutton.cpp.

QString QgsDataDefinedButton::unitsMmMuPercentDesc ( )
static

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

QString QgsDataDefinedButton::verticalAnchorDesc ( )
static

Definition at line 736 of file qgsdatadefinedbutton.cpp.

Property Documentation

QString QgsDataDefinedButton::usageInfo
readwrite

Definition at line 36 of file qgsdatadefinedbutton.h.


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