reimp*/
| 60 | return index.isValid() ? 0 : 4; |
| 61 | } |
| 62 | /*reimp*/ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override |
| 63 | { |
| 64 | if (index.isValid() && index.row() < rowCount() && index.column() < columnCount()) { |
| 65 | switch (index.column()) { |
| 66 | case 0: |
| 67 | return (role == Qt::DisplayRole) |
| 68 | ? QVariant::fromValue(m_tasks[index.row()].title) |
| 69 | : QVariant(); |
| 70 | case 1: |
| 71 | return (role == Qt::DisplayRole) |
| 72 | ? QVariant::fromValue(( int )KDGantt::TypeTask) |
| 73 | : QVariant(); |
| 74 | case 2: |
| 75 | return (role == KDGantt::StartTimeRole || role == Qt::DisplayRole) |
| 76 | ? QVariant::fromValue(m_tasks[index.row()].start) |
| 77 | : QVariant(); |
| 78 | case 3: |
| 79 | return (role == KDGantt::EndTimeRole || role == Qt::DisplayRole) |
| 80 | ? QVariant::fromValue(m_tasks[index.row()].end) |
| 81 | : QVariant(); |
| 82 | } |
| 83 | } |
| 84 | return QVariant(); |
| 85 | } |
| 86 | |
| 87 | void moveRow(int from, int to) |
| 88 | { |
no test coverage detected