I have defined a widget, which contains a QLabel (and other elements) that should show wrapped text.
This QLabel has:
Horizontal Policy: Minimum
Vertical Policy: MinimumExpanding
WordWrap: true
The widget has:
LayoutSizeConstraint: SetMinimumSize
Other than that a I have another widget which contains QListWidget item. I want to add the widget with QLabel as many times as I want. To do that I use a helper:
QListWidgetItem* showWidgetOnTheList(QListWidget* view, QWidget* widget)
{
QListWidgetItem *item = new QListWidgetItem(view);
QSize size(view->size().width(), widget->height());
item->setSizeHint(size);
view->addItem(item);
view->setItemWidget(item,widget);
return item;
}
The final result is that I see elements which overlap each other. What is the proper solution?