| 725 | } |
| 726 | |
| 727 | QRect InstanceView::geometryRect(const QModelIndex &index) const |
| 728 | { |
| 729 | const_cast<InstanceView*>(this)->executeDelayedItemsLayout(); |
| 730 | |
| 731 | if (!index.isValid() || isIndexHidden(index) || index.column() > 0) |
| 732 | { |
| 733 | return QRect(); |
| 734 | } |
| 735 | |
| 736 | int row = index.row(); |
| 737 | if(geometryCache.contains(row)) |
| 738 | { |
| 739 | return *geometryCache[row]; |
| 740 | } |
| 741 | |
| 742 | const VisualGroup *cat = category(index); |
| 743 | QPair<int, int> pos = cat->positionOf(index); |
| 744 | int x = pos.first; |
| 745 | // int y = pos.second; |
| 746 | |
| 747 | |
| 748 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 749 | QStyleOptionViewItem option; |
| 750 | initViewItemOption(&option); |
| 751 | #else |
| 752 | QStyleOptionViewItem option = viewOptions(); |
| 753 | #endif |
| 754 | |
| 755 | QRect out; |
| 756 | out.setTop(cat->verticalPosition() + cat->headerHeight() + 5 + cat->rowTopOf(index)); |
| 757 | out.setLeft(m_spacing + x * (itemWidth() + m_spacing)); |
| 758 | out.setSize(itemDelegate()->sizeHint(option, index)); |
| 759 | geometryCache.insert(row, new QRect(out)); |
| 760 | return out; |
| 761 | } |
| 762 | |
| 763 | QModelIndex InstanceView::indexAt(const QPoint &point) const |
| 764 | { |
nothing calls this directly
no test coverage detected