| Quantum GIS API Documentation
    1.8
    | 
A reusable widget that can be used to build a expression string. More...
#include <qgsexpressionbuilderwidget.h>

| Public Slots | |
| void | currentChanged (const QModelIndex &index, const QModelIndex &) | 
| void | on_expressionTree_doubleClicked (const QModelIndex &index) | 
| void | on_txtExpressionString_textChanged () | 
| void | on_txtSearchEdit_textChanged () | 
| void | on_lblPreview_linkActivated (QString link) | 
| void | on_mValueListWidget_itemDoubleClicked (QListWidgetItem *item) | 
| void | operatorButtonClicked () | 
| void | showContextMenu (const QPoint &) | 
| void | loadSampleValues () | 
| void | loadAllValues () | 
| Signals | |
| void | expressionParsed (bool isValid) | 
| Emited when the user changes the expression in the widget. | |
| Public Member Functions | |
| QgsExpressionBuilderWidget (QWidget *parent) | |
| ~QgsExpressionBuilderWidget () | |
| void | setLayer (QgsVectorLayer *layer) | 
| Sets layer in order to get the fields and values. | |
| void | loadFieldNames () | 
| Loads all the field names from the layer. | |
| void | loadFieldNames (QgsFieldMap fields) | 
| QString | expressionText () | 
| Gets the expression string that has been set in the expression area. | |
| void | setExpressionText (const QString &expression) | 
| Sets the expression string for the widget. | |
| void | registerItem (QString group, QString label, QString expressionText, QString helpText="", QgsExpressionItem::ItemType type=QgsExpressionItem::ExpressionNode) | 
| Registers a node item for the expression builder. | |
| bool | isExpressionValid () | 
| Private Slots | |
| void | setExpressionState (bool state) | 
| Private Member Functions | |
| void | fillFieldValues (int fieldIndex, int countLimit) | 
| QString | loadFunctionHelp (QgsExpressionItem *functionName) | 
| Private Attributes | |
| QgsVectorLayer * | mLayer | 
| QStandardItemModel * | mModel | 
| QgsExpressionItemSearchProxy * | mProxyModel | 
| QMap< QString, QgsExpressionItem * > | mExpressionGroups | 
| QgsFeature | mFeature | 
| QgsExpressionHighlighter * | highlighter | 
| bool | mExpressionValid | 
A reusable widget that can be used to build a expression string.
See QgsExpressionBuilderDialog for exmaple of usage.
Definition at line 106 of file qgsexpressionbuilderwidget.h.
| QgsExpressionBuilderWidget::QgsExpressionBuilderWidget | ( | QWidget * | parent | ) | 
Definition at line 27 of file qgsexpressionbuilderwidget.cpp.
References QgsExpression::BuiltinFunctions(), currentChanged(), expressionParsed(), QgsExpression::functionCount(), highlighter, QgsExpression::FunctionDef::mGroup, mModel, QgsExpression::FunctionDef::mName, QgsExpression::FunctionDef::mParams, mProxyModel, operatorButtonClicked(), registerItem(), setExpressionState(), and showContextMenu().
Definition at line 94 of file qgsexpressionbuilderwidget.cpp.
| void QgsExpressionBuilderWidget::currentChanged | ( | const QModelIndex & | index, | 
| const QModelIndex & | |||
| ) |  [slot] | 
Definition at line 104 of file qgsexpressionbuilderwidget.cpp.
References QgsExpressionItem::Field, QgsExpressionItem::getItemType(), loadFunctionHelp(), mModel, and mProxyModel.
Referenced by QgsExpressionBuilderWidget().
| void QgsExpressionBuilderWidget::expressionParsed | ( | bool | isValid | ) |  [signal] | 
Emited when the user changes the expression in the widget.
Users of this widget should connect to this signal to decide if to let the user continue.
| isValid | Is true if the expression the user has typed is valid. | 
Referenced by on_txtExpressionString_textChanged(), and QgsExpressionBuilderWidget().
| QString QgsExpressionBuilderWidget::expressionText | ( | ) | 
Gets the expression string that has been set in the expression area.
Definition at line 223 of file qgsexpressionbuilderwidget.cpp.
| void QgsExpressionBuilderWidget::fillFieldValues | ( | int | fieldIndex, | 
| int | countLimit | ||
| ) |  [private] | 
Definition at line 167 of file qgsexpressionbuilderwidget.cpp.
References mLayer, and QgsVectorLayer::uniqueValues().
Referenced by loadAllValues(), and loadSampleValues().
Definition at line 218 of file qgsexpressionbuilderwidget.cpp.
References mExpressionValid.
| void QgsExpressionBuilderWidget::loadAllValues | ( | ) |  [slot] | 
Definition at line 357 of file qgsexpressionbuilderwidget.cpp.
References QgsVectorLayer::fieldNameIndex(), fillFieldValues(), mLayer, mModel, and mProxyModel.
Referenced by showContextMenu().
Loads all the field names from the layer.
Definition at line 141 of file qgsexpressionbuilderwidget.cpp.
References mLayer, and QgsVectorLayer::pendingFields().
| void QgsExpressionBuilderWidget::loadFieldNames | ( | QgsFieldMap | fields | ) | 
Definition at line 152 of file qgsexpressionbuilderwidget.cpp.
References QgsExpressionHighlighter::addFields(), QgsExpressionItem::Field, highlighter, QgsField::name(), and registerItem().
| QString QgsExpressionBuilderWidget::loadFunctionHelp | ( | QgsExpressionItem * | functionName | ) |  [private] | 
Definition at line 376 of file qgsexpressionbuilderwidget.cpp.
References QgsExpressionItem::Field, file, QgsExpressionItem::getItemType(), QgsApplication::pkgDataPath(), and QgsApplication::reportStyleSheet().
Referenced by currentChanged().
| void QgsExpressionBuilderWidget::loadSampleValues | ( | ) |  [slot] | 
Definition at line 343 of file qgsexpressionbuilderwidget.cpp.
References QgsVectorLayer::fieldNameIndex(), fillFieldValues(), mLayer, mModel, and mProxyModel.
Referenced by showContextMenu().
| void QgsExpressionBuilderWidget::on_expressionTree_doubleClicked | ( | const QModelIndex & | index | ) |  [slot] | 
Definition at line 126 of file qgsexpressionbuilderwidget.cpp.
References QgsExpressionItem::getExpressionText(), QgsExpressionItem::getItemType(), QgsExpressionItem::Header, mModel, and mProxyModel.
| void QgsExpressionBuilderWidget::on_lblPreview_linkActivated | ( | QString | link | ) |  [slot] | 
Definition at line 306 of file qgsexpressionbuilderwidget.cpp.
References QgsMessageViewer::setMessageAsHtml().
| void QgsExpressionBuilderWidget::on_mValueListWidget_itemDoubleClicked | ( | QListWidgetItem * | item | ) |  [slot] | 
Definition at line 315 of file qgsexpressionbuilderwidget.cpp.
| void QgsExpressionBuilderWidget::on_txtExpressionString_textChanged | ( | ) |  [slot] | 
Definition at line 233 of file qgsexpressionbuilderwidget.cpp.
References QgsExpression::evalErrorString(), QgsExpression::evaluate(), expressionParsed(), QgsVectorLayer::geometryType(), QgsExpression::hasEvalError(), QgsExpression::hasParserError(), QgsFeature::isValid(), mFeature, mLayer, QgsExpression::needsGeometry(), QgsVectorLayer::nextFeature(), QGis::NoGeometry, QgsExpression::parserErrorString(), QgsVectorLayer::pendingAllAttributesList(), QgsVectorLayer::pendingFields(), and QgsVectorLayer::select().
| void QgsExpressionBuilderWidget::on_txtSearchEdit_textChanged | ( | ) |  [slot] | 
Definition at line 297 of file qgsexpressionbuilderwidget.cpp.
References mProxyModel.
| void QgsExpressionBuilderWidget::operatorButtonClicked | ( | ) |  [slot] | 
Definition at line 320 of file qgsexpressionbuilderwidget.cpp.
Referenced by QgsExpressionBuilderWidget().
| void QgsExpressionBuilderWidget::registerItem | ( | QString | group, | 
| QString | label, | ||
| QString | expressionText, | ||
| QString | helpText = "", | ||
| QgsExpressionItem::ItemType | type = QgsExpressionItem::ExpressionNode | ||
| ) | 
Registers a node item for the expression builder.
| group | The group the item will be show in the tree view. If the group doesn't exsit it will be created. | 
| label | The label that is show to the user for the item in the tree. | 
| expressionText | The text that is inserted into the expression area when the user double clicks on the item. | 
| helpText | The help text that the user will see when item is selected. | 
| type | The type of the expression item. | 
Definition at line 195 of file qgsexpressionbuilderwidget.cpp.
References QgsExpressionItem::Header, mExpressionGroups, and mModel.
Referenced by loadFieldNames(), and QgsExpressionBuilderWidget().
| void QgsExpressionBuilderWidget::setExpressionState | ( | bool | state | ) |  [private, slot] | 
Definition at line 371 of file qgsexpressionbuilderwidget.cpp.
References mExpressionValid.
Referenced by QgsExpressionBuilderWidget().
| void QgsExpressionBuilderWidget::setExpressionText | ( | const QString & | expression | ) | 
Sets the expression string for the widget.
Definition at line 228 of file qgsexpressionbuilderwidget.cpp.
| void QgsExpressionBuilderWidget::setLayer | ( | QgsVectorLayer * | layer | ) | 
Sets layer in order to get the fields and values.
Definition at line 99 of file qgsexpressionbuilderwidget.cpp.
References mLayer.
| void QgsExpressionBuilderWidget::showContextMenu | ( | const QPoint & | pt | ) |  [slot] | 
Definition at line 326 of file qgsexpressionbuilderwidget.cpp.
References QgsExpressionItem::Field, QgsExpressionItem::getItemType(), loadAllValues(), loadSampleValues(), mModel, and mProxyModel.
Referenced by QgsExpressionBuilderWidget().
Definition at line 177 of file qgsexpressionbuilderwidget.h.
Referenced by loadFieldNames(), and QgsExpressionBuilderWidget().
| QMap<QString, QgsExpressionItem*> QgsExpressionBuilderWidget::mExpressionGroups  [private] | 
Definition at line 175 of file qgsexpressionbuilderwidget.h.
Referenced by registerItem().
| bool QgsExpressionBuilderWidget::mExpressionValid  [private] | 
Definition at line 178 of file qgsexpressionbuilderwidget.h.
Referenced by isExpressionValid(), and setExpressionState().
Definition at line 176 of file qgsexpressionbuilderwidget.h.
Referenced by on_txtExpressionString_textChanged().
| QgsVectorLayer* QgsExpressionBuilderWidget::mLayer  [private] | 
Definition at line 172 of file qgsexpressionbuilderwidget.h.
Referenced by fillFieldValues(), loadAllValues(), loadFieldNames(), loadSampleValues(), on_txtExpressionString_textChanged(), and setLayer().
| QStandardItemModel* QgsExpressionBuilderWidget::mModel  [private] | 
Definition at line 173 of file qgsexpressionbuilderwidget.h.
Referenced by currentChanged(), loadAllValues(), loadSampleValues(), on_expressionTree_doubleClicked(), QgsExpressionBuilderWidget(), registerItem(), and showContextMenu().
Definition at line 174 of file qgsexpressionbuilderwidget.h.
Referenced by currentChanged(), loadAllValues(), loadSampleValues(), on_expressionTree_doubleClicked(), on_txtSearchEdit_textChanged(), QgsExpressionBuilderWidget(), and showContextMenu().
 1.7.6.1
 1.7.6.1