- // Select the signal if it has been clicked
- const shared_ptr<Trace> mouse_over_trace =
- get_mouse_over_trace(event->pos());
- if (mouse_over_trace) {
- if (mouse_over_trace->selected())
- mouse_over_trace->select(false);
- else {
- mouse_over_trace->select(true);
-
- if (~QApplication::keyboardModifiers() &
- Qt::ControlModifier)
- _drag_traces.clear();
-
- // Add the signal to the drag list
- if (event->button() & Qt::LeftButton)
- _drag_traces.push_back(
- make_pair(mouse_over_trace,
- mouse_over_trace->get_v_offset()));
- }
- }
-
- if (~QApplication::keyboardModifiers() & Qt::ControlModifier) {
- // Unselect all other signals because the Ctrl is not
- // pressed
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
- if (t != mouse_over_trace)
- t->select(false);
- }
+ // Save the offsets of any signals which will be dragged
+ for (const shared_ptr<RowItem> r : _view)
+ if (r->selected())
+ r->drag();