From 3efda736308edc11468a4b59bdb28d5793902529 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 1 Nov 2012 22:16:11 +0000 Subject: [PATCH] Made TimeMarker and Cursor QObjects --- CMakeLists.txt | 2 ++ pv/view/cursor.h | 2 ++ pv/view/timemarker.cpp | 7 +++++++ pv/view/timemarker.h | 10 +++++++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee79db2..1513d6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,8 +103,10 @@ set(pulseview_HEADERS pv/mainwindow.h pv/samplingbar.h pv/sigsession.h + pv/view/cursor.h pv/view/header.h pv/view/ruler.h + pv/view/timemarker.h pv/view/view.h pv/view/viewport.h ) diff --git a/pv/view/cursor.h b/pv/view/cursor.h index a982c05..ec51b81 100644 --- a/pv/view/cursor.h +++ b/pv/view/cursor.h @@ -28,6 +28,8 @@ namespace view { class Cursor : public TimeMarker { + Q_OBJECT + private: static const QColor LineColour; static const QColor FillColour; diff --git a/pv/view/timemarker.cpp b/pv/view/timemarker.cpp index 9f5bd5e..49d90e3 100644 --- a/pv/view/timemarker.cpp +++ b/pv/view/timemarker.cpp @@ -35,6 +35,13 @@ TimeMarker::TimeMarker(const View &view, const QColor &colour, { } +TimeMarker::TimeMarker(const TimeMarker &s) : + _view(s._view), + _colour(s._colour), + _time(s._time) +{ +} + double TimeMarker::time() const { return _time; diff --git a/pv/view/timemarker.h b/pv/view/timemarker.h index 616221b..c02dab1 100644 --- a/pv/view/timemarker.h +++ b/pv/view/timemarker.h @@ -22,6 +22,7 @@ #define PULSEVIEW_PV_VIEW_MARKER_H #include +#include class QPainter; class QRect; @@ -31,8 +32,10 @@ namespace view { class View; -class TimeMarker +class TimeMarker : public QObject { + Q_OBJECT + protected: /** * Constructor. @@ -42,6 +45,11 @@ protected: */ TimeMarker(const View &view, const QColor &colour, double time); + /** + * Copy constructor + */ + TimeMarker(const TimeMarker &s); + public: /** * Gets the time of the marker. -- 2.30.2