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;
}
Exemple #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;
}
Exemple #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;
}
Exemple #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();
}
/* 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 );
}