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

Method positionOf

launcher/ui/instanceview/VisualGroup.cpp:70–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70QPair<int, int> VisualGroup::positionOf(const QModelIndex &index) const
71{
72 int y = 0;
73 for (auto & row: rows)
74 {
75 for(auto x = 0; x < row.items.size(); x++)
76 {
77 if(row.items[x] == index)
78 {
79 return qMakePair(x,y);
80 }
81 }
82 y++;
83 }
84 qWarning() << "Item" << index.row() << index.data(Qt::DisplayRole).toString() << "not found in visual group" << text;
85 return qMakePair(0, 0);
86}
87
88int VisualGroup::rowTopOf(const QModelIndex &index) const
89{

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