]> sigrok.org Git - pulseview.git/commitdiff
MarginWidget: Added item() method
authorJoel Holdsworth <redacted>
Sun, 21 Dec 2014 13:28:16 +0000 (13:28 +0000)
committerJoel Holdsworth <redacted>
Mon, 29 Dec 2014 11:56:00 +0000 (11:56 +0000)
pv/view/header.cpp
pv/view/header.hpp
pv/view/marginwidget.hpp
pv/view/ruler.cpp
pv/view/ruler.hpp

index a2a7c505cfd420c5b6b66e3e6224795c7ecdabe9..83985eda68a28f925e41e9641bdc87fa1fde57f9 100644 (file)
@@ -80,6 +80,11 @@ QSize Header::extended_size_hint() const
        return sizeHint() + QSize(ViewItem::HighlightRadius, 0);
 }
 
+vector< shared_ptr<ViewItem> > Header::items()
+{
+       return vector< shared_ptr<ViewItem> >(view_.begin(), view_.end());
+}
+
 shared_ptr<ViewItem> Header::get_mouse_over_item(const QPoint &pt)
 {
        const QRect r(0, 0, width() - BaselineOffset, height());
index e249264330a074c65cbe51559d9fbde54844c412..867944c53650a405f75030f4f3677994eb5afebc 100644 (file)
@@ -60,6 +60,11 @@ public:
        static const int BaselineOffset;
 
 private:
+       /**
+        * Gets the row items.
+        */
+       std::vector< std::shared_ptr<pv::view::ViewItem> > items();
+
        /**
         * Gets the first view item which has a label that contains @c pt .
         * @param pt the point to search with.
index de5c866f3077fcc12acb8028167dc4de0711a69d..bd74801bf4d04a7f71e6a3875e2b8ed5acf652e9 100644 (file)
@@ -47,6 +47,11 @@ public:
        virtual QSize extended_size_hint() const = 0;
 
 protected:
+       /**
+        * Gets the items in the margin widget.
+        */
+       virtual std::vector< std::shared_ptr<pv::view::ViewItem> > items() = 0;
+
        /**
         * Shows the popup of a the specified @c ViewItem .
         * @param item The item to show the popup for.
index 5b84d6d321c445cad69afd0f13ea7a4383e9efa5..9f8de32fd0df7686906ee6381bba581f4158340f 100644 (file)
@@ -76,6 +76,13 @@ QSize Ruler::extended_size_hint() const
                ViewItem::HighlightRadius);
 }
 
+vector< shared_ptr<ViewItem> > Ruler::items()
+{
+       const vector< shared_ptr<TimeItem> > time_items(view_.time_items());
+       return vector< shared_ptr<ViewItem> >(
+               time_items.begin(), time_items.end());
+}
+
 shared_ptr<ViewItem> Ruler::get_mouse_over_item(const QPoint &pt)
 {
        const vector< shared_ptr<TimeItem> > items(view_.time_items());
index 68e7eb5884fcc751d0723ec13afbb80253937a43..e808b3097c665e4c33fbc14758d5ebf620438398 100644 (file)
@@ -62,6 +62,11 @@ public:
        QSize extended_size_hint() const;
 
 private:
+       /**
+        * Gets the time items.
+        */
+       std::vector< std::shared_ptr<pv::view::ViewItem> > items();
+
        /**
         * Gets the first view item which has a label that contains @c pt .
         * @param pt the point to search with.