Created
May 24, 2014 09:54
-
-
Save jesperrix/1484975ed496448e8912 to your computer and use it in GitHub Desktop.
Create Gui with Qt Designer and generate python code from it
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
| Install PyQt | |
| brew install pyqt | |
| 1. Create UI with Qt Designer | |
| On Your Desktop machine | |
| Open Qt Designer and create a gui and save it as a file.ui | |
| Example pic: http://farm3.static.flickr.com/2790/4337163813_3da33c11e3.jpg | |
| 2.Generate your Python code. | |
| Open a command window and write following command | |
| pyuic4 -x filename.ui -o filename.py -x generates additional code to allow you to test the ui element the -o tells it where to store the python "executable". | |
| Now run the file generated from the command to test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! Have you found any way to add comments to the output python file or even better divide it into sections?
The way Qt designer works is very helpful, but the python output code is not very intuitive if you want to find/edit a module (ie. button, etc.) especially for more complicated GUIs.
Any idea on how to divide the code in sections or add comments from the designer program? :/