PDA

View Full Version : QDockWidget with Grid Layout avoid content stretching



mqt
5th September 2013, 17:16
I have a Dock widget and I am setting a container QWidget for that. I am using Grid Layout for that container layout. I have two items added to row 1 and row 2 of the grid layout. The problem is that the Grid Layout is stretched to all four sides of Dock Widget. I would like the items to appear on top of the Dock Widget. How to Do that?

wysota
5th September 2013, 17:34
Place a spacer item (in Designer) or a vertical stretch (in code) under your widgets.

mqt
6th September 2013, 06:13
setRowStretch(last_row,1) worked