QTfrontend/teamselhelper.cpp
author displacer
Fri, 18 Aug 2006 20:46:43 +0000
changeset 118 fac200ee771c
parent 117 d21a48200772
child 120 87264c35b09a
permissions -rw-r--r--
pixmap for command as its fort

#include "teamselhelper.h"

#include <QPixmap>
#include <QPushButton>

void TeamLabel::teamButtonClicked()
{
  emit teamActivated(text());
}

TeamShowWidget::TeamShowWidget(HWTeam team, QWidget * parent) :
  QWidget(parent), mainLayout(this), m_team(team)
{
  this->setMaximumHeight(40);
  QLabel* pixlbl=new QLabel();
  pixlbl->setPixmap(QPixmap(QString("../share/hedgewars/Data/Forts/")+m_team.Fort+"L.png").scaledToHeight(30));
  mainLayout.addWidget(pixlbl);

  TeamLabel* lbl=new TeamLabel(team.TeamName);
  mainLayout.addWidget(lbl);

  QPushButton* butt=new QPushButton("o");
  butt->setGeometry(0, 0, 25, 25);
  butt->setMaximumWidth(30);
  mainLayout.addWidget(butt);

  QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam()));
}

void TeamShowWidget::activateTeam()
{
  emit teamStatusChanged(m_team);
}