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

src.gui.painting.qregion.cpp

//! [0]
        void MyWidget::paintEvent(QPaintEvent *)
        {
            QRegion r1(QRect(100, 100, 200, 80),    // r1: elliptic region
                       QRegion::Ellipse);
            QRegion r2(QRect(100, 120, 90, 30));    // r2: rectangular region
            QRegion r3 = r1.intersected(r2);        // r3: intersection

            QPainter painter(this);
          painter.setClipRegion(r3);
            ...                                     // paint clipped graphics
        }
//! [0]



Generated by  Doxygen 1.6.0   Back to index