Give focus to the PianoRoll widget when its window is opened

This commit is contained in:
Colin Wallace
2015-04-18 21:00:02 +00:00
parent 435a15d8bf
commit 382aec66f3
2 changed files with 8 additions and 0 deletions

View File

@@ -384,6 +384,8 @@ signals:
void currentPatternChanged();
private:
void focusInEvent(QFocusEvent * event);
PianoRoll* m_editor;
ComboBox * m_zoomingComboBox;

View File

@@ -4236,3 +4236,9 @@ QSize PianoRollWindow::sizeHint() const
{
return {m_toolBar->sizeHint().width() + 10, INITIAL_PIANOROLL_HEIGHT};
}
void PianoRollWindow::focusInEvent(QFocusEvent * event)
{
// when the window is given focus, also give focus to the actual piano roll
m_editor->setFocus(event->reason());
}