Hi all,
I want to connect to a web service so i used QNetworkAccessManager, and it worked and i got the informations i wanted.
The problem is i want to reconnect to the web service every time to get the currents informations, i was thinking to use a thread to do this, but it doesn't work , the slot connecting to the finish of the QNetworkAccessManager is not invoked until the end of the thread.
This is the code i used to connect to the web service one time :
m_url.setUrl("http://time.jsontest.com/");
m_request.setUrl(m_url);
connect(&m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(onResult(QNetworkReply*)));
m_networkManager.get(m_request);
m_url.setUrl("http://time.jsontest.com/");
m_request.setUrl(m_url);
connect(&m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(onResult(QNetworkReply*)));
m_networkManager.get(m_request);
To copy to clipboard, switch view to plain text mode
Bookmarks