| 315 | } |
| 316 | |
| 317 | bool 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 | |
| 335 | bool ExpandingWidgetModel::isExpanded(const QModelIndex& idx_) const |
| 336 | { |