Refresh score after add Element
I have a plugin where I add an element to the cursor:
var foo = newElement( Element.STAFF_TEXT );
foo.text = qsTr("foobar");
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?