QxtJob Class Reference
[QxtCore module]

Execute a Job on a QThread. once or multiple times. More...

 #include <QxtJob>

Inherits QObject.

Public Functions

Protected Functions

Signals


Detailed Description

QxtJob allows easily starting jobs on different threads.
exec() will ask for the QThread to run the job on. The Qthread needs an event loop. since version 4.4, QThread has a non pure run function with a default event loop, allowing easy deployment of jobs.

QThread thread;
thread.start();
LockJob().exec(&thread);

Member Documentation

QxtJob ( )

default constructor




~QxtJob ( )

warning Warning: The destructor joins.
Means it blocks until the job is finished




void exec ( QThread * onthread )

execute the Job on onthread




void join ( )

block until the Job finished
Note that the current thread will be blocked.
If you use this, you better be damn sure you actually want a thread.
Maybe you actualy want to use QxtSignalWaiter.




virtual void run ( ) =0

This function is called by QxtJob.
reimplemented this function to do useful work.
Returning from this method will end the execution of the job.




void done ( )

This signal is emitted, when the run() function returns.






Copyright © 2007 Qxt Foundation Trademarks
Qt Extension Library 0.4