Does DATreeModel::setCanData() get called only once or many times? I think you might be looking for something like this:
Qt Code:
  1. void DATreeModel::setCanData( CANDATA *pData, int nAmount, int nCount )
  2. {
  3. if( pData )
  4. {
  5. int row = rowCount();
  6. beginInsertRows(QModelIndex(), row, row + nAmount - 1);
  7. ...
  8. endInsertRows();
  9. }
  10. }
To copy to clipboard, switch view to plain text mode