| 237 | } |
| 238 | |
| 239 | QMap<int, QVariant> FilterModel::itemData(const QModelIndex& index) const |
| 240 | { |
| 241 | QMap<int, QVariant> ret; |
| 242 | if (!index.isValid()) { |
| 243 | return ret; |
| 244 | } |
| 245 | Q_ASSERT(!index.parent().isValid()); |
| 246 | Q_ASSERT(index.row() >= 0 && index.row() < m_filters.size()); |
| 247 | const SerializedFilter& filter = m_filters.at(index.row()); |
| 248 | ret.insert(Qt::UserRole + Pattern, filter.pattern); |
| 249 | ret.insert(Qt::UserRole + Inclusive, static_cast<int>(filter.type)); |
| 250 | ret.insert(Qt::UserRole + Targets, static_cast<int>(filter.targets)); |
| 251 | return ret; |
| 252 | } |
| 253 | |
| 254 | bool FilterModel::setItemData(const QModelIndex& index, const QMap< int, QVariant >& roles) |
| 255 | { |