]> sigrok.org Git - pulseview.git/commitdiff
Made TimeMarker and Cursor QObjects
authorJoel Holdsworth <redacted>
Thu, 1 Nov 2012 22:16:11 +0000 (22:16 +0000)
committerJoel Holdsworth <redacted>
Thu, 1 Nov 2012 23:19:58 +0000 (23:19 +0000)
CMakeLists.txt
pv/view/cursor.h
pv/view/timemarker.cpp
pv/view/timemarker.h

index ee79db217e61c8dafa65b09e8de12bb0184f6991..1513d6dd1f14da578c66561859142628b6ed85ce 100644 (file)
@@ -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
 )
index a982c05e4d2b76b10cb2c224b50002a8cc9ec138..ec51b81abdb4cfd495a358200eb543a1b9392069 100644 (file)
@@ -28,6 +28,8 @@ namespace view {
 
 class Cursor : public TimeMarker
 {
+       Q_OBJECT
+
 private:
        static const QColor LineColour;
        static const QColor FillColour;
index 9f5bd5e8c75effd218781125a82f0ed8b9b70fd9..49d90e39d551447f563debf9ea2e04b90d6bec4e 100644 (file)
@@ -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;
index 616221b23ba139afd1992b9ac7d6acc9332db1d8..c02dab159dbecb93c03a9f5a2b921012e6d82c40 100644 (file)
@@ -22,6 +22,7 @@
 #define PULSEVIEW_PV_VIEW_MARKER_H
 
 #include <QColor>
+#include <QObject>
 
 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.