Give focus to AutomationEditor when the window gets the foucs (#5170)

This will make shortcuts work on opening the editor.
This commit is contained in:
https://gitlab.com/users/CYBERDEViLNL
2019-10-02 01:00:11 +02:00
committed by Hyunjin Song
parent 867639929a
commit 5132d91bfc
2 changed files with 10 additions and 0 deletions

View File

@@ -297,6 +297,9 @@ public slots:
signals:
void currentPatternChanged();
protected:
virtual void focusInEvent(QFocusEvent * event);
protected slots:
void play();
void stop();

View File

@@ -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();