summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2022-03-15 13:02:07 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2022-03-15 20:18:56 +0100
commit6eda249402d2b32c2ecb5f25cde490e2ddcad7a2 (patch)
tree8cdf74b938f617dd6033bd6f89abaffc035bb1e5 /src/gui/text
parente494b39b337b26c44e4474cfde78f20d721ce83b (diff)
Fix deprecated use of QBA/Q*String::count
'Use size() or length() instead' Change-Id: I284fce29727c4c1ec9ea38a4e8ea13a9e0af5390 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextengine.cpp2
-rw-r--r--src/gui/text/qtexthtmlparser.cpp2
-rw-r--r--src/gui/text/qtextodfwriter.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 9e294d083e..b8e1c8869a 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -3198,7 +3198,7 @@ QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const
for (const QTextOption::Tab &tabSpec : qAsConst(tabArray)) {
QFixed tab = QFixed::fromReal(tabSpec.position) * dpiScale;
if (tab > x) { // this is the tab we need.
- int tabSectionEnd = layoutData->string.count();
+ int tabSectionEnd = layoutData->string.length();
if (tabSpec.type == QTextOption::RightTab || tabSpec.type == QTextOption::CenterTab) {
// find next tab to calculate the width required.
tab = QFixed::fromReal(tabSpec.position);
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index 2494fa472c..bb15feabfa 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1525,7 +1525,7 @@ void QTextHtmlParserNode::applyBackgroundImage(const QString &url, const QTextDo
bool QTextHtmlParserNode::hasOnlyWhitespace() const
{
- for (int i = 0; i < text.count(); ++i)
+ for (int i = 0; i < text.length(); ++i)
if (!text.at(i).isSpace() || text.at(i) == QChar::LineSeparator)
return false;
return true;
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index e36061ee9d..4e3e8a6fd9 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -360,8 +360,8 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc
bool escapeNextSpace = true;
int precedingSpaces = 0;
int exportedIndex = 0;
- for (int i=0; i <= fragmentText.count(); ++i) {
- QChar character = (i == fragmentText.count() ? QChar() : fragmentText.at(i));
+ for (int i=0; i <= fragmentText.length(); ++i) {
+ QChar character = (i == fragmentText.length() ? QChar() : fragmentText.at(i));
bool isSpace = character.unicode() == ' ';
// find more than one space. -> <text:s text:c="2" />
@@ -377,7 +377,7 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc
exportedIndex = i;
}
- if (i < fragmentText.count()) {
+ if (i < fragmentText.length()) {
if (character.unicode() == 0x2028) { // soft-return
//if (exportedIndex < i)
writer.writeCharacters(fragmentText.mid(exportedIndex, i - exportedIndex));