I try show a html file in webview, but I surprised because me always get a blank page.
I generate a html file with my function call htmlgenerate(). The file is created with successful, but I don't know why webview just give me a blank page. If I use firefox for display my html file, everything is fine.
This is my code for display
Code:
void Dialog::showHtml() { htmlgenerate(); // save to QDir::tempPath ()+"/tahede.html" Viewer *lap0=new Viewer(this); lap0->reload(); lap0->exec(); }
Code:
{ //web is QWebView m_ui->web->setUrl(url); } void Viewer::reload() { m_ui->web->reload(); qDebug() << m_ui->web->url(); // result always QUrl( "about:blank" ) }
Btw, I always remove my html every close my application
Code:
{ }