Unable to assign QJSValue to QString
Since the Harmony object practically does not exist in Musecore 3 (why?), I have to translate the text to a Chord object. The first part is to read Chords.xml, and since there is no XML parser, I have to parse it myself.
However, from the middle of nowhere, I got a bunch of errors:
18:33: Unable to assign QJSValue to QString
18:33: Unable to assign QJSValue to QString
18:33: Unable to assign QJSValue to QString
(20 at all)
I can go on working, but it's annoying.
Here is my work. What's Wrong with it?
Attachment | Size |
---|---|
Test.qml | 1.76 KB |
Comments
You'll probably need a .toString() somewhere; my first guess would be at line 60 (
console.log(key,"'", object[key], "'");
).Harmony indeed doesn't seem ported yet (why? time and contributions, that's why). Might it not be easier to put in a feature request to reinstate it?
In reply to You'll probably need a … by jeetee
You gave me the right direction, but the actual error was here: "property string chordsStack : [];". Changing 'string' to 'var' solved the problem. Thanks.
The Harmony object wasn't good enough on version 2, and I don't expect it to be better now. https://musescore.org/en/node/231191.
In reply to You gave me the right… by gideonrv
Ah yes, totally missed that. An array indeed isn't a string, and a property being a QML thing means that that string referred to a QString, which then can't be assigned the JavaScript empty array object.
Thanks for #231191: Harmony Object