Qt: Fix GBAKeyEditor focus issues

This commit is contained in:
Jeffrey Pfau 2016-01-17 16:29:05 -08:00
parent 05c3159916
commit 6bc609b1e0
1 changed files with 3 additions and 2 deletions

View File

@ -171,9 +171,10 @@ void GBAKeyEditor::closeEvent(QCloseEvent*) {
} }
bool GBAKeyEditor::event(QEvent* event) { bool GBAKeyEditor::event(QEvent* event) {
if (event->type() == QEvent::WindowActivate) { QEvent::Type type = event->type();
if (type == QEvent::WindowActivate || type == QEvent::Show) {
m_controller->stealFocus(this); m_controller->stealFocus(this);
} else if (event->type() == QEvent::WindowDeactivate) { } else if (type == QEvent::WindowDeactivate || type == QEvent::Hide) {
m_controller->releaseFocus(this); m_controller->releaseFocus(this);
} }
return QWidget::event(event); return QWidget::event(event);