[PyQt] Moving button to the right side edge of a QToolBar

Chris M chris.pm at gmail.com
Mon May 11 16:02:21 BST 2009


Try;

spacer = QWidget()
spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
toolBar.addWidget(spacer)
# Then your button to be right-aligned

Taken from http://www.ffuts.org/blog/right-aligning-a-button-in-a-qtoolbar/

2009/5/11 Peter Georges <peterg at al.com.au>:
> I have a QToolBar in my application and I want the last button i add to the
> toolbar to be positioned to the right. What is the ideal way to do that? Is
> there some sort of way I can add a 'stretching' widget to push the last
> button all the way over?
>
> Cheers
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>



More information about the PyQt mailing list