X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fview.h;h=cc06f80dae12ac19dccdb7f00ca0c7971a1d7368;hp=8229fbd25002b46f2acac89dc44682f1d4a52f21;hb=bcaa184ed439d801cb1a56b877bb2763246150da;hpb=33c62f44b72abab27bc141d66712ff0d1a2e395f diff --git a/pv/view/view.h b/pv/view/view.h index 8229fbd2..cc06f80d 100644 --- a/pv/view/view.h +++ b/pv/view/view.h @@ -33,6 +33,7 @@ #include #include "cursorpair.h" +#include "rowitemowner.h" namespace pv { @@ -43,10 +44,9 @@ namespace view { class CursorHeader; class Header; class Ruler; -class Trace; class Viewport; -class View : public QAbstractScrollArea { +class View : public QAbstractScrollArea, public RowItemOwner { Q_OBJECT private: @@ -70,6 +70,16 @@ public: SigSession& session(); const SigSession& session() const; + /** + * Returns the view of the owner. + */ + virtual pv::view::View* view(); + + /** + * Returns the view of the owner. + */ + virtual const pv::view::View* view() const; + Viewport* viewport(); const Viewport* viewport() const; @@ -84,7 +94,7 @@ public: * seconds. */ double offset() const; - int v_offset() const; + int owner_v_offset() const; void zoom(double steps); void zoom(double steps, int offset); @@ -100,10 +110,6 @@ public: */ void set_scale_offset(double scale, double offset); - std::vector< std::shared_ptr > get_traces() const; - - std::list > selected_items() const; - std::set< std::shared_ptr > get_visible_data() const; @@ -164,9 +170,22 @@ private: void update_layout(); - static bool compare_trace_v_offsets( - const std::shared_ptr &a, - const std::shared_ptr &b); + /** + * Satisifies RowItem functionality. + * @param p the QPainter to paint into. + * @param right the x-coordinate of the right edge of the header + * area. + * @param hover true if the label is being hovered over by the mouse. + */ + void paint_label(QPainter &p, int right, bool hover); + + /** + * Computes the outline rectangle of a label. + * @param right the x-coordinate of the right edge of the header + * area. + * @return Returns the rectangle of the signal label. + */ + QRectF label_rect(int right); private: bool eventFilter(QObject *object, QEvent *event);