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

void QPainter::setClipRegion ( const QRegion region,
Qt::ClipOperation  operation = Qt::ReplaceClip 
) [inherited]

Sets the clip region to the given region using the specified clip operation. The default clip operation is to replace the current clip region.

Note that the clip region is given in logical coordinates.

See also:
clipRegion(), setClipRect(), {QPainter::Clipping}{Clipping}

Definition at line 1892 of file qpainter.cpp.

References QRegion::boundingRect(), QRect::height(), QPainter::isActive(), QRegion::rects(), QVector< T >::size(), QRect::width(), QRect::x(), and QRect::y().

Referenced by QCommonStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), Q3IconView::drawContents(), QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QCommonStyle::drawControl(), QCommonStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QPicture::exec(), Q3Frame::paintEvent(), QMenuBar::paintEvent(), QMenu::paintEvent(), and Q3ListBox::viewportPaintEvent().

{
    Q_D(QPainter);
#ifdef QT_DEBUG_DRAW
    QRect rect = r.boundingRect();
    if (qt_show_painter_debug_output)
        printf("QPainter::setClipRegion(), size=%d, [%d,%d,%d,%d]\n",
           r.rects().size(), rect.x(), rect.y(), rect.width(), rect.height());
#endif
    if (!isActive()) {
        qWarning("QPainter::setClipRegion: Painter not active");
        return;
    }

    if (!d->state->clipEnabled && (op == Qt::IntersectClip || op == Qt::UniteClip))
        op = Qt::ReplaceClip;

    d->state->clipRegion = r;
    d->state->clipOperation = op;
    if (op == Qt::NoClip || op == Qt::ReplaceClip)
        d->state->clipInfo.clear();
    d->state->clipInfo << QPainterClipInfo(r, op, d->state->worldMatrix);
    d->state->clipEnabled = true;
    d->state->dirtyFlags |= QPaintEngine::DirtyClipRegion | QPaintEngine::DirtyClipEnabled;
    d->updateState(d->state);
}


Generated by  Doxygen 1.6.0   Back to index