QTfrontend/teamselhelper.cpp
changeset 132 2d0f404cdf05
parent 123 6987769ced3d
child 133 c79cb5e5b24a
equal deleted inserted replaced
131:482f78c595ec 132:2d0f404cdf05
     1 #include "teamselhelper.h"
     1 #include "teamselhelper.h"
       
     2 #include "hwconsts.h"
     2 
     3 
     3 #include <QPixmap>
     4 #include <QPixmap>
     4 #include <QPushButton>
     5 #include <QPushButton>
     5 #include "hwconsts.h"
     6 #include <QPainter>
       
     7 
       
     8 #include "hedgehogerWidget.h"
     6 
     9 
     7 void TeamLabel::teamButtonClicked()
    10 void TeamLabel::teamButtonClicked()
     8 {
    11 {
     9   emit teamActivated(text());
    12   emit teamActivated(text());
    10 }
    13 }
    11 
    14 
    12 TeamShowWidget::TeamShowWidget(HWTeam team, QWidget * parent) :
    15 TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent) :
    13   QWidget(parent), mainLayout(this), m_team(team)
    16   QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying)
    14 {
    17 {
    15   this->setMaximumHeight(40);
    18   this->setMaximumHeight(40);
    16   QPixmap* px=new QPixmap(QPixmap(datadir->absolutePath() + "/Forts/" + m_team.Fort + "L.png").scaled(40, 40));
    19   QPixmap* px=new QPixmap(QPixmap(datadir->absolutePath() + "/Forts/" + m_team.Fort + "L.png").scaled(40, 40));
    17 
    20 
    18   QPushButton* butt=new QPushButton(*px, "", this);
    21   QPushButton* butt=new QPushButton(*px, "", this);
    27   newPalette.setColor(QPalette::Button, palette().color(backgroundRole()));
    30   newPalette.setColor(QPalette::Button, palette().color(backgroundRole()));
    28   bText->setPalette(newPalette);
    31   bText->setPalette(newPalette);
    29   bText->setFlat(true);
    32   bText->setFlat(true);
    30   mainLayout.addWidget(bText);
    33   mainLayout.addWidget(bText);
    31 
    34 
       
    35   if(m_isPlaying) {
       
    36     CHedgehogerWidget* phhoger=new CHedgehogerWidget(this);
       
    37     mainLayout.addWidget(phhoger);
       
    38   }
       
    39 
    32   QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam()));
    40   QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam()));
    33   QObject::connect(bText, SIGNAL(clicked()), this, SLOT(activateTeam()));
    41   QObject::connect(bText, SIGNAL(clicked()), this, SLOT(activateTeam()));
    34 }
    42 }
    35 
    43 
    36 void TeamShowWidget::activateTeam()
    44 void TeamShowWidget::activateTeam()