What have I done wrong here? What happens is that it just put the new widget on top on the old one. I have tried the update() function but it does not seem to do anything in this case. It works if I delete the widget but as I do not know what widget that is in the layout at the moment I have no idea how to destroy the widget as I can not delete widgets that is already deleted(program freezes)