<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 class="prettyprint"><br><code><span class="kwd"><br><br>from</span><span class="pln"> PyQt4</span><span class="pun">.</span><span class="typ">QtCore</span><span class="pln"> </span><span class="kwd">import</span><span class="pln"> </span><span class="pun">*</span><span class="pln"> <br>
</span><span class="kwd">from</span><span class="pln"> PyQt4</span><span class="pun">.</span><span class="typ">QtGui</span><span class="pln"> </span><span class="kwd">import</span><span class="pln"> </span><span class="pun">*</span><span class="pln"><br>
</span><span class="kwd">import</span><span class="pln"> sys<br><br></span><span class="kwd">class</span><span class="pln"> </span><span class="typ">FileBrowser</span><span class="pun">(</span><span class="typ">QMainWindow</span><span class="pun">):</span><span class="pln"><br>
    </span><span class="kwd">def</span><span class="pln"> __init__</span><span class="pun">(</span><span class="kwd">self</span><span class="pun">):</span><span class="pln"><br>        </span><span class="typ">QMainWindow</span><span class="pun">.</span><span class="pln">__init__</span><span class="pun">(</span><span class="kwd">self</span><span class="pun">)</span><span class="pln"><br>
<br>        </span><span class="kwd">self</span><span class="pun">.</span><span class="pln">setGeometry</span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">920</span><span class="pun">,</span><span class="pln"> </span><span class="lit">780</span><span class="pun">)</span><span class="pln"><br>
        </span><span class="kwd">self</span><span class="pun">.</span><span class="pln">initClasses</span><span class="pun">()</span><span class="pln"><br><br>    </span><span class="kwd">def</span><span class="pln"> initClasses</span><span class="pun">(</span><span class="kwd">self</span><span class="pun">):</span><span class="pln"><br>
        </span><span class="com"># GroupBox</span><span class="pln"><br>        </span><span class="kwd">self</span><span class="pun">.</span><span class="pln">groupBox1 </span><span class="pun">=</span><span class="pln"> </span><span class="typ">GroupBox</span><span class="pun">(</span><span class="kwd">self</span><span class="pun">,</span><span class="pln"> </span><span class="typ">QRect</span><span class="pun">(</span><span class="lit">20</span><span class="pun">,</span><span class="pln"> </span><span class="lit">10</span><span class="pun">,</span><span class="pln"> </span><span class="lit">191</span><span class="pun">,</span><span class="pln"> </span><span class="lit">131</span><span class="pun">),</span><span class="pln">  </span><span class="str">&#39;Shot Info&#39;</span><span class="pun">)</span><span class="pln"><br>
<br>        </span><span class="com"># Label</span><span class="pln"><br>        </span><span class="kwd">self</span><span class="pun">.</span><span class="pln">labelGroup1_ShotInfo </span><span class="pun">=</span><span class="pln"> </span><span class="typ">Label</span><span class="pun">(</span><span class="kwd">self</span><span class="pun">,</span><span class="pln"> </span><span class="typ">QRect</span><span class="pun">(</span><span class="lit">10</span><span class="pun">,</span><span class="pln"> </span><span class="lit">26</span><span class="pun">,</span><span class="pln"> </span><span class="lit">52</span><span class="pun">,</span><span class="pln"> </span><span class="lit">15</span><span class="pun">),</span><span class="pln">  </span><span class="str">&#39;Film&#39;</span><span class="pun">)</span><span class="pln"><br>
<br></span><span class="kwd">class</span><span class="pln"> </span><span class="typ">GroupBox</span><span class="pun">(</span><span class="typ">QWidget</span><span class="pun">):</span><span class="pln"> <br>    </span><span class="kwd">def</span><span class="pln"> __init__</span><span class="pun">(</span><span class="kwd">self</span><span class="pun">,</span><span class="pln"> parent</span><span class="pun">,</span><span class="pln">  geo</span><span class="pun">,</span><span class="pln">  title</span><span class="pun">):</span><span class="pln"> <br>
        </span><span class="typ">QWidget</span><span class="pun">.</span><span class="pln">__init__</span><span class="pun">(</span><span class="kwd">self</span><span class="pun">,</span><span class="pln"> parent</span><span class="pun">)</span><span class="pln"><br>
        obj </span><span class="pun">=</span><span class="pln"> </span><span class="typ">QGroupBox</span><span class="pun">(</span><span class="pln">parent</span><span class="pun">)</span><span class="pln"><br>        obj</span><span class="pun">.</span><span class="pln">setGeometry</span><span class="pun">(</span><span class="pln">geo</span><span class="pun">)</span><span class="pln"><br>
        obj</span><span class="pun">.</span><span class="pln">setTitle</span><span class="pun">(</span><span class="pln">title</span><span class="pun">)</span><span class="pln"><br><br></span><span class="kwd">class</span><span class="pln"> </span><span class="typ">Label</span><span class="pun">(</span><span class="typ">QWidget</span><span class="pun">):</span><span class="pln"> <br>
    </span><span class="kwd">def</span><span class="pln"> __init__</span><span class="pun">(</span><span class="kwd">self</span><span class="pun">,</span><span class="pln"> parent</span><span class="pun">,</span><span class="pln">  geo</span><span class="pun">,</span><span class="pln">  text</span><span class="pun">):</span><span class="pln"> <br>
        </span><span class="typ">QWidget</span><span class="pun">.</span><span class="pln">__init__</span><span class="pun">(</span><span class="kwd">self</span><span class="pun">,</span><span class="pln"> parent</span><span class="pun">)</span><span class="pln"><br>
        obj </span><span class="pun">=</span><span class="pln"> </span><span class="typ">QLabel</span><span class="pun">(</span><span class="pln">parent</span><span class="pun">)</span><span class="pln"><br>        obj</span><span class="pun">.</span><span class="pln">setGeometry</span><span class="pun">(</span><span class="pln">geo</span><span class="pun">)</span><span class="pln"><br>
        obj</span><span class="pun">.</span><span class="pln">setText</span><span class="pun">(</span><span class="pln">text</span><span class="pun">)</span><span class="pln"><br><br></span><span class="kwd">def</span><span class="pln"> main</span><span class="pun">():</span><span class="pln"> <br>
    app </span><span class="pun">=</span><span class="pln"> </span><span class="typ">QApplication</span><span class="pun">(</span><span class="pln">sys</span><span class="pun">.</span><span class="pln">argv</span><span class="pun">)</span><span class="pln"> <br>
    w </span><span class="pun">=</span><span class="pln"> </span><span class="typ">FileBrowser</span><span class="pun">()</span><span class="pln"> <br>    w</span><span class="pun">.</span><span class="pln">show</span><span class="pun">()</span><span class="pln"> <br>
    sys</span><span class="pun">.</span><span class="kwd">exit</span><span class="pun">(</span><span class="pln">app</span><span class="pun">.</span><span class="pln">exec_</span><span class="pun">())</span><span class="pln"> <br>
<br></span><span class="kwd">if</span><span class="pln"> __name__ </span><span class="pun">==</span><span class="pln"> </span><span class="str">&quot;__main__&quot;</span><span class="pun">:</span><span class="pln"> <br>    main</span><span class="pun">()</span><span class="pln"><br>
</span></code></pre>