From e55f05e3254e65a6d0869a491c8ba95a26677fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Sat, 6 Oct 2012 16:18:15 +0200 Subject: [PATCH] Arbitration: fix a focus problem --- qt/arbitration_widget.cpp | 1 - qt/main_window.cpp | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qt/arbitration_widget.cpp b/qt/arbitration_widget.cpp index 8c63a72..1e8f716 100644 --- a/qt/arbitration_widget.cpp +++ b/qt/arbitration_widget.cpp @@ -214,7 +214,6 @@ ArbitrationWidget::ArbitrationWidget(QWidget *parent, refresh(); // Give focus to the rack - // FIXME: for some reason, the focus gets lost later... lineEditRack->setFocus(); lineEditRack->selectAll(); } diff --git a/qt/main_window.cpp b/qt/main_window.cpp index c75ad5e..b5f9fc9 100644 --- a/qt/main_window.cpp +++ b/qt/main_window.cpp @@ -409,7 +409,9 @@ void MainWindow::updateForGame(PublicGame *iGame) setWindowTitle(_q("Arbitration game") + " - Eliot"); 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); QObject::connect(m_arbitrationWidget, SIGNAL(gameUpdated()), this, SIGNAL(gameUpdated()));