treemodel.cpp
changeset 755 ed5b407975b3
parent 754 db0ec4bcf416
child 756 a8a5c7288f57
     1.1 --- a/treemodel.cpp	Mon Apr 20 10:42:05 2009 +0000
     1.2 +++ b/treemodel.cpp	Thu Apr 23 12:15:31 2009 +0000
     1.3 @@ -186,13 +186,16 @@
     1.4  	int last=row+count-1;
     1.5  	cout << "TreeModel::removeRows row="<<row<<"  count="<<count<<"  last="<<last<<endl;
     1.6      TreeItem *pi= getItem (parent);
     1.7 +	TreeItem *ti;
     1.8  	cout << "  pi="<<pi<<"  "<<pi->getHeading().toStdString()<<endl;
     1.9  	beginRemoveRows (parent,row,last);
    1.10  
    1.11  	for (int i=row; i<=last; i++)
    1.12  	{
    1.13  		cout << "TreeModel::removeRows removing i="<<i<<std::endl;
    1.14 -		pi->removeChild (row);
    1.15 +		ti=pi->getChildNum (row);
    1.16 +		pi->removeChild (row);	// does not delete object!
    1.17 +		delete (ti);
    1.18  	}
    1.19  	endRemoveRows ();
    1.20  	return true;