[SOLVED] QStatusBar - Permanent widget on the left
-
wrote on 17 Jan 2012, 13:52 last edited by
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... -
wrote on 17 Jan 2012, 14:00 last edited by
void QStatusBar::addPermanentWidget ( QWidget * widget, int stretch = 0 )
-
wrote on 17 Jan 2012, 14:08 last edited by
addPermanentWidget adds widget on the right side! I need permanent widget on the left side
-
wrote on 17 Jan 2012, 22:54 last edited by
A widget containing the label and an expanding spacer in a layout?
-
wrote on 18 Jan 2012, 08:28 last edited by
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?
-
wrote on 18 Jan 2012, 10:21 last edited by
Sorry, I have no idea...
-
wrote on 18 Jan 2012, 10:32 last edited by
...
-
wrote on 28 Dec 2013, 18:06 last edited by
Hi
I know this is an old thread, but i came across the same problem.
I do i get read of that vertical line? -
wrote on 10 Jan 2014, 10:21 last edited by
Found it ...
Just add:
@QStatusBar::item {border: none;} @
... to the application stylesheet. -
wrote on 29 Oct 2019, 13:25 last edited by
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. -
wrote on 17 Nov 2020, 11:59 last edited by
What helped is to use layout direction of the status bar:
this->statusBar()->setLayoutDirection(Qt::LayoutDirection::RightToLeft); -
What helped is to use layout direction of the status bar:
this->statusBar()->setLayoutDirection(Qt::LayoutDirection::RightToLeft);wrote on 5 Dec 2020, 06:11 last edited by SpriteOvO 12 May 2020, 06:12@Roman-Bober This will make
SizeGrip
also on the left side, and for me @DevDirrack‘s method works well. -
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.wrote on 6 Jun 2023, 21:00 last edited by@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()
. -
@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()
.wrote on 19 Sept 2023, 11:24 last edited by DonkeyTheMonkey@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.