Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I align a button at the bottom right in pyqt?

I am using a vertical layout that contains a Qlistview on top and a button at the bottom. I am trying to add the button at the bottom right but it is positioned at the bottom left. I've tried self.verticalLayout.setAlignment(QtCore.Qt.AlignRight) but I think that'd only work if the vlayout was part of a bigger layout.

like image 789
answerSeeker Avatar asked Dec 31 '16 03:12

answerSeeker


1 Answers

Use:

self.verticalLayout.addWidget(your_button, alignment=QtCore.Qt.AlignRight)
like image 71
eyllanesc Avatar answered Sep 18 '22 15:09

eyllanesc