QVBoxLayout vs Qlabel - resizing issue
simple adding lable into QVBoxLayout layout does not resize label .
Code:
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 ??
Re: QVBoxLayout vs Qlabel - resizing issue
How are you determining that the label does not get resized?
Code:
#include <QtGui>
#include <QDebug>
int main(int argc, char *argv[])
{
layout->addWidget(label);
widget.setLayout(layout);
qDebug() << widget.size() << label->size();
widget.show();
qDebug() << widget.size() << label->size();
widget.resize(320, 200);
qDebug() << widget.size() << label->size();
return app.exec();
}
out:
Some layout resizing is not done until the widget is displayed, but the label is resized.