Qt qwebview usa setHtml(); luego se muestra el código html entrante, pero ¿por qué no se muestra? ¿Cómo solucionarlo?
void q webview::set html(const QString & html, const QUrl & ampbaseUrl = QUrl())
Objetos externos a los que se hace referencia en el documento HTML (como hojas de estilo o imágenes ) posicionado en relación con baseUrl.
//Ejemplo
# incluir & ltQt core/q file & gt;
# incluir & ltQt core/QUrl & gt; p># incluir & ltQt GUI/q aplicación & gt;
# incluir & ltQt GUI/QMainWindow & gt;
# incluir & ltQt WebKit/QWebView & gt;
int main(int argc, char*argv[])
{
aplicación QApplication(argc, argv);
ventana QMainWindow;
Vista web QWebView(& ventana);
QFile source(":/Google . com . html ");
source open(QIODevice:: ReadOnly) ;
webview . set html(QString::from utf8(source . read all(). constData()), QUrl(" ");
setcentralwidget(& amp ; webview
window.show()
Devolver aplicación .
}
Referencias:
/questions/5126294/q webview-no-carga-cualquier-recurso-externo-si-carga-un-archivo-html-desde-qre sou