Editing parts from plugins
Reported version
3.2
Type
Plugins
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project
Coming from this comment.
When you create an element from qml (using the newElement()
method) the element's score property is set to the current score, and is not editable after. So when you try to add the element to any other score using cursor.add
, the element is added to the other score, but it's score property still refers to the score.
I see 3 way of dealing with this:
- Allowing READ and WRITE of the element's score property from QML
- Changing the newElement method as described there
- Changing cursor::add method: After this line, add something like s.setScore(_score)
btw, should lines 185 to 197 be refactored into the switch case
Fix version
3.3.3
Comments
Sorry, I don't quite understand from the description what this issue is about. Is this about being able to edit excerpts from a plugin? If so, this should be totally possible by finding those excerpt scores via
Score.excerpts
property. If you want to operate on that property with a Cursor API, just callscore.newCursor()
on a correspondingscore
object, it is not mandatory that exactlycurScore
should be used there. If you need to copy elements between scores you should probably obtain an element's copy viaelement.clone()
first. Does this cover what is requested here, or is this issue about something else?The simplest way to show this would be to ask you to run this plugin on the score in that same repo (ExportBreaksToPartPluginTestFile.mscz)
You will see that it will work: breaks will be copied to the parts. Unfortunately, if you go to the parts and click on a break, it should do something really strange: it shows the masterScore...
How it currently is:
How it could be:
Ah, so the added elements still think that they belong to a different score. Then this is an issue indeed. I would probably resolve it though by setting a correct score in
Cursor.add()
(and probablyChord.add()
) method. It seems logical that the elements added to some score should automatically belong to it without requiring extra explicit actions from a user (in this case, from a plugin developer).Fixed in branch master, commit bd7fde69c5
fix #295465: ensure that elements added from plugins belong to a correct score
Automatically closed -- issue fixed for 2 weeks with no activity.