3

I have a layout that I need the widgets pushed upwards. I know I can do this

layout = QtWidgets.QVBoxLayout()
layout.addWidget(test_widget)
layout.addStretch()

and the addStretch will push all widgets to the top. However the layout that I am using is a QGridLayout and .addSretch() does not work with the grid layout. How would I fill in all the empty space at the bottom of my window and push all my widgets to the top with a grid layout?

ghost654
  • 161
  • 2
  • 18

1 Answers1

5

nevermind, I found the answer. I had to to do this

layout.setRowStretch(row_number, 1)
ghost654
  • 161
  • 2
  • 18