From 6e06af6fa2f164ea04e056de32094191a67d07cf Mon Sep 17 00:00:00 2001 From: Kevin Whitaker Date: Wed, 6 Nov 2019 17:16:45 -0500 Subject: [PATCH] Add bluetooth to requirements. Fix up main screen to represent app layout. --- CMakeLists.txt | 2 +- src/contents/ui/main.qml | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 007acda..f77499d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ include(KDECompilerSettings NO_POLICY_SCOPE) ################# Find dependencies ################# -find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg QuickControls2) +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg QuickControls2 Bluetooth) find_package(KF5Kirigami2 ${KF5_MIN_VERSION}) ################# Enable C++11 features for clang and gcc ################# diff --git a/src/contents/ui/main.qml b/src/contents/ui/main.qml index 122617d..0d17b69 100644 --- a/src/contents/ui/main.qml +++ b/src/contents/ui/main.qml @@ -5,24 +5,43 @@ import QtQuick.Controls 2.0 as Controls Kirigami.ApplicationWindow { id: root - title: "Hello" + title: "QiFlora" pageStack.initialPage: mainPageComponent Component { id: mainPageComponent - Kirigami.Page { - title: "Hello" + Kirigami.ScrollablePage { + mainAction: Kirigami.Action { + iconName: "view-refresh" + text: i18n("Query Device") + } + title: "Monitor" + + Component.onCompleted: { + monitorTypes.append({"chartType": "temperature", "title": i18n("Temperature"), "icon": "filename-bpm-amarok"}); + monitorTypes.append({"chartType": "moisture", "title": i18n("Moisture"), "icon": "colors-chromablue"}); + monitorTypes.append({"chartType": "conductivity", "title": i18n("Conductivity"), "icon": "quickopen"}); + monitorTypes.append({"chartType": "brightness", "title": i18n("Brightness"), "icon": "contrast"}); + } - Rectangle { - color: "black" - anchors.fill: parent + Kirigami.CardsListView { + id: monitorView + model: ListModel { + id: monitorTypes + } - Controls.Label { - text: qsTr("Hello Kirigami") - color: "white" - anchors.centerIn: parent + delegate: Kirigami.Card { + id: card + banner { + title: model.title + titleIcon: model.icon + } + contentItem: Controls.Label { + wrapMode: Text.WordWrap + text: model.chartType + } } } } -- GitLab