Ejemplo n.º 1
0
QDebug operator<<(QDebug dbg, const KChart::FrameAttributes& fa)
{
    dbg << "KChart::FrameAttributes("
	<< "visible="<<fa.isVisible()
	<< "pen="<<fa.pen()
        << "cornerRadius="<<fa.cornerRadius()
        << "padding="<<fa.padding()
	<< ")";
    return dbg;
}
Ejemplo n.º 2
0
void Legend::setFramePen(const QPen &pen)
{
    d->framePen = pen;

    // KChart
    KChart::FrameAttributes attributes = d->kdLegend->frameAttributes();
    attributes.setPen(pen);
    d->kdLegend->setFrameAttributes(attributes);

    d->pixmapRepaintRequested = true;
}
Ejemplo n.º 3
0
void Legend::setFrameColor(const QColor &color)
{
    d->framePen.setColor(color);

    // KChart
    KChart::FrameAttributes attributes = d->kdLegend->frameAttributes();
    attributes.setVisible(true);
    QPen pen = attributes.pen();
    pen.setColor(color);
    attributes.setPen(pen);
    d->kdLegend->setFrameAttributes(attributes);

    d->pixmapRepaintRequested = true;
}
Ejemplo n.º 4
0
void PlotArea::plotAreaInit()
{
    d->kdChart->resize(size().toSize());
    d->kdChart->replaceCoordinatePlane(d->kdCartesianPlanePrimary);
    d->kdCartesianPlaneSecondary->setReferenceCoordinatePlane(d->kdCartesianPlanePrimary);

    KChart::FrameAttributes attr = d->kdChart->frameAttributes();
    attr.setVisible(false);
    d->kdChart->setFrameAttributes(attr);

    d->wall = new Surface(this);
    //d->floor = new Surface(this);

    d->initAxes();
}
Ejemplo n.º 5
0
/* static */
void AbstractAreaBase::paintFrameAttributes( QPainter& painter, const QRect& rect,
    const KChart::FrameAttributes& attributes )
{

    if ( !attributes.isVisible() ) return;

    // Note: We set the brush to NoBrush explicitly here.
    //       Otherwise we might get a filled rectangle, so any
    //       previously drawn background would be overwritten by that area.

    const QPen oldPen( painter.pen() );
    const QBrush oldBrush( painter.brush() );

    painter.setPen( PrintingParameters::scalePen( attributes.pen() ) );
    painter.setBrush( Qt::NoBrush );
    painter.drawRoundedRect( rect.adjusted( 0, 0, -1, -1 ), attributes.cornerRadius(), attributes.cornerRadius() );

    painter.setBrush( oldBrush );
    painter.setPen( oldPen );
}