QGIS API Documentation
2.8.2-Wien
|
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 | loadAllValues () |
void | loadSampleValues () |
void | on_btnNewFile_pressed () |
void | on_btnRun_pressed () |
void | on_btnSaveFile_pressed () |
void | on_cmbFileNames_currentIndexChanged (int index) |
void | on_expressionTree_doubleClicked (const QModelIndex &index) |
void | on_lblPreview_linkActivated (QString link) |
void | on_mValueListWidget_itemDoubleClicked (QListWidgetItem *item) |
void | on_txtExpressionString_textChanged () |
void | on_txtSearchEdit_textChanged () |
void | operatorButtonClicked () |
void | showContextMenu (const QPoint &) |
Signals | |
void | expressionParsed (bool isValid) |
Emitted when the user changes the expression in the widget. |
Public Member Functions | |
QgsExpressionBuilderWidget (QWidget *parent) | |
~QgsExpressionBuilderWidget () | |
QString | expressionText () |
Gets the expression string that has been set in the expression area. | |
bool | isExpressionValid () |
void | loadCodeFromFile (QString path) |
Load code from the given file into the function editor. | |
void | loadFieldNames () |
Loads all the field names from the layer. | |
void | loadFieldNames (const QgsFields &fields) |
void | loadFunctionCode (QString code) |
Load code into the function editor. | |
void | loadRecent (QString key) |
void | newFunctionFile (QString fileName="scratch") |
Create a new file in the function editor. | |
void | registerItem (QString group, QString label, QString expressionText, QString helpText="", QgsExpressionItem::ItemType type=QgsExpressionItem::ExpressionNode) |
Registers a node item for the expression builder. | |
void | saveFunctionFile (QString fileName) |
Save the current function editor text to the given file. | |
void | saveToRecent (QString key) |
void | setExpressionText (const QString &expression) |
Sets the expression string for the widget. | |
void | setGeomCalculator (const QgsDistanceArea &da) |
Sets geometry calculator used in distance/area calculations. | |
void | setLayer (QgsVectorLayer *layer) |
Sets layer in order to get the fields and values. | |
void | updateFunctionFileList (QString path) |
Update the list of function files found at the given path. |
A reusable widget that can be used to build a expression string.
See QgsExpressionBuilderDialog for exmaple of usage.
Definition at line 107 of file qgsexpressionbuilderwidget.h.
QgsExpressionBuilderWidget::QgsExpressionBuilderWidget | ( | QWidget * | parent | ) |
Definition at line 31 of file qgsexpressionbuilderwidget.cpp.
QgsExpressionBuilderWidget::~QgsExpressionBuilderWidget | ( | ) |
Definition at line 87 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 99 of file qgsexpressionbuilderwidget.cpp.
|
signal |
Emitted 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. |
QString QgsExpressionBuilderWidget::expressionText | ( | ) |
Gets the expression string that has been set in the expression area.
Definition at line 428 of file qgsexpressionbuilderwidget.cpp.
bool QgsExpressionBuilderWidget::isExpressionValid | ( | ) |
Definition at line 325 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 577 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::loadCodeFromFile | ( | QString | path | ) |
Load code from the given file into the function editor.
Definition at line 201 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::loadFieldNames | ( | ) |
Loads all the field names from the layer.
Definition at line 242 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::loadFieldNames | ( | const QgsFields & | fields | ) |
Definition at line 252 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::loadFunctionCode | ( | QString | code | ) |
Load code into the function editor.
Definition at line 209 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::loadRecent | ( | QString | key | ) |
Definition at line 348 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 562 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::newFunctionFile | ( | QString | fileName = "scratch" | ) |
Create a new file in the function editor.
Definition at line 175 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 187 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 121 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 214 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 192 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 226 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 520 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 529 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 438 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 511 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 536 of file qgsexpressionbuilderwidget.cpp.
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 300 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::saveFunctionFile | ( | QString | fileName | ) |
Save the current function editor text to the given file.
Definition at line 137 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::saveToRecent | ( | QString | key | ) |
Definition at line 330 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::setExpressionText | ( | const QString & | expression | ) |
Sets the expression string for the widget.
Definition at line 433 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::setGeomCalculator | ( | const QgsDistanceArea & | da | ) |
Sets geometry calculator used in distance/area calculations.
Definition at line 423 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::setLayer | ( | QgsVectorLayer * | layer | ) |
Sets layer in order to get the fields and values.
Definition at line 94 of file qgsexpressionbuilderwidget.cpp.
|
slot |
Definition at line 545 of file qgsexpressionbuilderwidget.cpp.
void QgsExpressionBuilderWidget::updateFunctionFileList | ( | QString | path | ) |
Update the list of function files found at the given path.
Definition at line 160 of file qgsexpressionbuilderwidget.cpp.