There is a QTabWidget . In its tab you need to add a widget, for example QLabel . The tab is just a widget, inside of which is a QHBoxLayout , and inside it is a Scroll Bar and Spacer.
QWidget* tab = ui->tabs->widget(0); QLabel* lbl = new QLabel(tab); QFont font; font.setPixelSize(24); lbl->setFont(font); lbl->setText("Some Text"); tab->layout()->addWidget(lbl); In theory, the last line is tab->layout()->addWidget(lbl); It just adds the same QLabel left of the tab, but it inserts the text outside the layout'a from the bottom (because there is a vertical layout.
Please explain what the problem is and how to fix it.


QTabWidgetitself, namely the tab) in your designer is made? Give a screen hierarchy then. Or, if the tab is created dynamically, then the code. - alexis031182layout()method, it adequately returns a pointer to it - sm4ll_3ggQHBoxLayout *hlayout = tab->layout()->findChild<QHBoxLayout*>(). Well, see if the pointer will be zero or will it still find the hidden layer. - alexis031182