QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsexpressionfinder.h
Go to the documentation of this file.
1/*********************************************************************************
2 qgsexpressionfinder.h - A helper class to locate expression in text editors
3 --------------------------------------
4 begin : September 2023
5 copyright : (C) 2023 by Yoann Quenach de Quivillic
6 email : yoann dot quenach at gmail dot com
7 *********************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 *********************************************************************************/
15
16#ifndef QGSEXPRESSIONFINDER_H
17#define QGSEXPRESSIONFINDER_H
18
19#include <QString>
20
21#include "qgis_sip.h"
22#include "qgis_gui.h"
23
24#define SIP_NO_FILE
25
26class QgsCodeEditor;
27class QTextEdit;
28class QPlainTextEdit;
29
36class GUI_EXPORT QgsExpressionFinder
37{
38 public:
53 static void findExpressionAtPos( const QString &text, int startSelectionPos, int endSelectionPos, int &start, int &end, QString &expression, const QString &pattern = QString() );
54
61 static QString findAndSelectActiveExpression( QgsCodeEditor *editor, const QString &pattern = QString() );
62
69 static QString findAndSelectActiveExpression( QTextEdit *editor, const QString &pattern = QString() );
70
77 static QString findAndSelectActiveExpression( QPlainTextEdit *editor, const QString &pattern = QString() );
78};
79
80#endif // QGSEXPRESSIONFINDER_H
A text editor based on QScintilla2.
Helper methods to locate expressions within text editors.