Align a widget to the bottom of the parent widget
-
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:
The attitude widget and map are not overlapped correctly ... btw the attitude widget is a child of the map widget.
How can I fix this?
Best regards,
Mike -
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. -
I tried assigning gridlayout to map widget and adding the two spacers to push attitude in the corner:
The layout was promising:
But the running result quite not:
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
-
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.
-
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. -
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. -
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.