From looking at your widget hierarchy, it seems like page2 of your stacked layout is not correct. That whole widget needs a layout so that the set of radio buttons and so forth is in one part of it, and the scroll area in the other part. You probably want a QHBoxLayout for this. When you finish, your page2 widget should look something like this:
------- etc.
------ QWidget (scrollAreaWidgetContents
) ---------- your custom widget #1
---------- your custom widget #2
---------- etc.
QWidget (page_2)
-- QHBoxLayout
---- QVBoxLayout (left hand side of hbox)
------- QCheckBox (checkBox)
------- QPushButton (pushButton_2
------- etc.
---- QScrollArea (right hand side of hbox)
------ QWidget (scrollAreaWidgetContents)
-------- QVBoxLayout (layout for scroll area's widget)
---------- your custom widget #1
---------- your custom widget #2
---------- etc.
To copy to clipboard, switch view to plain text mode
Your page 1 widget also needs a layout. Any time you have child widgets within another QWidget, you need to place a layout of some kind inside that QWidget to manage the layout of the child widgets. It is bad practice to simply add child widgets directly to a QWidget with absolute positions. By using a layout, the child widgets will behave properly as the window is resized. With no layout, the child widgets won't move or resize along with the widget that contains them.
You also do not need the QWidget you have added as the central widget for the main window. You can make the QStackedWidget the central widget directly.
Bookmarks