| 46 | } |
| 47 | |
| 48 | QVariant DetectorTableModel::data(const QModelIndex& index, int role) const |
| 49 | { |
| 50 | switch(role) |
| 51 | { |
| 52 | /*-----------------------------------------------------*\ |
| 53 | | Column 0 is the detector name, 1 is the enable flag | |
| 54 | \*-----------------------------------------------------*/ |
| 55 | case Qt::DisplayRole: |
| 56 | switch(index.column()) |
| 57 | { |
| 58 | case 0: |
| 59 | return detectors[index.row()].key.c_str(); |
| 60 | case 1: |
| 61 | return detectors[index.row()].value; |
| 62 | } |
| 63 | return QVariant(); |
| 64 | |
| 65 | case Qt::CheckStateRole: |
| 66 | switch(index.column()) |
| 67 | { |
| 68 | case 1: |
| 69 | return 2 * detectors[index.row()].value; |
| 70 | } |
| 71 | return QVariant(); |
| 72 | } |
| 73 | return QVariant(); |
| 74 | } |
| 75 | |
| 76 | bool DetectorTableModel::setData(const QModelIndex& index, const QVariant& value, int role) |
| 77 | { |
no outgoing calls
no test coverage detected