diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2014-03-26 18:56:33 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-03 21:52:13 +0200 |
commit | 3cb5203cb7a4bee9a867e8616c23ce635d6a8506 (patch) | |
tree | bdaf323e0fe9bc8fa3c3edacf2a002a5cd3df8d7 /tests/quicktestbrowser/quickwindow.qml | |
parent | b8403fa43730401e9d2ff378ff2c084373991cc3 (diff) |
Add history menu to the quicktestbrowser
Change-Id: Ibb5110eb013363f8a7ae386b6a3ccc45cc6ca0aa
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'tests/quicktestbrowser/quickwindow.qml')
-rw-r--r-- | tests/quicktestbrowser/quickwindow.qml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/quicktestbrowser/quickwindow.qml b/tests/quicktestbrowser/quickwindow.qml index 183e41f4f..0169215b0 100644 --- a/tests/quicktestbrowser/quickwindow.qml +++ b/tests/quicktestbrowser/quickwindow.qml @@ -114,6 +114,36 @@ ApplicationWindow { } } + Menu { + id: backHistoryMenu + + Instantiator { + model: currentWebView && currentWebView.experimental.navigationHistory.backItems + MenuItem { + text: model.title + onTriggered: currentWebView.experimental.goBackTo(index) + } + + onObjectAdded: backHistoryMenu.insertItem(index, object) + onObjectRemoved: backHistoryMenu.removeItem(object) + } + } + + Menu { + id: forwardHistoryMenu + + Instantiator { + model: currentWebView && currentWebView.experimental.navigationHistory.forwardItems + MenuItem { + text: model.title + onTriggered: currentWebView.experimental.goForwardTo(index) + } + + onObjectAdded: forwardHistoryMenu.insertItem(index, object) + onObjectRemoved: forwardHistoryMenu.removeItem(object) + } + } + toolBar: ToolBar { id: navigationBar RowLayout { @@ -124,6 +154,12 @@ ApplicationWindow { onClicked: currentWebView.goBack() enabled: currentWebView && currentWebView.canGoBack activeFocusOnTab: !browserWindow.platformIsMac + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + onClicked: backHistoryMenu.popup() + } } ToolButton { id: forwardButton @@ -131,6 +167,12 @@ ApplicationWindow { onClicked: currentWebView.goForward() enabled: currentWebView && currentWebView.canGoForward activeFocusOnTab: !browserWindow.platformIsMac + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + onClicked: forwardHistoryMenu.popup() + } } ToolButton { id: reloadButton |