summaryrefslogtreecommitdiff
path: root/src/statistics/StatisticsView.h
blob: 560f8b89cef8d04516e40c9c9ec5ab826f990f91 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef STATISTICS_VIEW_H
#define STATISTICS_VIEW_H

#include <QtCore>
#include <QtWidgets>

#include "StatisticsParams.h"

class Dictionary;
class CardPack;

class StatisticsView: public QDialog, public StatisticsParams
{
    Q_OBJECT
public:
    StatisticsView(const Dictionary* dict);

private:
    static QList<QPair<QString, int>> getPeriodsList();

private:
    void init();
    void closeEvent(QCloseEvent *event);
    void createPages();
    void createContentsList();
    void createListItems();
    void createUi();
    void loadSettings();
    void saveSettings();
    QBoxLayout* createControlLayout();
    QComboBox* createPacksBox();
    QComboBox* createPeriodBox();
    void updateChart();
    void updatePeriodBox();

private slots:
    void changePage(QListWidgetItem* curPage, QListWidgetItem* prevPage);
    void setPack(int packIndex);
    void setPeriod(int index);

private:
    static const QSize GridSize;
    static const int IconSize = 75;

private:
    const Dictionary* dict;
    QListWidget* contentsWidget;
    QLabel* periodLabel;
    QComboBox* periodBox;
    QStackedWidget* pagesWidget;
};

#endif