MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / geometryRect

Method geometryRect

launcher/ui/instanceview/InstanceView.cpp:717–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715}
716
717QRect 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
750QModelIndex InstanceView::indexAt(const QPoint& point) const
751{

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