MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / positionOf

Method positionOf

launcher/ui/instanceview/VisualGroup.cpp:97–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97QPair<int, int> VisualGroup::positionOf(const QModelIndex &index) const
98{
99 int y = 0;
100 for (auto & row: rows)
101 {
102 for(auto x = 0; x < row.items.size(); x++)
103 {
104 if(row.items[x] == index)
105 {
106 return qMakePair(x,y);
107 }
108 }
109 y++;
110 }
111 qWarning() << "Item" << index.row() << index.data(Qt::DisplayRole).toString() << "not found in visual group" << text;
112 return qMakePair(0, 0);
113}
114
115int VisualGroup::rowTopOf(const QModelIndex &index) const
116{

Callers 2

geometryRectMethod · 0.80
moveCursorMethod · 0.80

Calls 3

sizeMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected