MCPcopy Create free account
hub / github.com/KDE/kdevelop / isExpandable

Method isExpandable

plugins/quickopen/expandingtree/expandingwidgetmodel.cpp:317–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317bool ExpandingWidgetModel::isExpandable(const QModelIndex& idx_) const
318{
319 Q_ASSERT(idx_.model() == this);
320
321 QModelIndex idx(firstColumn(idx_));
322
323 auto expandStateIt = m_expandState.find(idx);
324 if (expandStateIt == m_expandState.end()) {
325 expandStateIt = m_expandState.insert(idx, NotExpandable);
326 QVariant v = data(idx, CodeCompletionModel::IsExpandable);
327 if (v.canConvert<bool>() && v.toBool()) {
328 *expandStateIt = Expandable;
329 }
330 }
331
332 return *expandStateIt != NotExpandable;
333}
334
335bool ExpandingWidgetModel::isExpanded(const QModelIndex& idx_) const
336{

Callers

nothing calls this directly

Calls 6

firstColumnFunction · 0.85
dataFunction · 0.50
modelMethod · 0.45
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected