MuseScore  3.4
Music composition and notation
slider.h
Go to the documentation of this file.
1 //=============================================================================
2 // Awl
3 // Audio Widget Library
4 //
5 // Copyright (C) 2002-2006 by Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __AWLSLIDER_H__
21 #define __AWLSLIDER_H__
22 
23 #include "aslider.h"
24 
25 namespace Awl {
26 
27 //---------------------------------------------------------
28 // Slider
29 //
31 //
34 //---------------------------------------------------------
35 
36 class Slider : public AbstractSlider {
37  Q_OBJECT
38 
39  Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
40  Q_PROPERTY(QSize sliderSize READ sliderSize WRITE setSliderSize)
41 
42  Qt::Orientation orient;
43  QSize _sliderSize;
44 
45  QPoint startDrag;
46  bool dragMode;
47  int dragppos;
48 
49  virtual void mouseReleaseEvent(QMouseEvent*);
50  virtual void mouseMoveEvent(QMouseEvent*);
51  virtual void paintEvent(QPaintEvent*);
52  void init();
53  void updateKnob();
54 
55  protected:
56  QPainterPath* points;
57  virtual void mousePressEvent(QMouseEvent*);
58 
59  signals:
60  void sliderPressed(int);
61  void sliderReleased(int);
62 
63  public:
64  Slider(QWidget* parent = 0);
65  Slider(Qt::Orientation orientation, QWidget* parent = 0);
66  ~Slider();
67 
68  virtual void setOrientation(Qt::Orientation);
69  Qt::Orientation orientation() const { return orient; }
70 
71  QSize sliderSize() const { return _sliderSize; }
72  void setSliderSize(const QSize& s);
73 
74  virtual void setInvertedAppearance(bool val);
75  virtual QSize sizeHint() const;
76  };
77 }
78 
79 #endif
80 
virtual void paintEvent(QPaintEvent *)
Definition: slider.cpp:196
virtual QSize sizeHint() const
Definition: slider.cpp:63
QSize sliderSize() const
Definition: slider.h:71
void updateKnob()
Definition: slider.cpp:94
int dragppos
Definition: slider.h:47
bool dragMode
Definition: slider.h:46
Qt::Orientation orient
Definition: slider.h:42
void sliderPressed(int)
QPainterPath * points
Definition: slider.h:56
Base class of all slider type input widgets.
Definition: slider.h:36
virtual void mouseReleaseEvent(QMouseEvent *)
Definition: slider.cpp:157
virtual void setInvertedAppearance(bool val)
Definition: slider.cpp:120
void init()
Definition: slider.cpp:48
Qt::Orientation orientation() const
Definition: slider.h:69
QPoint startDrag
Definition: slider.h:45
The AwlAbstractSlider class provides an double value within a range.
Definition: aslider.h:39
virtual void mouseMoveEvent(QMouseEvent *)
Definition: slider.cpp:169
virtual void mousePressEvent(QMouseEvent *)
Definition: slider.cpp:140
void sliderReleased(int)
Definition: aslider.cpp:23
void setSliderSize(const QSize &s)
Definition: slider.cpp:130
virtual void setOrientation(Qt::Orientation)
Definition: slider.cpp:83
QSize _sliderSize
Definition: slider.h:43