各位大神好
我做了一个很简单的webview工程,但是为什么 没有页面响应?
运行出下面的提示:
QML debugging is enabled. Only use this in a safe environment.
No native web view. Missing platform support?
我的qml代码:
import QtQuick 2.4
import QtQuick.Window 2.2
import QtWebView 1.0
import QtQuick.Controls 1.3
Rectangle{
id:webBase;
width: 1200;
height: 700;
WebView {
id: webVie1;
anchors.fill: parent;
url: ("https://www.baidu.com");
}
}
main.cpp代码:
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickView>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView viewer;
viewer.setResizeMode(QQuickView::SizeRootObjectToView);
viewer.setSource(QUrl("qrc:/main.qml"));
viewer.show();
return app.exec();
}
问题出来哪里呢??
谢谢各位专家帮忙啊~
------解决思路----------------------
import QtWebKit 3.0 而不是QtWebview1.0