migel
10th July 2011, 17:23
simple adding lable into QVBoxLayout layout does not resize label .
QLabel *label = new QLabel("test");
QVBoxLayout *layout = new QVBoxLayout;
QWidget *widget = new QWidget;
widget->setLayout(layout);
layout->addWidget(label);
But when I add QTabWidget it resizes just fine.
I have tried this scenario using Q Designer and works there.
I have tried changing different sizePolicy of the label and widget, no luck.
what I am doing wrong ??
QLabel *label = new QLabel("test");
QVBoxLayout *layout = new QVBoxLayout;
QWidget *widget = new QWidget;
widget->setLayout(layout);
layout->addWidget(label);
But when I add QTabWidget it resizes just fine.
I have tried this scenario using Q Designer and works there.
I have tried changing different sizePolicy of the label and widget, no luck.
what I am doing wrong ??