This has nothing to do with Tables haha - sorry.<br><br><div class="gmail_quote">On Wed, Sep 9, 2009 at 3:35 PM, Taylor Carrasco <span dir="ltr">&lt;<a href="mailto:crackerbunny@gmail.com">crackerbunny@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><p>In Python and Pyqt - I&#39;ve got a simple class which instantiates a Label class and a GroupBox class. </p>


<p>Should passing the Groupbox to the Label upon creation
should make the Groupbox the parent of Label?</p><p> When I create the GroupBox it&#39;s fine,
when I create the Label however - it appears distorted (or perhaps
behind the GroupBox?)</p><pre><br><code><span><br><br>from</span><span> PyQt4</span><span>.</span><span>QtCore</span><span> </span><span>import</span><span> </span><span>*</span><span> <br>
</span><span>from</span><span> PyQt4</span><span>.</span><span>QtGui</span><span> </span><span>import</span><span> </span><span>*</span><span><br>
</span><span>import</span><span> sys<br><br></span><span>class</span><span> </span><span>FileBrowser</span><span>(</span><span>QMainWindow</span><span>):</span><span><br>
    </span><span>def</span><span> __init__</span><span>(</span><span>self</span><span>):</span><span><br>        </span><span>QMainWindow</span><span>.</span><span>__init__</span><span>(</span><span>self</span><span>)</span><span><br>

<br>        </span><span>self</span><span>.</span><span>setGeometry</span><span>(</span><span>0</span><span>,</span><span> </span><span>0</span><span>,</span><span> </span><span>920</span><span>,</span><span> </span><span>780</span><span>)</span><span><br>

        </span><span>self</span><span>.</span><span>initClasses</span><span>()</span><span><br><br>    </span><span>def</span><span> initClasses</span><span>(</span><span>self</span><span>):</span><span><br>
        </span><span># GroupBox</span><span><br>        </span><span>self</span><span>.</span><span>groupBox1 </span><span>=</span><span> </span><span>GroupBox</span><span>(</span><span>self</span><span>,</span><span> </span><span>QRect</span><span>(</span><span>20</span><span>,</span><span> </span><span>10</span><span>,</span><span> </span><span>191</span><span>,</span><span> </span><span>131</span><span>),</span><span>  </span><span>&#39;Shot Info&#39;</span><span>)</span><span><br>

<br>        </span><span># Label</span><span><br>        </span><span>self</span><span>.</span><span>labelGroup1_ShotInfo </span><span>=</span><span> </span><span>Label</span><span>(</span><span>self</span><span>,</span><span> </span><span>QRect</span><span>(</span><span>10</span><span>,</span><span> </span><span>26</span><span>,</span><span> </span><span>52</span><span>,</span><span> </span><span>15</span><span>),</span><span>  </span><span>&#39;Film&#39;</span><span>)</span><span><br>

<br></span><span>class</span><span> </span><span>GroupBox</span><span>(</span><span>QWidget</span><span>):</span><span> <br>    </span><span>def</span><span> __init__</span><span>(</span><span>self</span><span>,</span><span> parent</span><span>,</span><span>  geo</span><span>,</span><span>  title</span><span>):</span><span> <br>

        </span><span>QWidget</span><span>.</span><span>__init__</span><span>(</span><span>self</span><span>,</span><span> parent</span><span>)</span><span><br>
        obj </span><span>=</span><span> </span><span>QGroupBox</span><span>(</span><span>parent</span><span>)</span><span><br>        obj</span><span>.</span><span>setGeometry</span><span>(</span><span>geo</span><span>)</span><span><br>

        obj</span><span>.</span><span>setTitle</span><span>(</span><span>title</span><span>)</span><span><br><br></span><span>class</span><span> </span><span>Label</span><span>(</span><span>QWidget</span><span>):</span><span> <br>

    </span><span>def</span><span> __init__</span><span>(</span><span>self</span><span>,</span><span> parent</span><span>,</span><span>  geo</span><span>,</span><span>  text</span><span>):</span><span> <br>
        </span><span>QWidget</span><span>.</span><span>__init__</span><span>(</span><span>self</span><span>,</span><span> parent</span><span>)</span><span><br>
        obj </span><span>=</span><span> </span><span>QLabel</span><span>(</span><span>parent</span><span>)</span><span><br>        obj</span><span>.</span><span>setGeometry</span><span>(</span><span>geo</span><span>)</span><span><br>

        obj</span><span>.</span><span>setText</span><span>(</span><span>text</span><span>)</span><span><br><br></span><span>def</span><span> main</span><span>():</span><span> <br>
    app </span><span>=</span><span> </span><span>QApplication</span><span>(</span><span>sys</span><span>.</span><span>argv</span><span>)</span><span> <br>
    w </span><span>=</span><span> </span><span>FileBrowser</span><span>()</span><span> <br>    w</span><span>.</span><span>show</span><span>()</span><span> <br>
    sys</span><span>.</span><span>exit</span><span>(</span><span>app</span><span>.</span><span>exec_</span><span>())</span><span> <br>
<br></span><span>if</span><span> __name__ </span><span>==</span><span> </span><span>&quot;__main__&quot;</span><span>:</span><span> <br>    main</span><span>()</span><span><br>
</span></code></pre>
</blockquote></div><br>