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