Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.3
-
None
Description
In the following example the QListWidget is not displayed correctly unless you the sizeHint is set for the QListWidgetItem.
If you resize the Window the QListwidget is also displayed correctly..
Example Code:
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QListWidget* listwidget = new QListWidget;
QWidget* w = new QWidget;
QVBoxLayout* v = new QVBoxLayout( w );
v->addWidget( new QLabel( "one" ) );
v->addWidget( new QLabel( "two" ) );
v->addWidget( new QLabel( "three" ) );
v->addWidget( new QLabel( "four" ) );
v->setSizeConstraint( QLayout::SetFixedSize );
QListWidgetItem* item = new QListWidgetItem;
//item->setSizeHint( w->sizeHint() );
listwidget->addItem( item );
listwidget->setItemWidget( item, w );
listwidget->show();
return app.exec();
}