Skip to content

Instantly share code, notes, and snippets.

@penk

penk/webview.qml

Created Nov 20, 2016
Embed
What would you like to do?
import QtQuick 2.0
import QtWebKit 3.0
import QtQuick.Window 2.2
// DISPLAY=:0.0 qmlscene webview.qml
Window {
width: Screen.width
height: Screen.height
TextInput {
id: bar
anchors.bottom: parent.bottom
//text: 'http://events.miappi.com/lonelyplanet?reset=1'
text: 'http://google.com/ncr'
onAccepted: {
webview.url = text
}
}
WebView {
id: webview
anchors {
left: parent.left
right: parent.right
top: parent.top
bottom: bar.top
}
onLoadingChanged: {
if (loadRequest.status == WebView.LoadSucceededStatus)
bar.text = webview.url
}
url: bar.text
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment