Question about threading

Andreas Pakulat apaku at gmx.de
Fri Aug 20 07:12:43 UTC 2010


On 20.08.10 09:07:04, Syron wrote:
> I cannot figure out how to make my grepview plugin asynchronous. I currently
> have done the following:
> 
> The class GrepJob is derived from OutputJob and IStatus. The method start()
> calls "QTimer::singleShot( 0, this, SLOT(slotWork()) )", as suggested by the
> docs from Qt. In slotWork(), I have several calls to showProgres(...), but I
> still cannot get rid of the UI blocking.

You need to split up slotWork into chunks and each time a chunk is done,
start a new single-shot timer.

> I had a look at BackgroundParser, but cannot figure out how it works
> exactly.

That would be the wrong tool, its for language-support plugins parsing
their files.

Andreas

-- 
You're being followed.  Cut out the hanky-panky for a few days.




More information about the KDevelop-devel mailing list