
Originally Posted by
ChrisW67
Is your AVR generating realistic HTTP headers?
You're right. Actually there where no HTTP headers. I haven't even thought about It. I've modified server source code, and now It works just fine! But I've got one more question - can I use the same "QNetworkReply *NetRepl;" and "QNetworkAccessManager NetAccMan;" a couple times? I mean for example in two different functions:
void MainWindow::getXML1()
{
QNetworkRequest request
(QUrl("[my_address_1]"));
NetRepl = NetAccMan.get(request);
connect(NetRepl, SIGNAL(finished()), this, SLOT(parseXML()));
}
void MainWindow::getXML2()
{
QNetworkRequest request
(QUrl("[my_address_2]"));
NetRepl = NetAccMan.get(request);
connect(NetRepl, SIGNAL(finished()), this, SLOT(parseXML()));
}
void MainWindow::getXML1()
{
QNetworkRequest request(QUrl("[my_address_1]"));
NetRepl = NetAccMan.get(request);
connect(NetRepl, SIGNAL(finished()), this, SLOT(parseXML()));
}
void MainWindow::getXML2()
{
QNetworkRequest request(QUrl("[my_address_2]"));
NetRepl = NetAccMan.get(request);
connect(NetRepl, SIGNAL(finished()), this, SLOT(parseXML()));
}
To copy to clipboard, switch view to plain text mode
And ofcourse in parseXML() I will have:
void MainWindow::parseXML()
{
[...]
NetRepl->disconnect();
NetRepl->deleteLater();
}
void MainWindow::parseXML()
{
[...]
NetRepl->disconnect();
NetRepl->deleteLater();
}
To copy to clipboard, switch view to plain text mode
Would It (putting deleteLater() only once) be enough to get rid of all unused stuff after downloading XML content? Event If one function is triggered after other? I'm asking because class reference says this about deleteLater():
Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will not perform the deferred deletion; for the object to be deleted, the control must return to the event loop from which deleteLater() was called.
thanks in advance
best regards
Tomasz
Bookmarks