qskinny/examples/iot-dashboard/Usage.cpp

35 lines
1.4 KiB
C++
Raw Normal View History

2020-08-12 15:11:00 +00:00
#include "Usage.h"
2021-03-31 08:08:30 +00:00
#include "Skin.h"
2020-08-12 15:11:00 +00:00
#include <QskTextLabel.h>
2020-09-16 16:38:17 +00:00
Usage::Usage( QQuickItem* parent )
2020-09-17 14:14:29 +00:00
: Box( "Usage", parent )
2020-08-12 15:11:00 +00:00
{
2020-09-16 16:38:17 +00:00
auto* content = new QskLinearBox( Qt::Vertical, this );
2020-08-14 10:48:15 +00:00
2020-09-16 16:38:17 +00:00
auto* today = new QskLinearBox( Qt::Horizontal, content );
auto* todayText = new QskTextLabel( "Usage today", today );
todayText->setFontRole( QskSkin::SmallFont );
auto* todaySpacer = new QskTextLabel( "_____", today );
todaySpacer->setTextColor( "#dddddd" );
auto* todayValue = new QskTextLabel( "0,5 kwH", today );
todayValue->setFontRole( QskSkin::SmallFont );
2020-08-12 15:11:00 +00:00
2020-09-16 16:38:17 +00:00
auto* month = new QskLinearBox( Qt::Horizontal, content );
auto* monthText = new QskTextLabel( "Usage this month", month );
monthText->setFontRole( QskSkin::SmallFont );
auto* monthSpacer = new QskTextLabel( "_____", month );
monthSpacer->setTextColor( "#dddddd" );
auto* monthValue = new QskTextLabel( "66 kwH", month );
monthValue->setFontRole( QskSkin::SmallFont );
2020-08-12 15:11:00 +00:00
2020-09-16 16:38:17 +00:00
auto* total = new QskLinearBox( Qt::Horizontal, content );
auto* totalText = new QskTextLabel( "Total working hours", total );
totalText->setFontRole( QskSkin::SmallFont );
auto* totalSpacer = new QskTextLabel( "_____", total );
totalSpacer->setTextColor( "#dddddd" );
auto* totalValue = new QskTextLabel( "125 hrs", total );
totalValue->setFontRole( QskSkin::SmallFont );
2020-08-12 15:11:00 +00:00
}