Reputation: 717
I am trying to position some buttons in a toolbar, on my application. As you can see in these images, I need to put one of them in the right side, opposing the others. Something, like this:
This is the toolbar that I have:
And I need to move, for example, the QLabel
to the right side:
Is there any way to do this? I've tried setGeometry
and move
methods, but I can't accomplish this.
Hope you can help me
Upvotes: 1
Views: 1106
Reputation: 120768
Add an expanding spacer widget before the label:
spacer = QtGui.QWidget(self)
spacer.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
toolbar.addWidget(spacer)
toolbar.addWidget(label)
Upvotes: 2