LegendItem::LegendItem() { setRenderHint( QwtPlotItem::RenderAntialiased ); QColor color( Qt::white ); setTextPen( color ); #if 1 setBorderPen( color ); QColor c( Qt::gray ); c.setAlpha( 200 ); setBackgroundBrush( c ); #endif }
JLegendItem() { setRenderHint(QwtPlotItem::RenderAntialiased); setAlignment(Qt::AlignTop | Qt::AlignRight); setTextPen(QColor(200, 200, 200, 150)); setBorderPen(QColor(150, 150, 150, 50)); setBackgroundBrush(QColor(150, 150, 150, 20)); setBorderRadius(3); setMargin(2); setSpacing(10); setItemMargin(0); QFont _font = font(); _font.setPointSize(8); setFont(_font); }
void LegendItem::setBackgroundOpacity(int alpha) { setBorderPen(QPen(QColor(0, 0, 0, alpha))); setBackgroundBrush(QColor(255, 255, 255, alpha)); }