summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/qstring/stringbuilder.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-06-19 04:36:47 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-06-19 04:36:47 (GMT)
commitfbf9db1fc6b500bfe05fdfca121986687d73d5c6 (patch)
tree0ab6e8834aa4cf7068df121d7f2a1f290b8a2726 /doc/src/snippets/qstring/stringbuilder.cpp
parent4383d5a9dae96bb87f824088d1b565a2fad09b18 (diff)
parent7d8cd9b7c2f857b9e065d9eebd169d2299dcf35b (diff)
downloadQt-fbf9db1fc6b500bfe05fdfca121986687d73d5c6.zip
Qt-fbf9db1fc6b500bfe05fdfca121986687d73d5c6.tar.gz
Qt-fbf9db1fc6b500bfe05fdfca121986687d73d5c6.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'doc/src/snippets/qstring/stringbuilder.cpp')
-rw-r--r--doc/src/snippets/qstring/stringbuilder.cpp28
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]