QTfrontend/ui/widget/teamselhelper.cpp
changeset 7145 1d1a14b39400
parent 7130 fcab1fd02bc6
child 7258 722e8a0d89dc
equal deleted inserted replaced
7144:6e3974128631 7145:1d1a14b39400
    18  */
    18  */
    19 
    19 
    20 #include <QPixmap>
    20 #include <QPixmap>
    21 #include <QPainter>
    21 #include <QPainter>
    22 #include <QStyleFactory>
    22 #include <QStyleFactory>
       
    23 #include <QDebug>
    23 
    24 
    24 #include <algorithm>
    25 #include <algorithm>
    25 
    26 
    26 #include "teamselhelper.h"
    27 #include "teamselhelper.h"
    27 #include "hwconsts.h"
    28 #include "hwconsts.h"
    31 void TeamLabel::teamButtonClicked()
    32 void TeamLabel::teamButtonClicked()
    32 {
    33 {
    33     emit teamActivated(text());
    34     emit teamActivated(text());
    34 }
    35 }
    35 
    36 
    36 TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, FrameTeams * parent) :
    37 TeamShowWidget::TeamShowWidget(const HWTeam & team, bool isPlaying, FrameTeams * parent) :
    37     QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0),
    38     QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0),
    38     colorWidget(0)
    39     colorWidget(0)
    39 {
    40 {
    40     m_parentFrameTeams = parent;
    41     m_parentFrameTeams = parent;
    41     QPalette newPalette = palette();
    42     QPalette newPalette = palette();
    71         colorWidget = new ColorWidget(colorsModel, this);
    72         colorWidget = new ColorWidget(colorsModel, this);
    72         colorWidget->setMinimumWidth(26);
    73         colorWidget->setMinimumWidth(26);
    73         colorWidget->setMaximumWidth(26);
    74         colorWidget->setMaximumWidth(26);
    74         colorWidget->setMinimumHeight(26);
    75         colorWidget->setMinimumHeight(26);
    75         colorWidget->setMaximumHeight(26);
    76         colorWidget->setMaximumHeight(26);
    76         //colorWidget->setGeometry(0, 0, 26, 26);
    77         colorWidget->setColor(team.color());
    77         connect(colorWidget, SIGNAL(colorChanged(int)), this, SLOT(onColorChanged(int)));
    78         connect(colorWidget, SIGNAL(colorChanged(int)), this, SLOT(onColorChanged(int)));
    78         colorWidget->setColor(m_parentFrameTeams->getNextColor());
       
    79         mainLayout.addWidget(colorWidget);
    79         mainLayout.addWidget(colorWidget);
    80 
    80 
    81         phhoger = new CHedgehogerWidget(QImage(":/res/hh25x25.png"), QImage(":/res/hh25x25grey.png"), this);
    81         phhoger = new CHedgehogerWidget(QImage(":/res/hh25x25.png"), QImage(":/res/hh25x25grey.png"), this);
    82         connect(phhoger, SIGNAL(hedgehogsNumChanged()), this, SLOT(hhNumChanged()));
    82         connect(phhoger, SIGNAL(hedgehogsNumChanged()), this, SLOT(hhNumChanged()));
    83         phhoger->setHHNum(team.numHedgehogs());
    83         phhoger->setHHNum(team.numHedgehogs());