Logo Search packages:      
Sourcecode: qt4-x11 version File versions

bool QWidget::isAncestorOf ( const QWidget child  )  const [inherited]

Returns true if this widget is a parent, (or grandparent and so on to any level), of the given child, and both widgets are within the same window; otherwise returns false.

Definition at line 7052 of file qwidget.cpp.

References QWidget::isWindow(), and QWidget::parentWidget().

Referenced by QStyledItemDelegate::eventFilter(), Q3ScrollView::focusNextPrevChild(), Q3WidgetStack::raiseWidget(), QWidget::setParent(), and QMdiSubWindow::showShaded().

{
    while (child) {
        if (child == this)
            return true;
        if (child->isWindow())
            return false;
        child = child->parentWidget();
    }
    return false;
}


Generated by  Doxygen 1.6.0   Back to index