tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Port.h
Go to the documentation of this file.
1 // (c) 2017 Alex Nadzharov
2 // License: GPL3
3 
4 #ifndef CM_PORTG_H
5 #define CM_PORTG_H
6 
7 #include <QGraphicsSceneMouseEvent>
8 #include <QWidget>
9 #include <QtGui>
10 
11 #include "UIItem.h"
12 
13 namespace tilde {
14 
18 class Port : public UIItem {
19  Q_OBJECT
20 
21 private:
22  UIPortType _portType;
23  int _portClass;
24  int _portIndex;
25 
26 public:
27  explicit Port(UIItem* parent = 0);
28 
29  UIPortType portType() { return _portType; }
30  void setPortType(UIPortType pt) { _portType = pt; }
31 
32  int portClass() { return _portClass; }
33  void setPortClass(int pc) { _portClass = pc; }
34 
35  int portIndex() { return _portIndex; }
36  void setPortIndex(int pi) { _portIndex = pi; }
37 
38  void paint(QPainter* p, const QStyleOptionGraphicsItem*, QWidget*);
39 
40  virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* ev);
41  virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* ev);
42 
43  void mousePressEvent(QGraphicsSceneMouseEvent* ev);
44  void mouseReleaseEvent(QGraphicsSceneMouseEvent* ev);
45 
46 public slots:
47 };
48 }
49 
50 #endif // CM_PORT_H
int portIndex()
Definition: Port.h:35
int portClass()
Definition: Port.h:32
void mouseReleaseEvent(QGraphicsSceneMouseEvent *ev)
Definition: Port.cpp:68
void setPortType(UIPortType pt)
Definition: Port.h:30
UIItem QGraphicsObject class.
Definition: UIItem.h:15
void setPortIndex(int pi)
Definition: Port.h:36
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *ev)
Definition: Port.cpp:39
void paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
Definition: Port.cpp:17
UIPortType portType()
Definition: Port.h:29
UIPortType
port type - in or out
Definition: CommonTypes.h:21
Port(UIItem *parent=0)
Definition: Port.cpp:7
Port QGraphicsItem class.
Definition: Port.h:18
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *ev)
Definition: Port.cpp:48
void setPortClass(int pc)
Definition: Port.h:33
void mousePressEvent(QGraphicsSceneMouseEvent *ev)
Definition: Port.cpp:57