Qt – remove all widgets from layout?

I had the same problem: I have a game app whose main window class inherits QMainWindow. Its constructor looks partly like this: m_scene = new QGraphicsScene; m_scene->setBackgroundBrush( Qt::black ); … m_view = new QGraphicsView( m_scene ); … setCentralWidget( m_view ); When I want to display a level of the game, I instantiate a QGridLayout, into … Read more