Mercurial > trustbridge
diff 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 |
line wrap: on
line diff
--- a/ui/certificatetablemodel.cpp Thu Apr 10 14:13:34 2014 +0200 +++ b/ui/certificatetablemodel.cpp Thu Apr 10 14:14:56 2014 +0200 @@ -42,6 +42,13 @@ return QVariant(); } +bool CertificateTabelModel::setData(const QModelIndex &index, + const QVariant &value, int role) +{ + //TODO + return true; +} + QVariant CertificateTabelModel::headerData(int section, Qt::Orientation orientation, int role) const { @@ -61,4 +68,14 @@ return header.size(); } +Qt::ItemFlags CertificateTabelModel::flags(const QModelIndex &index) const +{ + if (!index.isValid ()) + return Qt::ItemIsSelectable; + if (index.column() == 0) { + return QAbstractTableModel::flags(index) | Qt::ItemIsEditable; + } + + return QAbstractTableModel::flags(index); +}