| 212 | } |
| 213 | |
| 214 | void StructDetailModel::addField(const QModelIndex& index, FieldDef* field) |
| 215 | { |
| 216 | int start = index.row(); |
| 217 | |
| 218 | if (m_fields.isEmpty()) |
| 219 | { |
| 220 | start = 0; |
| 221 | } |
| 222 | else if (start < 0 || start >= m_fields.count()) |
| 223 | { |
| 224 | start = static_cast<int>(m_fields.count()); |
| 225 | } |
| 226 | |
| 227 | beginInsertRows(QModelIndex(), start, start); |
| 228 | m_fields.insert(start, field); |
| 229 | endInsertRows(); |
| 230 | |
| 231 | updateFieldOffsets(); |
| 232 | } |
| 233 | |
| 234 | void StructDetailModel::addPaddingFields(int count, int start) |
| 235 | { |