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

void QWidget::setMask ( const QRegion region  )  [inherited]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Causes only the parts of the widget which overlap region to be visible. If the region includes pixels outside the rect() of the widget, window system controls in that area may or may not be visible, depending on the platform.

Note that this effect can be slow if the region is particularly complex.

See also:
windowOpacity

Definition at line 2339 of file qwidget_x11.cpp.

References QWidget::geometry, QWidget::internalWinId(), QRegion::isEmpty(), QWidget::isWindow(), QWidget::parentWidget(), QWidget::rect, QWidget::testAttribute(), QRegion::translated(), and QWidget::update().

{
    Q_D(QWidget);
    d->createExtra();
    if (region == d->extra->mask)
        return;
#ifndef QT_NO_BACKINGSTORE
    QRegion parentR;
    if (!isWindow())
        parentR = d->extra->mask.isEmpty() ? QRegion(rect()) : d->extra->mask ;
#endif

    d->extra->mask = region;

    if (!testAttribute(Qt::WA_WState_Created))
        return;

    XShapeCombineRegion(X11->display, internalWinId(), ShapeBounding, 0, 0,
                        region.handle(), ShapeSet);
#ifndef QT_NO_BACKINGSTORE
    if (isVisible()) {
        if (!isWindow()) {
            parentR += d->extra->mask;
            parentWidget()->update(parentR.translated(geometry().topLeft()));
        }
        if (!testAttribute(Qt::WA_PaintOnScreen))
            update();
    }
#endif
}


Generated by  Doxygen 1.6.0   Back to index