| 398 | } |
| 399 | |
| 400 | QModelIndex CodeCompletionModel::parent(const QModelIndex& index) const |
| 401 | { |
| 402 | if (rowCount() == 0) |
| 403 | return QModelIndex(); |
| 404 | |
| 405 | if (index.isValid()) { |
| 406 | auto* element = static_cast<CompletionTreeElement*>(index.internalPointer()); |
| 407 | |
| 408 | if (element->parent()) |
| 409 | return createIndex(element->rowInParent(), element->columnInParent(), element->parent()); |
| 410 | } |
| 411 | |
| 412 | return QModelIndex(); |
| 413 | } |
| 414 | |
| 415 | int CodeCompletionModel::rowCount(const QModelIndex& parent) const |
| 416 | { |
no test coverage detected