X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fmarginwidget.hpp;h=54ace028fcda121bd79588c20a1b32d6af159c67;hb=2f7982367e8382e05c862de7afc71075ded5f606;hp=7df6c02d3fbebbcdf8ca5db4222e5a53c41e9713;hpb=5a6a4ce3e32a250cd586f4755573ed3bed530d7b;p=pulseview.git diff --git a/pv/view/marginwidget.hpp b/pv/view/marginwidget.hpp index 7df6c02..54ace02 100644 --- a/pv/view/marginwidget.hpp +++ b/pv/view/marginwidget.hpp @@ -67,11 +67,41 @@ protected: */ void show_popup(const std::shared_ptr &item); -private: + /** + * 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. + */ + void mouse_left_press_event(QMouseEvent *event); + + /** + * Handles left mouse button release events. + * @param event the mouse event that triggered this handler. + */ + void mouse_left_release_event(QMouseEvent *event); + +protected: + void mousePressEvent(QMouseEvent * event); + void mouseReleaseEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void leaveEvent(QEvent *event); virtual void contextMenuEvent(QContextMenuEvent *event); + virtual void keyPressEvent(QKeyEvent *e); + public Q_SLOTS: void clear_selection();