QTfrontend/ui/widget/frameTeam.cpp
changeset 7258 722e8a0d89dc
parent 7130 fcab1fd02bc6
child 9080 9b42757d7e71
equal deleted inserted replaced
7256:5b97b9946cde 7258:722e8a0d89dc
    23 #include <QStandardItemModel>
    23 #include <QStandardItemModel>
    24 
    24 
    25 #include "frameTeam.h"
    25 #include "frameTeam.h"
    26 #include "teamselhelper.h"
    26 #include "teamselhelper.h"
    27 #include "hwconsts.h"
    27 #include "hwconsts.h"
       
    28 #include "DataManager.h"
    28 
    29 
    29 FrameTeams::FrameTeams(QWidget* parent) :
    30 FrameTeams::FrameTeams(QWidget* parent) :
    30     QFrame(parent), maxHedgehogsPerGame(48), overallHedgehogs(0), mainLayout(this), nonInteractive(false)
    31     QFrame(parent), maxHedgehogsPerGame(48), overallHedgehogs(0), mainLayout(this), nonInteractive(false)
    31 {
    32 {
    32     QPalette newPalette = palette();
    33     QPalette newPalette = palette();
    52     }
    53     }
    53 }
    54 }
    54 
    55 
    55 void FrameTeams::resetColors()
    56 void FrameTeams::resetColors()
    56 {
    57 {
    57     currentColor = colorsModel->rowCount() - 1; // ensure next color is the first one
    58     currentColor = DataManager::instance().colorsModel()->rowCount() - 1; // ensure next color is the first one
    58 }
    59 }
    59 
    60 
    60 int FrameTeams::getNextColor()
    61 int FrameTeams::getNextColor()
    61 {
    62 {
    62     currentColor = (currentColor + 1) % colorsModel->rowCount();
    63     currentColor = (currentColor + 1) % DataManager::instance().colorsModel()->rowCount();
    63     return currentColor;
    64     return currentColor;
    64 }
    65 }
    65 
    66 
    66 void FrameTeams::addTeam(HWTeam team, bool willPlay)
    67 void FrameTeams::addTeam(HWTeam team, bool willPlay)
    67 {
    68 {