]> sigrok.org Git - pulseview.git/commitdiff
Ruler: Recombined with CursorHeader
authorJoel Holdsworth <redacted>
Sat, 20 Dec 2014 09:26:30 +0000 (09:26 +0000)
committerJoel Holdsworth <redacted>
Sun, 28 Dec 2014 18:52:53 +0000 (18:52 +0000)
12 files changed:
CMakeLists.txt
pv/view/cursorheader.cpp [deleted file]
pv/view/cursorheader.hpp [deleted file]
pv/view/header.cpp
pv/view/header.hpp
pv/view/marginwidget.hpp
pv/view/ruler.cpp
pv/view/ruler.hpp
pv/view/view.cpp
pv/view/view.hpp
pv/view/viewitem.hpp
test/CMakeLists.txt

index af6ee35782d4fccb06988048e4776857164ac764..546b99dcfe98b615a44594ebcf351de396effe46 100644 (file)
@@ -168,7 +168,6 @@ set(pulseview_SOURCES
        pv/toolbars/samplingbar.cpp
        pv/view/analogsignal.cpp
        pv/view/cursor.cpp
-       pv/view/cursorheader.cpp
        pv/view/cursorpair.cpp
        pv/view/flag.cpp
        pv/view/header.cpp
@@ -214,7 +213,6 @@ set(pulseview_HEADERS
        pv/prop/binding/deviceoptions.hpp
        pv/toolbars/samplingbar.hpp
        pv/view/cursor.hpp
-       pv/view/cursorheader.hpp
        pv/view/flag.hpp
        pv/view/header.hpp
        pv/view/logicsignal.hpp
diff --git a/pv/view/cursorheader.cpp b/pv/view/cursorheader.cpp
deleted file mode 100644 (file)
index efc9205..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#include "cursorheader.hpp"
-
-#include "ruler.hpp"
-#include "view.hpp"
-
-#include <QApplication>
-#include <QFontMetrics>
-#include <QMouseEvent>
-
-#include <pv/widgets/popup.hpp>
-
-using std::shared_ptr;
-using std::vector;
-
-namespace pv {
-namespace view {
-
-const int CursorHeader::Padding = 20;
-const int CursorHeader::BaselineOffset = 5;
-
-int CursorHeader::calculateTextHeight()
-{
-       QFontMetrics fm(font());
-       return fm.boundingRect(0, 0, INT_MAX, INT_MAX,
-               Qt::AlignLeft | Qt::AlignTop, "8").height();
-}
-
-CursorHeader::CursorHeader(View &parent) :
-       MarginWidget(parent),
-       textHeight_(calculateTextHeight())
-{
-}
-
-QSize CursorHeader::sizeHint() const
-{
-       return QSize(0, textHeight_ + Padding + BaselineOffset);
-}
-
-void CursorHeader::clear_selection()
-{
-       const vector< shared_ptr<TimeItem> > items(view_.time_items());
-       for (auto &i : items)
-               i->select(false);
-       update();
-}
-
-void CursorHeader::paintEvent(QPaintEvent*)
-{
-       QPainter p(this);
-       p.setRenderHint(QPainter::Antialiasing);
-
-       // The cursor labels are not drawn with the arrows exactly on the
-       // bottom line of the widget, because then the selection shadow
-       // would be clipped away.
-       const QRect r = rect().adjusted(0, 0, 0, -BaselineOffset);
-
-       // Draw the items
-       const vector< shared_ptr<TimeItem> > items(view_.time_items());
-       for (auto &m : items)
-               m->paint_label(p, r);
-}
-
-void CursorHeader::mouseMoveEvent(QMouseEvent *e)
-{
-       mouse_point_ = e->pos();
-
-       if (!(e->buttons() & Qt::LeftButton))
-               return;
-
-       if ((e->pos() - mouse_down_point_).manhattanLength() <
-               QApplication::startDragDistance())
-               return;
-
-       // Do the drag
-       dragging_ = true;
-
-       const int delta = e->pos().x() - mouse_down_point_.x();
-       const vector< shared_ptr<TimeItem> > items(view_.time_items());
-       for (auto &i : items)
-               if (i->dragging())
-                       i->set_time(view_.offset() +
-                               (i->drag_point().x() + delta - 0.5) *
-                               view_.scale());
-}
-
-void CursorHeader::mousePressEvent(QMouseEvent *e)
-{
-       if (e->buttons() & Qt::LeftButton) {
-               mouse_down_point_ = e->pos();
-
-               mouse_down_item_.reset();
-
-               clear_selection();
-
-               const vector< shared_ptr<TimeItem> > items(view_.time_items());
-               for (auto i = items.rbegin(); i != items.rend(); i++)
-                       if ((*i)->label_rect(rect()).contains(e->pos())) {
-                               mouse_down_item_ = (*i);
-                               break;
-                       }
-
-               if (mouse_down_item_) {
-                       mouse_down_item_->select();
-                       mouse_down_item_->drag();
-               }
-
-               selection_changed();
-       }
-}
-
-void CursorHeader::mouseReleaseEvent(QMouseEvent *)
-{
-       using pv::widgets::Popup;
-
-       if (!dragging_ && mouse_down_item_) {
-               Popup *const p = mouse_down_item_->create_popup(&view_);
-               if (p) {
-                       const QPoint arrpos(mouse_down_item_->get_x(),
-                               height() - BaselineOffset);
-                       p->set_position(mapToGlobal(arrpos), Popup::Bottom);
-                       p->show();
-               }
-       }
-
-       dragging_ = false;
-       mouse_down_item_.reset();
-
-       const vector< shared_ptr<TimeItem> > items(view_.time_items());
-       for (auto &i : items)
-               i->drag_release();
-}
-
-void CursorHeader::leaveEvent(QEvent*)
-{
-       mouse_point_ = QPoint(-1, -1);
-       update();
-}
-
-void CursorHeader::mouseDoubleClickEvent(QMouseEvent *e)
-{
-       view_.add_flag(view_.offset() + ((double)e->x() + 0.5) * view_.scale());
-}
-
-void CursorHeader::keyPressEvent(QKeyEvent *e)
-{
-       assert(e);
-
-       if (e->key() == Qt::Key_Delete)
-       {
-               const vector< shared_ptr<TimeItem> > items(view_.time_items());
-               for (auto &i : items)
-                       if (i->selected())
-                               i->delete_pressed();
-       }
-}
-
-} // namespace view
-} // namespace pv
diff --git a/pv/view/cursorheader.hpp b/pv/view/cursorheader.hpp
deleted file mode 100644 (file)
index ff73285..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#ifndef PULSEVIEW_PV_VIEW_CURSORHEADER_H
-#define PULSEVIEW_PV_VIEW_CURSORHEADER_H
-
-#include <memory>
-
-#include "marginwidget.hpp"
-
-namespace pv {
-namespace view {
-
-class TimeItem;
-
-/**
- * Widget to hold the labels over the cursors.
- */
-class CursorHeader : public MarginWidget
-{
-       Q_OBJECT
-
-       static const int Padding;
-
-       /**
-        * The vertical offset, relative to the bottom line of the widget,
-        * where the arrows of the cursor labels end.
-        */
-       static const int BaselineOffset;
-
-public:
-       CursorHeader(View &parent);
-
-       QSize sizeHint() const;
-
-       void clear_selection();
-
-private:
-       void paintEvent(QPaintEvent *event);
-
-       void mouseMoveEvent(QMouseEvent *e);
-       void mousePressEvent(QMouseEvent *e);
-       void mouseReleaseEvent(QMouseEvent *);
-       void leaveEvent(QEvent*);
-
-       void mouseDoubleClickEvent(QMouseEvent *e);
-
-       void keyPressEvent(QKeyEvent *e);
-
-private:
-       int calculateTextHeight();
-
-       std::shared_ptr<TimeItem> mouse_down_item_;
-       const int textHeight_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_CURSORHEADER_H
index 4b02c1944d35540bf78f1c220716b213ce4433e4..82c7dd0559a4662fe4123c2c4ed213c7649c8fe7 100644 (file)
@@ -75,6 +75,11 @@ QSize Header::sizeHint() const
        return QSize(max_rect.width() + Padding + BaselineOffset, 0);
 }
 
+QSize Header::extended_size_hint() const
+{
+       return sizeHint() + QSize(ViewItem::HighlightRadius, 0);
+}
+
 shared_ptr<RowItem> Header::get_mouse_over_row_item(const QPoint &pt)
 {
        const QRect r(0, 0, width() - BaselineOffset, height());
index ae39bc847490357877ed380ec99456073f849a1f..c5c8ae7a323ced381a0d18048ef31cca2327d7f7 100644 (file)
@@ -45,6 +45,13 @@ public:
 
        QSize sizeHint() const;
 
+       /**
+        * The extended area that the header widget would like to be sized to.
+        * @remarks This area is the area specified by sizeHint, extended by
+        * the area to overlap the viewport.
+        */
+       QSize extended_size_hint() const;
+
        /**
         * The horizontal offset, relative to the left edge of the widget,
         * where the arrows of the trace labels end.
index b4f0eb72c45e84abc4703a5b3e46f8031aca7e0a..6e98e4b083a3e2562835a1a111abb11284238e5b 100644 (file)
@@ -36,6 +36,13 @@ class MarginWidget : public QWidget
 public:
        MarginWidget(pv::view::View &parent);
 
+       /**
+        * The extended area that the margin widget would like to be sized to.
+        * @remarks This area is the area specified by sizeHint, extended by
+        * the area to overlap the viewport.
+        */
+       virtual QSize extended_size_hint() const = 0;
+
 public Q_SLOTS:
        virtual void clear_selection();
 
index ee521f0e82a1203438d8a7420ec2336baec89af4..7018c212db52f8b72f1449400b9160594a746dde 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include "ruler.hpp"
+#include <extdef.h>
 
+#include <QApplication>
+#include <QFontMetrics>
+#include <QMouseEvent>
+
+#include "ruler.hpp"
 #include "view.hpp"
-#include "pv/util.hpp"
 
-#include <extdef.h>
+#include <pv/util.hpp>
+#include <pv/widgets/popup.hpp>
 
 using namespace Qt;
 
+using std::shared_ptr;
+using std::vector;
+
 namespace pv {
 namespace view {
 
@@ -35,8 +43,12 @@ const int Ruler::MinorTickSubdivision = 4;
 
 const int Ruler::HoverArrowSize = 5;
 
+const int Ruler::Padding = 20;
+const int Ruler::BaselineOffset = 5;
+
 Ruler::Ruler(View &parent) :
-       MarginWidget(parent)
+       MarginWidget(parent),
+       text_height_(calculate_text_height())
 {
        setMouseTracking(true);
 
@@ -44,11 +56,25 @@ Ruler::Ruler(View &parent) :
                this, SLOT(hover_point_changed()));
 }
 
+void Ruler::clear_selection()
+{
+       const vector< shared_ptr<TimeItem> > items(view_.time_items());
+       for (auto &i : items)
+               i->select(false);
+       update();
+}
+
 QSize Ruler::sizeHint() const
 {
        return QSize(0, RulerHeight);
 }
 
+QSize Ruler::extended_size_hint() const
+{
+       return QSize(0, RulerHeight +
+               (text_height_ + Padding + BaselineOffset) / 2);
+}
+
 void Ruler::paintEvent(QPaintEvent*)
 {
        const int ValueMargin = 3;
@@ -59,9 +85,6 @@ void Ruler::paintEvent(QPaintEvent*)
        const double tick_period = view_.tick_period();
        const unsigned int prefix = view_.tick_prefix();
 
-       const int text_height = p.boundingRect(0, 0, INT_MAX, INT_MAX,
-               AlignLeft | AlignTop, "8").height();
-
        // Draw the tick marks
        p.setPen(palette().color(foregroundRole()));
 
@@ -75,8 +98,8 @@ void Ruler::paintEvent(QPaintEvent*)
        int division = (int)round(first_minor_division -
                first_major_division * MinorTickSubdivision) - 1;
 
-       const int major_tick_y1 = text_height + ValueMargin * 2;
-       const int tick_y2 = height();
+       const int major_tick_y1 = text_height_ + ValueMargin * 2;
+       const int tick_y2 = RulerHeight;
        const int minor_tick_y1 = (major_tick_y1 + tick_y2) / 2;
 
        double x;
@@ -88,7 +111,7 @@ void Ruler::paintEvent(QPaintEvent*)
                if (division % MinorTickSubdivision == 0)
                {
                        // Draw a major tick
-                       p.drawText(x, ValueMargin, 0, text_height,
+                       p.drawText(x, ValueMargin, 0, text_height_,
                                AlignCenter | AlignTop | TextDontClip,
                                pv::util::format_time(t, prefix));
                        p.drawLine(QPointF(x, major_tick_y1),
@@ -107,6 +130,110 @@ void Ruler::paintEvent(QPaintEvent*)
 
        // Draw the hover mark
        draw_hover_mark(p);
+
+       // The cursor labels are not drawn with the arrows exactly on the
+       // bottom line of the widget, because then the selection shadow
+       // would be clipped away.
+       const QRect r = rect().adjusted(0, 0, 0, -BaselineOffset);
+
+       // Draw the items
+       const vector< shared_ptr<TimeItem> > items(view_.time_items());
+       for (auto &i : items)
+               i->paint_label(p, r);
+}
+
+void Ruler::mouseMoveEvent(QMouseEvent *e)
+{
+       mouse_point_ = e->pos();
+
+       if (!(e->buttons() & Qt::LeftButton))
+               return;
+
+       if ((e->pos() - mouse_down_point_).manhattanLength() <
+               QApplication::startDragDistance())
+               return;
+
+       // Do the drag
+       dragging_ = true;
+
+       const int delta = e->pos().x() - mouse_down_point_.x();
+       const vector< shared_ptr<TimeItem> > items(view_.time_items());
+       for (auto &i : items)
+               if (i->dragging())
+                       i->set_time(view_.offset() +
+                               (i->drag_point().x() + delta - 0.5) *
+                               view_.scale());
+}
+
+void Ruler::mousePressEvent(QMouseEvent *e)
+{
+       if (e->buttons() & Qt::LeftButton) {
+               mouse_down_point_ = e->pos();
+
+               mouse_down_item_.reset();
+
+               clear_selection();
+
+               const vector< shared_ptr<TimeItem> > items(view_.time_items());
+               for (auto i = items.rbegin(); i != items.rend(); i++)
+                       if ((*i)->label_rect(rect()).contains(e->pos())) {
+                               mouse_down_item_ = (*i);
+                               break;
+                       }
+
+               if (mouse_down_item_) {
+                       mouse_down_item_->select();
+                       mouse_down_item_->drag();
+               }
+
+               selection_changed();
+       }
+}
+
+void Ruler::mouseReleaseEvent(QMouseEvent *)
+{
+       using pv::widgets::Popup;
+
+       if (!dragging_ && mouse_down_item_) {
+               Popup *const p = mouse_down_item_->create_popup(&view_);
+               if (p) {
+                       const QPoint arrpos(mouse_down_item_->get_x(),
+                               height() - BaselineOffset);
+                       p->set_position(mapToGlobal(arrpos), Popup::Bottom);
+                       p->show();
+               }
+       }
+
+       dragging_ = false;
+       mouse_down_item_.reset();
+
+       const vector< shared_ptr<TimeItem> > items(view_.time_items());
+       for (auto &i : items)
+               i->drag_release();
+}
+
+void Ruler::leaveEvent(QEvent*)
+{
+       mouse_point_ = QPoint(-1, -1);
+       update();
+}
+
+void Ruler::mouseDoubleClickEvent(QMouseEvent *e)
+{
+       view_.add_flag(view_.offset() + ((double)e->x() + 0.5) * view_.scale());
+}
+
+void Ruler::keyPressEvent(QKeyEvent *e)
+{
+       assert(e);
+
+       if (e->key() == Qt::Key_Delete)
+       {
+               const vector< shared_ptr<TimeItem> > items(view_.time_items());
+               for (auto &i : items)
+                       if (i->selected())
+                               i->delete_pressed();
+       }
 }
 
 void Ruler::draw_hover_mark(QPainter &p)
@@ -119,7 +246,7 @@ void Ruler::draw_hover_mark(QPainter &p)
        p.setPen(QPen(Qt::NoPen));
        p.setBrush(QBrush(palette().color(foregroundRole())));
 
-       const int b = height() - 1;
+       const int b = RulerHeight;
        const QPointF points[] = {
                QPointF(x, b),
                QPointF(x - HoverArrowSize, b - HoverArrowSize),
@@ -128,6 +255,13 @@ void Ruler::draw_hover_mark(QPainter &p)
        p.drawPolygon(points, countof(points));
 }
 
+int Ruler::calculate_text_height()
+{
+       QFontMetrics fm(font());
+       return fm.boundingRect(0, 0, INT_MAX, INT_MAX,
+               Qt::AlignLeft | Qt::AlignTop, "8").height();
+}
+
 void Ruler::hover_point_changed()
 {
        update();
index 073c86c9e600533f66ae3389f99a7e29660ee8ec..e47c424ae6b53168535a37d6cfe68a835e6de0a4 100644 (file)
@@ -28,6 +28,8 @@
 namespace pv {
 namespace view {
 
+class TimeItem;
+
 class Ruler : public MarginWidget
 {
        Q_OBJECT
@@ -38,21 +40,54 @@ private:
 
        static const int HoverArrowSize;
 
+       static const int Padding;
+
+       /**
+        * The vertical offset, relative to the bottom line of the widget,
+        * where the arrows of the cursor labels end.
+        */
+       static const int BaselineOffset;
+
 public:
        Ruler(View &parent);
 
+public:
+       void clear_selection();
+
 public:
        QSize sizeHint() const;
 
+       /**
+        * The extended area that the header widget would like to be sized to.
+        * @remarks This area is the area specified by sizeHint, extended by
+        * the area to overlap the viewport.
+        */
+       QSize extended_size_hint() const;
+
 private:
        void paintEvent(QPaintEvent *event);
 
+       void mouseMoveEvent(QMouseEvent *e);
+       void mousePressEvent(QMouseEvent *e);
+       void mouseReleaseEvent(QMouseEvent *);
+       void leaveEvent(QEvent*);
+
+       void mouseDoubleClickEvent(QMouseEvent *e);
+
+       void keyPressEvent(QKeyEvent *e);
+
 private:
        /**
         * Draw a hover arrow under the cursor position.
         */
        void draw_hover_mark(QPainter &p);
 
+       int calculate_text_height();
+
+private:
+       std::shared_ptr<TimeItem> mouse_down_item_;
+       const int text_height_;
+
 private Q_SLOTS:
        void hover_point_changed();
 };
index e43522577e9c985e3808d5cf5edce5b5c4365017..9cc1487e9dc30216c5e146d85c46ae48a44d291b 100644 (file)
@@ -38,7 +38,6 @@
 
 #include <libsigrok/libsigrok.hpp>
 
-#include "cursorheader.hpp"
 #include "decodetrace.hpp"
 #include "header.hpp"
 #include "logicsignal.hpp"
@@ -94,7 +93,6 @@ View::View(Session &session, QWidget *parent) :
        session_(session),
        viewport_(new Viewport(*this)),
        ruler_(new Ruler(*this)),
-       cursorheader_(new CursorHeader(*this)),
        header_(new Header(*this)),
        scale_(1e-6),
        offset_(0),
@@ -125,13 +123,13 @@ View::View(Session &session, QWidget *parent) :
                this, SLOT(on_signals_moved()));
 
        connect(header_, SIGNAL(selection_changed()),
-               cursorheader_, SLOT(clear_selection()));
-       connect(cursorheader_, SIGNAL(selection_changed()),
+               ruler_, SLOT(clear_selection()));
+       connect(ruler_, SIGNAL(selection_changed()),
                header_, SLOT(clear_selection()));
 
        connect(header_, SIGNAL(selection_changed()),
                this, SIGNAL(selection_changed()));
-       connect(cursorheader_, SIGNAL(selection_changed()),
+       connect(ruler_, SIGNAL(selection_changed()),
                this, SIGNAL(selection_changed()));
 
        connect(this, SIGNAL(hover_point_changed()),
@@ -145,7 +143,6 @@ View::View(Session &session, QWidget *parent) :
 
        viewport_->installEventFilter(this);
        ruler_->installEventFilter(this);
-       cursorheader_->installEventFilter(this);
        header_->installEventFilter(this);
 
        // Trigger the initial event manually. The default device has signals
@@ -153,7 +150,7 @@ View::View(Session &session, QWidget *parent) :
        signals_changed();
 
        // make sure the transparent widgets are on the top
-       cursorheader_->raise();
+       ruler_->raise();
        header_->raise();
 
        // Update the zoom state
@@ -294,7 +291,6 @@ void View::set_scale_offset(double scale, double offset)
 
        update_scroll();
        ruler_->update();
-       cursorheader_->update();
        viewport_->update();
        scale_offset_changed();
 }
@@ -347,7 +343,7 @@ bool View::cursors_shown() const
 void View::show_cursors(bool show)
 {
        show_cursors_ = show;
-       cursorheader_->update();
+       ruler_->update();
        viewport_->update();
 }
 
@@ -356,7 +352,7 @@ void View::centre_cursors()
        const double time_width = scale_ * viewport_->width();
        cursors_->first()->set_time(offset_ + time_width * 0.4);
        cursors_->second()->set_time(offset_ + time_width * 0.6);
-       cursorheader_->update();
+       ruler_->update();
        viewport_->update();
 }
 
@@ -518,13 +514,9 @@ void View::update_layout()
                header_->sizeHint().width() - pv::view::Header::BaselineOffset,
                ruler_->sizeHint().height(), 0, 0);
        ruler_->setGeometry(viewport_->x(), 0,
-               viewport_->width(), viewport_->y());
-       cursorheader_->setGeometry(
-               viewport_->x(),
-               ruler_->sizeHint().height() - cursorheader_->sizeHint().height() / 2,
-               viewport_->width(), cursorheader_->sizeHint().height());
+               viewport_->width(), ruler_->extended_size_hint().height());
        header_->setGeometry(0, viewport_->y(),
-               header_->sizeHint().width(), viewport_->height());
+               header_->extended_size_hint().width(), viewport_->height());
        update_scroll();
 }
 
@@ -588,7 +580,7 @@ bool View::eventFilter(QObject *object, QEvent *event)
                const QMouseEvent *const mouse_event = (QMouseEvent*)event;
                if (object == viewport_)
                        hover_point_ = mouse_event->pos();
-               else if (object == ruler_ || object == cursorheader_)
+               else if (object == ruler_)
                        hover_point_ = QPoint(mouse_event->x(), 0);
                else if (object == header_)
                        hover_point_ = QPoint(0, mouse_event->y());
@@ -640,7 +632,7 @@ void View::row_item_appearance_changed(bool label, bool content)
 void View::time_item_appearance_changed(bool label, bool content)
 {
        if (label)
-               cursorheader_->update();
+               ruler_->update();
        if (content)
                viewport_->update();
 }
@@ -668,7 +660,6 @@ void View::h_scroll_value_changed(int value)
        }
 
        ruler_->update();
-       cursorheader_->update();
        viewport_->update();
 }
 
index 6b7841f926ed105450a6181fe199e2b3eb2ed222..344e252e7e9f8caa7a2a2e00c8cb4f2f2df74626 100644 (file)
@@ -272,7 +272,6 @@ private:
 
        Viewport *viewport_;
        Ruler *ruler_;
-       CursorHeader *cursorheader_;
        Header *header_;
 
        /// The view time scale in seconds per pixel.
index 4c3df154072c8ca5f3c2b06d67d4f0ab7f5d5408..12e1f44fc7659ac538ea6d8725ca60fcc3b4b116 100644 (file)
@@ -43,7 +43,7 @@ class ViewItem : public QObject
 {
        Q_OBJECT
 
-private:
+public:
        static const int HighlightRadius;
 
 public:
index 494f8dda5f5a9605934965ee3215eb24dd55f5a7..446c868b253ae8a7b5eb4816fc5fcb54560a2b19 100644 (file)
@@ -40,7 +40,6 @@ set(pulseview_TEST_SOURCES
        ${PROJECT_SOURCE_DIR}/pv/popups/channels.cpp
        ${PROJECT_SOURCE_DIR}/pv/view/analogsignal.cpp
        ${PROJECT_SOURCE_DIR}/pv/view/cursor.cpp
-       ${PROJECT_SOURCE_DIR}/pv/view/cursorheader.cpp
        ${PROJECT_SOURCE_DIR}/pv/view/cursorpair.cpp
        ${PROJECT_SOURCE_DIR}/pv/view/flag.cpp
        ${PROJECT_SOURCE_DIR}/pv/view/header.cpp
@@ -84,7 +83,6 @@ set(pulseview_TEST_HEADERS
        ${PROJECT_SOURCE_DIR}/pv/prop/string.hpp
        ${PROJECT_SOURCE_DIR}/pv/prop/binding/deviceoptions.hpp
        ${PROJECT_SOURCE_DIR}/pv/view/cursor.hpp
-       ${PROJECT_SOURCE_DIR}/pv/view/cursorheader.hpp
        ${PROJECT_SOURCE_DIR}/pv/view/flag.hpp
        ${PROJECT_SOURCE_DIR}/pv/view/header.hpp
        ${PROJECT_SOURCE_DIR}/pv/view/logicsignal.hpp