/*! \reimp */ int QAccessibleWidget::indexOfChild(const QAccessibleInterface *child) const { if (!child) return -1; QWidgetList cl = childWidgets(widget()); return cl.indexOf(qobject_cast<QWidget *>(child->object())); }
/*! \reimp */ int QAccessibleWidget::indexOfChild(const QAccessibleInterface *child) const { QWidgetList cl = childWidgets(widget()); int index = cl.indexOf(qobject_cast<QWidget *>(child->object())); if (index != -1) ++index; return index; }
// Replace widgets in a widget-list type dynamic property of the parent // used for Z-order, etc. static void replaceWidgetListDynamicProperty(QWidget *parentWidget, QWidget *oldWidget, QWidget *newWidget, const char *name) { QWidgetList list = qvariant_cast<QWidgetList>(parentWidget->property(name)); const int index = list.indexOf(oldWidget); if (index != -1) { list.replace(index, newWidget); parentWidget->setProperty(name, QVariant::fromValue(list)); } }