Fix some syntax errors in snippets

- The following error occurs when trying to use these example codes:
"error: expected primary-expression before ‘!=’ token"
- Rename "map" to "hash" in the QHash snippet

Amends 7d542e1daf.

Pick-to: 6.6 6.5
Change-Id: I1ad5b799f444bf074dbfb44223c00770ecf456c7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
bb10
Szabolcs David 2023-06-06 15:19:42 +02:00
parent 8d127c5737
commit 4e367fa17b
3 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ while (i.hasNext()) {
//! [5]
for (auto i = set.cbegin(), end = set.cend(); != end; ++i)
for (auto i = set.cbegin(), end = set.cend(); i != end; ++i)
qDebug() << *i;
//! [5]

View File

@ -57,7 +57,7 @@ while (i.hasNext()) {
//! [8]
for (auto i = map.cbegin(), end = map.cend(); != end; ++i)
for (auto i = hash.cbegin(), end = hash.cend(); i != end; ++i)
cout << qPrintable(i.key()) << ": " << i.value() << endl;
//! [8]

View File

@ -57,7 +57,7 @@ while (i.hasNext()) {
//! [8]
for (auto i = map.cbegin(), end = map.cend(); != end; ++i)
for (auto i = map.cbegin(), end = map.cend(); i != end; ++i)
cout << qPrintable(i.key()) << ": " << i.value() << endl;
//! [8]