summaryrefslogtreecommitdiff
path: root/src/statistics/BaseStatPage.cpp
blob: a7a87642eb2c6c9b95b41db381b5bc605b540d9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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;
}