| 213 | } |
| 214 | |
| 215 | void ProjectExplorer::setCurrentAspect(const AbstractAspect* aspect) { |
| 216 | // HACK: when doing redo/undo in MainWin and an object is being deleted, |
| 217 | // we don't want to jump to another object in the project explorer. |
| 218 | // we reuse the aspectAddedSignalSuppressed also for the deletion of aspects. |
| 219 | if (m_project->aspectAddedSignalSuppressed()) |
| 220 | return; |
| 221 | |
| 222 | const auto* tree_model = dynamic_cast<AspectTreeModel*>(m_treeView->model()); |
| 223 | if (tree_model) { |
| 224 | const auto& index = tree_model->modelIndexOfAspect(aspect); |
| 225 | // TODO: This crashes on Windows in Debug mode |
| 226 | #if !defined(HAVE_WINDOWS) || defined(NDEBUG) |
| 227 | m_treeView->setCurrentIndex(index); |
| 228 | #endif |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | /*! |
| 233 | Sets the \c model for the tree view to present. |