summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2016-09-30 14:04:03 +0200
committerKai Koehne <kai.koehne@qt.io>2016-10-04 11:40:13 +0000
commitecd3e42930eb7e0b1ec65010291f8fba23a9f163 (patch)
tree759e41e42e3466c32239c4b47691ad452543e21c /examples
parent7b0b30ace1115b71a408cceeff9f77f13554c333 (diff)
RecipeBrowser: Hide context menu
Change-Id: Ia7438535398aa9ae39d0c49e244c4cde05a55b89 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc5
-rw-r--r--examples/webengine/recipebrowser/resources/qml/main.qml5
2 files changed, 8 insertions, 2 deletions
diff --git a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc
index 5327a0b26..d33f6bf10 100644
--- a/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc
+++ b/examples/webengine/recipebrowser/doc/src/recipebrowser.qdoc
@@ -106,10 +106,11 @@
We then disable the \l{WebEngineSettings::focusOnNavigationEnabled}{focusOnNavigationEnabled}
setting to make sure that the \l{WebEngineView} does not steal focus from the \c RecipeList
item every time its URL is changed. This allows the user to continue navigating through the
- recipes using the keyboard.
+ recipes using the keyboard. We also disable the default context menu by accepting the
+ ContextMenuRequest.
\skipto focusOnNavigationEnabled
- \printuntil focusOnNavigationEnabled
+ \printto firstLoadComplete
When the application starts, instead of directly showing the \l{WebEngineView}, we show a
placeholder \l{Rectangle} with a \l{BusyIndicator} to provide a nicer user experience while the
diff --git a/examples/webengine/recipebrowser/resources/qml/main.qml b/examples/webengine/recipebrowser/resources/qml/main.qml
index 84067e8f5..b49cb6649 100644
--- a/examples/webengine/recipebrowser/resources/qml/main.qml
+++ b/examples/webengine/recipebrowser/resources/qml/main.qml
@@ -102,6 +102,11 @@ ApplicationWindow {
// Make sure focus is not taken by the web view, so user can continue navigating
// recipes with the keyboard.
settings.focusOnNavigationEnabled: false
+
+ onContextMenuRequested: function(request) {
+ request.accepted = true
+ }
+
property bool firstLoadComplete: false
onLoadingChanged: {
if (loadRequest.status === WebEngineView.LoadSucceededStatus