jeetee / MuseScore_TempoChanges

MuseScore (https://musescore.org) plugin applying linear Tempo changes such as accelerando and ritardando.
BSD 3-Clause "New" or "Revised" License
33 stars 13 forks source link

Property get is not a function (Qt 5.15) #27

Open jamesjer opened 3 years ago

jamesjer commented 3 years ago

Using the Fedora 33 build of MuseScore plus TempoChanges 3.4.0, I see these messages on the console:

file:///home/jamesjer/Documents/MuseScore3/Plugins/MuseScore_TempoChanges-3.4.0/TempoChanges.qml:450: TypeError: Property 'get' of object 1 is not a function

I see two of those messages every time I use the plugin. Fedora 33 currently uses Qt 5.15.2. I wondered if the messages might be related to the deprecation of the "onFoo:" properties, so I changed line 449 to:

function onCurrentIndexChanged() { // update the value fields to match the new beatBase

With that change, the error messages are gone. The plugin appeared to operate normally both before and after making the change. I believe the onFoo properties were not deprecated until Qt 5.15, so I don't know at what point you will want to make this change, but just wanted to point out that you will probably want to do so in the future.

jeetee commented 3 years ago

5.15.2 still includes the possibility for using QtQuick.Controls 1.1 (1.4) which still have the onCurrentIndexChanged function.

Your change made it so the event handler is no longer called, but is now just an uncalled function (so no, the plugin likely doesn't work in the same way any longer). You should be able to validate this by inserting a console.log("I was here"); statement inside that function and run it from the Plugin Creator. I'm betting you won't see the log output happening.

What it seems to complain about is the line below, that you can't use get on beatBase.model any longer. Which I also don't (yet) understand, as https://doc.qt.io/qt-5/qml-qtqml-models-listmodel.html#get-method seems to indicate that this is still perfectly ok.

Anyhow; as MuseScore 3 is still on 5.9/5.12 and 5.15 isn't happening until MS4.0 (if it doesn't go straight to 6) and there is no decision yet on how the plugin framework will evolve I'll keep this in mind when the alpha/beta is released to review and update as necessary. Thanks for the heads-up!