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

Method paintEvent

DSView/pv/view/ruler.cpp:224–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void Ruler::paintEvent(QPaintEvent*)
225{
226 QStyleOption o;
227 o.initFrom(this);
228 QPainter p(this);
229 style()->drawPrimitive(QStyle::PE_Widget, &o, &p, this);
230
231 QFont font = p.font();
232 float fSize = AppConfig::Instance().appOptions.fontSize;
233 if (fSize > 10)
234 fSize = 10;
235 font.setPointSizeF(fSize);
236 p.setFont(font);
237
238 SigSession *session = AppControl::Instance()->GetSession();
239
240 // Draw tick mark
241 if (session->get_device()->get_work_mode() == DSO)
242 draw_osc_tick_mark(p);
243 else
244 draw_logic_tick_mark(p);
245
246 p.setRenderHint(QPainter::Antialiasing, true);
247 // Draw the hover mark
248 draw_hover_mark(p);
249
250 // Draw cursor selection
251 if (_cursor_sel_visible || _cursor_go_visible) {
252 draw_cursor_sel(p);
253 }
254
255 p.end();
256}
257
258void Ruler::mouseMoveEvent(QMouseEvent *e)
259{

Callers

nothing calls this directly

Calls 4

GetSessionMethod · 0.80
get_work_modeMethod · 0.80
get_deviceMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected