summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-18 11:33:26 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-18 11:33:26 (GMT)
commite6e60b096bb8b5e5073e32220c74810e80bf2d25 (patch)
treeca247002a4193d0deeee3b4be369e830c7b4f778 /doc/src/snippets
parent5a350be913139e2b994878c62ce06eb88604abbe (diff)
parentc23d4d6644bff2195fbb6aa84d3425dc2d31491a (diff)
downloadQt-e6e60b096bb8b5e5073e32220c74810e80bf2d25.zip
Qt-e6e60b096bb8b5e5073e32220c74810e80bf2d25.tar.gz
Qt-e6e60b096bb8b5e5073e32220c74810e80bf2d25.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: src/gui/graphicsview/qgraphicsitem_p.h
Diffstat (limited to 'doc/src/snippets')
-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]