diff options
-rw-r--r-- | doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp | 10 | ||||
-rw-r--r-- | src/corelib/concurrent/qtconcurrentrun.cpp | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp b/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp index 8f74461..cea6553 100644 --- a/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp +++ b/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp @@ -73,16 +73,14 @@ QFuture<QString> future = QtConcurrent::run(someFunction, bytearray); QString result = future.result(); //! [3] - //! [4] -// call 'QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const' in a separate thread -QString string = ...; -QFuture<QStringList> future = QtConcurrent::run(string, &QString::split, QString(", "), QString::KeepEmptyParts, Qt::CaseSensitive); +// call 'QList<QByteArray> QByteArray::split(char sep) const' in a separate thread +QByteArray bytearray = "hello world; +QFuture<QList<QByteArray> > future = QtConcurrent::run(bytearray, &QByteArray::split), ','); ... -QStringList result = future.result(); +QList<QByteArray> result = future.result(); //! [4] - //! [5] // call 'void QImage::invertPixels(InvertMode mode)' in a separate thread QImage image = ...; diff --git a/src/corelib/concurrent/qtconcurrentrun.cpp b/src/corelib/concurrent/qtconcurrentrun.cpp index 5a9c755..e80a204 100644 --- a/src/corelib/concurrent/qtconcurrentrun.cpp +++ b/src/corelib/concurrent/qtconcurrentrun.cpp @@ -99,7 +99,7 @@ functions; passing by pointer is useful for calling non-const member functions that modify the instance. - For example, calling QString::split() (a const member function) in a + For example, calling QByteArray::split() (a const member function) in a separate thread is done like this: \snippet doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp 4 |