| 702 | } |
| 703 | |
| 704 | QRect InstanceView::geometryRect(const QModelIndex& index) const |
| 705 | { |
| 706 | const_cast<InstanceView*>(this)->executeDelayedItemsLayout(); |
| 707 | |
| 708 | if (!index.isValid() || isIndexHidden(index) || index.column() > 0) { |
| 709 | return QRect(); |
| 710 | } |
| 711 | |
| 712 | int row = index.row(); |
| 713 | if (m_geometryCache.contains(row)) { |
| 714 | return *m_geometryCache[row]; |
| 715 | } |
| 716 | |
| 717 | const VisualGroup* cat = category(index); |
| 718 | QPair<int, int> pos = cat->positionOf(index); |
| 719 | int x = pos.first; |
| 720 | // int y = pos.second; |
| 721 | |
| 722 | QStyleOptionViewItem option; |
| 723 | initViewItemOption(&option); |
| 724 | |
| 725 | QRect out; |
| 726 | out.setTop(cat->verticalPosition() + cat->headerHeight() + 5 + cat->rowTopOf(index)); |
| 727 | out.setLeft(m_spacing + x * (itemWidth() + m_spacing)); |
| 728 | out.setSize(itemDelegate()->sizeHint(option, index)); |
| 729 | m_geometryCache.insert(row, new QRect(out)); |
| 730 | return out; |
| 731 | } |
| 732 | |
| 733 | QModelIndex InstanceView::indexAt(const QPoint& point) const |
| 734 | { |
nothing calls this directly
no test coverage detected