PDA

View Full Version : QListWidget update



Elwe
17th June 2009, 20:55
Hi guy! I'm here again with a new problem!

I search, and search, and search... So let me explain. I've a QListWidget, but when a resize items, they are the one on the other. They adjust only when I'm move by a drag&drop.

I've try to use update and repaint, but without any success! Someone could help me?


for (int i = 0; i < widgetList->count(); i++) {
if (groupeListWidget.at(i)->count() != 0
&& groupeListWidget.at(i)->count() != 1) {
widgetList->item(i)->setSizeHint(QSize(
widgetList->sizeHintForColumn(0), (26*
groupeListWidget .at(i)->count()) + 54));
widgetList->itemWidget(widgetList->item(i))->adjustSize();
}
widgetList->update(); //or repaint()
}

The items are those of the widgetList

PS: My QListWidget contains another QListWidget, but it doesn't matter, I think.

Elwe
18th June 2009, 10:18
I've found the answer. To do this, I finally use the function called doItemsLayout.

But I don't find this function in the trolltech documentation...