projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6871ee9
)
MarginWidget: Added item() method
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sun, 21 Dec 2014 13:28:16 +0000
(13:28 +0000)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Mon, 29 Dec 2014 11:56:00 +0000
(11:56 +0000)
pv/view/header.cpp
patch
|
blob
|
history
pv/view/header.hpp
patch
|
blob
|
history
pv/view/marginwidget.hpp
patch
|
blob
|
history
pv/view/ruler.cpp
patch
|
blob
|
history
pv/view/ruler.hpp
patch
|
blob
|
history
diff --git
a/pv/view/header.cpp
b/pv/view/header.cpp
index a2a7c505cfd420c5b6b66e3e6224795c7ecdabe9..83985eda68a28f925e41e9641bdc87fa1fde57f9 100644
(file)
--- a/
pv/view/header.cpp
+++ b/
pv/view/header.cpp
@@
-80,6
+80,11
@@
QSize Header::extended_size_hint() const
return sizeHint() + QSize(ViewItem::HighlightRadius, 0);
}
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());
shared_ptr<ViewItem> Header::get_mouse_over_item(const QPoint &pt)
{
const QRect r(0, 0, width() - BaselineOffset, height());
diff --git
a/pv/view/header.hpp
b/pv/view/header.hpp
index e249264330a074c65cbe51559d9fbde54844c412..867944c53650a405f75030f4f3677994eb5afebc 100644
(file)
--- a/
pv/view/header.hpp
+++ b/
pv/view/header.hpp
@@
-60,6
+60,11
@@
public:
static const int BaselineOffset;
private:
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.
/**
* Gets the first view item which has a label that contains @c pt .
* @param pt the point to search with.
diff --git
a/pv/view/marginwidget.hpp
b/pv/view/marginwidget.hpp
index de5c866f3077fcc12acb8028167dc4de0711a69d..bd74801bf4d04a7f71e6a3875e2b8ed5acf652e9 100644
(file)
--- a/
pv/view/marginwidget.hpp
+++ b/
pv/view/marginwidget.hpp
@@
-47,6
+47,11
@@
public:
virtual QSize extended_size_hint() const = 0;
protected:
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.
/**
* Shows the popup of a the specified @c ViewItem .
* @param item The item to show the popup for.
diff --git
a/pv/view/ruler.cpp
b/pv/view/ruler.cpp
index 5b84d6d321c445cad69afd0f13ea7a4383e9efa5..9f8de32fd0df7686906ee6381bba581f4158340f 100644
(file)
--- a/
pv/view/ruler.cpp
+++ b/
pv/view/ruler.cpp
@@
-76,6
+76,13
@@
QSize Ruler::extended_size_hint() const
ViewItem::HighlightRadius);
}
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());
shared_ptr<ViewItem> Ruler::get_mouse_over_item(const QPoint &pt)
{
const vector< shared_ptr<TimeItem> > items(view_.time_items());
diff --git
a/pv/view/ruler.hpp
b/pv/view/ruler.hpp
index 68e7eb5884fcc751d0723ec13afbb80253937a43..e808b3097c665e4c33fbc14758d5ebf620438398 100644
(file)
--- a/
pv/view/ruler.hpp
+++ b/
pv/view/ruler.hpp
@@
-62,6
+62,11
@@
public:
QSize extended_size_hint() const;
private:
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.
/**
* Gets the first view item which has a label that contains @c pt .
* @param pt the point to search with.