[PyKDE] autoAdding buttons to a grid

Richard Smith smithbone at gmail.com
Tue May 17 20:33:09 BST 2005


On 5/17/05, Richard Smith <smithbone at gmail.com> wrote:
> > > Thanks for the help. I'm glad I asked bc that would have probally
> > > taken me a long time to figure out on my own with trial and error.
> >
> > You may still have problems as the button dtors may be called twice. The
> 
> Haven't tried it yet.  Probally in then next hour or so.  What
> possible problems can I get into with the destructors getting called
> twice?

Ok.  I changed the code to look something like this

       self.item_buttons = []
       items = ["test1","test2","test3"]
       bgMainLayout = QGridLayout(self.bgMain.layout())
       bgMainLayout.setAutoAdd(1)

       for each in items:
           button = QPushButton(self.bgMain,each)
           self.item_buttons.append(button)
           self.bgMain.insert(button)

       bgMainLayout.activate()

However I get exaclty the same results.  Nothing. 

-- 
Richard A. Smith




More information about the PyQt mailing list