Skip to content

Instantly share code, notes, and snippets.

@penk
Created November 20, 2016 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penk/d3fa436ef3dd13fd4cf0b84f4af40c73 to your computer and use it in GitHub Desktop.
Save penk/d3fa436ef3dd13fd4cf0b84f4af40c73 to your computer and use it in GitHub Desktop.
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