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" 49 mExpressionText = expressionText;
60 mExpressionText = expressionText;
108 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
138 void loadFieldNames();
140 void loadFieldNames(
const QgsFields& fields );
156 void setExpressionText(
const QString& expression );
185 bool highlightedItem =
false,
int sortOrder = 1 );
187 bool isExpressionValid();
193 void saveToRecent(
const QString& collection =
"generic" );
199 void loadRecent(
const QString& collection =
"generic" );
203 void newFunctionFile(
const QString& fileName =
"scratch" );
207 void saveFunctionFile(
QString fileName );
211 void loadCodeFromFile(
QString path );
215 void loadFunctionCode(
const QString& code );
219 void updateFunctionFileList(
const QString& path );
226 void loadSampleValues();
231 void loadAllValues();
246 void showContextMenu(
QPoint );
247 void setExpressionState(
bool state );
249 void operatorButtonClicked();
250 void on_btnRun_pressed();
251 void on_btnNewFile_pressed();
253 void on_expressionTree_doubleClicked(
const QModelIndex &index );
254 void on_txtExpressionString_textChanged();
255 void on_txtSearchEdit_textChanged();
256 void on_txtSearchEditValues_textChanged();
257 void on_lblPreview_linkActivated(
const QString& link );
258 void on_mValuesListView_doubleClicked(
const QModelIndex &index );
259 void on_txtPython_textChanged();
267 void expressionParsed(
bool isValid );
273 void runPythonCode(
const QString& code );
274 void updateFunctionTree();
275 void fillFieldValues(
const QString &fieldName,
int countLimit );
277 QString helpStylesheet()
const;
279 void loadExpressionContext();
293 bool highlightedItem =
false,
int sortOrder = 1 );
305 bool mExpressionValid;
312 #endif // QGSEXPRESSIONBUILDER_H
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::ItemType getItemType() const
Get the type of expression item eg header, field, ExpressionNode.
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.
QString getExpressionText() const
static const int ItemTypeRole
Item type role.
QModelIndex index() const
QString getHelpText() const
Get the help text that is associated with this expression item.
Represents a vector layer which manages a vector based data sets.
void setHelpText(const QString &helpText)
Set the help text for the current item.