summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/code/src_corelib_tools_qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/doc/snippets/code/src_corelib_tools_qstring.cpp')
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qstring.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qstring.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qstring.cpp
index 9b3e89e5c4..4e79d1e27a 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qstring.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qstring.cpp
@@ -102,3 +102,21 @@ QString plain = "#include <QtCore>"
QString html = plain.toHtmlEscaped();
// html == "#include &lt;QtCore&gt;"
//! [7]
+
+//! [8]
+QString str("ab");
+str.repeated(4); // returns "abababab"
+//! [8]
+
+//! [9]
+// hasAttribute takes a QString argument
+if (node.hasAttribute("http-contents-length")) //...
+//! [9]
+
+//! [10]
+if (node.hasAttribute(QStringLiteral(u"http-contents-length"))) //...
+//! [10]
+
+//! [11]
+if (attribute.name() == QLatin1String("http-contents-length")) //...
+//! [11]