Merge pull request #1978 from Wallacoloo/pianorollfocus

Give focus to the PianoRoll widget when its window is opened
This commit is contained in:
Tres Finocchiaro
2015-04-19 15:06:27 +00:00
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());
}