59future.waitForFinished();
118 promise.addResult(
"Hello");
119 promise.addResult(
"world");
130 for (
int i = 0;
i < 100; ++
i) {
131 promise.suspendIfRequested();
132 if (promise.isCanceled())
136 const int res = ... ;
137 promise.addResult(
res);
156 promise.setProgressRange(0, 100);
158 for (
int i = 0;
i < 100; ++
i) {
160 const int part = ... ;
162 promise.setProgressValue(
i);
164 promise.addResult(
result);
170 qDebug() <<
"current progress:" << progress;
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays.
void progressValueChanged(int progressValue)
QList< T > results() const
void invertPixels(InvertMode=InvertRgb)
Inverts all pixel values in the image.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
QTCONCURRENT_RUN_NODISCARD auto run(QThreadPool *pool, Function &&f, Args &&...args)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLuint GLuint GLuint GLuint arg1
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
GLenum GLenum GLenum input
static void addOne(int &n)
[6]
void aFunctionWithArguments(int arg1, double arg2, const QString &string)
[explicit-pool-0]
QFuture< void > future
[5]
QString functionReturningAString()
[1]
void helloWorldFunction(QPromise< QString > &promise)
[10]
QFutureWatcher< int > watcher
void operator()(QPromise< double > &)
void operator()(QPromise< int > &)