How to use QT Creator for plugin development

• Jun 3, 2021 - 22:30

I am after assistance with using Qt Creator for plugin development.

I have two initial questions:

1) Opening an existing qml plugin file in Qt Creator I am immediately faced with the fact that Qt Creator throws an 'Unknown component' error with the 'import MuseScore 3.0 statement'. How do I fix this?

2) How do you run a plugin from Qt Creator against/in Musescore?


Comments

1) You don't
2) You don't
Not currently and not with the 3.x sources.

There might be a sliver of hope if you are building against the full sources, but I believe the metadata for Qt Creator to grasp the MuseScore3.0 module in its QML editor is non-existent.

In reply to by Jojo-Schmitz

> "And as far as I can tell also without it complainins about not finding the MuseScore module. If you're setup to build the whole MuseScore with QtCreator too, that is."
It wasn't last time I tried (but that's also been over 2y ago, so perhaps there is some secret sauce by now?)

In reply to by Jojo-Schmitz

I have had a quick look at using Qt Creator as an editor for plugins and it seems to work Ok (that is an understatement it is - much better than Plugin Creator - but that wouldn't be hard to achieve).

I am not set up for whole of MuseScore build. And I am not sure what extra advantage I would get if I were.

From what I have observed, Qt Creator throws an error on the "import MuseScore ... " statement at the start of the plugin file and then ignores (does not highlight or throw errors to) references to MuseScore objects.

The advantages of the qml syntax highlighting, error and warning highlighting, decent indentation and collapsing of code block, find and replace, highlighting of lines of code that have been edited, predictive text etc etc make QT Creator the logical way to go. Despite having to also open the plugin file in the Musescore Plugin Creator to run it.

If you have the same plugin file open in QT Creator (for editing) and Plugin Creator (for running the code), QT Creator will provide notification to the user that the file has been modified outside and saved outside of QT Creator - for instance modified in, and saved from, Plugin Creator. Plugin Creator does not have an equivalent feature. But if it did (so that it would notify of changes to a plugin file made in QT Creator), it would greatly enhance the user friendliness of using Qt Creator as an Editor and Plugin Creator for running the code.

For the future of MuseScore plugin development:
1) I assume that to develop the Plugin Creator to the level that It was a decent IDE would require a lot of work
2) I would also assume that using an existing IDE such as plugin creator would be a lot less work than enhancing Plugin Creator.
3) As an interim measure adding the functionality to Plugin Creator to enable it to notify the user of external changes in the saved version of the open file would be an easy modification that would greatly enhance the usability of using QT Creator and Plugin Creator together - a 'cheap' way to get a lot of the advantage of fully using an IDE such as Qt Creator for plugin development.

Do you make request for feature enhancements by creating an 'issue'. Or is there a separate place to make feature requests?

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