Redrawing/updating score view
In my plugin I'm planning a lot of tools, which would be opened in windows on top of main MuseScore's window. The windows uses Qt.WindowStaysOnTopHint flag.
First, I'm not sure if it's should work as I use it, but I've found, that simple code:
var cursor = curScore.newCursor() cursor.rewind(1) cursor.setDuration(1, 4) cursor.addNote(60)
does not shows any note as long as I don't update the score view manually (switching between page view and continuous view, for example). Then I found doLayout() method:
var cursor = curScore.newCursor() cursor.rewind(1) cursor.setDuration(1, 4) cursor.addNote(60) curScore.doLayout()
And now the generated note is visible, but only when I click on the score view (put the MuseScore's window on foreground).
Is it possible to make changes visible in place? For example, I push a button in my foreground window, the example code is evaluating and a generated note is appeared on the score in the selected measure without any other actions.