From bca35ce54a541991ff1e36a9bb2e0d436c757ed9 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 3 Oct 2017 15:40:01 +0200 Subject: Doc: add documentation to Dashboard example Task-number: QTBUG-60648 Change-Id: I79b9fdfde18041d95b7aa422bfb4d188ed907589 Reviewed-by: Mitch Curtis --- examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml | 10 ++++++---- examples/quickcontrols/extras/dashboard/qml/ValueSource.qml | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'examples/quickcontrols/extras') diff --git a/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml b/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml index b132510eb..c0fb67204 100644 --- a/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml +++ b/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml @@ -59,7 +59,7 @@ Item { property bool flashing: false scale: direction === Qt.LeftArrow ? 1 : -1 - +//! [1] Timer { id: flashTimer interval: 500 @@ -67,7 +67,8 @@ Item { repeat: true onTriggered: flashing = !flashing } - +//! [1] +//! [2] function paintOutlinePath(ctx) { ctx.beginPath(); ctx.moveTo(0, height * 0.5); @@ -79,7 +80,7 @@ Item { ctx.lineTo(0.6 * width, height); ctx.lineTo(0, height * 0.5); } - +//! [2] Canvas { id: backgroundCanvas anchors.fill: parent @@ -95,7 +96,7 @@ Item { ctx.stroke(); } } - +//! [3] Canvas { id: foregroundCanvas anchors.fill: parent @@ -111,4 +112,5 @@ Item { ctx.fill(); } } +//! [3] } diff --git a/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml b/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml index 7225be482..44913621a 100644 --- a/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml +++ b/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml @@ -49,7 +49,7 @@ ****************************************************************************/ import QtQuick 2.2 - +//! [0] Item { id: valueSource property real kph: 0 @@ -79,6 +79,7 @@ Item { property int turnSignal: gear == "P" && !start ? randomDirection() : -1 property real temperature: 0.6 property bool start: true +//! [0] function randomDirection() { return Math.random() > 0.5 ? Qt.LeftArrow : Qt.RightArrow; @@ -101,7 +102,7 @@ Item { SequentialAnimation { loops: Animation.Infinite - +//! [1] ParallelAnimation { NumberAnimation { target: valueSource @@ -120,6 +121,7 @@ Item { duration: 3000 } } +//! [1] ParallelAnimation { // We changed gears so we lost a bit of speed. NumberAnimation { -- cgit v1.2.3