65 void FrameTeams::addTeam(HWTeam team, bool willPlay) |
65 void FrameTeams::addTeam(HWTeam team, bool willPlay) |
66 { |
66 { |
67 TeamShowWidget* pTeamShowWidget = new TeamShowWidget(team, willPlay, this); |
67 TeamShowWidget* pTeamShowWidget = new TeamShowWidget(team, willPlay, this); |
68 if(nonInteractive) pTeamShowWidget->setNonInteractive(); |
68 if(nonInteractive) pTeamShowWidget->setNonInteractive(); |
69 // int hght=teamToWidget.empty() ? 0 : teamToWidget.begin()->second->size().height(); |
69 // int hght=teamToWidget.empty() ? 0 : teamToWidget.begin()->second->size().height(); |
|
70 mainLayout.addWidget(pTeamShowWidget); |
70 teamToWidget.insert(team, pTeamShowWidget); |
71 teamToWidget.insert(team, pTeamShowWidget); |
71 mainLayout.addWidget(pTeamShowWidget); |
|
72 QResizeEvent* pevent=new QResizeEvent(parentWidget()->size(), parentWidget()->size()); |
72 QResizeEvent* pevent=new QResizeEvent(parentWidget()->size(), parentWidget()->size()); |
73 QCoreApplication::postEvent(parentWidget(), pevent); |
73 QCoreApplication::postEvent(parentWidget(), pevent); |
74 } |
74 } |
75 |
75 |
76 void FrameTeams::removeTeam(HWTeam team) |
76 void FrameTeams::removeTeam(HWTeam team) |
77 { |
77 { |
78 tmapTeamToWidget::iterator it=teamToWidget.find(team); |
78 tmapTeamToWidget::iterator it=teamToWidget.find(team); |
|
79 if(it==teamToWidget.end()) return; |
79 mainLayout.removeWidget(it.value()); |
80 mainLayout.removeWidget(it.value()); |
80 delete it.value(); |
81 delete it.value(); |
81 teamToWidget.erase(it); |
82 teamToWidget.erase(it); |
|
83 } |
|
84 |
|
85 void FrameTeams::resetTeams() |
|
86 { |
|
87 for(tmapTeamToWidget::iterator it=teamToWidget.begin(); it!=teamToWidget.end(); ) { |
|
88 mainLayout.removeWidget(it.value()); |
|
89 delete it.value(); |
|
90 teamToWidget.erase(it++); |
|
91 } |
82 } |
92 } |
83 |
93 |
84 void FrameTeams::setHHNum(const HWTeam& team) |
94 void FrameTeams::setHHNum(const HWTeam& team) |
85 { |
95 { |
86 TeamShowWidget* pTeamShowWidget = dynamic_cast<TeamShowWidget*>(getTeamWidget(team)); |
96 TeamShowWidget* pTeamShowWidget = dynamic_cast<TeamShowWidget*>(getTeamWidget(team)); |