[Qt-interest] How to add more items in QListWidget

Abhishek abhishekworld at gmail.com
Mon Jan 3 05:38:22 CET 2011


Can you please share the Delegate code that way We can help you more .
NOTE: Please keep Qt-interest at qt.nokia.com in cc or every mail easy way is
to use replay all option and reply to mail in malling list :).

On Mon, Jan 3, 2011 at 7:05 AM, Siddu Hallikeri <siddugh at gmail.com> wrote:

> Hi Abhishek,
>
> Thanks for reply
>
> I tried with delegates by overriding the paint method
> but, view is flickring..
>
>
> On Mon, Jan 3, 2011 at 12:18 AM, Abhishek <abhishekworld at gmail.com> wrote:
>
>> Why dont you try using Delegates not sure about your case but making new
>> Cell every time is not a good idea ..
>>
>> On Sun, Jan 2, 2011 at 11:00 PM, Siddu Hallikeri <siddugh at gmail.com>wrote:
>>
>>>
>>> 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
>>>
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at qt.nokia.com
>>> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>>>
>>>
>>
>>
>> --
>> Abhishek Patil
>> URL: http://thezeroth.net
>> "Imagination is more important than knowledge..." -Albert Einstein
>>
>
>
>
> --
> Siddu Hallikeri
>



-- 
Abhishek Patil
URL: http://thezeroth.net
"Imagination is more important than knowledge..." -Albert Einstein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110103/cad95d2a/attachment.html 


More information about the Qt-interest-old mailing list