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

Method indexOfChild

launcher/ui/instanceview/AccessibleInstanceView.cpp:384–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384int AccessibleInstanceView::indexOfChild(const QAccessibleInterface *iface) const
385{
386 if (!view()->model())
387 return -1;
388 QAccessibleInterface *parent = iface->parent();
389 if (parent->object() != view())
390 return -1;
391
392 Q_ASSERT(iface->role() != QAccessible::TreeItem); // should be handled by tree class
393 if (iface->role() == QAccessible::Cell || iface->role() == QAccessible::ListItem) {
394 const AccessibleInstanceViewItem* cell = static_cast<const AccessibleInstanceViewItem*>(iface);
395 return logicalIndex(cell->m_index);
396 } else if (iface->role() == QAccessible::Pane) {
397 return 0; // corner button
398 } else {
399 qWarning() << "AccessibleInstanceView::indexOfChild has a child with unknown role..." << iface->role() << iface->text(QAccessible::Name);
400 }
401 // FIXME: we are in denial of our children. this should stop.
402 return -1;
403}
404
405QString AccessibleInstanceView::text(QAccessible::Text t) const
406{

Callers

nothing calls this directly

Calls 5

modelMethod · 0.80
objectMethod · 0.80
roleMethod · 0.80
parentMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected