qt qwebview usa setHtml();; después de mostrar el código html entrante, la imagen interna no se puede mostrar. ¿Cómo solucionarlo?
void QWebView::setHtml ( const QString & html, const QUrl & baseUrl = QUrl() )
Los objetos externos como hojas de estilo o imágenes a las que se hace referencia en el documento HTML se encuentran en diferentes ubicaciones.
//Ejemplo
#include
#include<.QtCore/QUrl>
#include
#include
#include
#include< QtWebKit/ QWebView>
int main(int argc,char*argv[])
{
aplicación QApplication (argc, argv);
ventana QMainWindow;
QWebView webview(&window);
QFile source(":/google.com.html");
source.open(QIODevice::ReadOnly);
webview.setHtml( QString::fromUtf8(source.readAll().constData()),QUrl(""));
window.setCentralWidget(&webview);
window.show();
return app.exec();
}
Referencia: .
/questions / 5126294/qwebview-no-carga-ningún-recurso-externo-si-carga-un-archivo-html-desde-qresou.