From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/statistics/BaseStatPage.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/statistics/BaseStatPage.cpp (limited to 'src/statistics/BaseStatPage.cpp') diff --git a/src/statistics/BaseStatPage.cpp b/src/statistics/BaseStatPage.cpp new file mode 100644 index 0000000..a7a8764 --- /dev/null +++ b/src/statistics/BaseStatPage.cpp @@ -0,0 +1,38 @@ +#include "BaseStatPage.h" +#include "StatisticsParams.h" + +BaseStatPage::BaseStatPage(const StatisticsParams* statParams): + statParams(statParams) +{ +} + +void BaseStatPage::init() +{ + createUi(); + updateDataSet(); +} + +void BaseStatPage::createUi() +{ + QVBoxLayout* mainLt = new QVBoxLayout; + mainLt->addWidget(createTitleLabel()); + mainLt->addWidget(createChart()); + mainLt->addWidget(createTotalReviewsLabel()); + setLayout(mainLt); +} + +QLabel* BaseStatPage::createTitleLabel() +{ + QLabel* titleLabel = new QLabel(getTitle()); + titleLabel->setFont(QFont("Sans Serif", 18, QFont::Bold)); + titleLabel->setAlignment(Qt::AlignCenter); + return titleLabel; +} + +QWidget* BaseStatPage::createTotalReviewsLabel() +{ + totalReviewsLabel = new QLabel; + totalReviewsLabel->setFont(QFont("Sans Serif", 16)); + totalReviewsLabel->setAlignment(Qt::AlignRight); + return totalReviewsLabel; +} -- cgit