summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@digia.com>2013-11-28 13:44:10 +0100
committerGatis Paeglis <gatis.paeglis@digia.com>2014-01-30 15:10:02 +0200
commit25a4745f5e187ed9e11e9a3a76be6bc0d8bafa1e (patch)
tree5a90dad509ff0a87b04d7cb9fca4865668782f6d
parentb2957ef0efbf55872d36762705b62822cc828cf3 (diff)
Add Enterprise Controls demos to the qtlauncher
Change-Id: I4d8873343b47157e0d5733129c321b3b0f5e5d56 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
-rw-r--r--basicsuite/enterprise-dashboard/DashboardGaugeStyle.qml144
-rw-r--r--basicsuite/enterprise-dashboard/IconGaugeStyle.qml103
-rw-r--r--basicsuite/enterprise-dashboard/TachometerStyle.qml95
-rw-r--r--basicsuite/enterprise-dashboard/TurnIndicator.qml88
-rw-r--r--basicsuite/enterprise-dashboard/ValueSource.qml300
-rw-r--r--basicsuite/enterprise-dashboard/description.txt1
-rw-r--r--basicsuite/enterprise-dashboard/images/fuel-icon.pngbin0 -> 666 bytes
-rw-r--r--basicsuite/enterprise-dashboard/images/temperature-icon.pngbin0 -> 3302 bytes
-rw-r--r--basicsuite/enterprise-dashboard/main.qml155
-rw-r--r--basicsuite/enterprise-dashboard/preview_l.jpgbin0 -> 11239 bytes
-rw-r--r--basicsuite/enterprise-dashboard/title.txt1
-rw-r--r--basicsuite/enterprise-gallery/BlackButtonBackground.qml51
-rw-r--r--basicsuite/enterprise-gallery/BlackButtonStyle.qml44
-rw-r--r--basicsuite/enterprise-gallery/CircularGaugeDarkStyle.qml76
-rw-r--r--basicsuite/enterprise-gallery/CircularGaugeDefaultStyle.qml26
-rw-r--r--basicsuite/enterprise-gallery/CircularGaugeLightStyle.qml77
-rw-r--r--basicsuite/enterprise-gallery/CircularGaugeView.qml204
-rw-r--r--basicsuite/enterprise-gallery/ControlView.qml168
-rw-r--r--basicsuite/enterprise-gallery/ControlViewToolbar.qml82
-rw-r--r--basicsuite/enterprise-gallery/CustomizerCheckBox.qml45
-rw-r--r--basicsuite/enterprise-gallery/CustomizerLabel.qml28
-rw-r--r--basicsuite/enterprise-gallery/CustomizerSlider.qml55
-rw-r--r--basicsuite/enterprise-gallery/FlickableMoreIndicator.qml56
-rw-r--r--basicsuite/enterprise-gallery/PieMenuControlView.qml195
-rw-r--r--basicsuite/enterprise-gallery/PieMenuDarkStyle.qml26
-rw-r--r--basicsuite/enterprise-gallery/PieMenuDefaultStyle.qml24
-rw-r--r--basicsuite/enterprise-gallery/StylePicker.qml79
-rw-r--r--basicsuite/enterprise-gallery/description.txt3
-rw-r--r--basicsuite/enterprise-gallery/fonts/LICENSE.txt202
-rw-r--r--basicsuite/enterprise-gallery/fonts/OpenSans-Regular.ttfbin0 -> 217360 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/background-light.pngbin0 -> 46832 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/background.pngbin0 -> 45497 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/center-light.pngbin0 -> 2113 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/center.pngbin0 -> 2392 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/icon-go.pngbin0 -> 536 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/icon-settings.pngbin0 -> 576 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/info.pngbin0 -> 709 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/needle-light.pngbin0 -> 2105 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/needle.pngbin0 -> 4891 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/zoom_in.pngbin0 -> 829 bytes
-rw-r--r--basicsuite/enterprise-gallery/images/zoom_out.pngbin0 -> 779 bytes
-rw-r--r--basicsuite/enterprise-gallery/main.qml254
-rw-r--r--basicsuite/enterprise-gallery/preview_l.jpgbin0 -> 9016 bytes
-rw-r--r--basicsuite/enterprise-gallery/title.txt1
45 files changed, 2583 insertions, 0 deletions
diff --git a/basicsuite/enterprise-dashboard/DashboardGaugeStyle.qml b/basicsuite/enterprise-dashboard/DashboardGaugeStyle.qml
new file mode 100644
index 0000000..109351c
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/DashboardGaugeStyle.qml
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+CircularGaugeStyle {
+ tickmarkInset: toPixels(0.04)
+ minorTickmarkInset: tickmarkInset
+ labelStepSize: 20
+ labelInset: toPixels(0.23)
+
+ property real xCenter: outerRadius
+ property real yCenter: outerRadius
+ property real needleLength: outerRadius - tickmarkInset * 1.25
+ property real needleTipWidth: toPixels(0.02)
+ property real needleBaseWidth: toPixels(0.06)
+ property bool halfGauge: false
+
+ function toPixels(percentage) {
+ return percentage * outerRadius;
+ }
+
+ function degToRad(degrees) {
+ return degrees * (Math.PI / 180);
+ }
+
+ function radToDeg(radians) {
+ return radians * (180 / Math.PI);
+ }
+
+ function paintBackground(ctx) {
+ if (halfGauge) {
+ ctx.beginPath();
+ ctx.rect(0, 0, ctx.canvas.width, ctx.canvas.height / 2);
+ ctx.clip();
+ }
+
+ ctx.beginPath();
+ ctx.fillStyle = "black";
+ ctx.ellipse(0, 0, ctx.canvas.width, ctx.canvas.height);
+ ctx.fill();
+
+ ctx.beginPath();
+ ctx.lineWidth = tickmarkInset;
+ ctx.strokeStyle = "black";
+ ctx.arc(xCenter, yCenter, outerRadius - ctx.lineWidth / 2, outerRadius - ctx.lineWidth / 2, 0, Math.PI * 2);
+ ctx.stroke();
+
+ ctx.beginPath();
+ ctx.lineWidth = tickmarkInset / 2;
+ ctx.strokeStyle = "#222";
+ ctx.arc(xCenter, yCenter, outerRadius - ctx.lineWidth / 2, outerRadius - ctx.lineWidth / 2, 0, Math.PI * 2);
+ ctx.stroke();
+
+ ctx.beginPath();
+ var gradient = ctx.createRadialGradient(xCenter, yCenter, outerRadius * 0.8, xCenter, yCenter, outerRadius);
+ gradient.addColorStop(0, Qt.rgba(1, 1, 1, 0));
+ gradient.addColorStop(0.7, Qt.rgba(1, 1, 1, 0.13));
+ gradient.addColorStop(1, Qt.rgba(1, 1, 1, 1));
+ ctx.fillStyle = gradient;
+ ctx.arc(xCenter, yCenter, outerRadius - tickmarkInset, outerRadius - tickmarkInset, 0, Math.PI * 2);
+ ctx.fill();
+ }
+
+ background: Canvas {
+ onPaint: {
+ var ctx = getContext("2d");
+ ctx.reset();
+ paintBackground(ctx);
+ }
+
+ Text {
+ id: speedText
+ font.pixelSize: toPixels(0.3)
+ text: kphInt
+ color: "white"
+ horizontalAlignment: Text.AlignRight
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.verticalCenter
+ anchors.topMargin: toPixels(0.1)
+
+ readonly property int kphInt: control.value
+ }
+ Text {
+ text: "km/h"
+ color: "white"
+ font.pixelSize: toPixels(0.09)
+ anchors.top: speedText.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ needle: Canvas {
+ width: needleBaseWidth
+ height: needleLength
+
+ property real xCenter: width / 2
+ property real yCenter: height / 2
+
+ onPaint: {
+ var ctx = getContext("2d");
+ ctx.reset();
+
+ ctx.beginPath();
+ ctx.moveTo(xCenter, height);
+ ctx.lineTo(xCenter - needleBaseWidth / 2, height - needleBaseWidth / 2);
+ ctx.lineTo(xCenter - needleTipWidth / 2, 0);
+ ctx.lineTo(xCenter, yCenter - needleLength);
+ ctx.lineTo(xCenter, 0);
+ ctx.closePath();
+ ctx.fillStyle = Qt.rgba(0.66, 0, 0, 0.66);
+ ctx.fill();
+
+ ctx.beginPath();
+ ctx.moveTo(xCenter, height)
+ ctx.lineTo(width, height - needleBaseWidth / 2);
+ ctx.lineTo(xCenter + needleTipWidth / 2, 0);
+ ctx.lineTo(xCenter, 0);
+ ctx.closePath();
+ ctx.fillStyle = Qt.lighter(Qt.rgba(0.66, 0, 0, 0.66));
+ ctx.fill();
+ }
+ }
+
+ foreground: null
+}
diff --git a/basicsuite/enterprise-dashboard/IconGaugeStyle.qml b/basicsuite/enterprise-dashboard/IconGaugeStyle.qml
new file mode 100644
index 0000000..32092d7
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/IconGaugeStyle.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+DashboardGaugeStyle {
+ id: fuelGaugeStyle
+ minimumValueAngle: 300
+ maximumValueAngle: 60
+ tickmarkStepSize: 1
+ labelStepSize: 1
+ labelInset: toPixels(-0.25)
+ minorTickmarkCount: 3
+
+ needleLength: toPixels(0.85)
+ needleBaseWidth: toPixels(0.08)
+ needleTipWidth: toPixels(0.03)
+
+ halfGauge: true
+
+ property string icon: ""
+ property color minWarningColor: "transparent"
+ property color maxWarningColor: "transparent"
+ readonly property real minWarningStartAngle: minimumValueAngle - 90
+ readonly property real maxWarningStartAngle: maximumValueAngle - 90
+
+ tickmark: Rectangle {
+ width: toPixels(0.06)
+ antialiasing: true
+ height: toPixels(0.2)
+ color: "#c8c8c8"
+ }
+
+ minorTickmark: Rectangle {
+ width: toPixels(0.03)
+ antialiasing: true
+ height: toPixels(0.15)
+ color: "#c8c8c8"
+ }
+
+ background: Item {
+ Canvas {
+ anchors.fill: parent
+ onPaint: {
+ var ctx = getContext("2d");
+ ctx.reset();
+
+ paintBackground(ctx);
+
+ if (minWarningColor != "transparent") {
+ ctx.beginPath();
+ ctx.lineWidth = fuelGaugeStyle.toPixels(0.08);
+ ctx.strokeStyle = minWarningColor;
+ ctx.arc(outerRadius, outerRadius,
+ // Start the line in from the decorations, and account for the width of the line itself.
+ outerRadius - tickmarkInset - ctx.lineWidth / 2,
+ degToRad(minWarningStartAngle),
+ degToRad(minWarningStartAngle + angleRange / (minorTickmarkCount + 1)), false);
+ ctx.stroke();
+ }
+ if (maxWarningColor != "transparent") {
+ ctx.beginPath();
+ ctx.lineWidth = fuelGaugeStyle.toPixels(0.08);
+ ctx.strokeStyle = maxWarningColor;
+ ctx.arc(outerRadius, outerRadius,
+ // Start the line in from the decorations, and account for the width of the line itself.
+ outerRadius - tickmarkInset - ctx.lineWidth / 2,
+ degToRad(maxWarningStartAngle - angleRange / (minorTickmarkCount + 1)),
+ degToRad(maxWarningStartAngle), false);
+ ctx.stroke();
+ }
+ }
+ }
+
+ Image {
+ source: icon
+ anchors.bottom: parent.verticalCenter
+ anchors.bottomMargin: toPixels(0.3)
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: toPixels(0.3)
+ height: width
+ fillMode: Image.PreserveAspectFit
+ }
+ }
+}
diff --git a/basicsuite/enterprise-dashboard/TachometerStyle.qml b/basicsuite/enterprise-dashboard/TachometerStyle.qml
new file mode 100644
index 0000000..e601dbb
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/TachometerStyle.qml
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+DashboardGaugeStyle {
+ id: tachometerStyle
+ tickmarkStepSize: 1
+ labelStepSize: 1
+ needleLength: toPixels(0.85)
+ needleBaseWidth: toPixels(0.08)
+ needleTipWidth: toPixels(0.03)
+
+ tickmark: Rectangle {
+ width: toPixels(0.03)
+ antialiasing: true
+ height: toPixels(0.08)
+ color: styleData.index === 7 || styleData.index === 8 ? Qt.rgba(0.5, 0, 0, 1) : "#c8c8c8"
+ }
+
+ minorTickmark: null
+
+ tickmarkLabel: Text {
+ font.pixelSize: Math.max(6, toPixels(0.12))
+ text: styleData.value
+ color: styleData.index === 7 || styleData.index === 8 ? Qt.rgba(0.5, 0, 0, 1) : "#c8c8c8"
+ antialiasing: true
+ }
+
+ background: Canvas {
+ onPaint: {
+ var ctx = getContext("2d");
+ ctx.reset();
+ paintBackground(ctx);
+
+ ctx.beginPath();
+ ctx.lineWidth = tachometerStyle.toPixels(0.08);
+ ctx.strokeStyle = Qt.rgba(0.5, 0, 0, 1);
+ var warningCircumference = maximumValueAngle - minimumValueAngle * 0.1;
+ var startAngle = maximumValueAngle - 90;
+ ctx.arc(outerRadius, outerRadius,
+ // Start the line in from the decorations, and account for the width of the line itself.
+ outerRadius - tickmarkInset - ctx.lineWidth / 2,
+ degToRad(startAngle - angleRange / 8 + angleRange * 0.015),
+ degToRad(startAngle - angleRange * 0.015), false);
+ ctx.stroke();
+ }
+
+ Text {
+ id: rpmText
+ font.pixelSize: tachometerStyle.toPixels(0.3)
+ text: rpmInt
+ color: "white"
+ horizontalAlignment: Text.AlignRight
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.verticalCenter
+ anchors.topMargin: 20
+
+ readonly property int rpmInt: valueSource.rpm
+ }
+ Text {
+ text: "x1000"
+ color: "white"
+ font.pixelSize: tachometerStyle.toPixels(0.1)
+ anchors.top: parent.top
+ anchors.topMargin: parent.height / 4
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ text: "RPM"
+ color: "white"
+ font.pixelSize: tachometerStyle.toPixels(0.1)
+ anchors.top: rpmText.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+}
diff --git a/basicsuite/enterprise-dashboard/TurnIndicator.qml b/basicsuite/enterprise-dashboard/TurnIndicator.qml
new file mode 100644
index 0000000..576b811
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/TurnIndicator.qml
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+Item {
+ // This enum is actually keyboard-related, but it serves its purpose
+ // as an indication of direction for us.
+ property int direction: Qt.LeftArrow
+ property bool on: false
+
+ property bool flashing: false
+
+ scale: direction === Qt.LeftArrow ? 1 : -1
+
+ Timer {
+ id: flashTimer
+ interval: 500
+ running: on
+ repeat: true
+ onTriggered: flashing = !flashing
+ }
+
+ function paintOutlinePath(ctx) {
+ ctx.beginPath();
+ ctx.moveTo(0, height * 0.5);
+ ctx.lineTo(0.6 * width, 0);
+ ctx.lineTo(0.6 * width, height * 0.28);
+ ctx.lineTo(width, height * 0.28);
+ ctx.lineTo(width, height * 0.72);
+ ctx.lineTo(0.6 * width, height * 0.72);
+ ctx.lineTo(0.6 * width, height);
+ ctx.lineTo(0, height * 0.5);
+ }
+
+ Canvas {
+ id: backgroundCanvas
+ anchors.fill: parent
+
+ onPaint: {
+ var ctx = getContext("2d");
+ ctx.reset();
+
+ paintOutlinePath(ctx);
+
+ ctx.lineWidth = 1;
+ ctx.strokeStyle = "black";
+ ctx.stroke();
+
+// ctx.fillStyle = "#552222";
+// ctx.fill();
+ }
+ }
+
+ Canvas {
+ id: foregroundCanvas
+ anchors.fill: parent
+ visible: on && flashing
+
+ onPaint: {
+ var ctx = getContext("2d");
+ ctx.reset();
+
+ paintOutlinePath(ctx);
+
+ ctx.fillStyle = "green";
+ ctx.fill();
+ }
+ }
+}
diff --git a/basicsuite/enterprise-dashboard/ValueSource.qml b/basicsuite/enterprise-dashboard/ValueSource.qml
new file mode 100644
index 0000000..10f6ee2
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/ValueSource.qml
@@ -0,0 +1,300 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: valueSource
+ property real kph: 0
+ property real rpm: 1
+ property real fuel: 0.85
+ property string gear: {
+ var g;
+ if (kph == 0) {
+ return "P";
+ }
+ if (kph < 30) {
+ return "1";
+ }
+ if (kph < 50) {
+ return "2";
+ }
+ if (kph < 80) {
+ return "3";
+ }
+ if (kph < 120) {
+ return "4";
+ }
+ if (kph < 160) {
+ return "5";
+ }
+ }
+ property int turnSignal: gear == "P" && !start ? randomDirection() : -1
+ property real temperature: 0.6
+ property bool start: true
+
+ function randomDirection() {
+ return Math.random() > 0.5 ? Qt.LeftArrow : Qt.RightArrow;
+ }
+
+ SequentialAnimation {
+ running: true
+ loops: 1
+
+ // We want a small pause at the beginning, but we only want it to happen once.
+ PauseAnimation {
+ duration: 1000
+ }
+
+ PropertyAction {
+ target: valueSource
+ property: "start"
+ value: false
+ }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+
+ ParallelAnimation {
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ from: 0
+ to: 30
+ duration: 3000
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ from: 1
+ to: 6.1
+ duration: 3000
+ }
+ }
+ ParallelAnimation {
+ // We changed gears so we lost a bit of speed.
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ from: 30
+ to: 26
+ duration: 600
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ from: 6
+ to: 2.4
+ duration: 600
+ }
+ }
+ ParallelAnimation {
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ to: 60
+ duration: 3000
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 5.6
+ duration: 3000
+ }
+ }
+ ParallelAnimation {
+ // We changed gears so we lost a bit of speed.
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ to: 56
+ duration: 600
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 2.3
+ duration: 600
+ }
+ }
+ ParallelAnimation {
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ to: 100
+ duration: 3000
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 5.1
+ duration: 3000
+ }
+ }
+ ParallelAnimation {
+ // We changed gears so we lost a bit of speed.
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ to: 96
+ duration: 600
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 2.2
+ duration: 600
+ }
+ }
+
+ ParallelAnimation {
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ to: 140
+ duration: 3000
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 6.2
+ duration: 3000
+ }
+ }
+
+ // Start downshifting.
+
+ // Fifth to fourth gear.
+ ParallelAnimation {
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.Linear
+ to: 100
+ duration: 5000
+ }
+
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 3.1
+ duration: 5000
+ }
+ }
+
+ // Fourth to third gear.
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 5.5
+ duration: 600
+ }
+
+ ParallelAnimation {
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ to: 60
+ duration: 5000
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 2.6
+ duration: 5000
+ }
+ }
+
+ // Third to second gear.
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 6.3
+ duration: 600
+ }
+
+ ParallelAnimation {
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ to: 30
+ duration: 5000
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 2.6
+ duration: 5000
+ }
+ }
+
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 6.5
+ duration: 600
+ }
+
+ // Second to first gear.
+ ParallelAnimation {
+ NumberAnimation {
+ target: valueSource
+ property: "kph"
+ easing.type: Easing.InOutSine
+ to: 0
+ duration: 5000
+ }
+ NumberAnimation {
+ target: valueSource
+ property: "rpm"
+ easing.type: Easing.InOutSine
+ to: 1
+ duration: 4500
+ }
+ }
+
+ PauseAnimation {
+ duration: 5000
+ }
+ }
+ }
+}
diff --git a/basicsuite/enterprise-dashboard/description.txt b/basicsuite/enterprise-dashboard/description.txt
new file mode 100644
index 0000000..dcf2b94
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/description.txt
@@ -0,0 +1 @@
+The dashboard demo uses Qt Quick Enterprise Controls to create a digital dashboard for a car.
diff --git a/basicsuite/enterprise-dashboard/images/fuel-icon.png b/basicsuite/enterprise-dashboard/images/fuel-icon.png
new file mode 100644
index 0000000..f521e90
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/images/fuel-icon.png
Binary files differ
diff --git a/basicsuite/enterprise-dashboard/images/temperature-icon.png b/basicsuite/enterprise-dashboard/images/temperature-icon.png
new file mode 100644
index 0000000..5a4334e
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/images/temperature-icon.png
Binary files differ
diff --git a/basicsuite/enterprise-dashboard/main.qml b/basicsuite/enterprise-dashboard/main.qml
new file mode 100644
index 0000000..5fbbb64
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/main.qml
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.1
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+import QtQuick.Enterprise.Controls 1.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+Rectangle {
+ id: root
+ visible: true
+ width: 1024
+ height: 600
+
+ color: "#161616"
+ //title: "QtQuick Enterprise Controls Demo"
+
+ ValueSource {
+ id: valueSource
+ }
+
+ // Dashboards are typically in a landscape orientation, so we need to ensure
+ // our height is never greater than our width.
+ Item {
+ id: container
+ width: root.width
+ height: Math.min(root.width, root.height)
+ anchors.centerIn: parent
+
+ Row {
+ id: gaugeRow
+ spacing: container.width * 0.02
+ anchors.centerIn: parent
+
+ TurnIndicator {
+ id: leftIndicator
+ anchors.verticalCenter: parent.verticalCenter
+ width: height
+ height: container.height * 0.1 - gaugeRow.spacing
+
+ direction: Qt.LeftArrow
+ on: valueSource.turnSignal == Qt.LeftArrow
+ }
+
+ Item {
+ width: height
+ height: container.height * 0.25 - gaugeRow.spacing
+ anchors.verticalCenter: parent.verticalCenter
+
+ CircularGauge {
+ id: fuelGauge
+ value: valueSource.fuel
+ maximumValue: 1
+ y: parent.height / 2 - height / 2 - container.height * 0.01
+ width: parent.width
+ height: parent.height * 0.7
+
+ style: IconGaugeStyle {
+ id: fuelGaugeStyle
+
+ icon: "images/fuel-icon.png"
+ minWarningColor: Qt.rgba(0.5, 0, 0, 1)
+
+ tickmarkLabel: Text {
+ color: "white"
+ visible: styleData.value === 0 || styleData.value === 1
+ font.pixelSize: fuelGaugeStyle.toPixels(0.225)
+ text: styleData.value === 0 ? "E" : (styleData.value === 1 ? "F" : "")
+ }
+ }
+ }
+
+ CircularGauge {
+ value: valueSource.temperature
+ maximumValue: 1
+ width: parent.width
+ height: parent.height * 0.7
+ y: parent.height / 2 + container.height * 0.01
+
+ style: IconGaugeStyle {
+ id: tempGaugeStyle
+
+ icon: "images/temperature-icon.png"
+ maxWarningColor: Qt.rgba(0.5, 0, 0, 1)
+
+ tickmarkLabel: Text {
+ color: "white"
+ visible: styleData.value === 0 || styleData.value === 1
+ font.pixelSize: tempGaugeStyle.toPixels(0.225)
+ text: styleData.value === 0 ? "C" : (styleData.value === 1 ? "H" : "")
+ }
+ }
+ }
+ }
+
+ CircularGauge {
+ id: speedometer
+ value: valueSource.kph
+ anchors.verticalCenter: parent.verticalCenter
+ maximumValue: 280
+ // We set the width to the height, because the height will always be
+ // the more limited factor. Also, all circular controls letterbox
+ // their contents to ensure that they remain circular. However, we
+ // don't want to extra space on the left and right of our gauges,
+ // because they're laid out horizontally, and that would create
+ // large horizontal gaps between gauges on wide screens.
+ width: height
+ height: container.height * 0.5
+
+ style: DashboardGaugeStyle {}
+ }
+
+ CircularGauge {
+ id: tachometer
+ width: height
+ height: container.height * 0.25 - gaugeRow.spacing
+ value: valueSource.rpm
+ maximumValue: 8
+ anchors.verticalCenter: parent.verticalCenter
+
+ style: TachometerStyle {}
+ }
+
+ TurnIndicator {
+ id: rightIndicator
+ anchors.verticalCenter: parent.verticalCenter
+ width: height
+ height: container.height * 0.1 - gaugeRow.spacing
+
+ direction: Qt.RightArrow
+ on: valueSource.turnSignal == Qt.RightArrow
+ }
+
+ }
+ }
+}
diff --git a/basicsuite/enterprise-dashboard/preview_l.jpg b/basicsuite/enterprise-dashboard/preview_l.jpg
new file mode 100644
index 0000000..eb2e3b5
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/preview_l.jpg
Binary files differ
diff --git a/basicsuite/enterprise-dashboard/title.txt b/basicsuite/enterprise-dashboard/title.txt
new file mode 100644
index 0000000..1a3fb29
--- /dev/null
+++ b/basicsuite/enterprise-dashboard/title.txt
@@ -0,0 +1 @@
+Qt Quick Enterprise Controls - Dashboard
diff --git a/basicsuite/enterprise-gallery/BlackButtonBackground.qml b/basicsuite/enterprise-gallery/BlackButtonBackground.qml
new file mode 100644
index 0000000..084d4e5
--- /dev/null
+++ b/basicsuite/enterprise-gallery/BlackButtonBackground.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+
+Rectangle {
+ property bool pressed: false
+
+ gradient: Gradient {
+ GradientStop {
+ color: pressed ? "#222" : "#333"
+ position: 0
+ }
+ GradientStop {
+ color: "#222"
+ position: 1
+ }
+ }
+ Rectangle {
+ height: 1
+ width: parent.width
+ anchors.top: parent.top
+ color: "#444"
+ visible: !pressed
+ }
+ Rectangle {
+ height: 1
+ width: parent.width
+ anchors.bottom: parent.bottom
+ color: "#000"
+ }
+}
diff --git a/basicsuite/enterprise-gallery/BlackButtonStyle.qml b/basicsuite/enterprise-gallery/BlackButtonStyle.qml
new file mode 100644
index 0000000..dde237f
--- /dev/null
+++ b/basicsuite/enterprise-gallery/BlackButtonStyle.qml
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+
+ButtonStyle {
+ property color fontColor;
+
+ background: BlackButtonBackground {
+ pressed: control.pressed
+ }
+ label: Item {
+ Text {
+ text: control.text
+ color: fontColor
+ font.pixelSize: control.height * 0.25
+ font.family: openSans.name
+ horizontalAlignment: Text.AlignLeft
+ verticalAlignment: Text.AlignVCenter
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 20
+ }
+ }
+}
diff --git a/basicsuite/enterprise-gallery/CircularGaugeDarkStyle.qml b/basicsuite/enterprise-gallery/CircularGaugeDarkStyle.qml
new file mode 100644
index 0000000..34991f9
--- /dev/null
+++ b/basicsuite/enterprise-gallery/CircularGaugeDarkStyle.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+CircularGaugeStyle {
+ id: root
+ tickmarkStepSize: 10
+ minorTickmarkCount: 1
+ labelStepSize: 20
+ tickmarkInset: outerRadius * 0.06
+ minorTickmarkInset: tickmarkInset
+ labelInset: outerRadius * 0.23
+
+ background: Image {
+ source: "images/background.png"
+ }
+
+ needle: Image {
+ id: needleImage
+ transformOrigin: Item.Bottom
+ source: "images/needle.png"
+ scale: {
+ var distanceFromLabelToRadius = labelInset / 2;
+ var idealHeight = outerRadius - distanceFromLabelToRadius;
+ var originalImageHeight = needleImage.sourceSize.height;
+ idealHeight / originalImageHeight;
+ }
+ }
+
+ foreground: Item {
+ Image {
+ anchors.centerIn: parent
+ source: "images/center.png"
+ scale: (outerRadius * 0.25) / sourceSize.height
+ }
+ }
+
+ tickmark: Rectangle {
+ width: outerRadius * 0.02
+ antialiasing: true
+ height: outerRadius * 0.05
+ color: "#888"
+ }
+
+ minorTickmark: Rectangle {
+ width: outerRadius * 0.01
+ antialiasing: true
+ height: outerRadius * 0.02
+ color: "#444"
+ }
+
+ tickmarkLabel: Text {
+ font.pixelSize: Math.max(6, outerRadius * 0.1)
+ text: styleData.value
+ color: "white"
+ }
+}
diff --git a/basicsuite/enterprise-gallery/CircularGaugeDefaultStyle.qml b/basicsuite/enterprise-gallery/CircularGaugeDefaultStyle.qml
new file mode 100644
index 0000000..3340bf3
--- /dev/null
+++ b/basicsuite/enterprise-gallery/CircularGaugeDefaultStyle.qml
@@ -0,0 +1,26 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+CircularGaugeStyle {
+ labelStepSize: 20
+}
diff --git a/basicsuite/enterprise-gallery/CircularGaugeLightStyle.qml b/basicsuite/enterprise-gallery/CircularGaugeLightStyle.qml
new file mode 100644
index 0000000..fbd71d7
--- /dev/null
+++ b/basicsuite/enterprise-gallery/CircularGaugeLightStyle.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+CircularGaugeStyle {
+ id: root
+ tickmarkStepSize: 10
+ minorTickmarkCount: 2
+ labelStepSize: 40
+ tickmarkInset: outerRadius * 0.06
+ minorTickmarkInset: tickmarkInset
+ labelInset: outerRadius * 0.23
+
+ background: Image {
+ source: "images/background-light.png"
+ }
+
+ needle: Image {
+ id: needleImage
+ source: "images/needle-light.png"
+ transformOrigin: Item.Bottom
+ scale: {
+ var distanceFromLabelToRadius = labelInset / 2;
+ var idealHeight = outerRadius - distanceFromLabelToRadius;
+ var originalImageHeight = needleImage.sourceSize.height;
+ idealHeight / originalImageHeight;
+ }
+ }
+
+ foreground: Item {
+ Image {
+ anchors.centerIn: parent
+ source: "images/center-light.png"
+ scale: (outerRadius * 0.25) / sourceSize.height
+ }
+ }
+
+ tickmark: Rectangle {
+ width: outerRadius * 0.01
+ antialiasing: true
+ height: outerRadius * 0.04
+ color: "#999"
+ }
+
+ minorTickmark: Rectangle {
+ width: outerRadius * 0.01
+ antialiasing: true
+ height: outerRadius * 0.02
+ color: "#bbb"
+ }
+
+ tickmarkLabel: Text {
+ font.family: "Helvetica neue"
+ font.pixelSize: Math.max(6, outerRadius * 0.1)
+ text: styleData.value
+ color: "#333"
+ }
+}
diff --git a/basicsuite/enterprise-gallery/CircularGaugeView.qml b/basicsuite/enterprise-gallery/CircularGaugeView.qml
new file mode 100644
index 0000000..f72fc2f
--- /dev/null
+++ b/basicsuite/enterprise-gallery/CircularGaugeView.qml
@@ -0,0 +1,204 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import QtQuick.Enterprise.Controls 1.0
+
+ControlView {
+ id: controlView
+ darkBackground: customizerItem.currentStyleDark
+
+ property color fontColor: darkBackground ? "white" : "black"
+
+ property bool accelerating: false
+
+ Keys.onSpacePressed: accelerating = true
+ Keys.onReleased: {
+ if (event.key === Qt.Key_Space) {
+ accelerating = false;
+ event.accepted = true;
+ }
+ }
+
+ Button {
+ id: accelerate
+ text: "Accelerate"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ height: root.height * 0.125
+
+ onPressedChanged: accelerating = pressed
+
+ style: BlackButtonStyle {
+ background: BlackButtonBackground {
+ pressed: control.pressed
+ }
+ label: Text {
+ text: control.text
+ color: "white"
+ font.pixelSize: root.toPixels(0.04)
+ font.family: openSans.name
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+
+ control: CircularGauge {
+ id: gauge
+ minimumValue: customizerItem.minimumValue
+ maximumValue: customizerItem.maximumValue
+ width: root.toPixels(0.65)
+ height: width
+
+ value: accelerating ? maximumValue : 0
+ style: styleMap[customizerItem.currentStylePath]
+
+ // This stops the styles being recreated when a new one is chosen.
+ property var styleMap: {
+ var styles = {};
+ for (var i = 0; i < customizerItem.allStylePaths.length; ++i) {
+ var path = customizerItem.allStylePaths[i];
+ styles[path] = Qt.createComponent(path, gauge);
+ }
+ styles;
+ }
+
+ // Called to update the style after the user has edited a property.
+ Connections {
+ target: customizerItem
+ onMinimumValueAngleChanged: __style.minimumValueAngle = customizerItem.minimumValueAngle
+ onMaximumValueAngleChanged: __style.maximumValueAngle = customizerItem.maximumValueAngle
+ onLabelStepSizeChanged: __style.tickmarkStepSize = __style.labelStepSize = customizerItem.labelStepSize
+ }
+
+ Behavior on value {
+ NumberAnimation {
+ easing.type: Easing.OutCubic
+ duration: 6000
+ }
+ }
+ }
+
+ customizer: Column {
+ readonly property var allStylePaths: {
+ var paths = [];
+ for (var i = 0; i < stylePicker.model.count; ++i) {
+ paths.push(stylePicker.model.get(i).path);
+ }
+ paths;
+ }
+ property alias currentStylePath: stylePicker.currentStylePath
+ property alias currentStyleDark: stylePicker.currentStyleDark
+ property alias minimumValue: minimumValueSlider.value
+ property alias maximumValue: maximumValueSlider.value
+ property alias minimumValueAngle: minimumAngleSlider.value
+ property alias maximumValueAngle: maximumAngleSlider.value
+ property alias labelStepSize: labelStepSizeSlider.value
+
+ id: circularGaugeColumn
+ spacing: customizerPropertySpacing
+
+ readonly property bool isDefaultStyle: stylePicker.model.get(stylePicker.currentIndex).name === "Default"
+
+ StylePicker {
+ id: stylePicker
+ currentIndex: 1
+
+ model: ListModel {
+ ListElement {
+ name: "Default"
+ path: "CircularGaugeDefaultStyle.qml"
+ dark: true
+ }
+ ListElement {
+ name: "Dark"
+ path: "CircularGaugeDarkStyle.qml"
+ dark: true
+ }
+ ListElement {
+ name: "Light"
+ path: "CircularGaugeLightStyle.qml"
+ dark: false
+ }
+ }
+ }
+
+ CustomizerLabel {
+ text: "Minimum angle"
+ }
+
+ CustomizerSlider {
+ id: minimumAngleSlider
+ minimumValue: 0
+ value: 215
+ maximumValue: 360
+ width: parent.width
+ }
+
+ CustomizerLabel {
+ text: "Maximum angle"
+ }
+
+ CustomizerSlider {
+ id: maximumAngleSlider
+ minimumValue: 0
+ value: 145
+ maximumValue: 360
+ }
+
+ CustomizerLabel {
+ text: "Minimum value"
+ }
+
+ CustomizerSlider {
+ id: minimumValueSlider
+ minimumValue: 0
+ value: 0
+ maximumValue: 360
+ stepSize: labelStepSizeSlider.stepSize
+ }
+
+ CustomizerLabel {
+ text: "Maximum value"
+ }
+
+ CustomizerSlider {
+ id: maximumValueSlider
+ minimumValue: 0
+ value: 220
+ maximumValue: 300
+ stepSize: labelStepSizeSlider.stepSize
+ }
+
+ CustomizerLabel {
+ text: "Label step size"
+ }
+
+ CustomizerSlider {
+ id: labelStepSizeSlider
+ minimumValue: 10
+ value: 20
+ maximumValue: 100
+ stepSize: 20
+ }
+ }
+}
diff --git a/basicsuite/enterprise-gallery/ControlView.qml b/basicsuite/enterprise-gallery/ControlView.qml
new file mode 100644
index 0000000..17f5784
--- /dev/null
+++ b/basicsuite/enterprise-gallery/ControlView.qml
@@ -0,0 +1,168 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+
+Rectangle {
+ id: view
+ color: darkBackground ? "transparent" : lightBackgroundColor
+
+ Keys.onReleased: {
+ if (event.key === Qt.Key_Back) {
+ stackView.pop();
+ event.accepted = true;
+ }
+ }
+
+ property bool darkBackground: true
+
+ property Component control
+ property Component customizer
+
+ property alias controlItem: controlLoader.item
+ property alias customizerItem: customizerLoader.item
+
+ property bool isCustomizerVisible: false
+
+ property real margin: root.toPixels(0.05)
+
+ property rect controlBounds: Qt.rect(largestControlItem.x + controlBoundsItem.x,
+ largestControlItem.y + controlBoundsItem.y, controlBoundsItem.width, controlBoundsItem.height)
+
+ Item {
+ id: largestControlItem
+ x: margin
+ y: margin
+ width: isCustomizerVisible ? widthWhenCustomizing : widthWhenNotCustomizing
+ height: isCustomizerVisible ? heightWhenCustomizing : heightWhenNotCustomizing
+
+ readonly property real widthWhenCustomizing: (!isScreenPortrait ? parent.width / 2 : parent.width) - margin * 2
+ readonly property real heightWhenCustomizing: (isScreenPortrait ? parent.height / 2 : parent.height - toolbar.height) - margin * 2
+ readonly property real widthWhenNotCustomizing: parent.width - margin * 2
+ readonly property real heightWhenNotCustomizing: parent.height - toolbar.height - margin * 2
+
+ Item {
+ id: controlBoundsItem
+ x: parent.width / 2 - controlBoundsItem.width / 2
+ y: customizer && customizerItem.visible ? 0 : (isScreenPortrait ? (parent.height / 2) - (controlBoundsItem.height / 2) : 0)
+ width: Math.min(parent.widthWhenCustomizing, parent.widthWhenNotCustomizing)
+ height: Math.min(parent.heightWhenCustomizing, parent.heightWhenNotCustomizing)
+
+ Behavior on x {
+ id: controlXBehavior
+ enabled: false
+ NumberAnimation {}
+ }
+
+ Behavior on y {
+ id: controlYBehavior
+ enabled: false
+ NumberAnimation {}
+ }
+
+ Loader {
+ id: controlLoader
+ sourceComponent: control
+ anchors.centerIn: parent
+
+ property alias view: view
+ }
+ }
+ }
+
+ Flickable {
+ id: flickable
+ // Hide the customizer on the right of the screen if it's not visible.
+ x: (isScreenPortrait ? 0 : (isCustomizerVisible ? largestControlItem.x + largestControlItem.width + margin : view.width)) + margin
+ y: (isScreenPortrait ? largestControlItem.y + largestControlItem.height : 0) + margin
+ width: largestControlItem.width
+ height: parent.height - y - toolbar.height - margin
+ anchors.leftMargin: margin
+ anchors.rightMargin: margin
+ visible: customizerLoader.opacity > 0
+
+ flickableDirection: Flickable.VerticalFlick
+
+ clip: true
+ contentWidth: width
+ contentHeight: customizerLoader.height
+
+ Behavior on x {
+ id: flickableXBehavior
+ enabled: false
+ NumberAnimation {}
+ }
+
+ Behavior on y {
+ id: flickableYBehavior
+ enabled: false
+ NumberAnimation {}
+ }
+
+ Loader {
+ id: customizerLoader
+ sourceComponent: customizer
+ opacity: 0
+ width: flickable.width
+
+ property alias view: view
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 300
+ }
+ }
+ }
+ }
+
+ ControlViewToolbar {
+ id: toolbar
+
+ onCustomizeClicked: {
+ controlXBehavior.enabled = !isScreenPortrait;
+ controlYBehavior.enabled = isScreenPortrait;
+
+ isCustomizerVisible = !isCustomizerVisible;
+
+ if (isScreenPortrait) {
+ flickableXBehavior.enabled = false;
+ flickableYBehavior.enabled = true;
+ } else {
+ flickableXBehavior.enabled = true;
+ flickableYBehavior.enabled = false;
+ }
+
+ customizerLoader.opacity = isCustomizerVisible ? 1 : 0;
+ }
+ }
+
+ FlickableMoreIndicator {
+ flickable: flickable
+ atTop: true
+ gradientColor: view.darkBackground ? darkBackgroundColor : lightBackgroundColor
+ }
+
+ FlickableMoreIndicator {
+ flickable: flickable
+ atTop: false
+ gradientColor: view.darkBackground ? darkBackgroundColor : lightBackgroundColor
+ }
+}
diff --git a/basicsuite/enterprise-gallery/ControlViewToolbar.qml b/basicsuite/enterprise-gallery/ControlViewToolbar.qml
new file mode 100644
index 0000000..f23b2d2
--- /dev/null
+++ b/basicsuite/enterprise-gallery/ControlViewToolbar.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+
+BlackButtonBackground {
+ anchors.bottom: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: root.height * 0.125
+
+ signal customizeClicked
+
+ gradient: Gradient {
+ GradientStop {
+ color: "#333"
+ position: 0
+ }
+ GradientStop {
+ color: "#222"
+ position: 1
+ }
+ }
+
+ Button {
+ id: back
+ width: parent.height
+ height: parent.height
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+
+ onClicked: stackView.pop()
+
+ style: BlackButtonStyle {
+ }
+
+ Image {
+ source: "images/icon-go.png"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ scale: -1
+ }
+ }
+
+ Button {
+ id: customize
+ width: parent.height
+ height: parent.height
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ visible: customizer
+
+ style: BlackButtonStyle {
+ }
+
+ onClicked: customizeClicked()
+
+ Image {
+ source: "images/icon-settings.png"
+ anchors.centerIn: parent
+ scale: -1
+ }
+ }
+}
diff --git a/basicsuite/enterprise-gallery/CustomizerCheckBox.qml b/basicsuite/enterprise-gallery/CustomizerCheckBox.qml
new file mode 100644
index 0000000..9426dc6
--- /dev/null
+++ b/basicsuite/enterprise-gallery/CustomizerCheckBox.qml
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+
+CheckBox {
+ id: checkBox
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: root.width * 0.04
+ height: width
+
+ style: CheckBoxStyle {
+ indicator: Rectangle {
+ color: "#666"
+ height: control.height
+ width: height
+
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: Math.round(checkBox.width * 0.1)
+ color: "#111"
+ visible: control.checked
+ }
+ }
+ }
+}
diff --git a/basicsuite/enterprise-gallery/CustomizerLabel.qml b/basicsuite/enterprise-gallery/CustomizerLabel.qml
new file mode 100644
index 0000000..c830832
--- /dev/null
+++ b/basicsuite/enterprise-gallery/CustomizerLabel.qml
@@ -0,0 +1,28 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Text {
+ color: fontColor
+ font.pixelSize: root.toPixels(0.04)
+ font.family: openSans.name
+ anchors.horizontalCenter: parent.horizontalCenter
+}
diff --git a/basicsuite/enterprise-gallery/CustomizerSlider.qml b/basicsuite/enterprise-gallery/CustomizerSlider.qml
new file mode 100644
index 0000000..b98c06d
--- /dev/null
+++ b/basicsuite/enterprise-gallery/CustomizerSlider.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.1
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+
+Slider {
+ id: slider
+ width: parent.width
+ height: root.toPixels(0.1)
+
+ style: SliderStyle {
+ handle: Rectangle {
+ height: root.toPixels(0.06)
+ width: height
+ radius: width/2
+ color: "#fff"
+ }
+
+ groove: Rectangle {
+ implicitHeight: root.toPixels(0.015)
+ implicitWidth: 100
+ radius: height/2
+ border.color: "#333"
+ color: "#222"
+ Rectangle {
+ height: parent.height
+ width: styleData.handlePosition
+ implicitHeight: 6
+ implicitWidth: 100
+ radius: height/2
+ color: "#555"
+ }
+ }
+
+ }
+}
diff --git a/basicsuite/enterprise-gallery/FlickableMoreIndicator.qml b/basicsuite/enterprise-gallery/FlickableMoreIndicator.qml
new file mode 100644
index 0000000..c935de2
--- /dev/null
+++ b/basicsuite/enterprise-gallery/FlickableMoreIndicator.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ anchors.top: atTop ? flickable.top : undefined
+ anchors.bottom: atTop ? undefined : flickable.bottom
+ anchors.left: isScreenPortrait ? parent.left : parent.horizontalCenter
+ anchors.right: parent.right
+ height: 30
+ visible: flickable.visible
+ opacity: atTop
+ ? (flickable.contentY > showDistance ? 1 : 0)
+ : (flickable.contentY < flickable.contentHeight - showDistance ? 1 : 0)
+ scale: atTop ? 1 : -1
+
+ readonly property real showDistance: 0
+ property Flickable flickable
+ property color gradientColor
+ /*! \c true if this indicator is at the top of the item */
+ property bool atTop
+
+ Behavior on opacity {
+ NumberAnimation {
+ }
+ }
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: gradientColor
+ }
+ GradientStop {
+ position: 1.0
+ color: "transparent"
+ }
+ }
+}
diff --git a/basicsuite/enterprise-gallery/PieMenuControlView.qml b/basicsuite/enterprise-gallery/PieMenuControlView.qml
new file mode 100644
index 0000000..91dae94
--- /dev/null
+++ b/basicsuite/enterprise-gallery/PieMenuControlView.qml
@@ -0,0 +1,195 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+import QtQuick.Controls 1.0
+import QtQuick.Enterprise.Controls 1.0
+
+Rectangle {
+ id: view
+ color: customizerItem.currentStyleDark ? "#111" : "#555"
+
+ Behavior on color {
+ ColorAnimation {}
+ }
+
+ Keys.onReleased: {
+ if (event.key === Qt.Key_Back) {
+ stackView.pop();
+ event.accepted = true;
+ }
+ }
+
+ property bool darkBackground: true
+
+ property Component mouseArea
+
+ property Component customizer: Column {
+ property alias currentStylePath: stylePicker.currentStylePath
+ property alias currentStyleDark: stylePicker.currentStyleDark
+
+ StylePicker {
+ id: stylePicker
+ currentIndex: 0
+
+ model: ListModel {
+ ListElement {
+ name: "Default"
+ path: "PieMenuDefaultStyle.qml"
+ dark: false
+ }
+ ListElement {
+ name: "Dark"
+ path: "PieMenuDarkStyle.qml"
+ dark: true
+ }
+ }
+ }
+ }
+
+ property alias controlItem: pieMenu
+ property alias customizerItem: customizerLoader.item
+
+ Item {
+ id: controlBoundsItem
+ width: parent.width
+ height: parent.height - toolbar.height
+ visible: customizerLoader.opacity === 0
+
+ Image {
+ id: bgImage
+ anchors.centerIn: parent
+ height: 48
+ Text {
+ id: bgLabel
+ anchors.top: parent.bottom
+ anchors.topMargin: 20
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "Tap to open"
+ color: "#999"
+ font.pointSize: 20
+ }
+ }
+
+ MouseArea {
+ id: touchArea
+ anchors.fill: parent
+
+ onClicked: {
+ pieMenu.popup(touchArea.mouseX, touchArea.mouseY)
+ }
+ }
+
+ Item {
+ width: labelText.width
+ height: labelText.height
+ anchors.bottom: pieMenu.top
+ anchors.bottomMargin: 10
+ anchors.horizontalCenter: pieMenu.horizontalCenter
+ visible: pieMenu.visible
+
+ Item {
+ id: labelBlurGuard
+ anchors.centerIn: parent
+ width: labelText.implicitWidth * 2
+ height: labelText.implicitHeight * 2
+
+ Text {
+ id: labelText
+ font.pointSize: 20
+ text: pieMenu.currentIndex !== -1 ? pieMenu.menuItems[pieMenu.currentIndex].text : ""
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ anchors.centerIn: parent
+ color: "#ccc"
+ antialiasing: true
+ }
+ }
+ }
+
+ PieMenu {
+ id: pieMenu
+ activationMode: ActivationMode.ActivateOnClick
+ width: Math.min(controlBoundsItem.width, controlBoundsItem.height) * 0.5
+ height: width
+
+ style: Qt.createComponent(customizerItem.currentStylePath)
+
+ MenuItem {
+ text: "Zoom In"
+ onTriggered: {
+ bgImage.source = iconSource
+ bgLabel.text = text + " selected"
+ }
+ iconSource: "images/zoom_in.png"
+ }
+ MenuItem {
+ text: "Zoom Out"
+ onTriggered: {
+ bgImage.source = iconSource
+ bgLabel.text = text + " selected"
+ }
+ iconSource: "images/zoom_out.png"
+ }
+ MenuItem {
+ text: "Info"
+ onTriggered: {
+ bgImage.source = iconSource
+ bgLabel.text = text + " selected"
+ }
+ iconSource: "images/info.png"
+ }
+ }
+ }
+ Loader {
+ id: customizerLoader
+ sourceComponent: customizer
+ opacity: 0
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.leftMargin: 30
+ anchors.rightMargin: 30
+ y: parent.height / 2 - height / 2 - toolbar.height
+ visible: customizerLoader.opacity > 0
+
+ property alias view: view
+
+ Behavior on y {
+ NumberAnimation {
+ duration: 300
+ }
+ }
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 300
+ }
+ }
+ }
+
+ ControlViewToolbar {
+ id: toolbar
+
+ onCustomizeClicked: {
+ customizerLoader.opacity = customizerLoader.opacity == 0 ? 1 : 0;
+ }
+ }
+}
diff --git a/basicsuite/enterprise-gallery/PieMenuDarkStyle.qml b/basicsuite/enterprise-gallery/PieMenuDarkStyle.qml
new file mode 100644
index 0000000..fa2a638
--- /dev/null
+++ b/basicsuite/enterprise-gallery/PieMenuDarkStyle.qml
@@ -0,0 +1,26 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+PieMenuStyle {
+ backgroundColor: "#222"
+ shadowColor: Qt.rgba(1, 1, 1, 0.26)
+}
diff --git a/basicsuite/enterprise-gallery/PieMenuDefaultStyle.qml b/basicsuite/enterprise-gallery/PieMenuDefaultStyle.qml
new file mode 100644
index 0000000..2f43dd1
--- /dev/null
+++ b/basicsuite/enterprise-gallery/PieMenuDefaultStyle.qml
@@ -0,0 +1,24 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+PieMenuStyle {
+}
diff --git a/basicsuite/enterprise-gallery/StylePicker.qml b/basicsuite/enterprise-gallery/StylePicker.qml
new file mode 100644
index 0000000..542abaa
--- /dev/null
+++ b/basicsuite/enterprise-gallery/StylePicker.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+import QtQuick.Enterprise.Controls 1.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+
+ListView {
+ id: stylePicker
+ width: parent.width
+ height: root.height * 0.06
+ interactive: false
+ spacing: -1
+
+ orientation: ListView.Horizontal
+
+ readonly property string currentStylePath: stylePicker.model.get(stylePicker.currentIndex).path
+ readonly property bool currentStyleDark: stylePicker.model.get(stylePicker.currentIndex).dark !== undefined
+ ? stylePicker.model.get(stylePicker.currentIndex).dark
+ : true
+
+ ExclusiveGroup {
+ id: styleExclusiveGroup
+ }
+
+ delegate: Button {
+ width: stylePicker.width / stylePicker.model.count
+ height: stylePicker.height
+ checkable: true
+ checked: index == ListView.view.currentIndex
+ exclusiveGroup: styleExclusiveGroup
+
+ onCheckedChanged: {
+ if (checked) {
+ ListView.view.currentIndex = index;
+ }
+ }
+
+ style: ButtonStyle {
+ background: Rectangle {
+ readonly property color checkedColor: currentStyleDark ? "#444" : "#777"
+ readonly property color uncheckedColor: currentStyleDark ? "#222" : "#bbb"
+ color: checked ? checkedColor : uncheckedColor
+ border.color: checkedColor
+ border.width: 1
+ radius: 1
+ }
+
+ label: Text {
+ text: name
+ color: currentStyleDark ? "white" : (checked ? "white" : "black")
+ font.pixelSize: root.toPixels(0.04)
+ font.family: openSans.name
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+}
diff --git a/basicsuite/enterprise-gallery/description.txt b/basicsuite/enterprise-gallery/description.txt
new file mode 100644
index 0000000..ba0806c
--- /dev/null
+++ b/basicsuite/enterprise-gallery/description.txt
@@ -0,0 +1,3 @@
+The Gallery example showcases Qt Quick Enterprise Controls. If you have any suggestions for improvements to existing controls or ideas for new controls please email them to Qt.Enterprise-Controls@digia.com.
+
+Each control can be customized and styled through the API. We have included a small subset of these customization options in the gallery example, which you can explore and interact with under the "cog" or "gear" icon on the lower right corner of each control's page.
diff --git a/basicsuite/enterprise-gallery/fonts/LICENSE.txt b/basicsuite/enterprise-gallery/fonts/LICENSE.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/basicsuite/enterprise-gallery/fonts/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/basicsuite/enterprise-gallery/fonts/OpenSans-Regular.ttf b/basicsuite/enterprise-gallery/fonts/OpenSans-Regular.ttf
new file mode 100644
index 0000000..db43334
--- /dev/null
+++ b/basicsuite/enterprise-gallery/fonts/OpenSans-Regular.ttf
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/background-light.png b/basicsuite/enterprise-gallery/images/background-light.png
new file mode 100644
index 0000000..2f76984
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/background-light.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/background.png b/basicsuite/enterprise-gallery/images/background.png
new file mode 100644
index 0000000..a3f4302
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/background.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/center-light.png b/basicsuite/enterprise-gallery/images/center-light.png
new file mode 100644
index 0000000..75add20
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/center-light.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/center.png b/basicsuite/enterprise-gallery/images/center.png
new file mode 100644
index 0000000..b18a5fa
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/center.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/icon-go.png b/basicsuite/enterprise-gallery/images/icon-go.png
new file mode 100644
index 0000000..ed86c2d
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/icon-go.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/icon-settings.png b/basicsuite/enterprise-gallery/images/icon-settings.png
new file mode 100644
index 0000000..6f37083
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/icon-settings.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/info.png b/basicsuite/enterprise-gallery/images/info.png
new file mode 100644
index 0000000..5c7a9df
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/info.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/needle-light.png b/basicsuite/enterprise-gallery/images/needle-light.png
new file mode 100644
index 0000000..d486d9e
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/needle-light.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/needle.png b/basicsuite/enterprise-gallery/images/needle.png
new file mode 100644
index 0000000..6b10c60
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/needle.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/qt-logo.png b/basicsuite/enterprise-gallery/images/qt-logo.png
new file mode 100644
index 0000000..14ddf2a
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/qt-logo.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/zoom_in.png b/basicsuite/enterprise-gallery/images/zoom_in.png
new file mode 100644
index 0000000..4128210
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/zoom_in.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/images/zoom_out.png b/basicsuite/enterprise-gallery/images/zoom_out.png
new file mode 100644
index 0000000..772d6ac
--- /dev/null
+++ b/basicsuite/enterprise-gallery/images/zoom_out.png
Binary files differ
diff --git a/basicsuite/enterprise-gallery/main.qml b/basicsuite/enterprise-gallery/main.qml
new file mode 100644
index 0000000..43ad848
--- /dev/null
+++ b/basicsuite/enterprise-gallery/main.qml
@@ -0,0 +1,254 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the QtQuick Enterprise Controls Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
+import QtQuick.Controls.Private 1.0
+import QtQuick.Dialogs 1.0
+import QtQuick.Enterprise.Controls 1.0
+import QtQuick.Enterprise.Controls.Styles 1.0
+import QtQuick.Window 2.1
+
+Rectangle {
+ id: root
+ visible: true
+ width: 480
+ height: 800
+
+ color: "#161616"
+ //title: "QtQuick Enterprise Controls Demo"
+
+ function toPixels(percentage) {
+ return percentage * Math.min(root.width, root.height);
+ }
+
+ property bool isScreenPortrait: height > width
+ property color fontColor: "white"
+ readonly property color lightBackgroundColor: "#ccc"
+ readonly property color darkBackgroundColor: "#161616"
+ property real customizerPropertySpacing: 10
+ property real colorPickerRowSpacing: 8
+
+ property Component circularGauge: CircularGaugeView {}
+
+ property Component dial: ControlView {
+ darkBackground: false
+
+ control: Dial {
+ id: dial
+ width: root.toPixels(0.3)
+ height: width
+
+ /*!
+ Determines whether the dial animates its rotation to the new value when
+ a single click or touch is received on the dial.
+ */
+ property bool animate: customizerItem.animate
+
+ Behavior on value {
+ enabled: dial.animate && !dial.pressed
+ NumberAnimation {
+ duration: 300
+ easing.type: Easing.OutSine
+ }
+ }
+
+ Text {
+ text: "Volume"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: dial.bottom
+ anchors.topMargin: 10
+ font.pixelSize: root.toPixels(0.045)
+ color: "#4e4e4e"
+ styleColor: "#ffffff"
+ style: Text.Raised
+ }
+ }
+
+ customizer: Column {
+ spacing: customizerPropertySpacing
+
+ property alias animate: animateCheckBox.checked
+
+ CustomizerLabel {
+ text: "Animate"
+ color: "black"
+ }
+
+ CustomizerCheckBox {
+ id: animateCheckBox
+ }
+ }
+ }
+
+ property Component delayButton: ControlView {
+ darkBackground: false
+
+ control: DelayButton {
+ text: "Alarm"
+ anchors.centerIn: parent
+ width: toPixels(0.3)
+ height: width
+ }
+ }
+
+ property Component gauge: ControlView {
+ id: gaugeView
+ control: Gauge {
+ id: gauge
+ width: orientation === Qt.Vertical ? root.toPixels(0.15) : gaugeView.controlBounds.width * 0.65
+ height: orientation === Qt.Vertical ? root.toPixels(0.65) : gaugeView.controlBounds.height * 0.15
+ anchors.centerIn: parent
+
+ minimumValue: 0
+ value: customizerItem.value
+ maximumValue: 100
+ orientation: customizerItem.orientationFlag ? Qt.Vertical : Qt.Horizontal
+ tickmarkAlignment: orientation === Qt.Vertical
+ ? (customizerItem.alignFlag ? Qt.AlignLeft : Qt.AlignRight)
+ : (customizerItem.alignFlag ? Qt.AlignTop : Qt.AlignBottom)
+ }
+
+ customizer: Column {
+ spacing: customizerPropertySpacing
+
+ property alias value: valueSlider.value
+ property alias orientationFlag: orientationCheckBox.checked
+ property alias alignFlag: alignCheckBox.checked
+
+ CustomizerLabel {
+ text: "Value"
+ }
+
+ CustomizerSlider {
+ id: valueSlider
+ minimumValue: 0
+ value: 50
+ maximumValue: 100
+ }
+
+ CustomizerLabel {
+ text: "Vertical orientation"
+ }
+
+ CustomizerCheckBox {
+ id: orientationCheckBox
+ checked: true
+ }
+
+ CustomizerLabel {
+ text: controlItem.orientation === Qt.Vertical ? "Left align" : "Top align"
+ }
+
+ CustomizerCheckBox {
+ id: alignCheckBox
+ checked: true
+ }
+ }
+ }
+
+ property Component toggleButton: ControlView {
+ darkBackground: false
+
+ control: ToggleButton {
+ text: checked ? "On" : "Off"
+ width: toPixels(0.3)
+ height: width
+ anchors.centerIn: parent
+ }
+ }
+
+ property Component pieMenu: PieMenuControlView {}
+
+ FontLoader {
+ id: openSans
+ Component.onCompleted: {
+ // QTBUG-35909
+ if (Qt.platform.os === "ios")
+ name = "Open Sans"
+ else
+ source = "fonts/OpenSans-Regular.ttf"
+ }
+ }
+
+ property var componentMap: {
+ "CircularGauge": circularGauge,
+ "DelayButton": delayButton,
+ "Dial": dial,
+ "Gauge": gauge,
+ "PieMenu": pieMenu,
+ "ToggleButton": toggleButton
+ }
+
+ StackView {
+ id: stackView
+ anchors.fill: parent
+
+ initialItem: ListView {
+ model: ListModel {
+ ListElement {
+ title: "CircularGauge"
+ }
+ ListElement {
+ title: "DelayButton"
+ }
+ ListElement {
+ title: "Dial"
+ }
+ ListElement {
+ title: "Gauge"
+ }
+ //ListElement {
+ // title: "PieMenu"
+ //}
+ ListElement {
+ title: "ToggleButton"
+ }
+ }
+
+ delegate: Button {
+ width: stackView.width
+ height: root.height * 0.125
+ text: title
+
+ Image {
+ source: "images/icon-go.png"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 30
+ }
+
+ style: BlackButtonStyle {
+ fontColor: root.fontColor
+ }
+
+ onClicked: {
+ if (stackView.depth == 1) {
+ // Only push the control view if we haven't already pushed it...
+ stackView.push({item: componentMap[title]});
+ stackView.currentItem.forceActiveFocus();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/basicsuite/enterprise-gallery/preview_l.jpg b/basicsuite/enterprise-gallery/preview_l.jpg
new file mode 100644
index 0000000..8ddcad8
--- /dev/null
+++ b/basicsuite/enterprise-gallery/preview_l.jpg
Binary files differ
diff --git a/basicsuite/enterprise-gallery/title.txt b/basicsuite/enterprise-gallery/title.txt
new file mode 100644
index 0000000..4ffcc0f
--- /dev/null
+++ b/basicsuite/enterprise-gallery/title.txt
@@ -0,0 +1 @@
+Qt Quick Enterprise Controls - Gallery