From c904f33cf1dc904db989dc5a37715a9d77e7f8a8 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Mon, 2 Jan 2023 09:42:41 +0100 Subject: [PATCH] IOT dashboard: Add more dummy pages --- examples/iotdashboard/DevicesPage.cpp | 21 +++++++++++++++++++++ examples/iotdashboard/DevicesPage.h | 19 +++++++++++++++++++ examples/iotdashboard/MainItem.cpp | 12 ++++++++++++ examples/iotdashboard/MembersPage.cpp | 21 +++++++++++++++++++++ examples/iotdashboard/MembersPage.h | 19 +++++++++++++++++++ examples/iotdashboard/MenuBar.cpp | 1 - examples/iotdashboard/StatisticsPage.cpp | 21 +++++++++++++++++++++ examples/iotdashboard/StatisticsPage.h | 19 +++++++++++++++++++ examples/iotdashboard/StoragePage.cpp | 21 +++++++++++++++++++++ examples/iotdashboard/StoragePage.h | 19 +++++++++++++++++++ examples/iotdashboard/iotdashboard.pro | 10 +++++++++- 11 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 examples/iotdashboard/DevicesPage.cpp create mode 100644 examples/iotdashboard/DevicesPage.h create mode 100644 examples/iotdashboard/MembersPage.cpp create mode 100644 examples/iotdashboard/MembersPage.h create mode 100644 examples/iotdashboard/StatisticsPage.cpp create mode 100644 examples/iotdashboard/StatisticsPage.h create mode 100644 examples/iotdashboard/StoragePage.cpp create mode 100644 examples/iotdashboard/StoragePage.h diff --git a/examples/iotdashboard/DevicesPage.cpp b/examples/iotdashboard/DevicesPage.cpp new file mode 100644 index 00000000..e525bdf4 --- /dev/null +++ b/examples/iotdashboard/DevicesPage.cpp @@ -0,0 +1,21 @@ +/****************************************************************************** + * Copyright (C) 2021 Edelhirsch Software GmbH + * This file may be used under the terms of the 3-clause BSD License + *****************************************************************************/ + +#include "DevicesPage.h" + +#include +#include + +QSK_SUBCONTROL( DevicesPage, Panel ) + +DevicesPage::DevicesPage( QQuickItem* parent ) + : QskLinearBox( Qt::Vertical, parent ) +{ + auto* const textLabel = new QskTextLabel( "devices page", this ); + textLabel->setAlignmentHint( QskTextLabel::Text, Qt::AlignCenter ); + textLabel->setFontRole( QskSkin::HugeFont ); +} + +#include "moc_DevicesPage.cpp" diff --git a/examples/iotdashboard/DevicesPage.h b/examples/iotdashboard/DevicesPage.h new file mode 100644 index 00000000..2241997f --- /dev/null +++ b/examples/iotdashboard/DevicesPage.h @@ -0,0 +1,19 @@ +/****************************************************************************** + * Copyright (C) 2021 Edelhirsch Software GmbH + * This file may be used under the terms of the 3-clause BSD License + *****************************************************************************/ + +#pragma once + +#include +#include + +class DevicesPage : public QskLinearBox +{ + Q_OBJECT + + public: + QSK_SUBCONTROLS( Panel ) + + DevicesPage( QQuickItem* parent ); +}; diff --git a/examples/iotdashboard/MainItem.cpp b/examples/iotdashboard/MainItem.cpp index 53d12cb0..8fff11be 100644 --- a/examples/iotdashboard/MainItem.cpp +++ b/examples/iotdashboard/MainItem.cpp @@ -1,8 +1,12 @@ #include "MainItem.h" #include "DashboardPage.h" +#include "DevicesPage.h" #include "MenuBar.h" +#include "MembersPage.h" #include "RoomsPage.h" +#include "StatisticsPage.h" +#include "StoragePage.h" #include #include @@ -108,9 +112,17 @@ MainItem::MainItem( QQuickItem* parent ) auto* const dashboardPage = new DashboardPage( m_cube ); auto* const roomsPage = new RoomsPage( m_cube ); + auto* const devicesPage = new DevicesPage( m_cube ); + auto* const statisticsPage = new StatisticsPage( m_cube ); + auto* const storagePage = new StoragePage( m_cube ); + auto* const membersPage = new MembersPage( m_cube ); m_cube->addItem( dashboardPage ); m_cube->addItem( roomsPage ); + m_cube->addItem( devicesPage ); + m_cube->addItem( statisticsPage ); + m_cube->addItem( storagePage ); + m_cube->addItem( membersPage ); m_cube->setCurrentItem( dashboardPage ); } diff --git a/examples/iotdashboard/MembersPage.cpp b/examples/iotdashboard/MembersPage.cpp new file mode 100644 index 00000000..cab47243 --- /dev/null +++ b/examples/iotdashboard/MembersPage.cpp @@ -0,0 +1,21 @@ +/****************************************************************************** + * Copyright (C) 2021 Edelhirsch Software GmbH + * This file may be used under the terms of the 3-clause BSD License + *****************************************************************************/ + +#include "MembersPage.h" + +#include +#include + +QSK_SUBCONTROL( MembersPage, Panel ) + +MembersPage::MembersPage( QQuickItem* parent ) + : QskLinearBox( Qt::Vertical, parent ) +{ + auto* const textLabel = new QskTextLabel( "members page", this ); + textLabel->setAlignmentHint( QskTextLabel::Text, Qt::AlignCenter ); + textLabel->setFontRole( QskSkin::HugeFont ); +} + +#include "moc_MembersPage.cpp" diff --git a/examples/iotdashboard/MembersPage.h b/examples/iotdashboard/MembersPage.h new file mode 100644 index 00000000..ea5cfd91 --- /dev/null +++ b/examples/iotdashboard/MembersPage.h @@ -0,0 +1,19 @@ +/****************************************************************************** + * Copyright (C) 2021 Edelhirsch Software GmbH + * This file may be used under the terms of the 3-clause BSD License + *****************************************************************************/ + +#pragma once + +#include +#include + +class MembersPage : public QskLinearBox +{ + Q_OBJECT + + public: + QSK_SUBCONTROLS( Panel ) + + MembersPage( QQuickItem* parent ); +}; diff --git a/examples/iotdashboard/MenuBar.cpp b/examples/iotdashboard/MenuBar.cpp index 64e8d9a8..ca092dbf 100644 --- a/examples/iotdashboard/MenuBar.cpp +++ b/examples/iotdashboard/MenuBar.cpp @@ -65,7 +65,6 @@ void MenuBar::setActivePage( const int index ) { m_entries.at( m_currentIndex )->setChecked( false ); m_currentIndex = index; - m_entries.at( m_currentIndex )->setChecked( true ); } #include "moc_MenuBar.cpp" diff --git a/examples/iotdashboard/StatisticsPage.cpp b/examples/iotdashboard/StatisticsPage.cpp new file mode 100644 index 00000000..2153efef --- /dev/null +++ b/examples/iotdashboard/StatisticsPage.cpp @@ -0,0 +1,21 @@ +/****************************************************************************** + * Copyright (C) 2021 Edelhirsch Software GmbH + * This file may be used under the terms of the 3-clause BSD License + *****************************************************************************/ + +#include "StatisticsPage.h" + +#include +#include + +QSK_SUBCONTROL( StatisticsPage, Panel ) + +StatisticsPage::StatisticsPage( QQuickItem* parent ) + : QskLinearBox( Qt::Vertical, parent ) +{ + auto* const textLabel = new QskTextLabel( "statistics page", this ); + textLabel->setAlignmentHint( QskTextLabel::Text, Qt::AlignCenter ); + textLabel->setFontRole( QskSkin::HugeFont ); +} + +#include "moc_StatisticsPage.cpp" diff --git a/examples/iotdashboard/StatisticsPage.h b/examples/iotdashboard/StatisticsPage.h new file mode 100644 index 00000000..8224e096 --- /dev/null +++ b/examples/iotdashboard/StatisticsPage.h @@ -0,0 +1,19 @@ +/****************************************************************************** + * Copyright (C) 2021 Edelhirsch Software GmbH + * This file may be used under the terms of the 3-clause BSD License + *****************************************************************************/ + +#pragma once + +#include +#include + +class StatisticsPage : public QskLinearBox +{ + Q_OBJECT + + public: + QSK_SUBCONTROLS( Panel ) + + StatisticsPage( QQuickItem* parent ); +}; diff --git a/examples/iotdashboard/StoragePage.cpp b/examples/iotdashboard/StoragePage.cpp new file mode 100644 index 00000000..934b4f59 --- /dev/null +++ b/examples/iotdashboard/StoragePage.cpp @@ -0,0 +1,21 @@ +/****************************************************************************** + * Copyright (C) 2021 Edelhirsch Software GmbH + * This file may be used under the terms of the 3-clause BSD License + *****************************************************************************/ + +#include "StoragePage.h" + +#include +#include + +QSK_SUBCONTROL( StoragePage, Panel ) + +StoragePage::StoragePage( QQuickItem* parent ) + : QskLinearBox( Qt::Vertical, parent ) +{ + auto* const textLabel = new QskTextLabel( "storage page", this ); + textLabel->setAlignmentHint( QskTextLabel::Text, Qt::AlignCenter ); + textLabel->setFontRole( QskSkin::HugeFont ); +} + +#include "moc_StoragePage.cpp" diff --git a/examples/iotdashboard/StoragePage.h b/examples/iotdashboard/StoragePage.h new file mode 100644 index 00000000..b94d6c2a --- /dev/null +++ b/examples/iotdashboard/StoragePage.h @@ -0,0 +1,19 @@ +/****************************************************************************** + * Copyright (C) 2021 Edelhirsch Software GmbH + * This file may be used under the terms of the 3-clause BSD License + *****************************************************************************/ + +#pragma once + +#include +#include + +class StoragePage : public QskLinearBox +{ + Q_OBJECT + + public: + QSK_SUBCONTROLS( Panel ) + + StoragePage( QQuickItem* parent ); +}; diff --git a/examples/iotdashboard/iotdashboard.pro b/examples/iotdashboard/iotdashboard.pro index 67a11908..e4ba4777 100644 --- a/examples/iotdashboard/iotdashboard.pro +++ b/examples/iotdashboard/iotdashboard.pro @@ -6,6 +6,7 @@ SOURCES += \ CircularProgressBar.cpp \ CircularProgressBarSkinlet.cpp \ DashboardPage.cpp \ + DevicesPage.cpp \ Diagram.cpp \ DiagramSkinlet.cpp \ EnergyMeter.cpp \ @@ -14,16 +15,19 @@ SOURCES += \ LightDisplaySkinlet.cpp \ LightDisplay.cpp \ MainItem.cpp \ + MainWindow.cpp \ MenuBar.cpp \ + MembersPage.cpp \ MyDevices.cpp \ RoomsPage.cpp \ RoundedIcon.cpp \ Skin.cpp \ + StatisticsPage.cpp \ + StoragePage.cpp \ TopBar.cpp \ RoundButton.cpp \ UsageBox.cpp \ UsageDiagram.cpp \ - MainWindow.cpp \ main.cpp \ SOURCES += \ @@ -44,13 +48,17 @@ HEADERS += \ LightDisplaySkinlet.h \ LightDisplay.h \ DashboardPage.h \ + DevicesPage.h \ MainItem.h \ MainWindow.h \ + MembersPage.h \ MenuBar.h \ MyDevices.h \ RoomsPage.h \ RoundedIcon.h \ Skin.h \ + StatisticsPage.h \ + StoragePage.h \ TopBar.h \ RoundButton.h \ UsageBox.h \