QTfrontend/teamselhelper.cpp
author unc0rr
Tue, 25 Jul 2006 20:19:46 +0000
changeset 86 664b536a1c27
parent 84 0f6669da2fcb
child 116 00d3d6d2e699
permissions -rw-r--r--
Predefined teams, 'simple game' doesn't need to create team
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
80
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
     1
#include "teamselhelper.h"
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
     2
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
     3
#include <QPixmap>
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
     4
#include <QPushButton>
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
     5
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
     6
void TeamLabel::teamButtonClicked()
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
     7
{
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
     8
  emit teamActivated(text());
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
     9
}
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    10
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    11
TeamShowWidget::TeamShowWidget(tmprop team, QWidget * parent) :
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    12
  QWidget(parent), mainLayout(this), m_team(team)
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    13
{
86
664b536a1c27 Predefined teams, 'simple game' doesn't need to create team
unc0rr
parents: 84
diff changeset
    14
  this->setMaximumHeight(40);
80
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    15
  QLabel* pixlbl=new QLabel();
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    16
  pixlbl->setPixmap(QPixmap("./Data/Graphics/thinking.png"));
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    17
  mainLayout.addWidget(pixlbl);
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    18
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    19
  TeamLabel* lbl=new TeamLabel(team.teamName);
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    20
  mainLayout.addWidget(lbl);
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    21
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    22
  QPushButton* butt=new QPushButton("o");
84
0f6669da2fcb Start rewrite ui
unc0rr
parents: 80
diff changeset
    23
  butt->setGeometry(0, 0, 25, 25);
86
664b536a1c27 Predefined teams, 'simple game' doesn't need to create team
unc0rr
parents: 84
diff changeset
    24
  butt->setMaximumWidth(30);
80
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    25
  mainLayout.addWidget(butt);
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    26
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    27
  QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam()));
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    28
}
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    29
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    30
void TeamShowWidget::activateTeam()
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    31
{
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    32
  emit teamStatusChanged(m_team);
3c3dc6a148ca - Fixed bug with hedgehog under water using rope
unc0rr
parents: 63
diff changeset
    33
}