Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. StackWidget objects in qt designer not resizing

StackWidget objects in qt designer not resizing

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 546 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LT-K101
    wrote on 26 Jan 2022, 10:52 last edited by LT-K101
    #1

    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.

    J S 2 Replies Last reply 26 Jan 2022, 10:59
    0
    • L LT-K101
      26 Jan 2022, 10:52

      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.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 26 Jan 2022, 10:59 last edited by
      #2

      @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.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply 26 Jan 2022, 14:13
      1
      • J jsulm
        26 Jan 2022, 10:59

        @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.

        L Offline
        L Offline
        LT-K101
        wrote on 26 Jan 2022, 14:13 last edited by
        #3

        @jsulm Thanks for your response.

        1. Below is the image of the designer screen

        A.png

        1. The second image shows the full screen. But it does not fill up the whole StackedWidget
          B.png
        J 1 Reply Last reply 26 Jan 2022, 14:19
        0
        • L LT-K101
          26 Jan 2022, 14:13

          @jsulm Thanks for your response.

          1. Below is the image of the designer screen

          A.png

          1. The second image shows the full screen. But it does not fill up the whole StackedWidget
            B.png
          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 26 Jan 2022, 14:19 last edited by
          #4

          @LT-K101 You added a QWidget to your QStackedWidget, but it looks like you did not put its children in a layout.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          L 1 Reply Last reply 26 Jan 2022, 14:28
          1
          • J jsulm
            26 Jan 2022, 14:19

            @LT-K101 You added a QWidget to your QStackedWidget, but it looks like you did not put its children in a layout.

            L Offline
            L Offline
            LT-K101
            wrote on 26 Jan 2022, 14:28 last edited by LT-K101
            #5

            @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.

            J 1 Reply Last reply 26 Jan 2022, 14:28
            0
            • L LT-K101
              26 Jan 2022, 14:28

              @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.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 26 Jan 2022, 14:28 last edited by
              #6

              @LT-K101 yes

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • L LT-K101
                26 Jan 2022, 10:52

                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.

                S Offline
                S Offline
                SimonSchroeder
                wrote on 27 Jan 2022, 08:27 last edited by
                #7

                @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.

                1 Reply Last reply
                0

                2/7

                26 Jan 2022, 10:59

                topic:navigator.unread, 5
                • Login

                • Login or register to search.
                2 out of 7
                • First post
                  2/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved