StackWidget objects in qt designer not resizing
-
wrote on 26 Jan 2022, 10:52 last edited by LT-K101
I'm using a StackedWidget packed with objects such as linEdits,comboBoxes and labels in main window. I want the objects in the StackedWidget to fill up the space when I maximize the mainwindow as I arranged them originally. But when I used all the layouts in Qt designer it reposition the objects in a different manner which is not the way i arranged the objects. I'm really struggling with this please any help would be appreciated. Thank you.
-
I'm using a StackedWidget packed with objects such as linEdits,comboBoxes and labels in main window. I want the objects in the StackedWidget to fill up the space when I maximize the mainwindow as I arranged them originally. But when I used all the layouts in Qt designer it reposition the objects in a different manner which is not the way i arranged the objects. I'm really struggling with this please any help would be appreciated. Thank you.
@LT-K101 said in StackWidget objects in qt designer not resizing:
please any help would be appreciate
Well, with this information it is hard to help.
Please post a screen-shot of your widget in designer.
And also screen-shot of what you get. -
@LT-K101 said in StackWidget objects in qt designer not resizing:
please any help would be appreciate
Well, with this information it is hard to help.
Please post a screen-shot of your widget in designer.
And also screen-shot of what you get. -
@jsulm Thanks for your response.
- Below is the image of the designer screen
- The second image shows the full screen. But it does not fill up the whole StackedWidget
@LT-K101 You added a QWidget to your QStackedWidget, but it looks like you did not put its children in a layout.
-
@LT-K101 You added a QWidget to your QStackedWidget, but it looks like you did not put its children in a layout.
-
@jsulm Please are the children referring to the LineEdits and ComboBoxes? If yes when I add a layout to the children, the current positions changes but I would like to maintain the current positions of children.
@LT-K101 yes
-
I'm using a StackedWidget packed with objects such as linEdits,comboBoxes and labels in main window. I want the objects in the StackedWidget to fill up the space when I maximize the mainwindow as I arranged them originally. But when I used all the layouts in Qt designer it reposition the objects in a different manner which is not the way i arranged the objects. I'm really struggling with this please any help would be appreciated. Thank you.
wrote on 27 Jan 2022, 08:27 last edited by@LT-K101 said in StackWidget objects in qt designer not resizing:
But when I used all the layouts in Qt designer it reposition the objects in a different manner which is not the way i arranged the objects.
I have to disagree here. When you don't use a layout, the position of widgets is in relation to the top left of the widget they are contained in: The spacing between the widgets stays the same in your full screen view, and also their relative position in relation to the top and the left.
I am not entirely sure what you are trying to achieve or why a layout would break the thing you are trying to achieve. With the way things are layout in Qt Designer right now, I would just apply a grid layout to the parent widget (I believe this is a little complicated with a stacked widget; you might have to select the correct widget in the Object Inspector on the right to apply the layout).
If you want some space between some of the widgets, add horizontal or vertical spacers (they can be found almost at the top of the list on the left). I tend to use horizontal spacers with a fixed width of 20 pixels from time to time.
2/7