tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UISlider.h
Go to the documentation of this file.
1 // (c) 2017 Alex Nadzharov
2 // License: GPL3
3 
4 #ifndef CMO_SLIDER_H
5 #define CMO_SLIDER_H
6 
7 #include <qlineedit.h>
8 
9 #include "Port.h"
10 #include "UIObject.h"
11 
12 #include <QGraphicsView>
13 
14 namespace tilde {
15 
19 class UISlider : public UIObject {
20  Q_OBJECT
21 
22 private:
23  bool _clicked;
24  float _value;
25  float _isHorizontal;
26 
27  void initProperties();
28  float valueFromPoint(QPoint pos);
29 
30 public:
31  explicit UISlider();
32 
33  static UIObject* createObj(QString data);
34 
35  virtual void paint(QPainter* p, const QStyleOptionGraphicsItem* option, QWidget*);
36 
37  // ---------------------------------------------------------------
38 
39  void mousePressEvent(QGraphicsSceneMouseEvent* ev);
40  void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
41  void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
42 
43  // -------
44 
45  void setPdMessage(QString message);
46 
47  void updateUI(t_cpd_list* msg);
48 
49  void resizeEvent();
50 };
51 }
52 
53 #endif // CMO_MSG_H
virtual void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *)
UIObject properties
Definition: UISlider.cpp:53
UISlider()
Definition: UISlider.cpp:14
void updateUI(t_cpd_list *msg)
Definition: UISlider.cpp:201
static UIObject * createObj(QString data)
Definition: UISlider.cpp:30
void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
Definition: UISlider.cpp:155
gui object: slider (ui.slider)
Definition: UISlider.h:19
void setPdMessage(QString message)
Definition: UISlider.cpp:196
void mousePressEvent(QGraphicsSceneMouseEvent *ev)
Definition: UISlider.cpp:107
Definition: UIObject.h:44
void resizeEvent()
Definition: UISlider.cpp:222
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: UISlider.cpp:157