-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGraphicsSocket.h
More file actions
42 lines (32 loc) · 790 Bytes
/
GraphicsSocket.h
File metadata and controls
42 lines (32 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef GRAPHICSSOCKET_H
#define GRAPHICSSOCKET_H
#include <QGraphicsItem>
#include <QPainter>
class GraphicsNode;
class GraphicsSocket : public QGraphicsItem
{
public:
GraphicsSocket(GraphicsNode *parent);
QRectF boundingRect() const override;
void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) override;
enum { Type = UserType + 2 };
int type() const override {
return Type;
}
int getIndex() { return index; }
void setIndex(int i) {
index = i;
}
int getSocketType() { return socketType; }
void setSocketType(int t) {
socketType = t;
}
GraphicsNode *parent;
private:
qreal radius;
int outlineWidth;
int padding;
int index;
int socketType;
};
#endif // GRAPHICSSOCKET_H