MCPcopy Create free account
hub / github.com/KDE/labplot / setCurrentAspect

Method setCurrentAspect

src/frontend/ProjectExplorer.cpp:215–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215void 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.

Callers 4

dockFocusChangedMethod · 0.80
newProjectMethod · 0.80
handleAspectRemovedMethod · 0.80

Calls 4

modelIndexOfAspectMethod · 0.80
modelMethod · 0.45
setCurrentIndexMethod · 0.45

Tested by 1