diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-02-23 20:20:36 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-02-26 01:31:07 +0100 |
commit | 3ec9331c341767b1430eb2b14df02383226e25e8 (patch) | |
tree | 3ae1b7d8e3c094d1c465980995ca9435cb289f7f /src/gui/text | |
parent | 08349ef0fe3902504987d12ebe0ed9674ed1e486 (diff) |
Text widgets: document find() behavior with QRegularExpression
The various find() overloads that take a QRE *ignore* the case
sensitivity option set on the QRE object itself. They instead apply the
case sensitivity passed in the flags (see QTextDocument::find).
I think it was an historic mishap, but it's too late to change now.
Amend the documentation.
Change-Id: I526650d89a98777c7bb839b27d2f2e536a43ca4f
Pick-to: 6.7 6.6 6.5 6.2 5.15
Fixes: QTBUG-88721
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 38279b3064..fc172c5057 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -1509,6 +1509,10 @@ static bool findInBlock(const QTextBlock &block, const QRegularExpression &expr, If the \a from position is 0 (the default) the search begins from the beginning of the document; otherwise it begins at the specified position. + + \warning For historical reasons, the case sensitivity option set on + \a expr is ignored. Instead, the \a options are used to determine + if the search is case sensitive or not. */ QTextCursor QTextDocument::find(const QRegularExpression &expr, int from, FindFlags options) const { |