diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-06-18 15:31:28 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-06-18 15:31:28 (GMT) |
commit | 1fa6b99c373e0dab9e0a0b7f190e3085190be668 (patch) | |
tree | 1c5181e125a7ebae7b10d8a3fbb53e1cf0e63b3a /doc/src/snippets/qstring/stringbuilder.cpp | |
parent | a18e5288324aa13da014ee52daffbfc589c87be3 (diff) | |
parent | f9f08de9d41fd55d9c7d01578191ef5d4099c9e6 (diff) | |
download | Qt-1fa6b99c373e0dab9e0a0b7f190e3085190be668.zip Qt-1fa6b99c373e0dab9e0a0b7f190e3085190be668.tar.gz Qt-1fa6b99c373e0dab9e0a0b7f190e3085190be668.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into qt-main/qgraphicssceneindex
Diffstat (limited to 'doc/src/snippets/qstring/stringbuilder.cpp')
-rw-r--r-- | doc/src/snippets/qstring/stringbuilder.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/src/snippets/qstring/stringbuilder.cpp b/doc/src/snippets/qstring/stringbuilder.cpp new file mode 100644 index 0000000..90803e2 --- /dev/null +++ b/doc/src/snippets/qstring/stringbuilder.cpp @@ -0,0 +1,28 @@ + +//! [0] + QString foo; + QString type = "long"; + + foo->setText(QLatin1String("vector<") + type + QLatin1String(">::iterator")); + + if (foo.startsWith("(" + type + ") 0x")) + ... +//! [0] + +//! [3] + #define QT_USE_FAST_CONCATENATION +//! [3] + +//! [4] + #define QT_USE_FAST_CONCATENATION + #define QT_USE_FAST_OPERATOR_PLUS +//! [4] + +//! [5] + #include <QStringBuilder> + + QString hello("hello"); + QStringRef el(&hello, 2, 3); + QLatin1String world("world"); + QString message = hello % el % world % QChar('!'); +//! [5] |