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. Align a widget to the bottom of the parent widget
Forum Updated to NodeBB v4.3 + New Features

Align a widget to the bottom of the parent widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.5k Views 2 Watching
  • 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.
  • DragoonD Offline
    DragoonD Offline
    Dragoon
    wrote on last edited by
    #1

    Hi, I'm a newbie in Qt ... I'm trying to overlap two widgets (map and attitude). I would like them to be aligned by the left bottom edges but I did not found a way to achieve this result... what I got now is this:

    2e1bfd91-13f7-416f-a938-74d7f5fc9884-image.png

    The attitude widget and map are not overlapped correctly ... btw the attitude widget is a child of the map widget.

    de9118ab-df11-457e-bf96-5893701dd6f0-image.png

    How can I fix this?

    Best regards,
    Mike

    bye by[t]e{s}... Mike

    1 Reply Last reply
    0
    • DragoonD Offline
      DragoonD Offline
      Dragoon
      wrote on last edited by
      #2

      I tried also to put a grid layout as a child of the map widget and then to add the attitude widget inside the grid layout.
      In this way it seems to work a little better but the alignment is not perfect even if I use vspacer and hspacer to push attitude in the bottom left corner probably because the gridlayout it's not filling up the whole map widget area but worst of all as a side effect I lost interactivity on the map.

      0f7e7d49-a02c-4720-b63d-67560661c5ed-image.png

      bye by[t]e{s}... Mike

      1 Reply Last reply
      0
      • DragoonD Offline
        DragoonD Offline
        Dragoon
        wrote on last edited by Dragoon
        #3

        I tried assigning gridlayout to map widget and adding the two spacers to push attitude in the corner:

        b1bc1d6c-1c15-4951-a126-1f3fa7bc6161-image.png

        The layout was promising:

        c68b0ab6-e40a-463e-93bb-a5142538e8ca-image.png

        But the running result quite not:

        8a7720a1-a02b-4c97-bdf5-a5a06a4a480b-image.png

        Not only the attitude is flushing off the map but its pushed on the top edge of it instead the bottom...the only good thing is that the map is back interactive

        bye by[t]e{s}... Mike

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          Since you want them to overlap, you have to move the widget at the right position by hand.

          You can do that in code usually in the resizeEvent of the widget containing those you want to manually position.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          DragoonD 1 Reply Last reply
          1
          • B Offline
            B Offline
            Bonnie
            wrote on last edited by Bonnie
            #5

            Since I don't know what a QGVMap is, so I googled and find it is a class from QGeoView, right?
            Then you should not assign a gridlayout to it because as I checked its source code, it already has a layout set.
            A new layout will break its original one.

            DragoonD 1 Reply Last reply
            0
            • B Bonnie

              Since I don't know what a QGVMap is, so I googled and find it is a class from QGeoView, right?
              Then you should not assign a gridlayout to it because as I checked its source code, it already has a layout set.
              A new layout will break its original one.

              DragoonD Offline
              DragoonD Offline
              Dragoon
              wrote on last edited by
              #6

              @Bonnie ok. thnx.

              bye by[t]e{s}... Mike

              1 Reply Last reply
              0
              • SGaistS SGaist

                Hi and welcome to devnet,

                Since you want them to overlap, you have to move the widget at the right position by hand.

                You can do that in code usually in the resizeEvent of the widget containing those you want to manually position.

                DragoonD Offline
                DragoonD Offline
                Dragoon
                wrote on last edited by
                #7

                @SGaist ok .. I'll try that solution.

                bye by[t]e{s}... Mike

                1 Reply Last reply
                0

                • Login

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