comparison ui/certificatetablemodel.cpp @ 348:e6aa82466420

Use the table item delegate for certificates and make the model editable.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 10 Apr 2014 14:14:56 +0200
parents fba80767fd7a
children 666abcfab229
comparison
equal deleted inserted replaced
347:dde533ba4fcc 348:e6aa82466420
40 } 40 }
41 41
42 return QVariant(); 42 return QVariant();
43 } 43 }
44 44
45 bool CertificateTabelModel::setData(const QModelIndex &index,
46 const QVariant &value, int role)
47 {
48 //TODO
49 return true;
50 }
51
45 QVariant CertificateTabelModel::headerData(int section, 52 QVariant CertificateTabelModel::headerData(int section,
46 Qt::Orientation orientation, int role) const 53 Qt::Orientation orientation, int role) const
47 { 54 {
48 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { 55 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
49 return header.at(section); 56 return header.at(section);
59 int CertificateTabelModel::columnCount(const QModelIndex&) const 66 int CertificateTabelModel::columnCount(const QModelIndex&) const
60 { 67 {
61 return header.size(); 68 return header.size();
62 } 69 }
63 70
71 Qt::ItemFlags CertificateTabelModel::flags(const QModelIndex &index) const
72 {
73 if (!index.isValid ())
74 return Qt::ItemIsSelectable;
64 75
76 if (index.column() == 0) {
77 return QAbstractTableModel::flags(index) | Qt::ItemIsEditable;
78 }
79
80 return QAbstractTableModel::flags(index);
81 }

http://wald.intevation.org/projects/trustbridge/