diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/quickcontrols2/gallery/gallery.qml | 20 | ||||
-rw-r--r-- | examples/quickcontrols2/texteditor/documenthandler.cpp | 2 | ||||
-rw-r--r-- | examples/quickcontrols2/texteditor/documenthandler.h | 1 |
3 files changed, 22 insertions, 1 deletions
diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml index 44987ada..44090b8a 100644 --- a/examples/quickcontrols2/gallery/gallery.qml +++ b/examples/quickcontrols2/gallery/gallery.qml @@ -62,6 +62,17 @@ ApplicationWindow { visible: true title: "Qt Quick Controls 2" + 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) + } + Settings { id: settings property string style: "Default" @@ -73,6 +84,11 @@ ApplicationWindow { onActivated: navigateBackAction.trigger() } + Shortcut { + sequence: StandardKey.HelpContents + onActivated: help() + } + Action { id: navigateBackAction icon.name: stackView.depth > 1 ? "back" : "drawer" @@ -131,6 +147,10 @@ ApplicationWindow { onTriggered: settingsDialog.open() } Action { + text: "Help" + onTriggered: help() + } + Action { text: "About" onTriggered: aboutDialog.open() } diff --git a/examples/quickcontrols2/texteditor/documenthandler.cpp b/examples/quickcontrols2/texteditor/documenthandler.cpp index 5def1b61..e840d411 100644 --- a/examples/quickcontrols2/texteditor/documenthandler.cpp +++ b/examples/quickcontrols2/texteditor/documenthandler.cpp @@ -385,3 +385,5 @@ void DocumentHandler::setModified(bool m) if (m_document) m_document->textDocument()->setModified(m); } + +#include "moc_documenthandler.cpp" diff --git a/examples/quickcontrols2/texteditor/documenthandler.h b/examples/quickcontrols2/texteditor/documenthandler.h index 97e55658..1a34f0e0 100644 --- a/examples/quickcontrols2/texteditor/documenthandler.h +++ b/examples/quickcontrols2/texteditor/documenthandler.h @@ -170,7 +170,6 @@ private: int m_selectionEnd; QFont m_font; - int m_fontSize; QUrl m_fileUrl; }; |