summaryrefslogtreecommitdiffstats
path: root/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp')
-rw-r--r--src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp
index d0deed4cc8..9b15eeaa99 100644
--- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp
+++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp
@@ -145,19 +145,11 @@ bool QString::contains(const QRegularExpression &regexp) const;
//! [9]
-//! [10]
-std::bind(&QString::contains, QRegularExpression("^\\S+$")); // matches strings without whitespace
-//! [10]
-
-
-//! [11]
-bool contains(const QString &string)
-//! [11]
-
-
//! [12]
QStringList strings = ...;
-std::bind(static_cast<bool(QString::*)(const QRegularExpression&)>( &QString::contains ), QRegularExpression("..."));
+QFuture<QString> future = QtConcurrent::filtered(list, [](const QString &str) {
+ return str.contains(QRegularExpression("^\\S+$")); // matches strings without whitespace
+});
//! [12]
//! [13]