Main windows is a bit special since it has "central widget".
which there to allow to define areas around it
for Dock windows. That is why we insert widget first.
For all types of other widget we would insert directly.
QWidget* centralWidget = new QWidget();
QVBoxLayout *layout = new QVBoxLayout;
For centralWidget , u can then use the Stacked.
Well , i did see it but button start in 0,0 perfect valid so did not think much about it.
Just added + QString::number(i) so when testing by changing
I could see it was indeed another button :)
It really depends on your application. One thing to keep in mind is that these buttons should not know what's in e.g. your login widget. They should be enabled when appropriate. Otherwise you are going to have a pretty hard to maintain widget there if you add more "pages".