Skip to content

Commit

Permalink
ch02: fix qmlbook#151
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Thelin committed May 12, 2022
1 parent 9a58b1d commit 3973643
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/ch02-start/app-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This first example demonstrates how you could add 2 constant strings. Admittedly

```cpp
// module or class includes
include <QtCore>
#include <QtCore>

// text stream is text-codec aware
QTextStream cout(stdout, QIODevice::WriteOnly);
Expand All @@ -26,7 +26,7 @@ int main(int argc, char** argv)
QString s2("London");
// string concatenation
QString s = s1 + " " + s2 + "!";
cout << s << endl;
cout << s << Qt::endl;
}
```
Expand All @@ -48,7 +48,7 @@ while(iter.hasNext()) {
cout << " ";
}
}
cout << "!" << endl;
cout << "!" << Qt::endl;
```

Here is a more advanced list function, that allows you to join a list of strings into one string. This is very handy when you need to proceed line based text input. The inverse (string to string-list) is also possible using the `QString::split()` function.
Expand All @@ -61,7 +61,7 @@ QStringList list;
list << s1 << s2;
// join strings
QString s = list.join(" ") + "!";
cout << s << endl;
cout << s << Qt::endl;
```
### File IO
Expand Down

0 comments on commit 3973643

Please sign in to comment.