16,212
社区成员
发帖
与我相关
我的任务
分享
#include <QApplication>
#include <QWebView>
int main(int argc, char *argv[])
{
char *def_url = "./test.html";
char url[128];
QApplication a(argc, argv);
QWebView view;
view.setUrl(QUrl::fromLocalFile("/home/root/test.html"));
view.show();
return a.exec();
}
CONFIG += console
QT += core gui
QT += webkitwidgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = qt5webkit-test-app
TEMPLATE = app
SOURCES += main.cpp
<html>
<body>
<h1> h1 title </h1>
</body>
</html>