| 222 | } |
| 223 | |
| 224 | void 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 | |
| 258 | void Ruler::mouseMoveEvent(QMouseEvent *e) |
| 259 | { |
nothing calls this directly
no test coverage detected