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>
bb10
Thiago Macieira 2021-10-01 21:29:42 -07:00 committed by Lars Knoll
parent a0d66b60b7
commit 7362b321e5
1 changed files with 9 additions and 4 deletions

View File

@ -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.
*/
/*!