Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Qt::ItemFlags MyTableModel::flags(const QModelIndex & index) const {
  2.  
  3. if(!index.isValid())
  4. return Qt::ItemIsEnabled;
  5.  
  6. return QAbstractTableModel::flags(index) | Qt::ItemIsSelectable;
  7. }
  8.  
  9. void MyTableModel::addRecord(RecordPtr newone){
  10.  
  11. //...
  12.  
  13. int position= recordsCollection->size();
  14. beginInsertRows(QModelIndex(), position, position);
  15. recordsCollection->push_back(newone);
  16. endInsertRows();
  17. emit(dataChanged(QModelIndex(), QModelIndex()));
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement