Hi,

I am adding and removing QCheckBoxes to/from a QButtonGroup dynamically. When I remove the checkbox I would also like it removed from the GUI. I am seeing two different behaviors when using Linux or when using windows. The qt version in windows is 3.3.1, the version in Linux is 3.3.4.

On Linux the item is removed as I expect, but after removing and adding a number of widgets when I exit the program I get a segment error. On windows nothing is removed, I also don't get a segment error when I exit the application.

My question is how can I delete an item from a QButtonGroup and have it removed from the GUI?

My code is as follows:
       # Remove check boxes
       self.testGroupLayout.deleteAllItems()
       childList = self.moduleTestsButtonGroup.children()
       for child in childList:
           if type(child) == QCheckBox:
               self.moduleTestsButtonGroup.remove(child)
               self.moduleTestsButtonGroup.removeChild(child)
               del child

       # Add check boxes
       for test in self.module.tests:
           checkBox = QCheckBox(test.name, self.moduleTestsButtonGroup)
           self.testGroupLayout.addWidget(checkBox)
           QToolTip.add(checkBox,test.__doc__)
           checkBox.setChecked(True)
           checkBox.show()
           test.enabled = True
       self.moduleTestsButtonGroup.update()

Cheers

Daryl
begin:vcard
fn:Daryl Dusheiko
n:Dusheiko;Daryl
adr:;;65 Johnston St;Annandale;NSW;2038;Australia
email;internet:[EMAIL PROTECTED]
tel;work:+ 61 2 9562 9858
tel;fax:+61 2 9518 7620
url:http://www.magtech.com.au
version:2.1
end:vcard

_______________________________________________
PyKDE mailing list    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to