QLabel does not display in QWidget
I have the following hierarchy in my Qt Application: QMainWindow > QWidget (centralWidget) > QWidget (subclassed) > QLabel Initialization code in my QMainWindow code: centralWidget = new QWidget(); centralWidget->setGeometry(0,0,width,height); chatWidget=new ChatWidget(this); // the subclassed QWidget setCentralWidget(centralWidget); In my subclassed QWidget initialization (which happens at the same time than the Qt App initialization) I have the following code: ChatWidget::ChatWidget(QWidget *parent):QWidget(parent) { QLabel *lbl; lbl=new QLabel(this); lbl->setText("Hello World 1"); <-- Is