summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
commit4ee4fc18b4067b90efa46ca9baba74f53b54d9ec (patch)
treecc68622c9b85992d99a8373ab55471ee821a4ebf /examples/widgets/tools/treemodelcompleter/mainwindow.cpp
parentab28ff2207e8f33754c79793089dbf943d67736d (diff)
parentebb49c66aaf22ed55d62ff7bc3690fce00b7d8ba (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into tqtc/lts-5.15-opensourcev5.15.8-lts-lgpl
Diffstat (limited to 'examples/widgets/tools/treemodelcompleter/mainwindow.cpp')
-rw-r--r--examples/widgets/tools/treemodelcompleter/mainwindow.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
index 302ccc436c..91cdaee229 100644
--- a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
+++ b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
@@ -206,7 +206,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString &fileName)
QRegularExpression re("^\\s+");
while (!file.atEnd()) {
- const QString line = QString::fromUtf8(file.readLine()).trimmed();
+ const QString line = QString::fromUtf8(file.readLine());
const QString trimmedLine = line.trimmed();
if (trimmedLine.isEmpty())
continue;
@@ -218,7 +218,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString &fileName)
level = 0;
} else {
const int capLen = match.capturedLength();
- level = line.startsWith(QLatin1Char('\t')) ? capLen / 4 : capLen;
+ level = capLen / 4;
}
if (level + 1 >= parents.size())
@@ -267,4 +267,3 @@ void MainWindow::updateContentsLabel(const QString &sep)
{
contentsLabel->setText(tr("Type path from model above with items at each level separated by a '%1'").arg(sep));
}
-