From: Joel Holdsworth Date: Fri, 7 Sep 2012 16:25:44 +0000 (+0100) Subject: Exposed View::_session with accessor function X-Git-Tag: pulseview-0.1.0~307 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1d19ef83d7598f3248086d456df55e844b229bb3;p=pulseview.git Exposed View::_session with accessor function --- diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 49b96ba3..e0d3ada7 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -63,6 +63,11 @@ View::View(SigSession &session, QWidget *parent) : setViewport(_viewport); } +SigSession& View::session() +{ + return _session; +} + double View::scale() const { return _scale; diff --git a/pv/view/view.h b/pv/view/view.h index 3c76c8ee..b7769899 100644 --- a/pv/view/view.h +++ b/pv/view/view.h @@ -45,6 +45,8 @@ private: public: explicit View(SigSession &session, QWidget *parent = 0); + SigSession& session(); + double scale() const; double offset() const; int v_offset() const; diff --git a/pv/view/viewport.cpp b/pv/view/viewport.cpp index 572e38b1..b8598bcb 100644 --- a/pv/view/viewport.cpp +++ b/pv/view/viewport.cpp @@ -60,7 +60,7 @@ int Viewport::get_total_height() const { int height = 0; BOOST_FOREACH(const shared_ptr s, - _view._session.get_signals()) { + _view.session().get_signals()) { assert(s); height += SignalHeight; } @@ -82,7 +82,7 @@ void Viewport::paintEvent(QPaintEvent *event) int offset; const vector< shared_ptr > &sigs = - _view._session.get_signals(); + _view.session().get_signals(); // Prepare for OpenGL rendering makeCurrent();