- int offset = SignalMargin;
- vector< shared_ptr<Signal> > &sigs = _session.get_signals();
- BOOST_FOREACH(shared_ptr<Signal> s, sigs) {
- s->set_v_offset(offset);
- offset += SignalHeight + 2 * SignalMargin;
+ setViewportMargins(
+ header_->sizeHint().width() - pv::view::Header::BaselineOffset,
+ ruler_->sizeHint().height(), 0, 0);
+ ruler_->setGeometry(viewport_->x(), 0,
+ viewport_->width(), ruler_->extended_size_hint().height());
+ header_->setGeometry(0, viewport_->y(),
+ header_->extended_size_hint().width(), viewport_->height());
+ update_scroll();
+}
+
+void View::paint_label(QPainter &p, const QRect &rect, bool hover)
+{
+ (void)p;
+ (void)rect;
+ (void)hover;
+}
+
+QRectF View::label_rect(const QRectF &rect)
+{
+ (void)rect;
+ return QRectF();
+}
+
+bool View::add_channels_to_owner(
+ const vector< shared_ptr<sigrok::Channel> > &channels,
+ RowItemOwner *owner, int &offset,
+ unordered_map<shared_ptr<sigrok::Channel>, shared_ptr<Signal> >
+ &signal_map,
+ std::function<bool (shared_ptr<RowItem>)> filter_func)
+{
+ bool any_added = false;
+
+ assert(owner);
+
+ for (const auto &channel : channels)
+ {
+ const auto iter = signal_map.find(channel);
+ if (iter == signal_map.end() ||
+ (filter_func && !filter_func((*iter).second)))
+ continue;
+
+ shared_ptr<RowItem> row_item = (*iter).second;
+ owner->add_child_item(row_item);
+ apply_offset(row_item, offset);
+ signal_map.erase(iter);
+
+ any_added = true;