IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QtConcurrent Namespace

The QtConcurrent namespace provides high-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives.

This namespace was introduced in Qt 4.4.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QtConcurrent Namespace

  • Header: QtConcurrent

  • Since: Qt 4.4

  • qmake: QT += concurrent

  • Group: QtConcurrent is part of thread

Detailed Description

See the Qt Concurrent module documentation for an overview of available functions, or see below for detailed information on each function.

Function Documentation

 

int QtConcurrent::run(Function, ...)

Equivalent to

 
Sélectionnez
QtConcurrent::run(QThreadPool::globalInstance(), function, ...);

Runs function in a separate thread. The thread is taken from the global QThreadPool. Note that function may not run immediately; function will only be run once a thread becomes available.

T is the same type as the return value of function. Non-void return values can be accessed via the QFuture::result() function.

The QFuture returned can only be used to query for the running/finished status and the return value of the function. In particular, canceling or pausing can be issued only if the computations behind the future has not been started.

See Also

See also Concurrent Run

[since 5.4] int QtConcurrent::run(int *, Function, ...)

Runs function in a separate thread. The thread is taken from the QThreadPool pool. Note that function may not run immediately; function will only be run once a thread becomes available.

T is the same type as the return value of function. Non-void return values can be accessed via the QFuture::result() function.

The QFuture returned can only be used to query for the running/finished status and the return value of the function. In particular, canceling or pausing can be issued only if the computations behind the future has not been started.

This function was introduced in Qt 5.4.

See Also

See also Concurrent Run

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+