Have you seen this article by Johan?

http://doc.trolltech.com/qq/qq27-panelstack.html

As a general remark, removing a widget from the stacked widget doesn't cause it to be deleted. You have to explicitely delete it yourself.