Index: trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
===================================================================
--- trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc	(revision 11731)
+++ trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc	(revision 11740)
@@ -20,6 +20,6 @@
 #include <QtGui/QFileDialog>
 
-#include <qwt_plot_grid.h>
-#include <qwt_symbol.h>
+#include <qwt-qt4/qwt_plot_grid.h>
+#include <qwt-qt4/qwt_symbol.h>
 
 #include "src/Configuration.h"
@@ -1022,4 +1022,5 @@
     if (whichSlice >= nRoi)
     {
+        whichSlice = 0;
         if (!loopCurrentEvent)
         {
@@ -1029,5 +1030,4 @@
             eventStep = backupStep;
         }
-        whichSlice=0;
     }
     emit signalCurrentSlice(whichSlice);
@@ -1039,4 +1039,5 @@
     if (whichSlice < 0)
     {
+        whichSlice = nRoi-1;
         if (!loopCurrentEvent)
         {
@@ -1046,5 +1047,4 @@
             eventStep = backupStep;
         }
-        whichSlice = nRoi-1;
     }
     emit signalCurrentSlice(whichSlice);
@@ -1641,22 +1641,28 @@
 //    startCellHistoZoom->setZoomBase(startCellHistoItem.boundingRect());
     QStack< QRectF > stack;
-    stack.push(boardsTimeHistoItem.boundingRect());
+//    QRectF cRectangle = boardsTimeHistoItem.boundingRect();
+    stack.push(scaleBoundingRectangle(boardsTimeHistoItem.boundingRect(), 1.05f));//cRectangle);//boardsTimeHistoItem.boundingRect());
     boardsTimeHistoZoom->setZoomStack(stack);
     stack.pop();
-    stack.push(startCellHistoItem.boundingRect());
+    stack.push(scaleBoundingRectangle(startCellHistoItem.boundingRect(), 1.05f));
     startCellHistoZoom->setZoomStack(stack);
     stack.pop();
-    stack.push(startTimeMarkHistoItem.boundingRect());
+    stack.push(scaleBoundingRectangle(startTimeMarkHistoItem.boundingRect(), 1.05f));
     startTimeMarkHistoZoom->setZoomStack(stack);
     stack.pop();
-    stack.push(triggerDelayHistoItem.boundingRect());
+    stack.push(scaleBoundingRectangle(triggerDelayHistoItem.boundingRect(), 1.05f));
     triggerDelayHistoZoom->setZoomStack(stack);
     stack.pop();
     pixelChanged(viewer->selectedPixel);
-
-
-
-}
-
+}
+//can't use a ref to rectangle, as the type must be converted first
+QRectF UIConnector::scaleBoundingRectangle(QRectF rectangle, float scale)
+{
+    QPointF bottomRight = rectangle.bottomRight();
+    QPointF topLeft = rectangle.topLeft();
+    QPointF center = rectangle.center();
+    return QRectF(topLeft + (topLeft-center)*(scale-1.0f), //top left
+                  bottomRight + (bottomRight-center)*(scale-1.0f)); //bottom right
+}
 void UIConnector::initHistograms()
 {
@@ -1776,11 +1782,11 @@
     }
 #if QWT_VERSION < 0x060000
-       pixelValueCurveItem.setRawData(xval, yval, viewer->nRoi);
+       pixelValueCurveItem.setData(xval, yval, viewer->nRoi);
 #else
-       pixelValueCurveItem.setRawSamples(xval, yval, viewer->nRoi);
+       pixelValueCurveItem.setSamples(xval, yval, viewer->nRoi);
 #endif
 
     QStack< QRectF > stack;
-    stack.push(pixelValueCurveItem.boundingRect());
+    stack.push(scaleBoundingRectangle(pixelValueCurveItem.boundingRect(), 1.05f));
     curveZoom->setZoomStack(stack);
     stack.pop();
@@ -1969,5 +1975,5 @@
         ("color.range", vars<double>(), "Range of the display colours")
         ("color.red", vars<double>(), "Range of red values")
-        ("color.rreen", vars<double>(), "Range of green values")
+        ("color.green", vars<double>(), "Range of green values")
         ("color.blue", vars<double>(), "Range of blue values")
         ("file,f", var<string>(), "File to be loaded at startup")
Index: trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h
===================================================================
--- trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h	(revision 11731)
+++ trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h	(revision 11740)
@@ -30,9 +30,9 @@
 #include <GL/gl.h>
 
-#include "qwt_plot.h"
+#include <qwt-qt4/qwt_plot.h>
 //#include "qwt_plot_histogram.h"
-#include "qwt_plot_curve.h"
-
-#include <qwt_plot_zoomer.h>
+#include <qwt-qt4/qwt_plot_curve.h>
+
+#include <qwt-qt4/qwt_plot_zoomer.h>
 
 
@@ -253,4 +253,5 @@
     int swID;
     bool rescaleWholeCamera;
+    QRectF scaleBoundingRectangle(QRectF rectangle, float scale);
 public:
     QListWidget *boardsTimeList;
Index: trunk/FACT++/gui/RawEventsViewer/viewer.ui
===================================================================
--- trunk/FACT++/gui/RawEventsViewer/viewer.ui	(revision 11731)
+++ trunk/FACT++/gui/RawEventsViewer/viewer.ui	(revision 11740)
@@ -857,5 +857,5 @@
    <class>QwtPlot</class>
    <extends>QFrame</extends>
-   <header>qwt_plot.h</header>
+   <header>qwt-qt4/qwt_plot.h</header>
    <container>1</container>
   </customwidget>
