Python -QT ?!

Python -QT ?!I have been trying to Program some simple applications with my MAC OSX machine and Python but using a modern GUI feel.

I found Python to be easy syntax and wanted a similarly easy interface building tool.

I found that QT from the Nokia site would do that but it was a long process to get it all installed properly.

Python comes pre-installed on OSX so that bit is straight forward.

The install of QT is a bit more complicated. Need to download the SDK form Nokia but as well the Libraries Package from a second place on the Nika Website. Then you need to run the install procedures of the various packages including SIP and pyQT. (Documentation is in the downloaded directories).

Then you have to change the configuration of the QT Creator to allow for compiling on QT even if really you will only use the “Design” part for the GUI.

update configuration of project
Clic Projects on left of main window
Go to build settings / build steps
Clic Details
setting to add "-spec macx-g++" in the additional argument
rebuild everything so that config change is applied

 

Once the GUI is designed on QT, save the .ui file, then “process” the file with the tool :

then you can run the pyic4 program to convert the .ui file into a full python program.

pyuic4 -x mainwindow.ui -o program.py

Here is a quick video describing how its done : Here.

Just got it working now on my machine and managed to get a ridiculously simple running, now need to find the time to learn the language etc…

 

This entry was posted in Coding. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *