Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.0.0
-
None
-
Windows 7 MVSC 2010
Description
I have a QListView that uses a QStandardItem model , to this listView I am adding a QPushButton(test case) using setIndexWidget(). When I am trying to load a large data set to the list it takes time and the application freezes for a while.
For eg
for (int i=0; i<500; i++)
{
QStandardItem *item = new QStandardItem(QString("Item %1").arg( i));
model->appendRow(item);
QModelIndex index = model->indexFromItem(item);
listView->setIndexWidget(index,new QPushButton("Hello World"));
}
The above example takes around 15 sec to display but if i remove setIndexWidget() and just create an instance of QPushButton(test case) it displays the items in no time.
Why does setIndexWidget() takes long time, Is there any workaround to load the widgets without taking long time.