Initial interractive zoom support
[pulseview.git] / sigview.cpp
index 53fbdeaac148859251c7792ab726c40d6d174c4c..df1eefec2745fec15041766a4777d086d6e114eb 100644 (file)
@@ -23,6 +23,8 @@
 #include "sigsession.h"
 #include "signal.h"
 
 #include "sigsession.h"
 #include "signal.h"
 
+#include <QMouseEvent>
+
 #include <boost/foreach.hpp>
 
 using namespace boost;
 #include <boost/foreach.hpp>
 
 using namespace boost;
@@ -82,3 +84,31 @@ void SigView::dataUpdated()
        update();
 }
 
        update();
 }
 
+void SigView::mouseMoveEvent(QMouseEvent *event)
+{
+       assert(event);
+}
+
+void SigView::mousePressEvent(QMouseEvent *event)
+{
+       assert(event);
+}
+
+void SigView::mouseReleaseEvent(QMouseEvent *event)
+{
+       assert(event);
+
+       switch(event->button())
+       {
+       case Qt::LeftButton:
+               _scale = (_scale * 2) / 3;
+               break;
+
+       case Qt::RightButton:
+               _scale = (_scale * 3) / 2;
+               break;
+       }
+
+       updateGL();
+}
+