forked from Drifter321/admintool
-
Notifications
You must be signed in to change notification settings - Fork 1
/
customitems.h
47 lines (40 loc) · 1 KB
/
customitems.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
#ifndef PLAYERTIMEITEM_H
#define PLAYERTIMEITEM_H
#include <QTableWidgetItem>
class ServerInfo;
class MainWindow;
//Time played in player area
class PlayerTimeTableItem : public QTableWidgetItem
{
public:
void updateTime(float newTime);
bool operator< (const QTableWidgetItem &other) const
{
return (this->time < ((PlayerTimeTableItem *)&other)->time);
}
float getTime(){return time;}
private:
void setTime();
float time;
};
//Server items
class ServerTableIndexItem : public QTableWidgetItem
{
public:
ServerTableIndexItem(ServerInfo *info);
ServerTableIndexItem(ServerInfo *info, QString text);
ServerInfo *GetServerInfo(){return serverInfo;}
private:
ServerInfo *serverInfo = nullptr;
};
//Player count in browser area
class PlayerTableItem : public QTableWidgetItem
{
public:
bool operator< (const QTableWidgetItem &other) const
{
return (this->players < ((PlayerTableItem *)&other)->players);
}
int players;
};
#endif // PLAYERTIMEITEM_H