X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Ftrace.h;h=ef327edb29a0207fb660c7b915f46b23487573f9;hb=1ef49ddd04f44a4369403fbab19ed235483e2975;hp=71ad4953d84dc8f37f6f3c2418ef7a554ee0eda4;hpb=e9213170687cf4afd14e20acdc690ff9381d94ae;p=pulseview.git diff --git a/pv/view/trace.h b/pv/view/trace.h index 71ad4953..ef327edb 100644 --- a/pv/view/trace.h +++ b/pv/view/trace.h @@ -29,16 +29,19 @@ #include -#include "selectableitem.h" +#include "rowitem.h" class QFormLayout; namespace pv { -namespace view { -class View; +namespace widgets { +class Popup; +} + +namespace view { -class Trace : public SelectableItem +class Trace : public RowItem { Q_OBJECT @@ -71,48 +74,7 @@ public: void set_colour(QColor colour); /** - * Gets the vertical layout offset of this signal. - */ - int get_v_offset() const; - - /** - * Sets the vertical layout offset of this signal. - */ - void set_v_offset(int v_offset); - - /** - * Returns true if the trace is visible and enabled. - */ - virtual bool enabled() const = 0; - - virtual void set_view(pv::view::View *view); - - /** - * Paints the background layer of the trace with a QPainter - * @param p the QPainter to paint into. - * @param left the x-coordinate of the left edge of the signal - * @param right the x-coordinate of the right edge of the signal - **/ - virtual void paint_back(QPainter &p, int left, int right); - - /** - * Paints the mid-layer of the trace with a QPainter - * @param p the QPainter to paint into. - * @param left the x-coordinate of the left edge of the signal - * @param right the x-coordinate of the right edge of the signal - **/ - virtual void paint_mid(QPainter &p, int left, int right); - - /** - * Paints the foreground layer of the trace with a QPainter - * @param p the QPainter to paint into. - * @param left the x-coordinate of the left edge of the signal - * @param right the x-coordinate of the right edge of the signal - **/ - virtual void paint_fore(QPainter &p, int left, int right); - - /** - * Paints the signal label into a QGLWidget. + * Paints the signal label. * @param p the QPainter to paint into. * @param right the x-coordinate of the right edge of the header * area. @@ -120,33 +82,17 @@ public: */ virtual void paint_label(QPainter &p, int right, bool hover); - /** - * Determines if a point is in the header label rect. - * @param left the x-coordinate of the left edge of the header - * area. - * @param right the x-coordinate of the right edge of the header - * area. - * @param point the point to test. - */ - bool pt_in_label_rect(int left, int right, const QPoint &point); - virtual QMenu* create_context_menu(QWidget *parent); pv::widgets::Popup* create_popup(QWidget *parent); - /** - * Gets the y-offset of the axis. - */ - int get_y() const; - /** * Computes the outline rectangle of a label. - * @param p the QPainter to lay out text with. * @param right the x-coordinate of the right edge of the header * area. * @return Returns the rectangle of the signal label. */ - QRectF get_label_rect(int right); + QRectF label_rect(int right); protected: @@ -173,8 +119,6 @@ protected: virtual void populate_popup_form(QWidget *parent, QFormLayout *form); - void close_popup(); - private Q_SLOTS: void on_text_changed(const QString &text); @@ -188,11 +132,8 @@ Q_SIGNALS: void colour_changed(); protected: - pv::view::View *_view; - QString _name; QColor _colour; - int _v_offset; private: pv::widgets::Popup *_popup;