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
parent
8d127c5737
commit
4e367fa17b
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue