PDA

View Full Version : Dynamically change the layout



pippo42
10th November 2009, 13:52
I would like to dynamically change the widget displayed in a part of a window. According to the situation, another widget should be displayed.

I have tried to remove the old widget from the layout and add the new one but it does not work.

I have tried to delete the old layout and create a new one but it does not solve the problem.

During these attempts, I have tried to repaint the window but it does not help.

How could I do? I just need to replace dynamically a widget with another one in a "box" of the layout.

Thanks!

lyuts
10th November 2009, 14:42
Take a look at QStackedLayout and QStackedWidget.

pippo42
12th November 2009, 13:01
Thank you!

This is exactly what I was looking for.

In the meantime, I had done it with QTabWidget but this is what I needed.

Thanks!