QTfrontend/ui/page/pageeditteam.cpp
changeset 8434 4821897a0f10
parent 8385 9e8924ff9813
child 8913 19a6e59e4441
equal deleted inserted replaced
8432:f2d57e987ba9 8434:4821897a0f10
   368 
   368 
   369 void PageEditTeam::loadTeam(const HWTeam & team)
   369 void PageEditTeam::loadTeam(const HWTeam & team)
   370 {
   370 {
   371     tbw->setCurrentIndex(0);
   371     tbw->setCurrentIndex(0);
   372     binder->resetInterface();
   372     binder->resetInterface();
   373     
   373 
   374     TeamNameEdit->setText(team.name());
   374     TeamNameEdit->setText(team.name());
   375     CBTeamLvl->setCurrentIndex(team.difficulty());
   375     CBTeamLvl->setCurrentIndex(team.difficulty());
   376 
   376 
   377     for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++)
   377     for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++)
   378     {
   378     {
   394 
   394 
   395     QStandardItemModel * binds = DataManager::instance().bindsModel();
   395     QStandardItemModel * binds = DataManager::instance().bindsModel();
   396     for(int i = 0; i < BINDS_NUMBER; i++)
   396     for(int i = 0; i < BINDS_NUMBER; i++)
   397     {
   397     {
   398         if (team.keyBind(i).isEmpty()) continue;
   398         if (team.keyBind(i).isEmpty()) continue;
   399         
   399 
   400         QModelIndexList mdl = binds->match(binds->index(0, 0), Qt::UserRole + 1, team.keyBind(i), 1, Qt::MatchExactly);
   400         QModelIndexList mdl = binds->match(binds->index(0, 0), Qt::UserRole + 1, team.keyBind(i), 1, Qt::MatchExactly);
   401 
   401 
   402         if(mdl.size() == 1)
   402         if(mdl.size() == 1)
   403             binder->setBindIndex(i, mdl[0].row());
   403             binder->setBindIndex(i, mdl[0].row());
   404         else
   404         else