diff options
Diffstat (limited to 'examples/widgets/symbianvibration/vibrationsurface.h')
-rw-r--r-- | examples/widgets/symbianvibration/vibrationsurface.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/widgets/symbianvibration/vibrationsurface.h b/examples/widgets/symbianvibration/vibrationsurface.h new file mode 100644 index 0000000..eee6291 --- /dev/null +++ b/examples/widgets/symbianvibration/vibrationsurface.h @@ -0,0 +1,31 @@ +#ifndef TOUCHAREA_H +#define TOUCHAREA_H + +#include <QWidget> + +class XQVibra; + +//! [0] +class VibrationSurface : public QWidget +{ + Q_OBJECT +public: + explicit VibrationSurface(XQVibra *vibra, QWidget *parent = 0); + +protected: + virtual void mousePressEvent(QMouseEvent *); + virtual void mouseMoveEvent(QMouseEvent *); + virtual void mouseReleaseEvent(QMouseEvent *); + virtual void paintEvent(QPaintEvent *); + +private: + + int getIntensity(int x, int y); + void applyIntensity(int x, int y); + + XQVibra *vibra; + int lastIntensity; +}; +//! [0] + +#endif // TOUCHAREA_H |