QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
|
Helper methods to locate expressions within text editors. More...
#include <qgsexpressionfinder.h>
Static Public Member Functions | |
static QString | findAndSelectActiveExpression (QgsCodeEditor *editor, const QString &pattern=QString()) |
Find the expression under the cursor in the given editor and select it. | |
static QString | findAndSelectActiveExpression (QPlainTextEdit *editor, const QString &pattern=QString()) |
Find the expression under the cursor in the given editor and select it. | |
static QString | findAndSelectActiveExpression (QTextEdit *editor, const QString &pattern=QString()) |
Find the expression under the cursor in the given editor and select it. | |
static void | findExpressionAtPos (const QString &text, int startSelectionPos, int endSelectionPos, int &start, int &end, QString &expression, const QString &pattern=QString()) |
Find an expression at the given position in the given text. | |
Helper methods to locate expressions within text editors.
Definition at line 36 of file qgsexpressionfinder.h.
|
static |
Find the expression under the cursor in the given editor and select it.
If an expression is found, it is returned (excluding the surrounding [% %] characters) Otherwise, the selection is kept unchanged and the selected text is returned
Definition at line 63 of file qgsexpressionfinder.cpp.
|
static |
Find the expression under the cursor in the given editor and select it.
If an expression is found, it is returned (excluding the surrounding [% %] characters) Otherwise, the selection is kept unchanged and the selected text is returned
Definition at line 98 of file qgsexpressionfinder.cpp.
|
static |
Find the expression under the cursor in the given editor and select it.
If an expression is found, it is returned (excluding the surrounding [% %] characters) Otherwise, the selection is kept unchanged and the selected text is returned
Definition at line 79 of file qgsexpressionfinder.cpp.
|
static |
Find an expression at the given position in the given text.
If an expression is found, start and end are set to the position of the opening and closing brakets of the expression, and expression is set to the trimmed expression (excluding the surrounding [% %] characters)
Otherwise, start and end are set to startSelectionPos and endSelectionPos and expression is set to the selected text
Optionally, a custom regex pattern can be used to find the expression. This pattern must contain a capture group to extract the expression from the match.
Definition at line 26 of file qgsexpressionfinder.cpp.