[SOLVED] QStatusBar - Permanent widget on the left
-
Hallo everybody,
do anybod know how to add permanent widget(QLabel) to statusBar on the left side without reimplementing paintEvent? I need to add small icon to status bar on the left side of statusbar message.... widget added with addWidget will be removed next time status bar message comes... -
addPermanentWidget adds widget on the right side! I need permanent widget on the left side
-
QStatusBar::showMessage doesn't draws message then...
I've just subclassed QWidget and draw content by myself... But where is another thing i need to fix: QStatusBar draws some kind of vertical and horizontal line on the right of my widget. How do I get this off?
-
Hi
I struggle with similiar issue right now and the @gtpt solution doesnt work for me, but I found out how to make it.
If you want to put widget on the left just addWidget or addPermanentWidget with stretch > 0. -
What helped is to use layout direction of the status bar:
this->statusBar()->setLayoutDirection(Qt::LayoutDirection::RightToLeft); -
@Roman-Bober This will make
SizeGrip
also on the left side, and for me @DevDirrack‘s method works well. -
@DevDirrack said in [SOLVED] QStatusBar - Permanent widget on the left:
If you want to put widget on the left just addWidget or addPermanentWidget with stretch > 0.
For future references and readers, this only works with
addWidget()
, does not work withaddPermanentWidget()
. -
@Abderrahmene_Rayene
Sorry to bring this old topic up as well.
But I do believe if you do mainWindow()->statusBar()->addPermanentWidget( new widget,1); it will put the widget on the left side, 0 will be default to the right.