Destroy objects

Login or register to post comments
3 replies [Last post]
Offline
Joined: 12/30/2009

I have created a set of Qtextboxes in one Qform. My problem es that I also have one delete button there and when I push it the textboxes and the button must dissapear from the form.
I have been looking for a solution and proving everything I can but i can't do it. I know at the end it'll be a foolness but can anybody tell me wich method is used to destroy objects?, in other words, after I have done this:

$button = New QButton($this)

I have to destroy it.

alex94040's picture
Offline
Joined: 11/06/2008

One simple way is to just hide the control -
$objControl->Visible = false;

Offline
Joined: 12/30/2009

Thanks Alex, that's what I was doing with the control or objects but I didn't know if there was another way to do that. I was thinking and maybe I found one solution to one problem I had with those objects, I'll let you know if it works

Offline
Joined: 03/31/2008

You could have them all children of a QPanel, then call RemoveChildControls on that.