summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-03-20 13:41:47 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-21 11:21:16 +0000
commit3cb9792777a41f6ab685472fa97708c9d6fb3c23 (patch)
treec7b66ceffd24deeb1ac572482d8dfd5397d7b1cd
parentbb27882c8f03a12fb2ffc1e8dd62296ef2f69d3e (diff)
Compile without warning after QString::count deprecation
Change-Id: Ie3a3f8833bf88716f3b13540e74ea7800c07234c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit 2d9eeed72084160c04d9d0dfe7a02528f3ed6e3d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/assistant/help/qhelpdbreader.cpp8
-rw-r--r--src/linguist/shared/xliff.cpp2
-rw-r--r--src/shared/qtgradienteditor/qtgradientmanager.cpp4
-rw-r--r--src/shared/qtpropertybrowser/qteditorfactory.cpp2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/assistant/help/qhelpdbreader.cpp b/src/assistant/help/qhelpdbreader.cpp
index 2d99a2a3c..142198b86 100644
--- a/src/assistant/help/qhelpdbreader.cpp
+++ b/src/assistant/help/qhelpdbreader.cpp
@@ -146,7 +146,7 @@ QString QHelpDBReader::qtVersionHeuristic() const
// We drop any non digit characters.
const QChar dot(QLatin1Char('.'));
QString tail;
- for (int i = nameSpace.count(); i > 0; --i) {
+ for (int i = nameSpace.size(); i > 0; --i) {
const QChar c = nameSpace.at(i - 1);
if (c.isDigit() || c == dot)
tail.prepend(c);
@@ -172,16 +172,16 @@ QString QHelpDBReader::qtVersionHeuristic() const
tail.chop(1);
if (tail.count(dot) == 0) {
- if (tail.count() > 5)
+ if (tail.size() > 5)
return tail;
// When we have 3 digits, we split it like: ABC -> A.B.C
// When we have 4 digits, we split it like: ABCD -> A.BC.D
// When we have 5 digits, we split it like: ABCDE -> A.BC.DE
const int major = tail.left(1).toInt();
- const int minor = tail.count() == 3
+ const int minor = tail.size() == 3
? tail.mid(1, 1).toInt() : tail.mid(1, 2).toInt();
- const int patch = tail.count() == 5
+ const int patch = tail.size() == 5
? tail.right(2).toInt() : tail.right(1).toInt();
return QString::fromUtf8("%1.%2.%3").arg(major).arg(minor).arg(patch);
diff --git a/src/linguist/shared/xliff.cpp b/src/linguist/shared/xliff.cpp
index ef380939e..f219f83b6 100644
--- a/src/linguist/shared/xliff.cpp
+++ b/src/linguist/shared/xliff.cpp
@@ -65,7 +65,7 @@ static QString dataType(const TranslatorMessage &m)
{
QByteArray fileName = m.fileName().toLatin1();
unsigned int extHash = 0;
- int pos = fileName.count() - 1;
+ int pos = fileName.size() - 1;
for (int pass = 0; pass < 4 && pos >=0; ++pass, --pos) {
if (fileName.at(pos) == '.')
break;
diff --git a/src/shared/qtgradienteditor/qtgradientmanager.cpp b/src/shared/qtgradienteditor/qtgradientmanager.cpp
index 2662221b5..84dcd4bd5 100644
--- a/src/shared/qtgradienteditor/qtgradientmanager.cpp
+++ b/src/shared/qtgradienteditor/qtgradientmanager.cpp
@@ -59,8 +59,8 @@ QString QtGradientManager::uniqueId(const QString &id) const
return id;
QString base = id;
- while (base.count() > 0 && base.at(base.count() - 1).isDigit())
- base = base.left(base.count() - 1);
+ while (base.size() > 0 && base.at(base.size() - 1).isDigit())
+ base = base.left(base.size() - 1);
QString newId = base;
int counter = 0;
while (m_idToGradient.contains(newId)) {
diff --git a/src/shared/qtpropertybrowser/qteditorfactory.cpp b/src/shared/qtpropertybrowser/qteditorfactory.cpp
index 31211333e..34dd0b865 100644
--- a/src/shared/qtpropertybrowser/qteditorfactory.cpp
+++ b/src/shared/qtpropertybrowser/qteditorfactory.cpp
@@ -1594,7 +1594,7 @@ void QtCharEdit::handleKeyEvent(QKeyEvent *e)
}
const QString text = e->text();
- if (text.count() != 1)
+ if (text.size() != 1)
return;
const QChar c = text.at(0);