注册 登录
编程论坛 QT论坛

在Qt-creator中找不到QWebView该如何做?

mch0dmin 发布于 2017-08-13 11:56, 4513 次点击
如题,谢谢大家!
1 回复
#2
songbinw2017-12-04 16:44
下载 Qt5.5.1 注意不要比这个版本高
代码:
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtWebKit 3.0
import QtQuick.Layouts 1.1

Rectangle {
    width: 1024
    height: 720
    ColumnLayout{
        spacing:2
        anchors.fill: parent
        RowLayout{
            spacing: 2
            TextInput{id: url;Layout.fillWidth: true;text: "http://www.baidu.com/"}
            Button{id: go;text: "Go";onClicked: webHtml.url=url.text}
            Keys.onReturnPressed: {go.clicked()}
        }
        ScrollView {
            Layout.fillWidth: true
            Layout.fillHeight: true
            WebView {
                id: webHtml
                anchors.fill: parent
            }
        }
    }
}
1