From: Joel Holdsworth Date: Thu, 1 Nov 2012 22:16:11 +0000 (+0000) Subject: Made TimeMarker and Cursor QObjects X-Git-Tag: pulseview-0.1.0~229 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=3efda736308edc11468a4b59bdb28d5793902529 Made TimeMarker and Cursor QObjects --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ee79db21..1513d6dd 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 a982c05e..ec51b81a 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 9f5bd5e8..49d90e39 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 616221b2..c02dab15 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.