//============================================================================= // MuseScore // Linux Music Score Editor // $Id:$ // // Qt Dialog Window alpha test template for plugin parametrization // // CopyLeft (C)2010 Bruno Permanne // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //============================================================================= // // This is ECMAScript code (ECMA-262 aka "Java Script") // var Window = new QDialog(); var Button = new QPushButton("Square",Window); var Button2 = new QPushButton("Close",Window); var Label1 = new QLabel("Number",Window); var LineEdit1 = new QLineEdit("2",Window); function Button_clicked(checked) { var x; x=parseFloat(LineEdit1.text); x=x*x; LineEdit1.text=x; } function Button2_clicked(checked) { Window.close(); } //--------------------------------------------------------- // init // this function will be called on startup of // mscore //--------------------------------------------------------- function init() { } //--------------------------------------------------------- // run // this function will be called when activating the // plugin menu entry //--------------------------------------------------------- function run() { Window.resize(320, 240); Window.open(); Window.windowTitle = "Plugin Setup"; Button.move(100, 200); Button.show(); Button.clicked.connect(Button_clicked); Button2.move(200, 200); Button2.show(); Button2.clicked.connect(Button2_clicked); Label1.move(20, 30); Label1.show(); LineEdit1.move(20, 50); LineEdit1.show(); } var mscorePlugin = { menu: 'Plugins. Qt Widgets Test', init: init, run: run }; mscorePlugin;