[PyKDE] Getting handles on designer created layout boxes

Lee Harr missive at hotmail.com
Fri Feb 27 23:10:00 GMT 2004


When I create a layout using qt designer, there are often
elements of the layout which are not bound to self when
they are created.  It looks like this ...


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)



So, if I want to add something to groupBox1Layout at runtime,
my strategy at this point would be to hack the generated file
and change every reference to groupBox1Layout to
self.groupBox1Layout.

It is not a very good solution, since I may want to go back and
edit the layout with designer again.

Any better suggestions?

Thank you for your time.

_________________________________________________________________
Click, drag and drop. My MSN is the simple way to design your homepage. 
http://click.atdmt.com/AVE/go/onm00200364ave/direct/01/




More information about the PyQt mailing list