每当我尝试创建新的 QWebView 时,构建后错误是
QWidget: Must construct a QApplication before a QPaintDevice
为什么会这样?
是的,我确实添加QT += webkit
到 pro 文件中,它在这里说
在 qwtconfig.pri 中
CONFIG += QwtDll 这一行必须是 ->
#CONFIG += QwtDll
qtwconfig.pri 在哪里?
FWI 我正在静态构建
这里是 main()
#include "MyWidget.h"
#include <QPlastiqueStyle>
#include <QtPlugin>
#include <QtWebKit/QWebView>
Q_IMPORT_PLUGIN(qico)
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.setStyle(new QPlastiqueStyle);
app.setFont(QFont("Calibri"));
MyWidget widget;
widget.show();
QWebView w;
w.show();
return app.exec();
}