+void MarginWidget::mouseMoveEvent(QMouseEvent *event)
+{
+ assert(event);
+ mouse_point_ = event->pos();
+
+ if (!(event->buttons() & Qt::LeftButton))
+ return;
+
+ if ((event->pos() - mouse_down_point_).manhattanLength() <
+ QApplication::startDragDistance())
+ return;
+
+ if (!accept_drag())
+ return;
+
+ // Do the drag
+ dragging_ = true;
+ drag_items(event->pos() - mouse_down_point_);
+
+ update();
+}
+