Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Qt::ItemFlags MyTableModel::flags(const QModelIndex & index) const {
- if(!index.isValid())
- return Qt::ItemIsEnabled;
- return QAbstractTableModel::flags(index) | Qt::ItemIsSelectable;
- }
- void MyTableModel::addRecord(RecordPtr newone){
- //...
- int position= recordsCollection->size();
- beginInsertRows(QModelIndex(), position, position);
- recordsCollection->push_back(newone);
- endInsertRows();
- emit(dataChanged(QModelIndex(), QModelIndex()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement