MCPcopy Create free account
hub / github.com/MultiMC/Launcher / geometryRect

Method geometryRect

launcher/ui/instanceview/InstanceView.cpp:692–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690}
691
692QRect 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
720QModelIndex InstanceView::indexAt(const QPoint &point) const
721{

Callers

nothing calls this directly

Calls 8

positionOfMethod · 0.80
verticalPositionMethod · 0.80
headerHeightMethod · 0.80
rowTopOfMethod · 0.80
insertMethod · 0.80
isValidMethod · 0.45
containsMethod · 0.45
sizeHintMethod · 0.45

Tested by

no test coverage detected