diff options
author | Kavindra Palaraja <kavindra.d@gmail.com> | 2015-07-14 21:33:34 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-07-22 20:20:12 +0000 |
commit | f8441c071fe52a4703692bdb334c019d3bdaa859 (patch) | |
tree | 49058c29f18ad3d50dce1857d255896b1b15b33f /src/gui | |
parent | 5f5db1c38b288441d02a68f1a095850b42585e04 (diff) |
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 <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
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. |