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

void QMenuBar::setCornerWidget ( QWidget w,
Qt::Corner  corner = Qt::TopRightCorner 
)

For internal use only.

This sets widget w to be shown directly on the left of the first or the right of the last menu item, depending on corner.

Definition at line 1561 of file qmenubar.cpp.

References QObject::installEventFilter(), QObject::removeEventFilter(), and QWidget::setParent().

{
    Q_D(QMenuBar);
    switch (corner) {
    case Qt::TopLeftCorner:
        if (d->leftWidget)
            d->leftWidget->removeEventFilter(this);
        d->leftWidget = w;
        break;
    case Qt::TopRightCorner:
        if (d->rightWidget)
            d->rightWidget->removeEventFilter(this);
        d->rightWidget = w;
        break;
    default:
        qWarning("QMenuBar::setCornerWidget: Only TopLeftCorner and TopRightCorner are supported");
        return;
    }

    if (w) {
        w->setParent(this);
        w->installEventFilter(this);
    }

    d->_q_updateLayout();
}


Generated by  Doxygen 1.6.0   Back to index