From f8441c071fe52a4703692bdb334c019d3bdaa859 Mon Sep 17 00:00:00 2001 From: Kavindra Palaraja Date: Tue, 14 Jul 2015 21:33:34 +0200 Subject: Clarified the documentation for QTextDocument::find. QTextDocument::find has a behavior that is different from the typical QRegExp/QRegularExpression behavior where finding a given expression is always constrained by the paragraph (block), regardless of newline characters in the expression. Task-number: QTBUG-21785 Change-Id: Ia6a061c6feb5a19e6b8caa3d8009da5ca31ec422 Reviewed-by: Konstantin Ritt Reviewed-by: Simon Hausmann --- src/gui/text/qtextdocument.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index b4efc5a957..40cca77c26 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -1402,7 +1402,9 @@ static bool findInBlock(const QTextBlock &block, const QRegExp &expression, int /*! \overload - Finds the next occurrence, matching the regular expression, \a expr, in the document. + Finds the next occurrence that matches the given regular expression, + \a expr, within the same paragraph in the document. + The search starts at the given \a from position, and proceeds forwards through the document unless specified otherwise in the search options. The \a options control the type of search performed. The FindCaseSensitively @@ -1455,7 +1457,9 @@ QTextCursor QTextDocument::find(const QRegExp & expr, int from, FindFlags option /*! \overload - Finds the next occurrence, matching the regular expression, \a expr, in the document. + Finds the next occurrence that matches the given regular expression, + \a expr, within the same paragraph in the document. + The search starts at the position of the given from \a cursor, and proceeds forwards through the document unless specified otherwise in the search options. The \a options control the type of search performed. The FindCaseSensitively @@ -1526,7 +1530,9 @@ static bool findInBlock(const QTextBlock &block, const QRegularExpression &expre /*! \since 5.5 - Finds the next occurrence, matching the regular expression, \a expr, in the document. + Finds the next occurrence that matches the given regular expression, + \a expr, within the same paragraph in the document. + The search starts at the given \a from position, and proceeds forwards through the document unless specified otherwise in the search options. The \a options control the type of search performed. @@ -1579,7 +1585,9 @@ QTextCursor QTextDocument::find(const QRegularExpression &expr, int from, FindFl /*! \since 5.5 - Finds the next occurrence, matching the regular expression, \a expr, in the document. + Finds the next occurrence that matches the given regular expression, + \a expr, within the same paragraph in the document. + The search starts at the position of the given \a cursor, and proceeds forwards through the document unless specified otherwise in the search options. The \a options control the type of search performed. -- cgit v1.2.3