[PyQt] Alignment Issue in QStatusbar

Tong Zhang warriorlance at gmail.com
Fri May 17 03:24:09 BST 2019


Hello,

I'm trying to create add widgets into QStatusbar, as the attached
screenshot shows, the first widget, which is a qtoolbutton and the second
widget, which is a qlabel, is not aligned well. I want them vertically
center aligned,  could somebody give me some hint? Thanks very much!
[image: Selection_001.png]

And this is the code I'm using now:
...
sb = QStatusBar(self)
btn = QToolButton(self)
...
lbl = QLabel("My App (Version: 1.0)")
lbl.setAlignment(Qt.AlignLeft)
...
sb.addPermanentWidget(btn, 0)
sb.addPermanentWidget(lbl, 1)
...
self.setStatusBar(sb)

- Tong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190516/c57fab92/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Selection_001.png
Type: image/png
Size: 2954 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190516/c57fab92/attachment.png>


More information about the PyQt mailing list