MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / paintEvent

Method paintEvent

DSView/pv/view/header.cpp:115–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void Header::paintEvent(QPaintEvent*)
116{
117 using pv::view::Trace;
118
119 QStyleOption o;
120 o.initFrom(this);
121 QPainter painter(this);
122 style()->drawPrimitive(QStyle::PE_Widget, &o, &painter, this);
123
124 const int w = width();
125 std::vector<Trace*> traces;
126 _view.get_traces(ALL_VIEW, traces);
127
128 const bool dragging = !_drag_traces.empty();
129 QColor fore(QWidget::palette().color(QWidget::foregroundRole()));
130 fore.setAlpha(View::ForeAlpha);
131
132 QFont font(painter.font());
133 float fSize = AppConfig::Instance().appOptions.fontSize;
134 if (fSize > 10)
135 fSize = 10;
136 font.setPointSizeF(fSize);
137 painter.setFont(font);
138
139 for(auto t : traces)
140 {
141 t->paint_label(painter, w, dragging ? QPoint(-1, -1) : _mouse_point, fore);
142 }
143
144 painter.end();
145}
146
147void Header::mouseDoubleClickEvent(QMouseEvent *event)
148{

Callers

nothing calls this directly

Calls 5

get_tracesMethod · 0.80
emptyMethod · 0.80
colorMethod · 0.80
paint_labelMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected