| 48 | } |
| 49 | |
| 50 | QVariant CheckSetSelectionListModel::data(const QModelIndex& index, int role) const |
| 51 | { |
| 52 | if (!index.isValid() || |
| 53 | index.row() < 0 || index.row() >= rowCount() || |
| 54 | index.column() != 0) { |
| 55 | return {}; |
| 56 | } |
| 57 | |
| 58 | if (role == Qt::DisplayRole) { |
| 59 | const int checkSetSelectionIndex = index.row(); |
| 60 | |
| 61 | const auto& checkSetSelection = m_checkSetSelections.at(checkSetSelectionIndex); |
| 62 | auto checkSetSelectionName = checkSetSelection.name(); |
| 63 | if (m_defaultCheckSetSelectionId == checkSetSelection.id()) { |
| 64 | checkSetSelectionName = i18nc("@item:inlistbox", "%1 (default selection)", checkSetSelectionName); |
| 65 | } |
| 66 | return checkSetSelectionName; |
| 67 | } |
| 68 | |
| 69 | return {}; |
| 70 | } |
| 71 | |
| 72 | QModelIndex CheckSetSelectionListModel::index(int row, int column, const QModelIndex& parent) const |
| 73 | { |