+
+ if (event->orientation() == Qt::Vertical) {
+ // Vertical scrolling is interpreted as zooming in/out
+ _view.zoom(event->delta() / 120, event->x());
+ } else if (event->orientation() == Qt::Horizontal) {
+ // Horizontal scrolling is interpreted as moving left/right
+ _view.set_scale_offset(_view.scale(),
+ event->delta() * _view.scale()
+ + _view.offset());
+ }
+}
+
+void Viewport::on_signals_changed()
+{
+ const vector< shared_ptr<Trace> > traces(_view.get_traces());
+ for (shared_ptr<Trace> t : traces) {
+ assert(t);
+ connect(t.get(), SIGNAL(visibility_changed()),
+ this, SLOT(update()));
+ }