Arbitration: fix a focus problem

This commit is contained in:
Olivier Teulière 2012-10-06 16:18:15 +02:00
parent 97f4355502
commit e55f05e325
2 changed files with 3 additions and 2 deletions

View file

@ -214,7 +214,6 @@ ArbitrationWidget::ArbitrationWidget(QWidget *parent,
refresh(); refresh();
// Give focus to the rack // Give focus to the rack
// FIXME: for some reason, the focus gets lost later...
lineEditRack->setFocus(); lineEditRack->setFocus();
lineEditRack->selectAll(); lineEditRack->selectAll();
} }

View file

@ -409,7 +409,9 @@ void MainWindow::updateForGame(PublicGame *iGame)
setWindowTitle(_q("Arbitration game") + " - Eliot"); setWindowTitle(_q("Arbitration game") + " - Eliot");
m_ui.groupBoxPlayers->setTitle(_q("Arbitration")); m_ui.groupBoxPlayers->setTitle(_q("Arbitration"));
m_arbitrationWidget = new ArbitrationWidget(NULL, iGame, m_coordModel); // Note: we specify the parent immediately, otherwise the
// reparenting creates focus issues
m_arbitrationWidget = new ArbitrationWidget(m_ui.groupBoxPlayers, iGame, m_coordModel);
m_ui.groupBoxPlayers->layout()->addWidget(m_arbitrationWidget); m_ui.groupBoxPlayers->layout()->addWidget(m_arbitrationWidget);
QObject::connect(m_arbitrationWidget, SIGNAL(gameUpdated()), QObject::connect(m_arbitrationWidget, SIGNAL(gameUpdated()),
this, SIGNAL(gameUpdated())); this, SIGNAL(gameUpdated()));