简单代码:
#include <QCoreApplication>
#include <QGraphicsWebView>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
return a.exec();
}
Run Code Online (Sandbox Code Playgroud)
示例.pro:
QT += core gui declarative network webkit multimedia
TARGET = QTTest
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
Run Code Online (Sandbox Code Playgroud)
我得到的错误:
C1083: Cannot open include file: 'QGraphicsWebView': No such file or directory
Run Code Online (Sandbox Code Playgroud)
在行
QT += core gui declarative network webkit multimedia
Run Code Online (Sandbox Code Playgroud)
替换webkit为webkitwidgets:
QT += core gui declarative network webkitwidgets multimedia
Run Code Online (Sandbox Code Playgroud)