| 310 | } |
| 311 | |
| 312 | void ProjectBaseItem::setModel( ProjectModel* model ) |
| 313 | { |
| 314 | Q_D(ProjectBaseItem); |
| 315 | |
| 316 | if (model == d->model) { |
| 317 | return; |
| 318 | } |
| 319 | |
| 320 | if (d->model && !d->m_indexedPath.isEmpty()) { |
| 321 | d->model->d_func()->pathLookupTable.remove(d->m_indexedPath, this); |
| 322 | } |
| 323 | |
| 324 | d->model = model; |
| 325 | |
| 326 | if (model && !d->m_indexedPath.isEmpty()) { |
| 327 | model->d_func()->pathLookupTable.insert(d->m_indexedPath, this); |
| 328 | } |
| 329 | |
| 330 | for (ProjectBaseItem* item : std::as_const(d->children)) { |
| 331 | item->setModel( model ); |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | void ProjectBaseItem::setRow( int row ) |
| 336 | { |