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

Method mousePressEvent

DSView/pv/view/ruler.cpp:287–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287void Ruler::mousePressEvent(QMouseEvent *event)
288{
289 if (event->button() & Qt::LeftButton) {
290 bool visible;
291 auto &cursor_list = _view.get_cursorList();
292
293 if (!_cursor_sel_visible && cursor_list.size()) {
294 _view.show_cursors(true);
295 auto i = cursor_list.begin();
296
297 while (i != cursor_list.end()) {
298 const QRect cursor_rect((*i)->get_label_rect(rect(), visible));
299 if ((*i)->get_close_rect(cursor_rect).contains(event->pos())) {
300 _view.del_cursor(*i);
301
302 if (cursor_list.empty()) {
303 _cursor_sel_visible = false;
304 _view.show_cursors(false);
305 }
306 _hitCursor = true;
307 break;
308 }
309
310 if (cursor_rect.contains(event->pos())) {
311 set_grabbed_cursor(*i);
312 _cursor_sel_visible = false;
313 _cursor_go_visible = false;
314 _hitCursor = true;
315 break;
316 }
317 i++;
318 }
319 }
320 }
321}
322
323void Ruler::mouseReleaseEvent(QMouseEvent *event)
324{

Callers

nothing calls this directly

Calls 7

sizeMethod · 0.80
show_cursorsMethod · 0.80
get_label_rectMethod · 0.80
emptyMethod · 0.80
endMethod · 0.45
get_close_rectMethod · 0.45
del_cursorMethod · 0.45

Tested by

no test coverage detected