[Qt-interest] How to add more items in QListWidget
Siddu Hallikeri
siddugh at gmail.com
Sun Jan 2 18:30:48 CET 2011
Hi all,
How to add more items in QListWidget ?
Below is the code I am using, it gives error as "memory full" in device (N8)
void gotItem(IndividualSearchData *item)
{
Cell* cell = new Cell();
cell->setTitle(item->m_Title);
cell->setDescription(item->m_ShortDescription);
cell->setImage(item->m_IconURL);
connect(cell,SIGNAL(imageButtonClicked(QPixmap)),this,SLOT(previewImage(QPixmap)));
QListWidgetItem *dataItem= new QListWidgetItem(ui->listWidget);
dataItem->setSizeHint(QSize(430,189));
ui->listWidget->addItem(dataItem);
ui->listWidget->setItemWidget(dataItem,cell);
}
Cell is a sub class of of QWidget and contains three labels "title",
"discription" and pass url as parameter.
The cell download the image from this url.
The gotItem method is called for about 400-500 times(whenever we get data
from server)
I checked with memory, it keeps on increasing, but how to reduce this ?
Please let me know how to achieve this.
Even I checked with 150 of items and stopped downloading image , still it
takes lot of memory
Thanks in advance
siddu
--
Siddu Hallikeri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110102/2a69b79c/attachment.html
More information about the Qt-interest-old
mailing list