| 51 | } |
| 52 | |
| 53 | QVariant MacroStepTableModel::data(const QModelIndex &index, int role) const |
| 54 | { |
| 55 | if (!index.isValid()) |
| 56 | return QVariant(); |
| 57 | |
| 58 | if (role == Qt::DisplayRole || role == Qt::EditRole || role == Qt::ToolTipRole) { |
| 59 | switch (index.column()) { |
| 60 | case 0: |
| 61 | if (role == Qt::EditRole) { |
| 62 | return static_cast<int>(macro->getSteps()[index.row()].message); |
| 63 | } |
| 64 | else { |
| 65 | return macro->getSteps()[index.row()].getName(); |
| 66 | } |
| 67 | case 1: |
| 68 | return macro->getSteps()[index.row()].str; |
| 69 | default: |
| 70 | break; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | return QVariant(); |
| 75 | } |
| 76 | |
| 77 | bool MacroStepTableModel::setData(const QModelIndex &index, const QVariant &value, int role) |
| 78 | { |