diff options
Diffstat (limited to 'demos/declarative/webbrowser/content/UrlInput.qml')
-rw-r--r-- | demos/declarative/webbrowser/content/UrlInput.qml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/demos/declarative/webbrowser/content/UrlInput.qml b/demos/declarative/webbrowser/content/UrlInput.qml index 9ea1904..9992456 100644 --- a/demos/declarative/webbrowser/content/UrlInput.qml +++ b/demos/declarative/webbrowser/content/UrlInput.qml @@ -48,6 +48,7 @@ Item { property alias url: urlText.text signal urlEntered(string url) + signal urlChanged width: parent.height; height: parent.height @@ -69,14 +70,24 @@ Item { id: urlText horizontalAlignment: TextEdit.AlignLeft font.pixelSize: 14; focusOnPress: true + + onTextChanged: container.urlChanged() + Keys.onEscapePressed: { urlText.text = webView.url webView.focus = true } + + Keys.onEnterPressed: { + container.urlEntered(urlText.text) + webView.focus = true + } + Keys.onReturnPressed: { container.urlEntered(urlText.text) webView.focus = true } + anchors { left: parent.left; right: parent.right; leftMargin: 18; rightMargin: 18 verticalCenter: parent.verticalCenter |