50
|
1 |
#ifndef _TEAM_SELECT_INCLUDED
|
|
2 |
#define _TEAM_SELECT_INCLUDED
|
|
3 |
|
|
4 |
#include <QWidget>
|
|
5 |
#include <QVBoxLayout>
|
|
6 |
|
|
7 |
#include <list>
|
|
8 |
#include <map>
|
|
9 |
|
|
10 |
using namespace std;
|
|
11 |
|
|
12 |
struct tmprop
|
|
13 |
{
|
|
14 |
tmprop(QString nm) : teamName(nm){};
|
|
15 |
QString teamName;
|
|
16 |
QString pixmapFileName;
|
|
17 |
bool operator==(const tmprop& t1) const {
|
|
18 |
return teamName==t1.teamName;
|
|
19 |
};
|
|
20 |
bool operator<(const tmprop& t1) const {
|
|
21 |
return teamName<t1.teamName;
|
|
22 |
};
|
|
23 |
};
|
|
24 |
|
|
25 |
class TeamSelWidget : public QWidget
|
|
26 |
{
|
|
27 |
Q_OBJECT
|
|
28 |
|
|
29 |
public:
|
|
30 |
TeamSelWidget(const vector<QString>& teams, QWidget* parent=0);
|
|
31 |
void addTeam(tmprop team);
|
|
32 |
void removeTeam(tmprop team);
|
|
33 |
|
|
34 |
private slots:
|
|
35 |
void changeTeamStatus(tmprop team);
|
|
36 |
|
|
37 |
private:
|
|
38 |
QVBoxLayout mainLayout;
|
|
39 |
QGridLayout playingLayout;
|
|
40 |
QGridLayout dontPlayingLayout;
|
|
41 |
|
|
42 |
list<tmprop> curPlayingTeams;
|
|
43 |
list<tmprop> curDontPlayingTeams;
|
|
44 |
map<tmprop, QWidget*> teamToWidget;
|
|
45 |
};
|
|
46 |
|
|
47 |
#endif // _TEAM_SELECT_INCLUDED
|