[PyQt] QNetworkAccessManager and "finished" signal
a.neumann at carto.net
Tue Apr 13 15:43:12 BST 2010
ok - this line was the cause. It works now:
Note the additional asterisk with the QNetworkReply as Lukas suggested.
QApplication.exec_: my app is actually a plugin in QGIS, not a standalone
app. Is the event loop also relevant in a plugin development context?
Anyway - it seems to work now. Thanks, Lukas and Mateusz for the quick
On Tue, April 13, 2010 4:04 pm, Lukas Hetzenecker wrote:
> please make sure that you have the event loop running (QApplication.exec_)
> and use finished(QNetworkReply *) instead of finished(QNetworkReply) as
> for the SIGNAL.
> Am Dienstag 13 April 2010 15:48:22 schrieb Andreas Neumann:
>> I am trying to fetch an image with the HTTP protocol, using the QNetwork
>> methods. I can see in my webserver log that the get request was made,
>> in my python script, the method that should be triggered by the "finish"
>> event never executes.
>> Here are the relevant parts of my code:
>> self.networkAccess = QNetworkAccessManager(self)
>> fotos/"+ uster_nr + ".jpg")))
>> def receiveFoto(self,networkReply):
>> QMessageBox.warning(None,"Debug","Received data")
>> byteArray = networkReply.readAll()
>> myImage = QImage.fromData(byteArray)
>> myPixmap = QPixmap.fromImage(myImage)
>> the "receiveFoto" method is never called, but I see the get request in
>> webserver log. Is there something wrong with my connect? Any other idea
>> why the receiveFoto method is never executed?
More information about the PyQt