summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/snippets/qstringlist/main.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/src/snippets/qstringlist/main.cpp b/doc/src/snippets/qstringlist/main.cpp
index d2d2afc281..8ca463371e 100644
--- a/doc/src/snippets/qstringlist/main.cpp
+++ b/doc/src/snippets/qstringlist/main.cpp
@@ -144,6 +144,21 @@ Widget::Widget(QWidget *parent)
list.replaceInStrings(QRegExp("^(.*), (.*)$"), "\\2 \\1");
// list == ["Bill Clinton", "Bill Murray"]
//! [15]
+
+ list.clear();
+//! [16]
+ list << "alpha" << "beta" << "gamma" << "epsilon";
+ list.replaceInStrings(QRegularExpression("^a"), "o");
+ // list == ["olpha", "beta", "gamma", "epsilon"]
+//! [16]
+
+ list.clear();
+//! [17]
+ list << "Bill Clinton" << "Murray, Bill";
+ list.replaceInStrings(QRegularExpression("^(.*), (.*)$"), "\\2 \\1");
+ // list == ["Bill Clinton", "Bill Murray"]
+//! [17]
+
}
int main(int argc, char *argv[])