Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
4.7.4
-
fc4cc4598e9f2f774fdc3622cab7e2eeb7e3a1fc
Description
The examples in the QtConcurrentRun documentation 'Using member functions' have errors (http://doc.qt.nokia.com/4.7/qtconcurrentrun.html#using-member-functions).
The example of calling QByteArray::split() has an extra bracket. It would also be nice for the split to actually happen (the bytearray would have a comma). This would work:
QByteArray bytearray = "hello, world"; QFuture<QList<QByteArray> > future = QtConcurrent::run(bytearray, &QByteArray::split, ','); ... QList<QByteArray> result = future.result();
The example of calling QImage::invertPixels is not doing anything to the image right now. A reference to the image should be given for the QtConcurrent::run:
QImage image = ...; QFuture<void> future = QtConcurrent::run(&image, &QImage::invertPixels, QImage::InvertRgba); ... future.waitForFinished();