A Qt GUI for Python scripts

What’s the point?

I want to use Qt to create a GUI for the Python scripts that I’ve written so far; extraction, analysis, and synthesis of a quadruped’s motion. The Python scripts need some cleaning up, but they’re working. I want to start by just creating a standalone widget for the scripts, but eventually turn the GUI and scripts into a plugin for Maya 2012.

What’re my options?

I’m seeing two main routes: PySide or PyQt. After searching for the differences between the two and looking at what was said on stackoverflow questions, I’ll go with PyQt. I’m not doing anything too intense. What I’m focused on now is ensuring that everything’s going to install and work together.

PyQt

Before installing, I went through the install directions and noticed that there might be a compatibility issue regarding my system’s versions of OSX and Python and the versions from the instructions. Now I’m trying to find out more information about what’s under Python’s hood. I’m starting with the Python documentation, here. Also, it might be as simple as changing the Qt paths after the installation of the QtSDK as mentioned here.

To install PyQt on my system (OS X 10.6.8), with Xcode installed, download and install SIP and PyQt4 following these directions here.

Getting Started with PyQt (from PyQtWiki)

PySide Binaries for Mac OS X: http://qt-project.org/wiki/PySide_Binaries_MacOSX

Installing PyQt on Mac OS X: here (2009)

Before I follow the above links, I need to determine whether installing SIP and PyQt4 will cause any compatibility issues with my current setup; Python 2.7 on OS X 10.6.8?

QtSDK (Qt Creator? I thought it was called Qt Designer?)

Downloaded and installed the QtSDK and was confused as to where the Qt Designer was located. So much of what I found online was focused on Qt Designer, but after installing and opening the QtSDK, the main application seemed to be called Qt Creator. I started searching for the difference between Creator and Designer, if there was one, and found the following video. It shows that once you’ve created a Qt Widget project for a Desktop GUI and you’re in the project tree to view the hierarchy (in edit mode), open the Forms folder and double click the mainwindow.ui file. This opens the Qt Designer with the visual library.

Maya + Python + Qt

Apparently I need to go over the Maya+Python Book some more. Here’s the book’s website: http://www.maya-python.com/2011/09/building-and-installing-pyqt/

Also, I need to find an answer to this question: What’s Qt modified for Maya 2012 Gold? http://usa.autodesk.com/adsk/servlet/item?id=14561324&siteID=123112

This might be a helpful project to start from also: Codeproject, Intro to QT in Maya 2012 http://www.codeproject.com/Articles/361231/Intro-to-QT-in-Maya-2012

Getting Started With Qt Designer

From Qt’s documents, http://doc.trolltech.com/4.3/designer-getting-started.html

Tutorial looks helpful as well, “Tutorial: Creating GUI Applications in Python with Qt”, http://www.cs.usfca.edu/~afedosov/qttut/

Tutorial from Zetcode.com: http://zetcode.com/tutorials/pyqt4/

“A Simple Tutorial On GUI Programming Using Qt Designer With PyQt4”, (2010) http://lionel.textmalaysia.com/a-simple-tutorial-on-gui-programming-using-qt-designer-with-pyqt4.html#.UDu0S0SEw5I

Leave a comment