general info on QT as it relates to MuseScore plugins?
I've got a few plugins in the works. At least one would involve creating a dialog box / GUI, but that task is a bit a daunting to me, not being familiar with QT. I'm trying to crib what I can from other plugins, but am wondering if there are specific resources I should be checking out for info. There is, needless to say, an overwhelming amount of info on QT in general, but I'm trying to figure out what I actually need - and can access - for creating some basic dialog boxes.
Comments
You can almost access any class of the Qt Framework. (note that it's Qt not QT).
The easiest way to make a dialog or UI is to use Qt Creator. Qt Creator is installed with your version of Qt normally.
my.ui
//read the UI file and create a form out of it
var loader = new QUiLoader(null);
var file = new QFile(pluginPath + "/my.ui");
file.open(QIODevice.OpenMode(QIODevice.ReadOnly, QIODevice.Text));
form = loader.load(file, null);
//initialize some widget value if necessary
form.verticalLayoutWidget.myLabel.text = curScore.title;
form.verticalLayoutWidget.myLabel2.text = curScore.composer;
//connect signal
form.searchBtn.clicked.connect(doSomething);
form.closeBtn.clicked.connect(close);
//show the form
form.show();
The "break" plugin is a good and simple example of this process. Should I put this in the plugin documentation? An idea for a title?
In reply to You can almost access any by [DELETED] 5
Thanks for the info, and yes, I think this would be good for the plugin docs. "Creating a GUI using Qt" would make a nice title.
I had uninstalled Qt in anticipation of setting up a build environment on an external drive, but this may be the incentive I need to re-install it.
In reply to Thanks for the info, and yes, by Marc Sabatella
I added to the "'how to" for plugin development : http://musescore.org/en/plugin-development/how-plugin-development