You are creating your networkAccessManager in local scope thus the variable is allocated on the stack. It will be destroyed a soon as your fOpenSomething method finishes. And the actual loading of the webpage will occur only after a return to the event loop I guess. And by that time your NAM is gone. What you have to do, is to allocate your instance on the global heap with new. That allows a longer lifetime.
void FNavigateur::fOpenSomething{
NAM* nam = new NAM(this);
page = new QWebPage;
WebViewNavigateur->setPage(page);
page->setNetworkAccessManager(nam);
page
->mainFrame
()->load
(QUrl("http://google.com"));
}
void FNavigateur::fOpenSomething{
NAM* nam = new NAM(this);
page = new QWebPage;
WebViewNavigateur->setPage(page);
page->setNetworkAccessManager(nam);
page->mainFrame()->load(QUrl("http://google.com"));
}
To copy to clipboard, switch view to plain text mode
You also have to set a parent for the NAM so, that it will be deleted at some point.
Edit: Stampede was faster :->
HIH
Joh
Bookmarks