QProgressDialog and QTConcurrent::run
Let say I want to download 100 pictures in multiple threads, but not 100. So I use something like:
the function called lookes like:
void loadPMapInThread( SDLM_DATA * data )
Now every time one of the threads finished one picture (map) it should send a signal to the main thread, so that this can update a QTProgressDialog. As far as I understand the signal slot system I would use emit inside of loadPMapInThread to send a signal and use a slot in the MainW to receive it and update the ProgressDialog. But what I don't understand is the function connect:
bool QObject::connect ( const QObject * sender, const char * signal, const QObject * receiver, const char * method, Qt::ConnectionType type = Qt::AutoConnection ) [static]
The receiver is MainW and method the receiving slot, signal is what I use with emit, but what do I set sender to? loadPMapInThread is not member of a class derrived from QObject.
And the same problem will ocure if I want to connect a signal to cancel the download when the cancel-Button of dthe QProgressDialog is pressed.
thanks, that looks fine. I finished programming it and did some tests.