summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-03-16 14:50:59 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2022-03-17 21:03:08 +0100
commit73e7fc2d8e6084af71ee31d88621305e0dc67b1d (patch)
tree331127094d3d6d59b2048ba1048db6e94aaa43ea
parentaec6b0075863bff181d1d3dfdf1399264de01f67 (diff)
Fix a few more {QString, QByteArray}::count() deprecation warnings
Change-Id: I0be2d5e7a8f6af3bc1077ae6d1f20cc5da8f2266 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp2
-rw-r--r--src/gui/util/qedidparser.cpp2
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring.cpp14
3 files changed, 12 insertions, 6 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index c119bee2fc..17248c8b3f 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -230,7 +230,7 @@ bool QLibraryPrivate::load_sys()
attempt = name;
int lparen = attempt.indexOf(QLatin1Char('('));
if (lparen == -1)
- lparen = attempt.count();
+ lparen = attempt.size();
attempt = path + prefixes.at(prefix) + attempt.insert(lparen, suffixes.at(suffix));
} else {
attempt = path + prefixes.at(prefix) + name + suffixes.at(suffix);
diff --git a/src/gui/util/qedidparser.cpp b/src/gui/util/qedidparser.cpp
index db5ccf1772..690f072d85 100644
--- a/src/gui/util/qedidparser.cpp
+++ b/src/gui/util/qedidparser.cpp
@@ -272,7 +272,7 @@ QString QEdidParser::parseEdidString(const quint8 *data)
buffer = buffer.replace('\r', '\0').replace('\n', '\0');
// Replace non-printable characters with dash
- for (int i = 0; i < buffer.count(); ++i) {
+ for (int i = 0; i < buffer.size(); ++i) {
if (buffer[i] < '\040' || buffer[i] > '\176')
buffer[i] = '-';
}
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
index 024bb6dab4..7743c13dc0 100644
--- a/tests/auto/corelib/text/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
@@ -976,7 +976,9 @@ void tst_QString::length()
QFETCH(QString, s1);
QTEST(s1.length(), "res");
QTEST(s1.size(), "res");
- QTEST(s1.count(), "res");
+#if QT_DEPRECATED_SINCE(6, 4)
+ QT_IGNORE_DEPRECATIONS(QTEST(s1.count(), "res");)
+#endif
}
#include <qfile.h>
@@ -1905,7 +1907,9 @@ void tst_QString::count()
QCOMPARE(a.count( QStringView(), Qt::CaseInsensitive), 16);
QString nullStr;
- QCOMPARE(nullStr.count(), 0);
+#if QT_DEPRECATED_SINCE(6, 4)
+ QT_IGNORE_DEPRECATIONS(QCOMPARE(nullStr.count(), 0);)
+#endif
QCOMPARE(nullStr.count('A'), 0);
QCOMPARE(nullStr.count("AB"), 0);
QCOMPARE(nullStr.count(view), 0);
@@ -1919,7 +1923,9 @@ void tst_QString::count()
#endif
QString emptyStr("");
- QCOMPARE(emptyStr.count(), 0);
+#if QT_DEPRECATED_SINCE(6, 4)
+ QT_IGNORE_DEPRECATIONS(QCOMPARE(emptyStr.count(), 0);)
+#endif
QCOMPARE(emptyStr.count('A'), 0);
QCOMPARE(emptyStr.count("AB"), 0);
QCOMPARE(emptyStr.count(view), 0);
@@ -6500,7 +6506,7 @@ void tst_QString::arg_fillChar()
QFETCH(IntList, widths);
QFETCH(QString, fillChars);
QFETCH(QString, expected);
- QCOMPARE(replaceValues.count(), fillChars.count());
+ QCOMPARE(replaceValues.count(), fillChars.size());
QCOMPARE(replaceValues.count(), widths.count());
QString actual = pattern;