Splitting a plugin into two qml files or more
For readability reasons, I want to move a part of the plugin into another qml file. Is there an #include or a similar directive?
For readability reasons, I want to move a part of the plugin into another qml file. Is there an #include or a similar directive?
Do you still have an unanswered question? Please log in first to post your question.
Comments
I believe it should be possible to use
import myotherfile.js
, but I'm not sure how the relative path would be resolved.In reply to I believe it should be… by jeetee
The Quarter tone playback plugin uses
import "./"
Basically, you should be able to do one of the following:
utils.js
) and put an import statement to the beginning of the file likeimport "utils.js" as Utils
After that you should be able to use it in your QML file as
var a = Utils.someFunction(b, c);
In reply to Basically, you should be… by dmitrio95
looks like the js import works fine, but the qml does not. See also https://musescore.org/en/comment/965777#comment-965777
EDIT: the js imports also don't work.
In reply to looks like the js import… by ecstrema
It would probably not work from a Plugin Creator built into MuseScore but should work fine if running a plugin from a menu. So there is likely an issue with Plugin Creator here.
In reply to It would probably not work… by dmitrio95
both don't work for me.
In reply to both don't work for me. by ecstrema
Here is a simple example of plugin that uses both separate .qml and .js files (attached below). It works without any issues for me if I enable this plugin from Plugin Manager and execute it via a menu entry.
In reply to Here is a simple example of… by dmitrio95
wow, good news! I guess it was my fault then!
Weird that it doesn't work from plugin creator though...
In reply to wow, good news! I guess it… by ecstrema
Plugin Creator issue should be fixed now with this commit.
In reply to Plugin Creator issue should… by dmitrio95
I have a plugin that imports other files. When I make changes to those (I use VSCode) and then click update in Musescore's "Plugin Creator", those files are not updated as it seems... any chance to implement that, too?
EDIT: I just realized that I can delete the cached version (*.qmlc) of external files, but that doesn't do it either.
In reply to Plugin Creator issue should… by dmitrio95
plugin creator issue is not fixed for me...