Re: [QGIS-Developer] Qt Model-View updates blocked when Python console not open

2017-10-11 Thread Peter Devoy
Hi guys Thank you all for your suggestions. Calls to print() triggering QCoreAppliation::processEvents() explains the phenomena and I was able to fix using the Boundless's QNetworkAccessManager wrapper instead of the requests library. Thanks again! Peter On 6 October 2017 at 07:41, Richard D

Re: [QGIS-Developer] Qt Model-View updates blocked when Python console not open

2017-10-05 Thread Richard Duivenvoorde
And to make things easier, use https://github.com/boundlessgeo/lib-qgis-commons/blob/master/qgiscommons2/network/networkaccessmanager.py which should be core class in QGIS if you ask me. So we can get rid of all other different blocking/nonproxying etc ways to connect QGIS to http... Regards,

Re: [QGIS-Developer] Qt Model-View updates blocked when Python console not open

2017-10-05 Thread Ricardo Filipe Soares Garcia da
Hi Peter In addition to Matthias' advice perhaps try using QNetworkAccessManager[1] and related classes in order to deal with your http requests asynchronously. This should fix the UI blocking issues. Best regards [1] - http://pyqt.sourceforge.net/Docs/PyQt4/qnetworkaccessmanager.html#details

Re: [QGIS-Developer] Qt Model-View updates blocked when Python console not open

2017-10-05 Thread Matthias Kuhn
Hi Peter, Have a look at this answer here, which explains how you can trigger the same behavior without using the print and relying on side-effects of the console open. It also outlines the risks involved in using this kind of approach. https://gis.stackexchange.com/a/257016 Cheers Matthias

Re: [QGIS-Developer] Qt Model-View updates blocked when Python console not open

2017-10-05 Thread Peter Devoy
Just a little update; it is the fact I am using print() to output debug information upon each request which is allowing the UI to repaint. Also, it seems that opening and closing the Python console once is enough. Peter 3XE P: 01326 567155 M: 07770 693662 A: 3XE Ltd Tremough Innovation Centre PE

[QGIS-Developer] Qt Model-View updates blocked when Python console not open

2017-10-04 Thread Peter Devoy
Hi all In my plugin I have extended QAbstractListModel to create a list of objects; each object in the list has a 'url' property containing the URL of an API resource. When the user selects a feature in main QGIS interface, each object in the list makes a HTTP request to its URL and updates its p