I'm wanting to get the height of a staff in order to calculate a position below it. But, the Staff object doesn't seem to have any relevant properties. I do see Element properties for staffLines and lineDistance, but I guess those are probably only applicable to "staff type change" objects (not that these seem to be exposed according to the API). I know the number of staff lines and their distance can vary through a score because of these changes, so internally in the code, when one wants to get the number of lines or line distance, you call a function and pass the tick, and this actually gets the property from the corresponding staffType object. But, it seems this isn't made available in the API, unless someone knows a workaround?
Stepping back, the problem I really want to solve is, I wish to set a segment annotation (a staff text, for example) to a given vertical position that is below the staff. The problem is I know the "pos" (measured from top staff line) I want to achieve but not the "offset" (measured from bottom staff line) that will achieve it.
I have a hack solution: temporarily disable autoplace for the element, set its offset to 0, and grab it's pos - that will tell me the staff height. Then I can restore the original values. But this puts an extra weird step onto the undo stack, plus it's just a hack.
> I do see Element properties for staffLines and lineDistance, but I guess those are probably only applicable to "staff type change" objects
what is "staff type change" objects ?
should be line distance * (number of lines-1), so on a default staff would be = 4
can you access the settings in "staff/measure properties" with API?
Another hacky idea:
if at least two elements exist on diff ledger lines:
pagePos QPointF(23.5103, 15.5714)
pagePos QPointF(25.4978, 19.5714)
Another more hacky idea:
maybe read the mscx?
In reply to > I do see Element… by msfp
I found the staff type change object doc, yea not very useful