| 17 | } |
| 18 | |
| 19 | QVariant RouteListModel::data(const QModelIndex &index, int role) const |
| 20 | { |
| 21 | if (!index.isValid()) |
| 22 | return QVariant(); |
| 23 | |
| 24 | auto route = routes[index.row()]; |
| 25 | |
| 26 | switch (role) { |
| 27 | case Qt::ItemDataRole::DisplayRole: |
| 28 | return QString::fromStdString(route.description); |
| 29 | case Qt::ItemDataRole::UserRole: |
| 30 | return QVariant::fromValue(route); |
| 31 | default: |
| 32 | return QVariant(); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | bool RouteListModel::loadRemaining(IOutputDevice device, PresetRuleTableModel* ruleModel) |
| 37 | { |