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

Method indexOfChild

launcher/ui/instanceview/AccessibleInstanceView.cpp:390–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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