16 #ifndef QGSEXPRESSIONBUILDER_H 17 #define QGSEXPRESSIONBUILDER_H 20 #include "ui_qgsexpressionbuilder.h" 25 #include "QStandardItemModel" 26 #include "QStandardItem" 27 #include "QSortFilterProxyModel" 28 #include "QStringListModel" 48 mExpressionText = expressionText;
59 mExpressionText = expressionText;
106 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
132 void loadFieldNames();
134 void loadFieldNames(
const QgsFields& fields );
150 void setExpressionText(
const QString& expression );
179 bool highlightedItem =
false,
int sortOrder = 1 );
181 bool isExpressionValid();
183 void saveToRecent(
const QString& key );
185 void loadRecent(
const QString& key );
189 void newFunctionFile(
const QString& fileName =
"scratch" );
193 void saveFunctionFile(
QString fileName );
197 void loadCodeFromFile(
QString path );
201 void loadFunctionCode(
const QString& code );
205 void updateFunctionFileList(
const QString& path );
212 void loadSampleValues();
217 void loadAllValues();
232 void showContextMenu(
QPoint );
233 void setExpressionState(
bool state );
235 void operatorButtonClicked();
236 void on_btnRun_pressed();
237 void on_btnNewFile_pressed();
239 void on_expressionTree_doubleClicked(
const QModelIndex &index );
240 void on_txtExpressionString_textChanged();
241 void on_txtSearchEdit_textChanged();
242 void on_txtSearchEditValues_textChanged();
243 void on_lblPreview_linkActivated(
const QString& link );
244 void on_mValuesListView_doubleClicked(
const QModelIndex &index );
245 void on_txtPython_textChanged();
253 void expressionParsed(
bool isValid );
259 void runPythonCode(
const QString& code );
260 void updateFunctionTree();
261 void fillFieldValues(
const QString &fieldName,
int countLimit );
263 QString helpStylesheet()
const;
265 void loadExpressionContext();
277 bool mExpressionValid;
284 #endif // QGSEXPRESSIONBUILDER_H
QString getExpressionText() const
QString getHelpText() const
Get the help text that is associated with this expression item.
QgsExpressionItem(const QString &label, const QString &expressionText, const QString &helpText, QgsExpressionItem::ItemType itemType=ExpressionNode)
static const int CustomSortRole
Custom sort order role.
Container of fields for a vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
virtual void setData(const QVariant &value, int role)
Search proxy used to filter the QgsExpressionBuilderWidget tree.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QStandardItem * parent() const
QgsExpressionItem(const QString &label, const QString &expressionText, QgsExpressionItem::ItemType itemType=ExpressionNode)
General purpose distance and area calculator.
An expression item that can be used in the QgsExpressionBuilderWidget tree.
static const int ItemTypeRole
Item type role.
QModelIndex index() const
Represents a vector layer which manages a vector based data sets.
QgsExpressionItem::ItemType getItemType() const
Get the type of expression item eg header, field, ExpressionNode.
void setHelpText(const QString &helpText)
Set the help text for the current item.