summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-10-01 21:29:42 -0700
committerThiago Macieira <thiago.macieira@intel.com>2021-11-04 08:47:48 -0700
commitec186cddb98419282856dad6efb0f7110514bc0d (patch)
treee84ea219a60d656174754d0322d91c81b6ac9948 /src
parent753944998dbc00ef6c9fdbf63345e5aa6c3f9f38 (diff)
Doc: QByteArrayMatcher: add note that the pattern must remain on scope
This issue bit me. The API is surprising and very un-Qt-like... Change-Id: I2bbf422288924c198645fffd16aa1c58d921bd7e Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 7362b321e5cf2053234bb711340cc1603e1ce812)
Diffstat (limited to 'src')
-rw-r--r--src/corelib/text/qbytearraymatcher.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/text/qbytearraymatcher.cpp b/src/corelib/text/qbytearraymatcher.cpp
index 4292064de2..9e6d741c88 100644
--- a/src/corelib/text/qbytearraymatcher.cpp
+++ b/src/corelib/text/qbytearraymatcher.cpp
@@ -124,10 +124,12 @@ QByteArrayMatcher::QByteArrayMatcher()
}
/*!
- Constructs a byte array matcher from \a pattern. \a pattern
- has the given \a length. \a pattern must remain in scope, but
- the destructor does not delete \a pattern.
- */
+ Constructs a byte array matcher from \a pattern. \a pattern
+ has the given \a length. Call indexIn() to perform a search.
+
+ \note the data that \a pattern is referencing must remain valid while this
+ object is used.
+*/
QByteArrayMatcher::QByteArrayMatcher(const char *pattern, qsizetype length) : d(nullptr)
{
p.p = reinterpret_cast<const uchar *>(pattern);