I found this article very helpful.
http://talk.maemo.org/archive/index.php/t-43663.html
I'll briefly describe the actions to create and change .ui file to .py file, taken from that article.
- Start Qt Designer from your start menu.
- From "New Form" window, create "Main Window"
- From "Display Widgets" towards the bottom of your "Widget Box Menu" on the left hand side
add a "Label Widget". (Click Drag and Drop)
- Double click on the newly added Label Widget to change its name to "Hello World"
- at this point you can use Control + R hotkey to see how it will look.
- Add buttons or text or other widgets by drag and drop if you want.
- Now save your form.. File->Save As-> "Hello World.ui" (Control + S will also bring up
the "Save As" option) Keep note of the directory where you saved your "Hello World" .ui
file. (I saved mine in (C:) for convenience)
The file is created and saved, now we will Generate the Python code from it using pyuic!
- From your start menu open a command window.
- Now "cd" into the directory where you saved your "Hello World.ui" For me i just had to
"cd\" and was at my "C:>" prompt, where my "Hello World.ui" was saved to.
- When you get to the directory where your file is stored type the following.
- pyuic4 -x helloworld.ui -o helloworld.py
- Congratulations!! You now have a python Qt4 GUI application!!
- Double click your helloworld.py file to run it. ( I use pyscripter and upon double click
it opens in pyscripter, then i "run" the file from there)
Hope this helps someone.