summaryrefslogtreecommitdiff
path: root/src/statistics/BaseStatPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/statistics/BaseStatPage.cpp')
-rw-r--r--src/statistics/BaseStatPage.cpp38
1 files changed, 38 insertions, 0 deletions
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;
+}