]> sigrok.org Git - pulseview.git/blobdiff - pv/view/trace.cpp
Trace: Renamed get_name() to name()
[pulseview.git] / pv / view / trace.cpp
index e825337c6d4156fb4e430cfface2a5aab2d0cb08..367891a22c67e72b21a68057ba553c9d0ba50e7a 100644 (file)
@@ -42,15 +42,13 @@ 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)
 {
 }
 
-QString Trace::get_name() const
+QString Trace::name() const
 {
        return _name;
 }
@@ -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);
 
@@ -185,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(),
@@ -211,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;