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

Method updateGeometries

launcher/ui/instanceview/InstanceView.cpp:182–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void InstanceView::updateGeometries()
183{
184 geometryCache.clear();
185
186 QMap<LocaleString, VisualGroup *> cats;
187
188 for (int i = 0; i < model()->rowCount(); ++i)
189 {
190 const QString groupName = model()->index(i, 0).data(InstanceViewRoles::GroupRole).toString();
191 if (!cats.contains(groupName))
192 {
193 VisualGroup *old = this->category(groupName);
194 if (old)
195 {
196 auto cat = new VisualGroup(old);
197 cats.insert(groupName, cat);
198 cat->update();
199 }
200 else
201 {
202 auto cat = new VisualGroup(groupName, this);
203 if(fVisibility) {
204 cat->collapsed = fVisibility(groupName);
205 }
206 cats.insert(groupName, cat);
207 cat->update();
208 }
209 }
210 }
211
212 qDeleteAll(m_groups);
213 m_groups = cats.values();
214 updateScrollbar();
215 viewport()->update();
216}
217
218bool InstanceView::isIndexHidden(const QModelIndex &index) const
219{

Callers 1

finalizeInstanceMethod · 0.80

Calls 9

categoryMethod · 0.95
insertMethod · 0.80
clearMethod · 0.45
rowCountMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
indexMethod · 0.45
containsMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected