Re: [Qgis-developer] Socket server freezes on Python plugin

2012-06-19 Thread Víctor González
Hi, Good to know that =) I'll keep working on my plugin with PyQt. Thanks again for all the help! Víctor. 2012/6/19 G. Allegri > No problems with your basic example with pure python threading. The > problem is the interaction with the Qt event loop. That's why PyQt > threading is there ;) > >

Re: [Qgis-developer] Socket server freezes on Python plugin

2012-06-19 Thread G. Allegri
No problems with your basic example with pure python threading. The problem is the interaction with the Qt event loop. That's why PyQt threading is there ;) giovanni Inviato da dispositivo mobile Il giorno 19/giu/2012 12.50, "Víctor González" ha scritto: > > Hi again, > > I tried Bernhard's solu

Re: [Qgis-developer] Socket server freezes on Python plugin

2012-06-19 Thread Víctor González
Hi again, I tried Bernhard's solution and it worked like charm. After digging a little more into PyQt I found this thread [1] with some answers. Seems like QtNetworking deals with all this networking and threading issues internally, so my problem is solved that way. Regarding Giovanni's comments,

Re: [Qgis-developer] Socket server freezes on Python plugin

2012-06-19 Thread G. Allegri
> > The plugin server unfreezes even if you simply move the mouse over QGis > (wihtout doing any action on it). > This happens only if you move the mouse over the Canvas, while the server remains freezed while moving on other areas (TOC, toolbar, etc.) > It must be investigated... > > giovanni >

Re: [Qgis-developer] Socket server freezes on Python plugin

2012-06-19 Thread G. Allegri
I've tried it. I seems it depends on QGis not giving the plugin thread the option to serve while IDLE waiting for user interaction. The plugin server unfreezes even if you simply move the mouse over QGis (wihtout doing any action on it). It must be investigated... giovanni 2012/6/19 Víctor Gonzál

Re: [Qgis-developer] Socket server freezes on Python plugin

2012-06-19 Thread Bernhard Ströbl
Hi Victor, I happen to have done just that recently. I used QTcpServer, not sure if it is the best way to do it, but it works with QGIS 1.7.4 and 1.8. I think I used the PyQt examples. I hope it is of use. from PyQt4 import QtCore, QtGui, QtSql, QtNetwork class MyPlugin: def __init__(sel