[PyKDE] Getting handles on designer created layout boxes

Lee Harr missive at hotmail.com
Sat Feb 28 03:22:01 GMT 2004


> > class Form1(QDialog):
> >    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
> >        QDialog.__init__(self,parent,name,modal,fl)
> >
> >        Form1Layout = QVBoxLayout(self,11,6,"Form1Layout")
> >
> >        self.groupBox1 = QGroupBox(self,"groupBox1")
> >        self.groupBox1.setColumnLayout(0,Qt.Vertical)
> >        groupBox1Layout = QHBoxLayout(self.groupBox1.layout())
> >        groupBox1Layout.setAlignment(Qt.AlignTop)
> >        Form1Layout.addWidget(self.groupBox1)
> >
> >

>the layout is available from via a call to self.layout() -- you don't have 
>to maintain a reference to it because the widget already does that.
>


On which do I call .layout() to get the groupBox1Layout back?

I tried self.layout()  and self.groupBox1.layout()  but those are
both QVBoxLayout type.

Actually, I just figured out I can use ...

self.hlayout = self.groupBox1.layout().children()[0]

but that seems a bit roundabout. Is there any way to configure
pyuic to just keep a handle on everything?  I have a feeling that
if I move things around in designer, the HBox that I want may no
longer be .children()[0] any more ....

Thanks for your help.

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus




More information about the PyQt mailing list