How to add items in QStatusBar?

Found on the Internet only option:
QLabel *label1;
label1 = new QLabel();
ui->statusBar->addWidget(label1); // in left of statusbar

QLabel *label2;
label2 = new QLabel();
ui->statusBar->addPermanentWidget(label2); // in right side of statusbar

But it turns out mixing code and graphics. Is it possible to add these 2 label in design mode?

If you can not, and will have to add so, can you replace #include QLabel something more "universal"?
For example if I want to add a ProgressBar would have to add #include QProgressBar, thought you can write something like #include QWindow or #include QWidget, but no.
June 26th 19 at 14:10
1 answer
June 26th 19 at 14:12
1. Such roughness in Qt the car and small truck. Don't know how the status bar, but toolbar s (if they do not consist of buttons, or if a lot of them on one form) you have to collect programmatically.
2. Impossible. We need a specific constructor of type QLabel and so we need the header, where the designer is.
3. Understand that even if the form editor is ideal, as in the Embarcadero, there are tasks that he performs. This can be a tricky behavior when you resize the form, queries the components of the "wait to refresh me" and "everything is now possible", appearance settings, and much more... Separation of code and graphics necessary to produce a branch in another module working code, not the Department of graphics in the file *.ui (or *.dfm).
Okay, thank you. Used that in the editor you can do all that allows a graphics library (VCL, WinForm, WPF). - Jensen.Stros commented on June 26th 19 at 14:15
Too wrote little real acting soft, so if you happy with the editor.
There are tons of tasks that the editor does, because you don't have to.
Note I called Embarcadero "perfect" — just because it is rare when the simplest tasks can be done via the editor. - Humberto_Lynch68 commented on June 26th 19 at 14:18
Normal wrote :) you can Not "mutter" and be dissatisfied at all, it feels like something positive. In QT, so far nothing positive has been found.
I mean the simplest tasks. The task is "add in the status bar a few labels and progress bar" is not the simplest? All libraries specified by me it is solved with a couple of clicks (Yes, jokes about programming with the mouse). - Jensen.Stros commented on June 26th 19 at 14:21

Find more questions by tags Qt