Hi Etienne, On Thu, 19. Jul 2012 at 15:17:42 -0300, Etienne Tourigny wrote: > A more generic question - is there a way that we could implement a > generic mechanism for stopping a processing that takes forever, such > as > > - Identify tool in a *very* large vector layer > - unresponsive WMS server (when opened in the browser dock)
> I would like to be able to be able to cancel such actions, for example > wit the Esc key. Currently when this happens I have to kill the qgis > application which is rather extreme. > Would this require running processes in a thread, or is there a way QT > can listen for a specific event and cancel whatever is happening, > returning to a "inactive" application? Threads can help, if you can't avoid to block, but other things can be solved by switching from iterative processing to event driven processing (with or without threads). That's the "normal" way Qt does things, but as soon we leave the framework and turn to external APIs like GEOS, GDAL, libpq etc. the intended (or just the easiest) way there is iterative. And therefore lots of stuff in QGIS is also iteratively. There are even a few places where event driven Qt stuff is wrapped in a polling loop with QCoreApplication::processEvents(), when we need event driven Qt stuff within iterative loops. Although we could probably move all that blocking stuff into threads, that emit signals whenever a blocking iterative loop within the thread continues. So curring this would require major changes - also to the QGIS API. Add complexity and also introduce new pitfalls (eg. race conditions, locking...). BTW the threading branch was/is addressing some of these issues. Jürgen -- Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31 Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50 Software Engineer D-26506 Norden http://www.norbit.de committ(ed|ing) to Quantum GIS IRC: jef on FreeNode -- norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH Rheinstrasse 13, 26506 Norden GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502 _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
