aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2016-12-09 13:19:51 +0000
committerRomain Forlot <romain.forlot@iot.bzh>2016-12-09 13:19:51 +0000
commitc8dac073aa7b1f7dbe5f20d95ea8e72379416de4 (patch)
treec3742d2ac2be3588fc58095f9a720f1ae631cf03
parent240a5d1785f49653ac82242e3f092f5d175cca0a (diff)
Added AGL/Demo qml dependancies
Change-Id: I994bce42371adf6a1919ad4a9d9c688e5519a839 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--app/AGL/Demo/Controls/ImageButton.qml31
-rw-r--r--app/AGL/Demo/Controls/ToggleButton.qml31
-rw-r--r--app/AGL/Demo/Controls/qmldir2
-rw-r--r--app/hvac-demo.qml9
4 files changed, 73 insertions, 0 deletions
diff --git a/app/AGL/Demo/Controls/ImageButton.qml b/app/AGL/Demo/Controls/ImageButton.qml
new file mode 100644
index 0000000..f66f37a
--- /dev/null
+++ b/app/AGL/Demo/Controls/ImageButton.qml
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2016 The Qt Company Ltd.
+ *
+ * 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.
+ */
+
+import QtQuick 2.6
+import QtQuick.Templates 2.0 as T
+
+T.Button {
+ id: control
+ implicitWidth: contentItem.implicitWidth
+ implicitHeight: contentItem.implicitHeight
+
+ property url offImage
+ property url onImage: offImage
+
+ contentItem: Image {
+ source: control.pressed ? control.onImage : control.offImage
+ }
+}
diff --git a/app/AGL/Demo/Controls/ToggleButton.qml b/app/AGL/Demo/Controls/ToggleButton.qml
new file mode 100644
index 0000000..4a9fc72
--- /dev/null
+++ b/app/AGL/Demo/Controls/ToggleButton.qml
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2016 The Qt Company Ltd.
+ *
+ * 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.
+ */
+
+import QtQuick 2.6
+import QtQuick.Templates 2.0 as T
+
+T.CheckBox {
+ id: control
+ implicitWidth: contentItem.implicitWidth
+ implicitHeight: contentItem.implicitHeight
+
+ property url onImage
+ property url offImage
+
+ contentItem: Image {
+ source: control.checked ? control.onImage : control.offImage
+ }
+}
diff --git a/app/AGL/Demo/Controls/qmldir b/app/AGL/Demo/Controls/qmldir
new file mode 100644
index 0000000..6ece36d
--- /dev/null
+++ b/app/AGL/Demo/Controls/qmldir
@@ -0,0 +1,2 @@
+ToggleButton 1.0 ToggleButton.qml
+ImageButton 1.0 ImageButton.qml
diff --git a/app/hvac-demo.qml b/app/hvac-demo.qml
index 565b108..9474f53 100644
--- a/app/hvac-demo.qml
+++ b/app/hvac-demo.qml
@@ -18,10 +18,19 @@ import QtQuick 2.6
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import AGL.Demo.Controls 1.0
+import QtWebSockets 1.0
ApplicationWindow {
id: root
+ // GET BINDINGS VARIABLES
+ property string port_str: Qt.application.arguments[1]
+ property string token_str: Qt.application.arguments[2]
+ property string address_str: "ws://localhost:"+port_str+"/api?token="+token_str
+ property string request_str: ""
+ property string status_str: "waiting..."
+ property var msgid_enu: { "call":2, "retok":3, "reterr":4, "event":5 }
+
ColumnLayout {
anchors.fill: parent
anchors.topMargin: width / 10