qwt_slider.h
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #ifndef QWT_SLIDER_H
11 #define QWT_SLIDER_H
12 
13 #include "qwt_global.h"
14 #include "qwt_abstract_slider.h"
15 
16 class QwtScaleDraw;
17 
31 {
32  Q_OBJECT
33 
34  Q_ENUMS( ScalePosition BackgroundStyle )
35 
36  Q_PROPERTY( Qt::Orientation orientation
37  READ orientation WRITE setOrientation )
38  Q_PROPERTY( ScalePosition scalePosition READ scalePosition
39  WRITE setScalePosition )
40 
41  Q_PROPERTY( bool trough READ hasTrough WRITE setTrough )
42  Q_PROPERTY( bool groove READ hasGroove WRITE setGroove )
43 
44  Q_PROPERTY( QSize handleSize READ handleSize WRITE setHandleSize )
45  Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
46  Q_PROPERTY( int spacing READ spacing WRITE setSpacing )
47 
48 public:
49 
55  {
58 
61 
63  TrailingScale
64  };
65 
66  explicit QwtSlider( QWidget *parent = NULL );
67  explicit QwtSlider( Qt::Orientation, QWidget *parent = NULL );
68 
69  virtual ~QwtSlider();
70 
71  void setOrientation( Qt::Orientation );
72  Qt::Orientation orientation() const;
73 
74  void setScalePosition( ScalePosition );
75  ScalePosition scalePosition() const;
76 
77  void setTrough( bool );
78  bool hasTrough() const;
79 
80  void setGroove( bool );
81  bool hasGroove() const;
82 
83  void setHandleSize( const QSize & );
84  QSize handleSize() const;
85 
86  void setBorderWidth( int bw );
87  int borderWidth() const;
88 
89  void setSpacing( int );
90  int spacing() const;
91 
92  virtual QSize sizeHint() const;
93  virtual QSize minimumSizeHint() const;
94 
95  void setScaleDraw( QwtScaleDraw * );
96  const QwtScaleDraw *scaleDraw() const;
97 
98  void setUpdateInterval( int );
99  int updateInterval() const;
100 
101 protected:
102  virtual double scrolledTo( const QPoint & ) const;
103  virtual bool isScrollPosition( const QPoint & ) const;
104 
105  virtual void drawSlider ( QPainter *, const QRect & ) const;
106  virtual void drawHandle( QPainter *, const QRect &, int pos ) const;
107 
108  virtual void mousePressEvent( QMouseEvent * );
109  virtual void mouseReleaseEvent( QMouseEvent * );
110  virtual void resizeEvent( QResizeEvent * );
111  virtual void paintEvent ( QPaintEvent * );
112  virtual void changeEvent( QEvent * );
113  virtual void timerEvent( QTimerEvent * );
114 
115  virtual bool event( QEvent * );
116 
117  virtual void scaleChange();
118 
119  QRect sliderRect() const;
120  QRect handleRect() const;
121 
122 private:
123  QwtScaleDraw *scaleDraw();
124 
125  void layoutSlider( bool );
126  void initSlider( Qt::Orientation );
127 
128  class PrivateData;
130 };
131 
132 #endif
#define QWT_EXPORT
Definition: qwt_global.h:38
PrivateData * d_data
Definition: qwt_slider.h:128
virtual void scaleChange()
An abstract base class for slider widgets with a scale.
The slider has no scale.
Definition: qwt_slider.h:57
virtual double scrolledTo(const QPoint &pos) const =0
Determine the value for a new position of the movable part of the slider.
virtual bool isScrollPosition(const QPoint &pos) const =0
Determine what to do when the user presses a mouse button.
The Slider Widget.
Definition: qwt_slider.h:30
virtual void changeEvent(QEvent *)
The scale is right of a vertical or below a horizontal slider.
Definition: qwt_slider.h:60
virtual void mouseReleaseEvent(QMouseEvent *)
A class for drawing scales.
virtual void mousePressEvent(QMouseEvent *)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18