Ejemplo n.º 1
0
void QWSWindowSurface::setGeometry(const QRect &rect, const QRegion &mask)
{
    if (rect == geometry()) // XXX: && mask == prevMask
        return;

    const bool isResize = rect.size() != geometry().size();
    const bool needsRepaint = isResize || !isBuffered();

    QWindowSurface::setGeometry(rect);

    const QRegion region = mask & rect;
    QWidget *win = window();
    // Only request regions for widgets visible on the screen.
    // (Added the !win check for compatibility reasons, because
    // there was no "if (win)" check before).
    const bool requestQWSRegion = !win || !win->testAttribute(Qt::WA_DontShowOnScreen);
    if (requestQWSRegion)
        QWidget::qwsDisplay()->requestRegion(winId(), key(), permanentState(), region);

    if (needsRepaint)
        invalidateBuffer();

    if (!requestQWSRegion) {
        // We didn't request a region, hence we won't get a QWSRegionEvent::Allocation
        // event back from the server so we set the clip directly. We have to
        // do this after the invalidateBuffer() call above, as it might trigger a
        // backing store sync, resulting in too many update requests.
        setClipRegion(region);
    }
}
Ejemplo n.º 2
0
void KoChild::transform( QPainter &painter )
{
    setClipRegion( painter, true );

    QWMatrix m = painter.worldMatrix();
    m = d->m_matrix * m;
    m.scale( d->m_scaleX, d->m_scaleY );
    painter.setWorldMatrix( m );
}
Ejemplo n.º 3
0
void BrainPlot::appendPoint( QPointF point, int Channel )
{
    /*Adds new point - with proper index and offset - to the data series*/
    CurveData *data = static_cast<CurveData *>( d_curves[Channel]->data() );
    point.setY(minusExpectedAmplitude*(2*Channel+1)+point.y());
    data->replace(sample%plotLength, point);
    setClipRegion(d_curves[Channel], point);

    d_directPainter->drawSeries( d_curves[Channel],
                                 data->size() - 1, data->size() - 1 );
}
Ejemplo n.º 4
0
void BrainPlot::timeStep(std::vector<float> data) {
    /*Curves*/
    for(int c = 0; c < nChannels; c++)
        appendPoint(QPointF(sample%plotLength, data[c]), c);

    /*Sweep line*/
    CurveData *sweep = static_cast<CurveData *>( d_sweep->data() );
    sweep->replace(0, QPointF((sample)%plotLength, plotLength));
    sweep->replace(1, QPointF((sample)%plotLength, 2*nChannels*minusExpectedAmplitude));
    setClipRegion(d_sweep, QPointF(0,0));
    d_directPainter->drawSeries( d_sweep, 0, 1);

    /*Time step*/
    sample++;

    /*Refreshes plot*/
    replot();
}