]> sigrok.org Git - pulseview.git/blobdiff - pv/view/trace.cpp
RowItem: Renamed get_v_offset to v_offset
[pulseview.git] / pv / view / trace.cpp
index ca5f7150353ac67f03f94aae996d37e49d4a35eb..aba51510db59ad964d9f4213b994c05caf5275d8 100644 (file)
@@ -42,9 +42,7 @@ const QPen Trace::AxisPen(QColor(128, 128, 128, 64));
 const int Trace::LabelHitPadding = 2;
 
 Trace::Trace(QString name) :
-       _view(NULL),
        _name(name),
-       _v_offset(0),
        _popup(NULL),
        _popup_form(NULL)
 {
@@ -70,47 +68,9 @@ void Trace::set_colour(QColor colour)
        _colour = colour;
 }
 
-int Trace::get_v_offset() const
-{
-       return _v_offset;
-}
-
-void Trace::set_v_offset(int v_offset)
-{
-       _v_offset = v_offset;
-}
-
-void Trace::set_view(pv::view::View *view)
-{
-       assert(view);
-       _view = view;
-}
-
-void Trace::paint_back(QPainter &p, int left, int right)
-{
-       (void)p;
-       (void)left;
-       (void)right;
-}
-
-void Trace::paint_mid(QPainter &p, int left, int right)
-{
-       (void)p;
-       (void)left;
-       (void)right;
-}
-
-void Trace::paint_fore(QPainter &p, int left, int right)
-{
-       (void)p;
-       (void)left;
-       (void)right;
-}
-
 void Trace::paint_label(QPainter &p, int right, bool hover)
 {
-       assert(_view);
-       const int y = _v_offset - _view->v_offset();
+       const int y = get_y();
 
        p.setBrush(_colour);
 
@@ -164,12 +124,6 @@ void Trace::paint_label(QPainter &p, int right, bool hover)
                Qt::AlignCenter | Qt::AlignVCenter, _name);
 }
 
-bool Trace::pt_in_label_rect(int left, int right, const QPoint &point)
-{
-       (void)left;
-       return enabled() && label_rect(right).contains(point);
-}
-
 QMenu* Trace::create_context_menu(QWidget *parent)
 {
        QMenu *const menu = SelectableItem::create_context_menu(parent);
@@ -191,17 +145,10 @@ pv::widgets::Popup* Trace::create_popup(QWidget *parent)
        return _popup;
 }
 
-int Trace::get_y() const
-{
-       return _v_offset - _view->v_offset();
-}
-
 QRectF Trace::label_rect(int right)
 {
        using pv::view::View;
 
-       assert(_view);
-
        QFontMetrics m(QApplication::font());
        const QSize text_size(
                m.boundingRect(QRect(), 0, _name).width(),
@@ -217,10 +164,6 @@ QRectF Trace::label_rect(int right)
                label_size.height());
 }
 
-void Trace::hover_point_changed()
-{
-}
-
 QColor Trace::get_text_colour() const
 {
        return (_colour.lightness() > 64) ? Qt::black : Qt::white;