Refresh score after add Element
Hi,
I have a plugin where I add an element to the cursor:
var foo = newElement( Element.STAFF_TEXT );
foo.text = qsTr("foobar");
cursor.add(foo);
The element doesn't get drawn until I do something significant, like Save the score, or rerun the plugin. It doesn't refresh for simpler thnigs, like selecting another element in the score, or playing the score, or changing values in Edit Preferences.
How can I force the flush / refresh of the event queue?
Thanks
Comments
It seems to be an interaction with the QT controls. This code adds two text items to the score. Inside the onRun, the text from makeLabel is displayed immediately. From the buttonOK, however, it will only display after major score refreshes like Save.
In reply to It seems to be an interaction by kzh
The trick is to use curScore.startCmd and endCmd within the onClicked callback: