diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-10-01 21:29:42 -0700 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-10-21 07:55:48 +0000 |
commit | 7362b321e5cf2053234bb711340cc1603e1ce812 (patch) | |
tree | 45eb18cdf2f2be72171bcc5efe41472ebdfc8401 /src | |
parent | a0d66b60b75cfe3d7580c7016959890693b2a132 (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...
Pick-to: 6.2
Change-Id: I2bbf422288924c198645fffd16aa1c58d921bd7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/text/qbytearraymatcher.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/corelib/text/qbytearraymatcher.cpp b/src/corelib/text/qbytearraymatcher.cpp index ca1791c18b..52c77bb267 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); @@ -157,6 +159,9 @@ QByteArrayMatcher::QByteArrayMatcher(const QByteArray &pattern) Constructs a byte array matcher that will search for \a pattern. Call indexIn() to perform a search. + + \note the data that \a pattern is referencing must remain valid while this + object is used. */ /*! |