diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 3dcb812a80..bb5c0fe4ee 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -3290,7 +3290,7 @@ QString &QString::remove(qsizetype pos, qsizetype len) if (pos < 0) // count from end of string pos += size(); - if (pos >= size() || len <= 0) + if (size_t(pos) >= size_t(size()) || len <= 0) return *this; len = std::min(len, size() - pos);