summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text')
-rw-r--r--src/corelib/text/qbytearray.cpp8
-rw-r--r--src/corelib/text/qbytearray.h3
-rw-r--r--src/corelib/text/qstring.cpp5
-rw-r--r--src/corelib/text/qstring.h3
4 files changed, 14 insertions, 5 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp
index 62c52bbca1..a3254c9a72 100644
--- a/src/corelib/text/qbytearray.cpp
+++ b/src/corelib/text/qbytearray.cpp
@@ -2659,12 +2659,14 @@ qsizetype QByteArray::count(char ch) const
return static_cast<int>(countCharHelper(*this, ch));
}
+#if QT_DEPRECATED_SINCE(6, 4)
/*! \fn qsizetype QByteArray::count() const
-
+ \deprecated [6.4] Use size() or length() instead.
\overload
Same as size().
*/
+#endif
/*!
\fn int QByteArray::compare(QByteArrayView bv, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
@@ -4481,7 +4483,7 @@ static void q_fromPercentEncoding(QByteArray *ba, char percent)
const char *inputPtr = data;
qsizetype i = 0;
- qsizetype len = ba->count();
+ qsizetype len = ba->size();
qsizetype outlen = 0;
int a, b;
char c;
@@ -4584,7 +4586,7 @@ static void q_toPercentEncoding(QByteArray *ba, const char *dontEncode, const ch
return;
QByteArray input = *ba;
- qsizetype len = input.count();
+ qsizetype len = input.size();
const char *inputData = input.constData();
char *output = nullptr;
qsizetype length = 0;
diff --git a/src/corelib/text/qbytearray.h b/src/corelib/text/qbytearray.h
index d3b3c3ca6e..bacc023cdf 100644
--- a/src/corelib/text/qbytearray.h
+++ b/src/corelib/text/qbytearray.h
@@ -468,7 +468,10 @@ public:
inline std::string toStdString() const;
inline qsizetype size() const noexcept { return d->size; }
+#if QT_DEPRECATED_SINCE(6, 4)
+ QT_DEPRECATED_VERSION_X_6_4("Use size() or length() instead.")
inline qsizetype count() const noexcept { return size(); }
+#endif
inline qsizetype length() const noexcept { return size(); }
bool isNull() const noexcept;
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index c0fed806a6..1464763b05 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -4671,13 +4671,14 @@ qsizetype QString::count(const QRegularExpression &re) const
}
#endif // QT_CONFIG(regularexpression)
+#if QT_DEPRECATED_SINCE(6, 4)
/*! \fn qsizetype QString::count() const
-
+ \deprecated [6.4] Use size() or length() instead.
\overload count()
Same as size().
*/
-
+#endif
/*!
\enum QString::SectionFlag
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h
index 7b494ec2e3..b30f4ac981 100644
--- a/src/corelib/text/qstring.h
+++ b/src/corelib/text/qstring.h
@@ -466,7 +466,10 @@ public:
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QString)
void swap(QString &other) noexcept { d.swap(other.d); }
inline qsizetype size() const { return d.size; }
+#if QT_DEPRECATED_SINCE(6, 4)
+ QT_DEPRECATED_VERSION_X_6_4("Use size() or length() instead.")
inline qsizetype count() const { return d.size; }
+#endif
inline qsizetype length() const { return d.size; }
inline bool isEmpty() const;
void resize(qsizetype size);