Mercurial > trustbridge
comparison ui/certificatetablemodel.cpp @ 353:666abcfab229
Implemented setData in certificate table model.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 10 Apr 2014 15:56:59 +0200 |
parents | e6aa82466420 |
children | 9ba7b4b4c1de |
comparison
equal
deleted
inserted
replaced
352:b0a274f4f9e2 | 353:666abcfab229 |
---|---|
43 } | 43 } |
44 | 44 |
45 bool CertificateTabelModel::setData(const QModelIndex &index, | 45 bool CertificateTabelModel::setData(const QModelIndex &index, |
46 const QVariant &value, int role) | 46 const QVariant &value, int role) |
47 { | 47 { |
48 //TODO | 48 if (index.row() > certificates.size() || index.row() < 0) { |
49 return false; | |
50 } | |
51 | |
52 bool newValue = value.toBool(); | |
53 Certificate &cert = certificates[index.row()]; | |
54 cert.setInstallCert(newValue); | |
55 | |
56 emit dataChanged(index, index); | |
57 | |
49 return true; | 58 return true; |
50 } | 59 } |
51 | 60 |
52 QVariant CertificateTabelModel::headerData(int section, | 61 QVariant CertificateTabelModel::headerData(int section, |
53 Qt::Orientation orientation, int role) const | 62 Qt::Orientation orientation, int role) const |