Can't use onScoreStateChanged

• Oct 30, 2019 - 18:44

Hello,

I'm trying to use a basic listener/event in my main PluginAPI class named Musescore but I can't even execute cause of : "ligne 20: Cannot assign to non-existent property "onScoreStateChanged""
But on the Doxygen documentation, every PluginAPI object seems to have this property.
And also, the code I'm trying is the basic "selectionChangeExample" plugin...
I'm not a QML/Qt pro, so please someone can help me ? Here is the code :


import QtQuick 2.0
import MuseScore 3.0
MuseScore {
menuPath: "Plugins.selectionChangeExample"
pluginType: "dock"
dockArea: "left"
implicitHeight: 75 // necessary for dock widget to appear with nonzero height
implicitWidth: 150

Text {
// A label which will display pitch of the currently selected note
id: pitchLabel
anchors.fill: parent
}
onRun: {
console.log(this);
console.log(Object.keys(this));
}
curScore.onScoreStateChanged: {
if (state.selectionChanged) {
var el = curScore ? curScore.selection.elements[0] : null;
if (el && el.type == Element.NOTE)
pitchLabel.text = el.pitch;
else
pitchLabel.text = "no note selected";
}
}
}


Comments

Are you trying this in the 3.3-release candidate or the current stable version (3.2.3) ?

This feature is only available from 3.3+. The release is scheduled for tomorrow, but the documentation has already been updated in anticipation of it.

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