aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/wearable/doc/src/qtquickcontrols-wearable.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quickcontrols/wearable/doc/src/qtquickcontrols-wearable.qdoc')
-rw-r--r--examples/quickcontrols/wearable/doc/src/qtquickcontrols-wearable.qdoc136
1 files changed, 48 insertions, 88 deletions
diff --git a/examples/quickcontrols/wearable/doc/src/qtquickcontrols-wearable.qdoc b/examples/quickcontrols/wearable/doc/src/qtquickcontrols-wearable.qdoc
index b6665003fd..4088a1f56e 100644
--- a/examples/quickcontrols/wearable/doc/src/qtquickcontrols-wearable.qdoc
+++ b/examples/quickcontrols/wearable/doc/src/qtquickcontrols-wearable.qdoc
@@ -7,6 +7,8 @@
\title Qt Quick Controls - Wearable Demo
\keyword Qt Quick Controls 2 - Wearable Demo
\ingroup qtquickcontrols-examples
+ \examplecategory {Embedded}
+ \examplecategory {Mobile}
\brief Demonstrates an application launcher designed for wearable devices.
\image qtquickcontrols-wearable.png
@@ -19,22 +21,17 @@
The main .qml file, \c wearable.qml, consists of an ApplicationWindow, a StackView
for a stack-based navigation model, and buttons for interactive navigation.
- \quotefromfile wearable/wearable.qml
- \skipuntil import "qml/Style"
- \printuntil id: window
- \dots
- \skipto header
- \printuntil id: homeButton
+ \snippet wearable/Wearable/Main.qml window start
+ \dots 4
+ \snippet wearable/Wearable/Main.qml stackview start
\dots 8
- \skipto onClicked
- \printuntil }
- \printuntil id: backButton
+ \snippet wearable/Wearable/Main.qml onLaunched connection
\dots 8
- \skipto onClicked
- \printuntil id: stackView
- \dots 8
- \skipuntil initialItem
- \printuntil /^\}/
+ \snippet wearable/Wearable/Main.qml stackview end
+ \snippet wearable/Wearable/Main.qml DemoMode
+ \snippet wearable/Wearable/Main.qml DemoModeIndicator
+ \snippet wearable/Wearable/Main.qml MouseArea
+ \snippet wearable/Wearable/Main.qml window end
\section1 Styling
@@ -44,79 +41,41 @@
singleton type for various styling attributes, such as fonts and colors.
\list
- \li \c qml/Style/PageIndicator.qml
- \li \c qml/Style/Slider.qml
- \li \c qml/Style/Switch.qml
- \li \c qml/Style/UIStyle.qml
+ \li \c WearableStyle/PageIndicator.qml
+ \li \c WearableStyle/Slider.qml
+ \li \c WearableStyle/Switch.qml
+ \li \c WearableStyle/UIStyle.qml
\endlist
The style is applied in \c main() in \c wearable.cpp:
\snippet wearable/wearable.cpp style
- The main benefit of using the built-in styling system is that the style selection
- is fully transparent to the application code. There is no need to import a specific
- folder that contains the styled controls. This way, the application can be run with
- other styles too.
-
- \section1 Custom Type
-
- The demo application contains a custom button type implemented in
- \c qml/NaviButton.qml. The navigation button is used as a home and back
- button in \c wearable.qml. \c NaviButton extends the AbstractButton type
- with properties that control the slide in and slide out transitions and
- the button image.
-
- \quotefromfile wearable/qml/NaviButton.qml
- \skipuntil import "Style"
- \printuntil id: image
- \dots 8
- \skipuntil }
- \printuntil background:
- \dots 8
- \skipto }
- \printuntil /^\}/
-
- \section1 Icons
-
- The demo ships a custom icon theme. The icons are bundled into the \c :/icons
- folder in the application's resources. The \c index.theme file lists the contents
- of the icon theme:
-
- \quotefile wearable/icons/wearable/index.theme
-
- Finally, the icon theme is selected in \c main():
-
- \snippet wearable/wearable.cpp icons
-
- The icons are used on the Launcher Page, which is presented below. See
- \l {Icons in Qt Quick Controls} for more details about icons and themes.
+ The main benefit of using the built-in styling system is that the style
+ selection is fully transparent to the application code. There is no need
+ to import a specific folder that contains the styled controls. This way,
+ the application can be run with other styles too.
\section1 Launcher Page
The application launcher is implemented using a circular PathView in
\c LauncherPage.qml. Each application is in a separate .qml file,
- which is added to the ListModel on the launcher page.
-
- \quotefromfile wearable/qml/LauncherPage.qml
- \skipto PathView
- \printuntil signal launched
- \dots
- \skipto ListModel
- \printuntil }
+ which are added to the ListModel on the launcher page. For some applications
+ a fallback option is provided to handle optional dependencies like QtLocation.
+
+ \snippet wearable/Wearable/LauncherPage.qml LauncherPage start
+ \dots 4
+ \snippet wearable/Wearable/LauncherPage.qml Model start
+ \snippet wearable/Wearable/LauncherPage.qml Model mid
\dots 8
- \printline ListElement
- \skipto "Settings"
- \printuntil delegate:
+ \snippet wearable/Wearable/LauncherPage.qml Model end
+ \snippet wearable/Wearable/LauncherPage.qml Delegate start
\dots 8
- \skipto icon.width
- \printuntil icon.name
+ \snippet wearable/Wearable/LauncherPage.qml Delegate mid
\dots 8
- \skipto onClicked:
- \printto path:
- \dots
- \skipto /^\}/
- \printline }
+ \snippet wearable/Wearable/LauncherPage.qml Delegate end
+ \dots 4
+ \snippet wearable/Wearable/LauncherPage.qml LauncherPage end
\section1 Applications
@@ -124,24 +83,25 @@
or communication means are typically offered by wearable devices.
Most applications have their own JavaScript files that act as dummy
- application backends. They illustrate fetching external data and help
- manipulating or converting the data. In the \c Navigation and \c Weather
- applications, data acquisition is implemented using \l XMLHttpRequest to
- read from local files. These files were generated by storing responses from
- remote servers in JSON format. This code can be easily modified to acquire
- data from remote servers.
+ application backends. They demonstrate how to fetch and manipulate or
+ convert external data. For example, the \c Weather application reads data
+ from local files using \l XMLHttpRequest. These files were generated by
+ storing responses from remote servers in JSON format. This code can be
+ easily modified to acquire data from remote servers.
\section2 Navigation
- This application displays a walking route from source to destination. This
- route information is obtained using the REST API provided by
- \l {https://www.openstreetmap.org/}. The API response is in JSON format, which
- is parsed using JavaScript by the application. Currently, it is not possible
- to specify the source and destination from within the application, but it can
- be added based on the device's capabilities. For example, user input
- could be implemented as screens with input fields, or can be communicated
- over Bluetooth/Wifi from a paired application running on another device
- such as a smart phone or PC.
+ This application uses the QtLocation module to display a route within Oslo.
+ If QtLocation is not installed, it shows a static image as the map and route
+ information based on a JSON file. Currently, it is not possible to specify
+ the source and destination from within the application, but it can be added
+ based on the device's capabilities. For example, you can collect necessary
+ info. using one of the following methods:
+ \list
+ \li Implement additional screens to collect input from user
+ \li Communicate with another device (smart phone or PC)
+ over Bluetooth or WiFi channels.
+ \endlist
\section2 Weather