Mercurial > trustbridge
changeset 353:666abcfab229
Implemented setData in certificate table model.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 10 Apr 2014 15:56:59 +0200 |
parents | b0a274f4f9e2 |
children | c9315b24b055 |
files | ui/certificatetablemodel.cpp |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ui/certificatetablemodel.cpp Thu Apr 10 15:55:47 2014 +0200 +++ b/ui/certificatetablemodel.cpp Thu Apr 10 15:56:59 2014 +0200 @@ -45,7 +45,16 @@ bool CertificateTabelModel::setData(const QModelIndex &index, const QVariant &value, int role) { - //TODO + if (index.row() > certificates.size() || index.row() < 0) { + return false; + } + + bool newValue = value.toBool(); + Certificate &cert = certificates[index.row()]; + cert.setInstallCert(newValue); + + emit dataChanged(index, index); + return true; }