tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UIFloat.h
Go to the documentation of this file.
1 // (c) 2017 Alex Nadzharov
2 // License: GPL3
3 
4 #ifndef cmo_float_H
5 #define cmo_float_H
6 
7 #include "Port.h"
8 #include "UIObject.h"
9 
10 #include <QGraphicsView>
11 #include <QLineEdit>
12 
13 //#include "cm_pdlink.h"
14 
15 namespace tilde {
16 
20 class UIFloat : public UIObject {
21  Q_OBJECT
22 
23 private:
24  float _startY;
25 
26 public:
27  explicit UIFloat();
28 
29  static UIObject* createObj(QString);
30 
31  void initProperties();
32 
33  virtual void paint(QPainter* p, const QStyleOptionGraphicsItem* option, QWidget*);
34 
35  void autoResize();
36 
37  // -------
38 
39  void objectPressEvent(QGraphicsSceneMouseEvent* ev);
40  void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
41  void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
42  // -------
43 
44  void updateUI(t_cpd_list* msg);
45  std::string asPdFileString();
46 
47  // -----
48  void sync();
49 };
50 }
51 
52 #endif // cmo_float_H
static UIObject * createObj(QString)
Definition: UIFloat.cpp:33
gui object: float number box (ui.float)
Definition: UIFloat.h:20
virtual void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *)
UIObject properties
Definition: UIFloat.cpp:46
UIFloat()
Definition: UIFloat.cpp:17
void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
Definition: UIFloat.cpp:100
std::string asPdFileString()
call this after setting object data
Definition: UIFloat.cpp:149
void updateUI(t_cpd_list *msg)
Definition: UIFloat.cpp:137
void sync()
Definition: UIFloat.cpp:162
void autoResize()
custom resize event
Definition: UIFloat.cpp:77
void objectPressEvent(QGraphicsSceneMouseEvent *ev)
Definition: UIFloat.cpp:89
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: UIFloat.cpp:104
void initProperties()
Definition: UIFloat.cpp:40
Definition: UIObject.h:44