auto resizing stackedwidget and children
-
I'm using the qt designer with a QMainWindow and in that a QWidget contained a QStackedWidget so my program can have several different widgets. The problem I'm having is getting things to resize with the QMainWindow, it seems anything inside the QStackedWidget doesn't resize with the window, how can I fix this?
-
Hi,
Did you put that QStackedWidget as your QMainWindow central widget ?
-
In that case, either replace the central widget with the QStackedWidget, or put a layout on the central widget and the QStackedWidget in that layout.
-
You can build complex layouts to do what you want.
If you really want to manage all by hand then you have to also re-implement the resize event of your "container" widgets to update the size and postions of their children.
-
Do you mean learn the use of layouts ?
-
@SGaist learn how to make the complex layouts, because as far as I'm aware I've looked over the documentation and I still can't create a custom layout how I wan't. I just need pages that when the user resizes so does every child widget on that page, but I also wan't to be able to place the widgets where I wan't
-
Can you show an example of such a widget ?
-
Hi
With GridLayout, you can resize the widgets by dragging the handles while in layout
However, as name suggest its a grid so there needs to be some alignment.