From 8b0f8ab96a09964b5dbbca2d97859805a2414694 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 17 Jan 2023 17:24:46 +0200 Subject: [PATCH] QString: add note about isNull() vs. isEmpty() to more methods Namely compare() and operator==(). Change-Id: I7e404f2f1df5b93614f7e266bdbebe909e4e7623 Fixes: QTBUG-54505 Reviewed-by: Thiago Macieira (cherry picked from commit 5d0b338f4dec7bf457605a87330917818525d4b2) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/text/qstring.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 52a9c65fc8d..271af2b8751 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -3914,6 +3914,8 @@ QString &QString::replace(QChar c, QLatin1StringView after, Qt::CaseSensitivity Returns \c true if string \a s1 is equal to string \a s2; otherwise returns \c false. + \include qstring.cpp compare-isNull-vs-isEmpty + \sa {Comparing Strings} */ @@ -6287,6 +6289,11 @@ QString& QString::fill(QChar ch, qsizetype size) \snippet qstring/main.cpp 16 +//! [compare-isNull-vs-isEmpty] + \note This function treats null strings the same as empty strings, + for more details see \l {Distinction Between Null and Empty Strings}. +//! [compare-isNull-vs-isEmpty] + \sa operator==(), operator<(), operator>(), {Comparing Strings} */