hi,

i have a treemodel which is actually working fine, except removing.
how it looks like:
Qt Code:
  1. HEADLINE (expanded view)
  2. group1
  3. item1
  4. item2
  5. item3
  6. group2
  7. itemA
  8. itemB
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. HEADLINE (collapsed view group1)
  2. group1
  3. group2
  4. itemA
  5. itemB
To copy to clipboard, switch view to plain text mode 
adding is working fine.
removing items from any expanded group does work fine.

BUT if "group1" is collapsed and i remove an item (eg: "item3"), then the button infront of "group1" will vanish.
i can still press that invisible button to expand "group1".
when i add another item to "group1" the button will appear BUT only if it is expanded.

other groups are not affected until i remove item out of them

Qt Code:
  1. bool TreeModel::insertRows( int row , int count , const QModelIndex &parent )
  2. {
  3. TreeItem *parentItem = getItem(parent);
  4. beginInsertRows(parent, row, row + count - 1);
  5. parentItem->appendChild(tmpItem);
  6. endInsertRows();
  7. return true;
  8. }
  9. bool TreeModel::removeRows( int row , int count , const QModelIndex &parent )
  10. {
  11. TreeItem *parentItem = getItem(parent);
  12. beginRemoveRows(parent, row, row + count - 1);
  13. parentItem->removeChild(tmpItem);
  14. endRemoveRows();
  15. return true;
  16. }
To copy to clipboard, switch view to plain text mode 

any help or ideas ?