RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
scrollzoomer.h
Go to the documentation of this file.
1 #ifndef _SCROLLZOOMER_H
2 #define _SCROLLZOOMER_H
3 
4 #include <qglobal.h>
5 #include <qwt_plot.h>
6 #include <qwt_plot_zoomer.h>
7 
8 class ScrollData;
9 class ScrollBar;
10 
11 class ScrollZoomer : public QwtPlotZoomer
12 {
13  Q_OBJECT
14 public:
16  {
19  };
20 
21  ScrollZoomer(QWidget*);
22  virtual ~ScrollZoomer();
23 
26 
27  void setHScrollBarMode(Qt::ScrollBarPolicy);
28  void setVScrollBarMode(Qt::ScrollBarPolicy);
29 
30  Qt::ScrollBarPolicy vScrollBarMode() const;
31  Qt::ScrollBarPolicy hScrollBarMode() const;
32 
35 
38 
39  QWidget* cornerWidget() const;
40  virtual void setCornerWidget(QWidget*);
41 
42  virtual bool eventFilter(QObject*, QEvent*);
43 
44  virtual void rescale();
45 
46 protected:
47  virtual ScrollBar* scrollBar(Qt::Orientation);
48  virtual void updateScrollBars();
49  virtual void layoutScrollBars(const QRect&);
50 
51 private Q_SLOTS:
52  void scrollBarMoved(Qt::Orientation o, double min, double max);
53 
54 private:
55  bool needScrollBar(Qt::Orientation) const;
56  int oppositeAxis(int) const;
57 
58  QWidget* d_cornerWidget;
59 
62 
63  bool d_inZoom;
64  bool d_alignCanvasToScales[QwtPlot::axisCnt];
65 };
66 
67 #endif
QWidget * d_cornerWidget
Definition: scrollzoomer.h:58
Qt::ScrollBarPolicy hScrollBarMode() const
void setVScrollBarPosition(ScrollBarPosition)
int oppositeAxis(int) const
ScrollData * d_vScrollData
Definition: scrollzoomer.h:61
virtual void setCornerWidget(QWidget *)
Qt::ScrollBarPolicy vScrollBarMode() const
virtual void layoutScrollBars(const QRect &)
ScrollBarPosition vScrollBarPosition() const
void setHScrollBarMode(Qt::ScrollBarPolicy)
QWidget * cornerWidget() const
virtual bool eventFilter(QObject *, QEvent *)
bool d_alignCanvasToScales[QwtPlot::axisCnt]
Definition: scrollzoomer.h:64
virtual void rescale()
void setVScrollBarMode(Qt::ScrollBarPolicy)
virtual void updateScrollBars()
ScrollBar * verticalScrollBar() const
ScrollData * d_hScrollData
Definition: scrollzoomer.h:60
ScrollBarPosition hScrollBarPosition() const
ScrollZoomer(QWidget *)
bool needScrollBar(Qt::Orientation) const
void setHScrollBarPosition(ScrollBarPosition)
virtual ~ScrollZoomer()
ScrollBar * horizontalScrollBar() const
void scrollBarMoved(Qt::Orientation o, double min, double max)
virtual ScrollBar * scrollBar(Qt::Orientation)