QTfrontend/frameTeam.cpp
changeset 348 c91b983de18f
parent 341 184230eb4151
child 352 4665bfe25470
--- a/QTfrontend/frameTeam.cpp	Wed Jan 17 19:56:51 2007 +0000
+++ b/QTfrontend/frameTeam.cpp	Wed Jan 17 21:32:52 2007 +0000
@@ -48,7 +48,7 @@
 {
   TeamShowWidget* pTeamShowWidget = new TeamShowWidget(team, willPlay, this);
 //  int hght=teamToWidget.empty() ? 0 : teamToWidget.begin()->second->size().height();
-  teamToWidget.insert(make_pair(team, pTeamShowWidget));
+  teamToWidget.insert(team, pTeamShowWidget);
   mainLayout.addWidget(pTeamShowWidget);
   QResizeEvent* pevent=new QResizeEvent(parentWidget()->size(), parentWidget()->size());
   QCoreApplication::postEvent(parentWidget(), pevent);
@@ -57,15 +57,15 @@
 void FrameTeams::removeTeam(HWTeam team)
 {
   tmapTeamToWidget::iterator it=teamToWidget.find(team);
-  mainLayout.removeWidget(it->second);
-  delete it->second;
-  teamToWidget.erase(team);
+  mainLayout.removeWidget(it.value());
+  delete it.value();
+  teamToWidget.erase(it);
 }
 
 QWidget* FrameTeams::getTeamWidget(HWTeam team)
 {
   tmapTeamToWidget::iterator it=teamToWidget.find(team);
-  QWidget* ret = it!=teamToWidget.end() ? it->second : 0;
+  QWidget* ret = it!=teamToWidget.end() ? it.value() : 0;
   return ret;
 }