[Qt-interest] How to design a "search and download" application in Qt with multiple threads in mind.

Sven Grunewaldt strayer at olle-orks.org
Fri Sep 10 17:24:21 CEST 2010


Hi, I'm currently trying to plan an application that scans multiple web
pages for images, puts them in a download queue and downloads these images.

I'm struggling with the design of the classes and such. My initial idea
was the following:

The applications main method fetches the pages and puts the source code
in a queue of some sort. This queue is processed by two threads which
parse each source code for images and put these in another queue. THIS
queue is processed by two threads which download the images.

So basically there is the following scheme: One/two thread(s) find
stuff, puts it into a queue, some other threads process this queue.
Now the problem is - I don't know how to do that with the existing Qt
classes. My hope was that I could just put a QQueue in the main class,
enqueue stuff I find and let some other threads read the QQueue with
parent()->queue->dequeue(), which I hoped to be blocking (which it is not).

After I realized I would not accomplish much with my current knowledge I
looked into my Qt book (the one by J. Blanchette and M. Summerfield) but
couldn't find help there, so I have to bore you guys with my noobish
question! :)

Can anyone give me some pointers where I need to start? I'm really
totally lost right now...

Regards,
Sven Grunewaldt



More information about the Qt-interest-old mailing list