Hi, the parent widget will delete its children, so PA will delete all the new A objects, but only when PA itself gets deleted. So while PA exists you will accumulate AType objects which you cannot access because you did not store a pointer (you could get a pointer by using methods like QObject::findChild, but I try to avoid that if I can).
It would be nicer if you would clean unused AType objects, or (probably better because it avoids the new allocations) you can create it once on the first call, then re-use the AType object from the first call and only use show() and hide().
Ginsengelf
Bookmarks