Is there any solution to embed a QLabel in QStatusBar using Qt Designer?
I don't believe so. It's fairly simple to add one programmatically, though.
If you're just wanting to show a message, you could use: statusBar()->showMessage(tr("Message Here"));
, or alternatively if you really needed a QLabel on the status bar, you could do something along the lines of:
QLabel label = new QLabel("Message");
statusBar()->addWidget(label);
label
would become a child of statusBar()
, and appear in the first empty spot from the bottom left (addPermanentWidget(label)
would add it to the first empty spot from the bottom right). If you place QLabel label
in the classes header (or other var name), you'd be able to access the variable directly later (removing the initial QLabel
type from the first line, of course).
Yes It's a simple solution but it doesn't solve my problem. I want to know whether it can be done via QtDesigner.