forked from shervinkh/sgu-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
competitionview.h
59 lines (46 loc) · 1.17 KB
/
competitionview.h
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
54
55
56
57
58
59
#ifndef COMPETITIONVIEW_H
#define COMPETITIONVIEW_H
#include <QTableWidget>
#include <QList>
#include <QSize>
#include "statusprocessor.h"
enum CompetitionType {MoreAc, NearAc, DiffAc, DiffSub};
class CompetitionInfo
{
private:
CompetitionType CType;
QString TargetID;
public:
CompetitionInfo() {}
CompetitionInfo(CompetitionType T, const QString &str)
{
CType = T;
TargetID = str;
}
bool operator==(const CompetitionInfo &ci) const
{
return CType == ci.CType && TargetID == ci.TargetID;
}
CompetitionType type() const {return CType;}
QString target() const {return TargetID;}
};
class AccountManager;
class Competition;
class CompetitionView : public QTableWidget
{
Q_OBJECT
private:
AccountManager *am;
Competition *com;
QList<CompetitionInfo> ids;
QString reason(CompetitionType T) const;
protected:
QSize sizeHint() const;
public:
explicit CompetitionView(QWidget *parent = nullptr, AccountManager *am = nullptr,
Competition *com = nullptr);
void setData(const QList<CompetitionInfo> &in);
private slots:
void handleDoubleClick(int row, int col);
};
#endif // COMPETITIONVIEW_H