summaryrefslogtreecommitdiffstats
path: root/src/concurrent/qtconcurrentfilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/concurrent/qtconcurrentfilter.cpp')
-rw-r--r--src/concurrent/qtconcurrentfilter.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/concurrent/qtconcurrentfilter.cpp b/src/concurrent/qtconcurrentfilter.cpp
index 22a1243c18..ab0227983d 100644
--- a/src/concurrent/qtconcurrentfilter.cpp
+++ b/src/concurrent/qtconcurrentfilter.cpp
@@ -40,15 +40,10 @@
****************************************************************************/
/*!
- \headerfile <QtConcurrentFilter>
+ \page qtconcurrentfilter.html
\title Concurrent Filter and Filter-Reduce
\ingroup thread
- \brief The <QtConcurrentFilter> header provides concurrent Filter and
- Filter-Reduce.
-
- These functions are a part of the \l {Qt Concurrent} framework.
-
The QtConcurrent::filter(), QtConcurrent::filtered() and
QtConcurrent::filteredReduced() functions filter items in a sequence such
as a QList or a QVector in parallel. QtConcurrent::filter() modifies a
@@ -56,6 +51,8 @@
containing the filtered content, and QtConcurrent::filteredReduced()
returns a single result.
+ These functions are a part of the \l {Qt Concurrent} framework.
+
Each of the above functions have a blocking variant that returns the final
result instead of a QFuture. You use them in the same way as the
asynchronous variants.
@@ -155,15 +152,11 @@
\section2 Using Bound Function Arguments
- Note that Qt does not provide support for bound functions. This is
- provided by 3rd party libraries like
- \l{http://www.boost.org/libs/bind/bind.html}{Boost} or
- \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf}
- {C++ TR1 Library Extensions}.
-
If you want to use a filter function takes more than one argument, you can
- use boost::bind() or std::tr1::bind() to transform it onto a function that
- takes one argument.
+ use std::bind() to transform it onto a function that takes one argument. If
+ C++11 support is not available, \l{http://www.boost.org/libs/bind/bind.html}
+ {boost::bind()} or \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf}
+ {std::tr1::bind()} are suitable replacements.
As an example, we use QString::contains():
@@ -177,7 +170,7 @@
\snippet code/src_concurrent_qtconcurrentfilter.cpp 10
- The return value from boost::bind() is a function object (functor) with
+ The return value from std::bind() is a function object (functor) with
the following signature:
\snippet code/src_concurrent_qtconcurrentfilter.cpp 11
@@ -190,7 +183,6 @@
/*!
\fn QFuture<void> QtConcurrent::filter(Sequence &sequence, FilterFunction filterFunction)
- \relates <QtConcurrentFilter>
Calls \a filterFunction once for each item in \a sequence. If
\a filterFunction returns \c true, the item is kept in \a sequence;
@@ -199,7 +191,6 @@
/*!
\fn QFuture<T> QtConcurrent::filtered(const Sequence &sequence, FilterFunction filterFunction)
- \relates <QtConcurrentFilter>
Calls \a filterFunction once for each item in \a sequence and returns a
new Sequence of kept items. If \a filterFunction returns \c true, a copy of
@@ -209,7 +200,6 @@
/*!
\fn QFuture<T> QtConcurrent::filtered(ConstIterator begin, ConstIterator end, FilterFunction filterFunction)
- \relates <QtConcurrentFilter>
Calls \a filterFunction once for each item from \a begin to \a end and
returns a new Sequence of kept items. If \a filterFunction returns \c true, a
@@ -219,7 +209,6 @@
/*!
\fn QFuture<T> QtConcurrent::filteredReduced(const Sequence &sequence, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions)
- \relates <QtConcurrentFilter>
Calls \a filterFunction once for each item in \a sequence. If
\a filterFunction returns \c true for an item, that item is then passed to
@@ -236,7 +225,6 @@
/*!
\fn QFuture<T> QtConcurrent::filteredReduced(ConstIterator begin, ConstIterator end, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions)
- \relates <QtConcurrentFilter>
Calls \a filterFunction once for each item from \a begin to \a end. If
\a filterFunction returns \c true for an item, that item is then passed to