Ejemplo n.º 1
0
void SliderRuler::paintEvent(QPaintEvent *)
{
    //绘制准备工作,启用反锯齿
    QPainter painter(this);
    painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);

    //绘制背景
    drawBg(&painter);
    //绘制标尺
    drawRule(&painter);
    //绘制滑块
    drawSlider(&painter);
    //绘制当前值的提示
    drawTip(&painter);
}
Ejemplo n.º 2
0
void PrintOut::flushLine(bool /* mayBreak */)
{
    if (voffset + cp.rect.height() > vsize)
        breakPage();
    else if (!firstParagraph)
        drawRule(nextRule);

    for (int i = 0; i < cp.boxes.count(); ++i) {
        Box b = cp.boxes[i];
        b.rect.translate(0, voffset);
        QRect r = b.rect;
        p.setFont(b.font);
        p.drawText(r, b.text, b.options);
    }
    voffset += cp.rect.height();

    nextRule = NoRule;
    cp = Paragraph(QPoint(hmargin, voffset));
    firstParagraph = false;
}
Ejemplo n.º 3
0
void PrintOut::flushLine( bool /* mayBreak */ )
{
    if ( voffset + cp.rect.height() > vsize )
	breakPage();
    else if ( !firstParagraph )
	drawRule( nextRule );

    for ( int i = 0; i < (int) cp.boxes.count(); i++ ) {
	Box b = cp.boxes[i];
	b.rect.moveBy( 0, voffset );
	QRect r = b.rect;
	p.setFont( b.font );
	p.drawText( r, b.align, b.text );
    }
    voffset += cp.rect.height();

    nextRule = NoRule;
    cp = Paragraph( QPoint(hmargin, voffset) );
    firstParagraph = FALSE;
}