diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-01-09 11:33:12 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-01-10 10:04:09 +0100 |
commit | 492586930b4edbee5a8ab13de3fead9efa1b3e38 (patch) | |
tree | 9547b2b14d94b84b3a484a81baae532712e4afe6 /examples/quickcontrols2/gallery/gallery.qml | |
parent | ec686af14f817cc51323cfb01186f036905789c3 (diff) |
Gallery example: Add "Help" menu and shortcut
Add a property "control" identifying the control to be demo-ed
to the page and add a help shortcut and menu item displaying
its help.
Change-Id: Ic3c7c31f5a44fccd57ee018fd3681dc6bdffee58
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Diffstat (limited to 'examples/quickcontrols2/gallery/gallery.qml')
-rw-r--r-- | examples/quickcontrols2/gallery/gallery.qml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml index 44987ada..95fc739f 100644 --- a/examples/quickcontrols2/gallery/gallery.qml +++ b/examples/quickcontrols2/gallery/gallery.qml @@ -62,6 +62,15 @@ ApplicationWindow { visible: true title: "Qt Quick Controls 2" + function help() + { + var url = "https://doc.qt.io/qt-5/" + + (stackView.depth > 1 + ? "qml-qtquick-controls2-" + stackView.currentItem.control + ".html" + : "qtquick-controls2-qmlmodule.html"); + Qt.openUrlExternally(url) + } + Settings { id: settings property string style: "Default" @@ -73,6 +82,11 @@ ApplicationWindow { onActivated: navigateBackAction.trigger() } + Shortcut { + sequence: StandardKey.HelpContents + onActivated: help() + } + Action { id: navigateBackAction icon.name: stackView.depth > 1 ? "back" : "drawer" @@ -131,6 +145,10 @@ ApplicationWindow { onTriggered: settingsDialog.open() } Action { + text: "Help" + onTriggered: help() + } + Action { text: "About" onTriggered: aboutDialog.open() } |