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?
nevermind, I found the answer. I had to to do this
layout.setRowStretch(row_number, 1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With