| 748 | } // FileSystemModel::data |
| 749 | |
| 750 | QModelIndex |
| 751 | FileSystemModel::index(int row, |
| 752 | int column, |
| 753 | const QModelIndex &parent) const |
| 754 | { |
| 755 | // As the Name column is a tree, we will only create index whose parent is in the Name column |
| 756 | if ( parent.isValid() && ( (Sections)parent.column() != Name ) ) { |
| 757 | return QModelIndex(); |
| 758 | } |
| 759 | |
| 760 | FileSystemItemPtr parentItem = getItem(parent); |
| 761 | |
| 762 | |
| 763 | if (parentItem) { |
| 764 | FileSystemItemPtr childItem = parentItem->childAt(row); |
| 765 | |
| 766 | if (childItem) { |
| 767 | return createIndex( row, column, childItem.get() ); |
| 768 | } |
| 769 | } |
| 770 | |
| 771 | return QModelIndex(); |
| 772 | } |
| 773 | |
| 774 | QModelIndex |
| 775 | FileSystemModel::parent(const QModelIndex &index) const |
nothing calls this directly
no test coverage detected