Fix the doc example

The intention is to return list containing two items, not just one.

Change-Id: I96f3ce939f2ef6db6bdac5d9165bb7814ebfa91a
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This commit is contained in:
Jarek Kobus 2020-08-19 12:50:49 +02:00
parent 9260950552
commit 7773f7f90e

View File

@ -93,7 +93,7 @@ QString result = future.result();
//! [4] //! [4]
// call 'QList<QByteArray> QByteArray::split(char sep) const' in a separate thread // call 'QList<QByteArray> QByteArray::split(char sep) const' in a separate thread
QByteArray bytearray = "hello world"; QByteArray bytearray = "hello world";
QFuture<QList<QByteArray> > future = QtConcurrent::run(&QByteArray::split, bytearray, ','); QFuture<QList<QByteArray> > future = QtConcurrent::run(&QByteArray::split, bytearray, ' ');
... ...
QList<QByteArray> result = future.result(); QList<QByteArray> result = future.result();
//! [4] //! [4]