Plugin can set selection but does not see what’s in it

• Aug 27, 2022 - 12:24

If I run SelectTest.qml I get the desired selection , but I invariably (I tried cursor.rewinds etc) get :
SelectTest.qml
Debug: Hello World
Debug: el.length = 0

What am I doing wrong?

EDIT: If I select the measure manually & comment out the programmatic selection
//curScore.selection.selectRange(startTick, endTick+1, 0, curScore.nstaves)
it works: Debug: el.length = 21 (or whatever > 0)


Comments

You forgot to persist your score-changing action (the selection) by wrapping it between startCmd and endCmd.

Sidenote: don't use Qt.quit; check out the plugin development handbook page on why not.

Attachment Size
SelectTest_0-fixed.qml 968 bytes

Do you still have an unanswered question? Please log in first to post your question.