title: PyQt4 - Custom widget class structure?
body: <p>During regular intervals of my program, a block (of 3 stacked) widgets need to be added to a horizontal layout. Since the widgets within each block are important to eachother, I wish to encapsulate each stack as it's own widget (making the layout adding business much easier).</p>
  
  <p>I'm having trouble getting PyQt4 to recognise my 'stack' as a widget.</p>
  
  <p>I made the widget stack in Qt Designer (as form: widget) and converted it to a .py via<br>
  'pyuic4 DesignerFile.ui > ClassFile.py'.</p>
  
  <p>Now I can't seem to add this 'stack' (parent widget of 3 child widgets) to the layout via .addWidget( Class ).</p>
  
  <p>I tried constructing a super class of the stack class (because I need to add more functionality to the stack) but the instance of the class is either...  </p>
  
  <ul>
  <li>Not recognised as a widget</li>
  <li>Invisible</li>
  <li>defective because I've no idea on how to structure the super class.</li>
  </ul>
  
  <p>Here's what I'm failing with at the moment (though it's about the 8th class structure I've tried):</p>
  
  <pre><code>from ClassFile import ClassCode
  
  class Stack(ClassCode):
      def __init__(self,parent= None):
          QtGui.QWidget.__init__(self,parent)
  </code></pre>
  
  <p>Could somebody help me structure this or lead me to some good examples?<br>
  (I've mimicked the code in both the following sources but with no avail!!<br>
  <a href="http://lateral.netmanagers.com.ar/stories/27.html#what-you-need-to-follow-the-tutorial" rel="noreferrer">http://lateral.netmanagers.com.ar/stories/27.html#what-you-need-to-follow-the-tutorial</a><br>
  <a href="http://zetcode.com/tutorials/pyqt4/customwidgets/" rel="noreferrer">http://zetcode.com/tutorials/pyqt4/customwidgets/</a> )</p>
  
  <p>Thanks!</p>
  
  <p>Specs:<br>
  python 2.7.2<br>
  PyQt4<br>
  Windows 7</p>