[Qt-interest] Troubles with QNetworkAccessManager

Lars Andersson lars.andersson at galder.se
Tue May 10 21:06:53 CEST 2011


Hello!



I have a program that makes some requests against a web page using
QNetworkAccessManager::get. The finished signal in the
QNetworkAccessManager is connected to a slot in the same class as the
QNetworkAccessManager is instantiated.




The program runs without problems on Linux but on Windows I am getting
the following errors.




QObject::connect: Cannot connect (null)::aboutToQuit() to
QNativeWifiEngine::closeHandle()


QObject::startTimer: QTimer can only be used with threads started with
QThread



The slot that the finished signal is connected to is never called but
the program continues running.



I am guessing it has something to do with the fact that
QNetworkAccessManager is using asynchronous calls and that the threads
that are used to make the asynchronous calls are started without
QThread?



I am able to reproduce the problem with this minimal application.





#include<QtCore/QCoreApplication>

#include<QtNetwork/QNetworkAccessManager>
#include<QtNetwork/QNetworkRequest>

#include<QUrl>



intmain(intargc,char*argv[])

{

QCoreApplicationa(argc,argv);



QNetworkAccessManagernetworkAccessManager;



networkAccessManager.get(QNetworkRequest(QUrl("http://www.google.se")));



returna.exec();

}







Have anyone encountered this problem before?




Regards,

Lars Andersson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110510/b40ba425/attachment.html 


More information about the Qt-interest-old mailing list