Index: src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollBar.cpp
===================================================================
--- src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollBar.cpp	(revision 35302b57b5c489d9535c30527e3c33675ec2acb6)
+++ src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollBar.cpp	(revision 35302b57b5c489d9535c30527e3c33675ec2acb6)
@@ -0,0 +1,200 @@
+/*
+ * QSeisScrollbar.cpp
+ *
+ *  taken from "realtime"-example
+ *
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qstyle.h>
+#if QT_VERSION >= 0x040000
+#include <qstyleoption.h>
+#endif
+#include "ScrollBar.hpp"
+
+
+// have this after(!) all Qt includes
+#include "CodePatterns/MemDebug.hpp"
+
+ScrollBar::ScrollBar(QWidget * parent):
+    QScrollBar(parent)
+{
+    init();
+}
+
+ScrollBar::ScrollBar(Qt::Orientation o, 
+        QWidget *parent):
+    QScrollBar(o, parent)
+{
+    init();
+}
+
+ScrollBar::ScrollBar(double minBase, double maxBase, 
+        Qt::Orientation o, QWidget *parent):
+    QScrollBar(o, parent)
+{
+    init();
+    setBase(minBase, maxBase);
+    moveSlider(minBase, maxBase);
+}
+
+void ScrollBar::init()
+{
+    d_inverted = orientation() == Qt::Vertical;
+    d_baseTicks = 1000000;
+    d_minBase = 0.0;
+    d_maxBase = 1.0;
+    moveSlider(d_minBase, d_maxBase);
+
+    connect(this, SIGNAL(sliderMoved(int)), SLOT(catchSliderMoved(int)));
+    connect(this, SIGNAL(valueChanged(int)), SLOT(catchValueChanged(int)));
+}
+
+void ScrollBar::setInverted(bool inverted)
+{
+    if ( d_inverted != inverted )
+    {
+        d_inverted = inverted;
+        moveSlider(minSliderValue(), maxSliderValue());
+    }
+}
+
+bool ScrollBar::isInverted() const
+{
+    return d_inverted;
+}
+
+void ScrollBar::setBase(double min, double max)
+{
+    if ( min != d_minBase || max != d_maxBase )
+    {
+        d_minBase = min;
+        d_maxBase = max;
+
+        moveSlider(minSliderValue(), maxSliderValue());
+    }
+}
+
+void ScrollBar::moveSlider(double min, double max)
+{
+    const int sliderTicks = qRound((max - min) / 
+        (d_maxBase - d_minBase) * d_baseTicks);
+
+    // setRange initiates a valueChanged of the scrollbars
+    // in some situations. So we block
+    // and unblock the signals.
+
+    blockSignals(true);
+
+    setRange(sliderTicks / 2, d_baseTicks - sliderTicks / 2);
+    int steps = sliderTicks / 200;
+    if ( steps <= 0 )
+        steps = 1;
+
+#if QT_VERSION < 0x040000
+    setSteps(steps, sliderTicks);
+#else
+    setSingleStep(steps);
+    setPageStep(sliderTicks);
+#endif
+
+    int tick = mapToTick(min + (max - min) / 2);
+    if ( isInverted() )
+        tick = d_baseTicks - tick;
+
+#if QT_VERSION < 0x040000
+    directSetValue(tick);
+    rangeChange();
+#else
+    setSliderPosition(tick);
+#endif
+    blockSignals(false);
+}
+
+double ScrollBar::minBaseValue() const
+{
+    return d_minBase;
+}
+
+double ScrollBar::maxBaseValue() const
+{
+    return d_maxBase;
+}
+
+void ScrollBar::sliderRange(int value, double &min, double &max) const
+{
+    if ( isInverted() )
+        value = d_baseTicks - value;
+
+    const int visibleTicks = pageStep();
+
+    min = mapFromTick(value - visibleTicks / 2);
+    max = mapFromTick(value + visibleTicks / 2);
+}
+
+double ScrollBar::minSliderValue() const
+{
+    double min, dummy;
+    sliderRange(value(), min, dummy);
+
+    return min;
+}
+
+double ScrollBar::maxSliderValue() const
+{
+    double max, dummy;
+    sliderRange(value(), dummy, max);
+
+    return max;
+}
+
+int ScrollBar::mapToTick(double v) const
+{   
+    return (int) ( ( v - d_minBase) / (d_maxBase - d_minBase ) * d_baseTicks );
+}
+
+double ScrollBar::mapFromTick(int tick) const
+{   
+    return d_minBase + ( d_maxBase - d_minBase ) * tick / d_baseTicks;
+}
+
+void ScrollBar::catchValueChanged(int value)
+{
+    double min, max;
+    sliderRange(value, min, max);
+    emit valueChanged(orientation(), min, max);
+}
+
+void ScrollBar::catchSliderMoved(int value)
+{
+    double min, max;
+    sliderRange(value, min, max);
+    emit sliderMoved(orientation(), min, max);
+}
+
+int ScrollBar::extent() const
+{
+#if QT_VERSION < 0x040000
+    return style().pixelMetric(QStyle::PM_ScrollBarExtent, this);
+#else
+    QStyleOptionSlider opt;
+    opt.init(this);
+    opt.subControls = QStyle::SC_None;
+    opt.activeSubControls = QStyle::SC_None;
+    opt.orientation = orientation();
+    opt.minimum = minimum();
+    opt.maximum = maximum();
+    opt.sliderPosition = sliderPosition();
+    opt.sliderValue = value();
+    opt.singleStep = singleStep();
+    opt.pageStep = pageStep();
+    opt.upsideDown = invertedAppearance();
+    if (orientation() == Qt::Horizontal)
+        opt.state |= QStyle::State_Horizontal;
+    return style()->pixelMetric(QStyle::PM_ScrollBarExtent, &opt, this);
+#endif
+}
Index: src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollBar.hpp
===================================================================
--- src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollBar.hpp	(revision 35302b57b5c489d9535c30527e3c33675ec2acb6)
+++ src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollBar.hpp	(revision 35302b57b5c489d9535c30527e3c33675ec2acb6)
@@ -0,0 +1,65 @@
+/*
+ * QSeisScrollbar.cpp
+ *
+ *  taken from "realtime"-example
+ *
+ */
+
+#ifndef _SCROLLBAR_HPP
+#define _SCROLLBAR_HPP
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qscrollbar.h>
+
+class ScrollBar: public QScrollBar
+{
+    Q_OBJECT
+
+public:
+    ScrollBar(QWidget *parent = NULL);
+    ScrollBar(Qt::Orientation, QWidget *parent = NULL);
+    ScrollBar(double minBase, double maxBase,       
+        Qt::Orientation o, QWidget *parent = NULL);
+
+    void setInverted(bool);
+    bool isInverted() const;
+
+    double minBaseValue() const;
+    double maxBaseValue() const;
+
+    double minSliderValue() const;
+    double maxSliderValue() const;
+
+    int extent() const;
+
+signals:
+    void sliderMoved(Qt::Orientation, double, double);
+    void valueChanged(Qt::Orientation, double, double);
+
+public slots:
+    virtual void setBase(double min, double max);
+    virtual void moveSlider(double min, double max);
+
+protected:
+    void sliderRange(int value, double &min, double &max) const;
+    int mapToTick(double) const;
+    double mapFromTick(int) const;
+
+private slots:
+    void catchValueChanged(int value);
+    void catchSliderMoved(int value);
+
+private:
+    void init();
+
+    bool d_inverted;
+    double d_minBase;
+    double d_maxBase;
+    int d_baseTicks;
+};
+
+#endif // _SCROLLBAR_HPP
Index: src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollZoomer.cpp
===================================================================
--- src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollZoomer.cpp	(revision 35302b57b5c489d9535c30527e3c33675ec2acb6)
+++ src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollZoomer.cpp	(revision 35302b57b5c489d9535c30527e3c33675ec2acb6)
@@ -0,0 +1,537 @@
+/*
+ * QSeisScrollzoomer.cpp
+ *
+ *  taken from "realtime"-example
+ *
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qevent.h>
+#include <qwt_plot_canvas.h>
+#include <qwt_plot_layout.h>
+#include <qwt_scale_engine.h>
+#include <qwt_scale_widget.h>
+#include "ScrollZoomer.hpp"
+
+#include "UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollBar.hpp"
+
+// have this after(!) all Qt includes
+#include "CodePatterns/MemDebug.hpp"
+
+class ScrollData
+{
+public:
+    ScrollData():
+        scrollBar(NULL),
+        position(ScrollZoomer::OppositeToScale),
+#if QT_VERSION < 0x040000
+        mode(QScrollView::Auto)
+#else
+        mode(Qt::ScrollBarAsNeeded)
+#endif
+    {
+    }
+
+    ~ScrollData()
+    {
+        delete scrollBar;
+    }
+
+    ScrollBar *scrollBar;
+    ScrollZoomer::ScrollBarPosition position;
+#if QT_VERSION < 0x040000
+    QScrollView::ScrollBarMode mode;
+#else
+    Qt::ScrollBarPolicy mode;
+#endif
+};
+
+ScrollZoomer::ScrollZoomer(QwtPlotCanvas *canvas):
+    QwtPlotZoomer(canvas),
+    d_cornerWidget(NULL),
+    d_hScrollData(NULL),
+    d_vScrollData(NULL),
+    d_inZoom(false),
+    d_alignCanvasToScales(false)
+{
+    if ( !canvas )
+        return;
+
+    d_hScrollData = new ScrollData;
+    d_vScrollData = new ScrollData;
+
+    //disable zoom reset on middle mouse button
+    setMousePattern(QwtEventPattern::MouseSelect3, Qt::NoButton);
+}
+
+ScrollZoomer::~ScrollZoomer()
+{
+    delete d_cornerWidget;
+    delete d_vScrollData;
+    delete d_hScrollData;
+}
+
+void ScrollZoomer::rescale()
+{
+    QwtScaleWidget *xScale = plot()->axisWidget(xAxis());
+    QwtScaleWidget *yScale = plot()->axisWidget(yAxis());
+
+    if ( zoomRectIndex() <= 0 )
+    {
+        if ( d_inZoom )
+        {
+            xScale->setMinBorderDist(0, 0);
+            yScale->setMinBorderDist(0, 0);
+
+            QwtPlotLayout *layout = plot()->plotLayout();
+            layout->setAlignCanvasToScales(d_alignCanvasToScales);
+
+            d_inZoom = false;
+        }
+    }
+    else
+    {
+        if ( !d_inZoom )
+        {
+            /*
+             We set a minimum border distance. 
+             Otherwise the canvas size changes when scrolling, 
+             between situations where the major ticks are at
+             the canvas borders (requiring extra space for the label)
+             and situations where all labels can be painted below/top
+             or left/right of the canvas.
+             */
+            int start, end;
+
+            xScale->getBorderDistHint(start, end);
+            xScale->setMinBorderDist(start, end);
+
+            yScale->getBorderDistHint(start, end);
+            yScale->setMinBorderDist(start, end);
+
+            QwtPlotLayout *layout = plot()->plotLayout();
+            d_alignCanvasToScales = layout->alignCanvasToScales();
+            layout->setAlignCanvasToScales(false);
+
+            d_inZoom = true;
+        }
+    }
+
+    QwtPlotZoomer::rescale();
+    updateScrollBars();
+}
+
+ScrollBar *ScrollZoomer::scrollBar(Qt::Orientation o)
+{
+    ScrollBar *&sb = (o == Qt::Vertical) 
+        ? d_vScrollData->scrollBar : d_hScrollData->scrollBar;
+
+    if ( sb == NULL )
+    {
+        sb = new ScrollBar(o, canvas());
+        sb->hide();
+        connect(sb,
+            SIGNAL(valueChanged(Qt::Orientation, double, double)),
+            SLOT(scrollBarMoved(Qt::Orientation, double, double)));
+    }
+    return sb;
+}
+
+ScrollBar *ScrollZoomer::horizontalScrollBar() const
+{
+    return d_hScrollData->scrollBar;
+}
+
+ScrollBar *ScrollZoomer::verticalScrollBar() const
+{
+    return d_vScrollData->scrollBar;
+}
+    
+#if QT_VERSION < 0x040000
+void ScrollZoomer::setHScrollBarMode(QScrollView::ScrollBarMode mode)
+#else
+void ScrollZoomer::setHScrollBarMode(Qt::ScrollBarPolicy mode)
+#endif
+{
+    if ( hScrollBarMode() != mode )
+    {
+        d_hScrollData->mode = mode;
+        updateScrollBars();
+    }
+}
+
+#if QT_VERSION < 0x040000
+void ScrollZoomer::setVScrollBarMode(QScrollView::ScrollBarMode mode)
+#else
+void ScrollZoomer::setVScrollBarMode(Qt::ScrollBarPolicy mode)
+#endif
+{
+    if ( vScrollBarMode() != mode )
+    {
+        d_vScrollData->mode = mode;
+        updateScrollBars();
+    }
+}
+
+#if QT_VERSION < 0x040000
+QScrollView::ScrollBarMode ScrollZoomer::hScrollBarMode() const
+#else
+Qt::ScrollBarPolicy ScrollZoomer::hScrollBarMode() const
+#endif
+{
+    return d_hScrollData->mode;
+}
+
+#if QT_VERSION < 0x040000
+QScrollView::ScrollBarMode ScrollZoomer::vScrollBarMode() const
+#else
+Qt::ScrollBarPolicy ScrollZoomer::vScrollBarMode() const
+#endif
+{
+    return d_vScrollData->mode;
+}
+
+void ScrollZoomer::setHScrollBarPosition(ScrollBarPosition pos)
+{
+    if ( d_hScrollData->position != pos )
+    {
+        d_hScrollData->position = pos;
+        updateScrollBars();
+    }
+}
+
+void ScrollZoomer::setVScrollBarPosition(ScrollBarPosition pos)
+{
+    if ( d_vScrollData->position != pos )
+    {
+        d_vScrollData->position = pos;
+        updateScrollBars();
+    }
+}
+
+ScrollZoomer::ScrollBarPosition ScrollZoomer::hScrollBarPosition() const
+{
+    return d_hScrollData->position;
+}
+
+ScrollZoomer::ScrollBarPosition ScrollZoomer::vScrollBarPosition() const
+{
+    return d_vScrollData->position;
+}
+
+void ScrollZoomer::setCornerWidget(QWidget *w)
+{
+    if ( w != d_cornerWidget )
+    {
+        if ( canvas() )
+        {
+            delete d_cornerWidget;
+            d_cornerWidget = w;
+            if ( d_cornerWidget->parent() != canvas() )
+            {
+#if QT_VERSION < 0x040000
+                d_cornerWidget->reparent(canvas(), QPoint(0, 0));
+#else
+                d_cornerWidget->setParent(canvas());
+#endif
+            }
+
+            updateScrollBars();
+        }
+    }
+}
+
+QWidget *ScrollZoomer::cornerWidget() const
+{
+    return d_cornerWidget;
+}
+
+bool ScrollZoomer::eventFilter(QObject *o, QEvent *e)
+{
+    if (  o == canvas() )
+    {
+        switch(e->type())
+        {
+            case QEvent::Resize:
+            {
+                const int fw = ((QwtPlotCanvas *)canvas())->frameWidth();
+
+                QRect rect;
+                rect.setSize(((QResizeEvent *)e)->size());
+                rect.setRect(rect.x() + fw, rect.y() + fw,
+                    rect.width() - 2 * fw, rect.height() - 2 * fw);
+
+                layoutScrollBars(rect);
+                break;
+            }
+            case QEvent::ChildRemoved:
+            {
+                const QObject *child = ((QChildEvent *)e)->child();
+                if ( child == d_cornerWidget )
+                    d_cornerWidget = NULL;
+                else if ( child == d_hScrollData->scrollBar )
+                    d_hScrollData->scrollBar = NULL;
+                else if ( child == d_vScrollData->scrollBar )
+                    d_vScrollData->scrollBar = NULL;
+                break;
+            }
+            default:
+                break;
+        }
+    }
+    return QwtPlotZoomer::eventFilter(o, e);
+}
+
+bool ScrollZoomer::needScrollBar(Qt::Orientation o) const
+{
+#if QT_VERSION < 0x040000
+    QScrollView::ScrollBarMode mode;
+#else
+    Qt::ScrollBarPolicy mode;
+#endif
+    double zoomMin, zoomMax, baseMin, baseMax;
+
+    if ( o == Qt::Horizontal )
+    {
+        mode = d_hScrollData->mode;
+        baseMin = zoomBase().left();
+        baseMax = zoomBase().right();
+        zoomMin = zoomRect().left();
+        zoomMax = zoomRect().right();
+    }
+    else
+    {
+        mode = d_vScrollData->mode;
+        baseMin = zoomBase().top();
+        baseMax = zoomBase().bottom();
+        zoomMin = zoomRect().top();
+        zoomMax = zoomRect().bottom();
+    }
+
+    bool needed = false;
+    switch(mode)
+    {
+#if QT_VERSION < 0x040000
+        case QScrollView::AlwaysOn:
+#else
+        case Qt::ScrollBarAlwaysOn:
+#endif
+            needed = true;
+            break;
+#if QT_VERSION < 0x040000
+        case QScrollView::AlwaysOff:    
+#else
+        case Qt::ScrollBarAlwaysOff:
+#endif
+            needed = false;
+            break;
+        default:
+        {
+            if ( baseMin < zoomMin || baseMax > zoomMax )
+                needed = true;
+            break;
+        }
+    }
+    return needed;
+}
+
+void ScrollZoomer::updateScrollBars()
+{
+    if ( !canvas() )
+        return;
+
+    const int xAxis = QwtPlotZoomer::xAxis();
+    const int yAxis = QwtPlotZoomer::yAxis();
+
+    int xScrollBarAxis = xAxis;
+    if ( hScrollBarPosition() == OppositeToScale )
+        xScrollBarAxis = oppositeAxis(xScrollBarAxis);
+
+    int yScrollBarAxis = yAxis;
+    if ( vScrollBarPosition() == OppositeToScale ) 
+        yScrollBarAxis = oppositeAxis(yScrollBarAxis); 
+
+
+    QwtPlotLayout *layout = plot()->plotLayout();
+
+    bool showHScrollBar = needScrollBar(Qt::Horizontal);
+    if ( showHScrollBar )
+    {
+        ScrollBar *sb = scrollBar(Qt::Horizontal);
+
+        sb->setPalette(plot()->palette());
+
+        const QwtScaleDiv *sd = plot()->axisScaleDiv(xAxis);
+        sb->setInverted(sd->lowerBound() > sd->upperBound() );
+
+        sb->setBase(zoomBase().left(), zoomBase().right());
+        sb->moveSlider(zoomRect().left(), zoomRect().right());
+
+        if ( !sb->isVisibleTo(canvas()) )
+        {
+            sb->show();
+            layout->setCanvasMargin(layout->canvasMargin(xScrollBarAxis) 
+                + sb->extent(), xScrollBarAxis);
+        }
+    }
+    else
+    {
+        if ( horizontalScrollBar() )
+        {
+            horizontalScrollBar()->hide();
+            layout->setCanvasMargin(layout->canvasMargin(xScrollBarAxis) 
+                - horizontalScrollBar()->extent(), xScrollBarAxis);
+        }
+    }
+
+    bool showVScrollBar = needScrollBar(Qt::Vertical);
+    if ( showVScrollBar )
+    {
+        ScrollBar *sb = scrollBar(Qt::Vertical);
+
+        sb->setPalette(plot()->palette());
+
+        const QwtScaleDiv *sd = plot()->axisScaleDiv(yAxis);
+        sb->setInverted(sd->lowerBound() < sd->upperBound() );
+
+        sb->setBase(zoomBase().top(), zoomBase().bottom());
+        sb->moveSlider(zoomRect().top(), zoomRect().bottom());
+
+        if ( !sb->isVisibleTo(canvas()) )
+        {
+            sb->show();
+            layout->setCanvasMargin(layout->canvasMargin(yScrollBarAxis) 
+                + sb->extent(), yScrollBarAxis);
+        }
+    }
+    else
+    {
+        if ( verticalScrollBar() )
+        {
+            verticalScrollBar()->hide();
+            layout->setCanvasMargin(layout->canvasMargin(yScrollBarAxis) 
+                - verticalScrollBar()->extent(), yScrollBarAxis);
+        }
+    }
+
+    if ( showHScrollBar && showVScrollBar )
+    {
+        if ( d_cornerWidget == NULL )
+        {
+            d_cornerWidget = new QWidget(canvas());
+#if QT_VERSION >= 0x040100
+            d_cornerWidget->setAutoFillBackground(true);
+#endif
+            d_cornerWidget->setPalette(plot()->palette());
+        }
+        d_cornerWidget->show();
+    }
+    else
+    {
+        if ( d_cornerWidget )
+            d_cornerWidget->hide();
+    }
+
+    layoutScrollBars(((QwtPlotCanvas *)canvas())->contentsRect());
+    plot()->updateLayout();
+}
+
+void ScrollZoomer::layoutScrollBars(const QRect &rect)
+{
+    int hPos = xAxis();
+    if ( hScrollBarPosition() == OppositeToScale )
+        hPos = oppositeAxis(hPos);
+
+    int vPos = yAxis();
+    if ( vScrollBarPosition() == OppositeToScale )
+        vPos = oppositeAxis(vPos);
+
+    ScrollBar *hScrollBar = horizontalScrollBar();
+    ScrollBar *vScrollBar = verticalScrollBar();
+
+    const int hdim = hScrollBar ? hScrollBar->extent() : 0;
+    const int vdim = vScrollBar ? vScrollBar->extent() : 0;
+    
+    if ( hScrollBar && hScrollBar->isVisible() )
+    {
+        int x = rect.x();
+        int y = (hPos == QwtPlot::xTop) 
+            ? rect.top() : rect.bottom() - hdim + 1;
+        int w = rect.width();
+
+        if ( vScrollBar && vScrollBar->isVisible() )
+        {
+            if ( vPos == QwtPlot::yLeft )
+                x += vdim;
+            w -= vdim;
+        }
+
+        hScrollBar->setGeometry(x, y, w, hdim);
+    }
+    if ( vScrollBar && vScrollBar->isVisible() )
+    {
+        int pos = yAxis();
+        if ( vScrollBarPosition() == OppositeToScale )
+            pos = oppositeAxis(pos);
+
+        int x = (vPos == QwtPlot::yLeft)
+            ? rect.left() : rect.right() - vdim + 1;
+        int y = rect.y();
+
+        int h = rect.height();
+
+        if ( hScrollBar && hScrollBar->isVisible() )
+        {
+            if ( hPos == QwtPlot::xTop )
+                y += hdim;
+                
+            h -= hdim;
+        }
+
+        vScrollBar->setGeometry(x, y, vdim, h);
+    }
+    if ( hScrollBar && hScrollBar->isVisible() &&
+        vScrollBar && vScrollBar->isVisible() )
+    {
+        if ( d_cornerWidget )
+        {
+            QRect cornerRect(
+                vScrollBar->pos().x(), hScrollBar->pos().y(),
+                vdim, hdim);
+            d_cornerWidget->setGeometry(cornerRect);
+        }
+    }
+}
+
+void ScrollZoomer::scrollBarMoved(Qt::Orientation o, double min, double)
+{
+    if ( o == Qt::Horizontal )
+        move(min, zoomRect().top());
+    else
+        move(zoomRect().left(), min);
+
+    emit zoomed(zoomRect());
+}
+
+int ScrollZoomer::oppositeAxis(int axis) const
+{
+    switch(axis)
+    {
+        case QwtPlot::xBottom:
+            return QwtPlot::xTop;
+        case QwtPlot::xTop:
+            return QwtPlot::xBottom;
+        case QwtPlot::yLeft:
+            return QwtPlot::yRight;
+        case QwtPlot::yRight:
+            return QwtPlot::yLeft;
+        default:
+            break;
+    }
+
+    return axis;
+}
Index: src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollZoomer.hpp
===================================================================
--- src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollZoomer.hpp	(revision 35302b57b5c489d9535c30527e3c33675ec2acb6)
+++ src/UIElements/Views/Qt4/Plotting/QScrollZoomer/ScrollZoomer.hpp	(revision 35302b57b5c489d9535c30527e3c33675ec2acb6)
@@ -0,0 +1,89 @@
+/*
+ * QSeisScrollzoomer.h
+ *
+ *  taken from "realtime"-example
+ *
+ */
+
+#ifndef _SCROLLZOOMER_HPP
+#define _SCROLLZOOMER_HPP
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qglobal.h>
+#if QT_VERSION < 0x040000
+#include <qscrollview.h>
+#endif
+#include <qwt_plot_zoomer.h>
+
+class ScrollData;
+class ScrollBar;
+
+class ScrollZoomer: public QwtPlotZoomer
+{
+    Q_OBJECT
+public:
+    enum ScrollBarPosition
+    {
+        AttachedToScale,
+        OppositeToScale
+    };
+
+    ScrollZoomer(QwtPlotCanvas *);
+    virtual ~ScrollZoomer();
+
+    ScrollBar *horizontalScrollBar() const;
+    ScrollBar *verticalScrollBar() const;
+
+#if QT_VERSION < 0x040000
+    void setHScrollBarMode(QScrollView::ScrollBarMode);
+    void setVScrollBarMode(QScrollView::ScrollBarMode);
+
+    QScrollView::ScrollBarMode vScrollBarMode () const;
+    QScrollView::ScrollBarMode hScrollBarMode () const;
+#else
+    void setHScrollBarMode(Qt::ScrollBarPolicy);
+    void setVScrollBarMode(Qt::ScrollBarPolicy);
+
+    Qt::ScrollBarPolicy vScrollBarMode () const;
+    Qt::ScrollBarPolicy hScrollBarMode () const;
+#endif
+
+    void setHScrollBarPosition(ScrollBarPosition);
+    void setVScrollBarPosition(ScrollBarPosition);
+
+    ScrollBarPosition hScrollBarPosition() const;
+    ScrollBarPosition vScrollBarPosition() const;
+
+    QWidget* cornerWidget() const;
+    virtual void setCornerWidget(QWidget *); 
+    
+    virtual bool eventFilter(QObject *, QEvent *);
+
+    virtual void rescale();
+
+protected:
+    virtual ScrollBar *scrollBar(Qt::Orientation);
+    virtual void updateScrollBars();
+    virtual void layoutScrollBars(const QRect &);
+
+private slots:
+    void scrollBarMoved(Qt::Orientation o, double min, double max);
+
+private:
+    bool needScrollBar(Qt::Orientation) const;
+    int oppositeAxis(int) const;
+
+    QWidget *d_cornerWidget;
+
+    ScrollData *d_hScrollData;
+    ScrollData *d_vScrollData;
+
+    bool d_inZoom;
+    bool d_alignCanvasToScales;
+};
+            
+#endif // _SCROLLZOOMER_HPP
