| 690 | } |
| 691 | |
| 692 | QRect InstanceView::geometryRect(const QModelIndex &index) const |
| 693 | { |
| 694 | const_cast<InstanceView*>(this)->executeDelayedItemsLayout(); |
| 695 | |
| 696 | if (!index.isValid() || isIndexHidden(index) || index.column() > 0) |
| 697 | { |
| 698 | return QRect(); |
| 699 | } |
| 700 | |
| 701 | int row = index.row(); |
| 702 | if(geometryCache.contains(row)) |
| 703 | { |
| 704 | return *geometryCache[row]; |
| 705 | } |
| 706 | |
| 707 | const VisualGroup *cat = category(index); |
| 708 | QPair<int, int> pos = cat->positionOf(index); |
| 709 | int x = pos.first; |
| 710 | // int y = pos.second; |
| 711 | |
| 712 | QRect out; |
| 713 | out.setTop(cat->verticalPosition() + cat->headerHeight() + 5 + cat->rowTopOf(index)); |
| 714 | out.setLeft(m_spacing + x * (itemWidth() + m_spacing)); |
| 715 | out.setSize(itemDelegate()->sizeHint(viewOptions(), index)); |
| 716 | geometryCache.insert(row, new QRect(out)); |
| 717 | return out; |
| 718 | } |
| 719 | |
| 720 | QModelIndex InstanceView::indexAt(const QPoint &point) const |
| 721 | { |
nothing calls this directly
no test coverage detected