comparison widgets/Thumbwheel.h @ 187:e7cf6044c2a0

* better icon * support range mappers in thumbwheel * supply range mapper for vertical zoom from spectrogram * fix bug in fftmodel for scaled ffts * make the various widgets all respond to double-click for edit, middle-click for reset, ctrl-left-click for reset
author Chris Cannam
date Fri, 12 Jan 2007 14:49:18 +0000
parents 42118892f428
children 5b7472db612b
comparison
equal deleted inserted replaced
186:8dd247c4c5f1 187:e7cf6044c2a0
15 15
16 #ifndef _THUMBWHEEL_H_ 16 #ifndef _THUMBWHEEL_H_
17 #define _THUMBWHEEL_H_ 17 #define _THUMBWHEEL_H_
18 18
19 #include <QWidget> 19 #include <QWidget>
20
21 class RangeMapper;
20 22
21 class Thumbwheel : public QWidget 23 class Thumbwheel : public QWidget
22 { 24 {
23 Q_OBJECT 25 Q_OBJECT
24 26
39 virtual void mouseMoveEvent(QMouseEvent *e); 41 virtual void mouseMoveEvent(QMouseEvent *e);
40 virtual void mouseReleaseEvent(QMouseEvent *e); 42 virtual void mouseReleaseEvent(QMouseEvent *e);
41 virtual void wheelEvent(QWheelEvent *e); 43 virtual void wheelEvent(QWheelEvent *e);
42 virtual void paintEvent(QPaintEvent *e); 44 virtual void paintEvent(QPaintEvent *e);
43 45
46 void setRangeMapper(RangeMapper *mapper); // I take ownership, will delete
47 const RangeMapper *getRangeMapper() const { return m_rangeMapper; }
48 float getMappedValue() const;
49
50 void setShowToolTip(bool show);
51
44 QSize sizeHint() const; 52 QSize sizeHint() const;
45 53
46 signals: 54 signals:
47 void valueChanged(int); 55 void valueChanged(int);
48 56
52 void setDefaultValue(int deft); 60 void setDefaultValue(int deft);
53 void setSpeed(float speed); 61 void setSpeed(float speed);
54 void setTracking(bool tracking); 62 void setTracking(bool tracking);
55 void setShowScale(bool show); 63 void setShowScale(bool show);
56 void setValue(int value); 64 void setValue(int value);
65 void setMappedValue(float mappedValue);
57 void resetToDefault(); 66 void resetToDefault();
67
68 protected slots:
69 void updateMappedValue(int value);
58 70
59 private: 71 private:
60 int m_min; 72 int m_min;
61 int m_max; 73 int m_max;
62 int m_default; 74 int m_default;
63 int m_value; 75 int m_value;
76 float m_mappedValue;
77 bool m_noMappedUpdate;
64 float m_rotation; 78 float m_rotation;
65 Qt::Orientation m_orientation; 79 Qt::Orientation m_orientation;
66 float m_speed; 80 float m_speed;
67 bool m_tracking; 81 bool m_tracking;
68 bool m_showScale; 82 bool m_showScale;
69 bool m_clicked; 83 bool m_clicked;
70 bool m_atDefault; 84 bool m_atDefault;
71 QPoint m_clickPos; 85 QPoint m_clickPos;
72 float m_clickRotation; 86 float m_clickRotation;
87 bool m_showTooltip;
88 RangeMapper *m_rangeMapper;
73 }; 89 };
74 90
75 #endif 91 #endif