[Qt-interest] delete QStandardItem but allocated buffer not free

163 mail htyoung at 163.com
Mon Nov 22 17:23:52 CET 2010


Hi,

I use QStandardItemModel to display some items.
But found a strange issue after allocated QStandardItem .

issue description:
I add a new item by allocated QStandardItem,   like following:

/////////////////  Code example 1 /////////////////////////////////

QStandardItemModel * m_itemModel = new QStandardItemModel(0, 2, this);;

QStandardItem * item1 =new QStandardItem("Test" );
QStandardItem * item2 =new QStandardItem("Test" );

QList <QStandardItem  * >itemLits;
iteList.append(item1 );
iteList.append(item2 );
 m_itemModel->appendRow(itemLits);

////////////////////end Code example 1
///////////////////////////////////////////



Then I delete the item 1 and item2 like following:


/////////////////  Code example 2 /////////////////////////////////
delete item1 ;
delete item2;

////////////////////end Code example 2
///////////////////////////////////////////


But I found a issue, We can't release the buffer after delete item1 and
item2.

It'means, the execute buffer fastly augment.

 How can we delete the allocated QStandardItem , without memeory augment?


wya
23, Nov.2010
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101123/50eb62ae/attachment.html 


More information about the Qt-interest-old mailing list