summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/qstringlist/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/doc/snippets/qstringlist/main.cpp')
-rw-r--r--src/corelib/doc/snippets/qstringlist/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/corelib/doc/snippets/qstringlist/main.cpp b/src/corelib/doc/snippets/qstringlist/main.cpp
index d2175aafb5..1b7453cf6a 100644
--- a/src/corelib/doc/snippets/qstringlist/main.cpp
+++ b/src/corelib/doc/snippets/qstringlist/main.cpp
@@ -66,7 +66,7 @@ Widget::Widget(QWidget *parent)
result.clear();
//! [12]
- foreach (const QString &str, list) {
+ for (const auto &str : std::as_const(list)) {
if (str.contains("Bill"))
result += str;
}
@@ -93,6 +93,13 @@ Widget::Widget(QWidget *parent)
// list == ["Bill Clinton", "Bill Murray"]
//! [17]
+ {
+//! [18]
+ QStringList veryLongList;
+ QStringMatcher matcher(u"Straße", Qt::CaseInsensitive);
+ QStringList filtered = veryLongList.filter(matcher);
+//! [18]
+ }
}
int main(int argc, char *argv[])