diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index 9705c5efa6a..968bb34bef9 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -297,6 +297,9 @@ public slots: signals: void currentPatternChanged(); +protected: + virtual void focusInEvent(QFocusEvent * event); + protected slots: void play(); void stop(); diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 94e9d5cc86a..7583501c78e 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -198,6 +198,8 @@ AutomationEditor::AutomationEditor() : setCurrentPattern( NULL ); setMouseTracking( true ); + setFocusPolicy( Qt::StrongFocus ); + setFocus(); } @@ -2516,6 +2518,11 @@ void AutomationEditorWindow::clearCurrentPattern() setCurrentPattern(nullptr); } +void AutomationEditorWindow::focusInEvent(QFocusEvent * event) +{ + m_editor->setFocus( event->reason() ); +} + void AutomationEditorWindow::play() { m_editor->play();