Answer the question
In order to leave comments, you need to log in
QWebView - how to load a page from html code (Qt)?
Failed to load:
//---------Scripts-----------
QString textScript ="<script>alert('Hello!');</script>";
//---------Styles------------
QString textStyle="<style>#title{font-size:20px;background-color:red;text-align:center;}</style>";
QString startText = "<html><head>"+textStyle+textScript+"</head><body><div id='title'>Hello!</div><br/>";
QString endText = "</body></html>";
QUrl baseUrl = QUrl::fromLocalFile( QDir::current().absoluteFilePath("mybinaryfile") );
QString htmlText = startText + " " + endText;
ui->webView->setHtml(htmlText, baseUrl);//Что за второй параметр?
C:\Qt\Tools\QtCreator\bin\Formula\mainwindow.cpp:154: ошибка: incomplete type 'QDir' used in nested name specifier
QUrl baseUrl = QUrl::fromLocalFile( QDir::current().absoluteFilePath("mybinaryfile") );
^
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question