X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fmarginwidget.hpp;h=0a24ad2ece705bde08e7c4be1af1421e680e9b7d;hp=4bd7ac18497991cc7cd8159eea9ca8a47b4339d7;hb=6454b1e960c85b17ec9590b78bc0387dc348ae9b;hpb=2155b66bed9f0802caec0b1e86f7f03d317a3e83 diff --git a/pv/view/marginwidget.hpp b/pv/view/marginwidget.hpp index 4bd7ac18..0a24ad2e 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 @@ -48,18 +48,11 @@ public: protected: /** - * Gets the items in the margin widget. + * Indicates the event an a view item has been clicked. + * @param item the view item that has been clicked. */ - virtual std::vector< std::shared_ptr > items() = 0; - - /** - * Gets the first view item which has a label that contains @c pt . - * @param pt the point to search with. - * @return the view item that has been found, or and empty - * @c shared_ptr if no item was found. - */ - virtual std::shared_ptr get_mouse_over_item( - const QPoint &pt) = 0; + virtual void item_clicked( + const std::shared_ptr &item); /** * Shows the popup of a the specified @c ViewItem . @@ -67,23 +60,10 @@ protected: */ void show_popup(const std::shared_ptr &item); -private: - void leaveEvent(QEvent *event); - +protected: virtual void contextMenuEvent(QContextMenuEvent *event); -public Q_SLOTS: - virtual void clear_selection(); - -Q_SIGNALS: - void selection_changed(); - -protected: - pv::view::View &view_; - QPoint mouse_point_; - QPoint mouse_down_point_; - std::shared_ptr mouse_down_item_; - bool dragging_; + virtual void keyPressEvent(QKeyEvent *e); }; } // namespace view