in this template beside just importation of PyQt4 , I have made an import of SIP module, SIP is the communication layer between PyQt wrapping and actual Qt binaries. This does the communication between the C++ object and the Python object.
Note, that I have used QMainWindow as the base class from which I inherit, but instead we can also use QWidget or QDialog . Although using QWidget would make more sense if you are making a window that is going to dock or just be part of maya main window because maya main window itself is a QMainWindow. However using QMainWindow provides immediate methods for managing toolbars, menus, and statusbar, along with dock widgets.
Blog, Website Content, VFX Showreel work & Tools & Scripts by Sanjeev Kumar is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.