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