MCPcopy Create free account
hub / github.com/PrismLauncher/PrismLauncher / geometryRect

Method geometryRect

launcher/ui/instanceview/InstanceView.cpp:704–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

702}
703
704QRect 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
733QModelIndex InstanceView::indexAt(const QPoint& point) const
734{

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected