X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fmarginwidget.hpp;h=308d9348d12a0341aa6a203cd1b214a8c74839cf;hp=35d557d10ccab7dcae57f57f6c990bce7c85e9d6;hb=40aca27ed83559f7f79873e353f64d2c36a18fce;hpb=e47b69882ca7299041123c664dbcc8b552c5db99 diff --git a/pv/view/marginwidget.hpp b/pv/view/marginwidget.hpp index 35d557d1..308d9348 100644 --- a/pv/view/marginwidget.hpp +++ b/pv/view/marginwidget.hpp @@ -24,15 +24,15 @@ #include #include -#include + +#include "viewwidget.hpp" namespace pv { namespace view { -class View; class ViewItem; -class MarginWidget : public QWidget +class MarginWidget : public ViewWidget { Q_OBJECT @@ -67,6 +67,18 @@ protected: */ void show_popup(const std::shared_ptr &item); + /** + * Returns true if the selection of row items allows dragging. + * @return Returns true if the drag is acceptable. + */ + virtual bool accept_drag() const = 0; + + /** + * Drag the dragging items by the delta offset. + * @param delta the drag offset in pixels. + */ + virtual void drag_items(const QPoint &delta) = 0; + /** * Handles left mouse button press events. * @param event the mouse event that triggered this handler. @@ -82,6 +94,7 @@ protected: protected: void mousePressEvent(QMouseEvent * event); void mouseReleaseEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); void leaveEvent(QEvent *event); @@ -96,7 +109,6 @@ Q_SIGNALS: void selection_changed(); protected: - pv::view::View &view_; QPoint mouse_point_; QPoint mouse_down_point_; std::shared_ptr mouse_down_item_;