I liked Qt Designer on Windows so much for making GUIs for Python applications (using PyQt4) that I went and tried to install it on my Mac (under OSX 10.6.6).
At this point, I have successfully installed SIP, Qt4, and PyQt4.
The PyQt binary installers (for Windows) include a version of Qt Designer that works with PyQt. On OSX, there is no binary installer, just source. So no Qt Designer.
The Qt website offers Qt Creator as a download, but as far as I can tell, it requires that you’re writing code in C/C++.
Is there a way to make Qt Creator work with PyQt? Or is there another GUI designer for PyQt that works on a Mac?
Thanks!
-Wesley
If you’ve installed Qt4, then you have Qt Designer. If you used the installer from qt.nokia.com, it should be in /Developer/Applications/Qt.
Qt Designer itself works just fine with PyQt. Qt designer just spits out XML describing the UI structure. If you were using standard Qt with C++, you would have to run the
uictool to generate C++ from the .ui files. Likewise, with PyQt4, you must runpyuic4on the generated .ui file to create python source from it.If you’re looking for a full IDE solution that handles all of this with PyQt automatically, I’m unaware of the existence of one. I just have a
build_helper.pyscript that processes all of my .ui files and places them in the appropriate place in the python package I’m developing. I run the build helper script before running the actual main program to ensure that the generated code is up to date.All of my .ui files go into a subfolder
uiin the project root. The script then creates python source and places it into ‘myapp/ui/generated’.For example:
I also have a few other functions in there for running
pyrcc4for resource compilation andpylupdate4andlreleaseto generate translations.