[Qt-interest] delete QStandardItem but allocated buffer not free
John Weeks
john at wavemetrics.com
Tue Nov 30 23:03:48 CET 2010
I have never actually used QStandardItemModel; my answer was based on reading the documentation.
I don't know what memory buffer you are referring too. In your original post you mentioned "execute buffer". Do you mean the memory allocated to your application?
> Hi John Weeks,
>
> Thanks,but I can't deal with my problem until now..
>
> I check the QStandardItemModel::removeRows, which will delete them.
>
> So I am confused why the memory buffer continue augment after I use removeRows ?
>
> I want make my Model/view architecture like a FIFO, always display only 100 rows.
>
> When new data entry, I remove the first row , then add one row at the last position.
>
> But if I do like this, the memory buffer augment so fast.
>
> Can you give me some suggestion ?
>
>
> wya
> 30, Nov. 2010
>
>
> On 23 November 2010 01:57, John Weeks <john at wavemetrics.com> wrote:
>
> On Nov 22, 2010, at 8:23 AM, 163 mail wrote:
>
>> How can we delete the allocated QStandardItem , without memeory augment?
>
> How about QStandardItemModel::removeRows or QStandardItemModel::takeRow or takeItem?
>
> The description of the takeXXX functions has the provocotive statement, "Removes the item ... without deleting it. The model releases ownership of the item." This seems to imply that putting items into the model transfers ownership, and that removeRows might just delete them for you. Do some research in the documentation, including the base class QAbstractItemModel.
>
> Regards,
> John Weeks
>
> WaveMetrics, Inc.
> Phone (503) 620-3001
> Fax (503) 620-6754
> email support at WaveMetrics.com
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
Regards,
John Weeks
WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
email support at WaveMetrics.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101130/b44802ad/attachment.html
More information about the Qt-interest-old
mailing list