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

void QWidget::raise (  )  [slot, inherited]

Raises this widget to the top of the parent widget's stack.

After this call the widget will be visually in front of any overlapping sibling widgets.

Note:
When using activateWindow(), you can call this function to ensure that the window is stacked on top.
See also:
lower(), stackUnder()

Definition at line 9477 of file qwidget.cpp.

References QObject::children(), QWidget::create(), QList< T >::indexOf(), QWidget::isWindow(), QList< T >::move(), QWidget::parentWidget(), QCoreApplication::sendEvent(), QList< T >::size(), and QWidget::testAttribute().

Referenced by Q3ComboBox::popup(), qdesigner_internal::Layout::setup(), View::showInformation(), and Q3Table::updateGeometries().

{
    Q_D(QWidget);
    if (!isWindow()) {
        QWidget *p = parentWidget();
        const int parentChildCount = p->d_func()->children.size();
        if (parentChildCount < 2)
            return;
        const int from = p->d_func()->children.indexOf(this);
        Q_ASSERT(from >= 0);
        // Do nothing if the widget is already in correct stacking order _and_ created.
        if (from != parentChildCount -1)
            p->d_func()->children.move(from, parentChildCount - 1);
        if (!testAttribute(Qt::WA_WState_Created) && p->testAttribute(Qt::WA_WState_Created))
            create();
        else if (from == parentChildCount - 1)
            return;
    }
    if (testAttribute(Qt::WA_WState_Created))
        d->raise_sys();

    QEvent e(QEvent::ZOrderChange);
    QApplication::sendEvent(this, &e);
}


Generated by  Doxygen 1.6.0   Back to index