MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / drawBackground

Method drawBackground

pj_plotting/widget/src/PlotLegend.cpp:110–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void PlotLegend::drawBackground(QPainter* painter, const QRectF& rect) const {
111 painter->save();
112 QPen pen = textPen();
113 QColor border = parent_plot_->canvas()->palette().windowText().color();
114 border.setAlphaF(0.4);
115 pen.setColor(border);
116 painter->setPen(pen);
117 QColor background = parent_plot_->palette().window().color();
118 if (!background.isValid() || background.alpha() == 0) {
119 background = parent_plot_->canvas()->palette().window().color();
120 }
121 background.setAlphaF(0.4);
122 painter->setBrush(background);
123 const double radius = borderRadius();
124 painter->drawRoundedRect(rect, radius, radius);
125 painter->restore();
126}
127
128const QwtPlotItem* PlotLegend::itemAt(const QPoint& pos) const {
129 const QRect canvas_rect = parent_plot_->canvas()->rect();

Callers

nothing calls this directly

Calls 8

paletteMethod · 0.80
colorMethod · 0.45
canvasMethod · 0.45
setColorMethod · 0.45
setPenMethod · 0.45
isValidMethod · 0.45
alphaMethod · 0.45
setBrushMethod · 0.45

Tested by

no test coverage detected