aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/gallery/gallery.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quickcontrols2/gallery/gallery.qml')
-rw-r--r--examples/quickcontrols2/gallery/gallery.qml12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml
index 95fc739f..44090b8a 100644
--- a/examples/quickcontrols2/gallery/gallery.qml
+++ b/examples/quickcontrols2/gallery/gallery.qml
@@ -62,11 +62,13 @@ 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"
+ function help() {
+ let displayingControl = listView.currentIndex !== -1
+ let currentControlName = displayingControl
+ ? listView.model.get(listView.currentIndex).title.toLowerCase() : ""
+ let url = "https://doc.qt.io/qt-5/"
+ + (displayingControl
+ ? "qml-qtquick-controls2-" + currentControlName + ".html"
: "qtquick-controls2-qmlmodule.html");
Qt.openUrlExternally(url)
}