Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

qt status bar center align?

How can I center align the text in QStatusBar? By default it is always left aligned.

I know I can add a QLabel and set alignment, but I want to use plain text, and .showMessage(QString, int) method, so I can add the timeout value.

like image 320
ZolaKt Avatar asked Dec 21 '22 20:12

ZolaKt


1 Answers

A QStatusBar has three functions of note here:

addPermanentWidget - Places a widget right aligned

addWidget - Places a widget left aligned which can be obscured by status messages

showMessage - Displays a status message

These are well established standards for status bars. While you could hack away to get what you're looking for, I'd suggest you reconsider your needs. Perhaps your QLabel should be placed with addPermanentWidget instead?

Take a look at the docs for more info: http://doc.qt.io/qt-5/qstatusbar.html

like image 184
OliJG Avatar answered Dec 28 '22 17:12

OliJG