vector< shared_ptr<ViewItem> > Viewport::items()
{
vector< shared_ptr<ViewItem> > items;
- const vector< shared_ptr<TraceTreeItem> > trace_tree_items(
- view_.list_by_type<TraceTreeItem>());
- copy(trace_tree_items.begin(), trace_tree_items.end(),
- back_inserter(items));
+ const std::vector< shared_ptr<ViewItem> > view_items(
+ view_.list_by_type<ViewItem>());
+ copy(view_items.begin(), view_items.end(), back_inserter(items));
const vector< shared_ptr<TimeItem> > time_items(view_.time_items());
copy(time_items.begin(), time_items.end(), back_inserter(items));
return items;
void Viewport::paintEvent(QPaintEvent*)
{
- vector< shared_ptr<TraceTreeItem> > trace_tree_items(
- view_.list_by_type<TraceTreeItem>());
- assert(none_of(trace_tree_items.begin(), trace_tree_items.end(),
- [](const shared_ptr<TraceTreeItem> &r) { return !r; }));
+ vector< shared_ptr<RowItem> > row_items(view_.list_by_type<RowItem>());
+ assert(none_of(row_items.begin(), row_items.end(),
+ [](const shared_ptr<RowItem> &r) { return !r; }));
- stable_sort(trace_tree_items.begin(), trace_tree_items.end(),
- [](const shared_ptr<TraceTreeItem> &a, const shared_ptr<TraceTreeItem> &b) {
- return a->visual_v_offset() < b->visual_v_offset(); });
+ stable_sort(row_items.begin(), row_items.end(),
+ [](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
+ return a->point(QRect()).y() < b->point(QRect()).y(); });
const vector< shared_ptr<TimeItem> > time_items(view_.time_items());
assert(none_of(time_items.begin(), time_items.end(),
for (const shared_ptr<TimeItem> t : time_items)
t->paint_back(p, pp);
- for (const shared_ptr<TraceTreeItem> r : trace_tree_items)
+ for (const shared_ptr<RowItem> r : row_items)
r->paint_back(p, pp);
for (const shared_ptr<TimeItem> t : time_items)
t->paint_mid(p, pp);
- for (const shared_ptr<TraceTreeItem> r : trace_tree_items)
+ for (const shared_ptr<RowItem> r : row_items)
r->paint_mid(p, pp);
p.setRenderHint(QPainter::Antialiasing, false);
- for (const shared_ptr<TraceTreeItem> r : trace_tree_items)
+ for (const shared_ptr<RowItem> r : row_items)
r->paint_fore(p, pp);
for (const shared_ptr<TimeItem> t : time_items)
t->paint_fore(p, pp);