[PyKDE] Segmentation fault with dynamic creating of widget content

Phil Thompson phil at riverbankcomputing.co.uk
Tue Jun 17 10:27:00 BST 2003


On Monday 16 June 2003 11:34 pm, Wido Depping wrote:
> I have a widget whose children are created dynamicly. if i get new data i
> have to refresh the widget, delete all it's children and create the
> child-widgets again. Most of the time this method works, but sometimes i
> get a segmentation fault.
> This is the method for the deletion of the children:
> for x in  self.attributeWidget.children():
> 	name = str(x.name())
> 	# this ensures, that the layout is not deleted
> 	# every label, lineedit and button has a name which starts with 'LDAP'
> 	if name[:4] == "LDAP":
> 		x.destroy()
> 		self.attributeWidget.removeChild(x)
>
> So, is my code wrong or is it PyQt's fault? Attached is a backtracke i got
> from gdb:

What happens if you call removeChild() before you call destroy()?

Phil




More information about the PyQt mailing list