| 197 | } |
| 198 | |
| 199 | bool FilterModel::insertRows(int row, int count, const QModelIndex& parent) |
| 200 | { |
| 201 | Q_ASSERT(!parent.isValid()); |
| 202 | Q_ASSERT(count == 1); |
| 203 | if (row == -1) { |
| 204 | // after end of list and we cannot just append either as then the |
| 205 | // later setData events will fails... |
| 206 | m_ignoredLastInsert = true; |
| 207 | return false; |
| 208 | } |
| 209 | m_ignoredLastInsert = false; |
| 210 | Q_ASSERT(row >= 0 && row <= m_filters.size()); |
| 211 | Q_ASSERT(row + count - 1 <= m_filters.size()); |
| 212 | |
| 213 | beginInsertRows(parent, row, row + count - 1); |
| 214 | for (int i = 0; i < count; ++i) { |
| 215 | m_filters.insert(row + i, SerializedFilter()); |
| 216 | } |
| 217 | endInsertRows(); |
| 218 | return true; |
| 219 | } |
| 220 | |
| 221 | bool FilterModel::removeRows(int row, int count, const QModelIndex& parent) |
| 222 | { |
no test coverage detected