Finally I solved this doing a setParent(0); that way it is not painted anymore.
Finally I solved this doing a setParent(0); that way it is not painted anymore.
You should have called hide() on the widget. setParent(0) will just make the widget into a toplevel widget (no parent). Look around carefully and no doubt it is floating around on your desktop somewhere (or it will after a show()).
Save yourself some pain. Learn C++ before learning Qt.
QLayout::removeWidget() does only remove the widget from the layout so that it's geometry won't be anymore managed by the layout. The widget will be left there where it was during the removal. If you want to get completely rid of the widget, delete it. If you will need it later, hide it. Just be aware that reparenting it with no parent makes it just a top level widget as CBM already stated. That's most probably not what you want.
J-P Nurmi
Bookmarks