summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qtextedit.cpp
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@idiap.ch>2018-08-19 18:05:55 +0200
committerSamuel Gaist <samuel.gaist@idiap.ch>2018-10-08 13:53:39 +0000
commitd348363673e088da8d9fd10fa627529ade14a987 (patch)
tree6fe3a85f5491fe9b0047357051af92e6c14a8e17 /src/widgets/widgets/qtextedit.cpp
parent0c8299462383b20ccaee1a43ec2acd264adf5640 (diff)
Implement QRegularExpression overload for QTextEdit::find
This patch adds the missing overload for QRegularExpression to match the QRegExp one for QTextEdit. [ChangeLog][QtWidgets][QTextEdit] Added QRegularExpression find() method overload. Change-Id: Ic7be224dcc59fc8d832daddd1999a713b7f04253 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qtextedit.cpp')
-rw-r--r--src/widgets/widgets/qtextedit.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index e3a45680ef..038d76a0fe 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -2534,6 +2534,27 @@ bool QTextEdit::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 QTextEdit::find(const QRegularExpression &exp, QTextDocument::FindFlags options)
+{
+ Q_D(QTextEdit);
+ return d->control->find(exp, options);
+}
+#endif
+
+/*!
\fn void QTextEdit::copyAvailable(bool yes)
This signal is emitted when text is selected or de-selected in the