comparison ui/certificatetabledelegate.cpp @ 358:9ba7b4b4c1de

Implemented the load from certificate file and set the edit state of certificates.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 10 Apr 2014 17:06:37 +0200
parents c9315b24b055
children bae8d4a20ef1
comparison
equal deleted inserted replaced
357:d56f952ba817 358:9ba7b4b4c1de
36 } 36 }
37 37
38 QWidget *CertificateTableDelegate::drawComboBox(QWidget *parent, 38 QWidget *CertificateTableDelegate::drawComboBox(QWidget *parent,
39 const QStyleOptionViewItem &option, const QModelIndex &index) const 39 const QStyleOptionViewItem &option, const QModelIndex &index) const
40 { 40 {
41 bool editable = index.data(Qt::UserRole).toBool();
41 // Create a combobox and add two items for install/remove. 42 // Create a combobox and add two items for install/remove.
42 QComboBox *comboBox = new QComboBox(parent); 43 QComboBox *comboBox = new QComboBox(parent);
43 comboBox->addItem(QIcon(":/img/list-add.png"), QString(""), QVariant("true")); 44 comboBox->addItem(QIcon(":/img/list-add.png"), QString(""), QVariant("true"));
44 comboBox->addItem(QIcon(":/img/list-remove.png"), QString(""), QVariant("false")); 45 if (editable) {
46 comboBox->addItem(QIcon(":/img/list-remove.png"),
47 QString(""), QVariant("false"));
48 }
45 return comboBox; 49 return comboBox;
46 } 50 }
47 51
48 void CertificateTableDelegate::setEditorData(QWidget *editor, 52 void CertificateTableDelegate::setEditorData(QWidget *editor,
49 const QModelIndex &index) const 53 const QModelIndex &index) const

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