| 315 | } |
| 316 | |
| 317 | QVariant TemplateListModel::data(const QModelIndex& index, int role) const { |
| 318 | const int row = index.row(); |
| 319 | if (!index.isValid() || row > mFiles.count() || row < 0) |
| 320 | return QVariant(); |
| 321 | |
| 322 | switch (role) { |
| 323 | case FilenameRole: // fall through |
| 324 | case Qt::ItemDataRole::DisplayRole: |
| 325 | return mFiles.at(row).fileName; |
| 326 | case FilePathRole: |
| 327 | return mFiles.at(row).path; |
| 328 | } |
| 329 | |
| 330 | return QVariant(); |
| 331 | } |
no test coverage detected