summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qplaintextedit.cpp
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@idiap.ch>2018-08-19 18:06:53 +0200
committerSamuel Gaist <samuel.gaist@idiap.ch>2018-10-08 13:53:42 +0000
commit5271b36672c18cf3c1e530adb6ce2fc85c44469c (patch)
tree844e49dc7e0099b6feb53f9045dbd653a16a3dc3 /src/widgets/widgets/qplaintextedit.cpp
parentd348363673e088da8d9fd10fa627529ade14a987 (diff)
Implement QRegularExpression overload for QPlainTextEdit::find
This patch adds the missing overload for QRegularExpression to match the QRegExp one for QPlainTextEdit. [ChangeLog][QtWidgets][QPlainTextEdit] Added QRegularExpression find() method overload. Change-Id: Id156971d3fa0372712bfa8b72a55550942a767e0 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qplaintextedit.cpp')
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index e54b28a045..36a150396c 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -2924,6 +2924,27 @@ bool QPlainTextEdit::find(const QRegExp &exp, QTextDocument::FindFlags options)
#endif
/*!
+ \fn bool QTextEdit::find(const QRegularExpression &exp, QTextDocument::FindFlags options)
+
+ \since 5.13
+ \overload
+
+ Finds the next occurrence, matching the regular expression, \a exp, using the given
+ \a options. The QTextDocument::FindCaseSensitively option is ignored for this overload,
+ use QRegularExpression::CaseInsensitiveOption instead.
+
+ Returns \c true if a match was found and changes the cursor to select the match;
+ otherwise returns \c false.
+*/
+#if QT_CONFIG(regularexpression)
+bool QPlainTextEdit::find(const QRegularExpression &exp, QTextDocument::FindFlags options)
+{
+ Q_D(QPlainTextEdit);
+ return d->control->find(exp, options);
+}
+#endif
+
+/*!
\fn void QPlainTextEdit::copyAvailable(bool yes)
This signal is emitted when text is selected or de-selected in the