Created
March 10, 2012 17:45
-
-
Save lasconic/2012268 to your computer and use it in GitHub Desktop.
Creating a GUI in QtScript using .ui file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
COOL I love you