8 #include <QGraphicsObject>
15 class UIItem :
public QGraphicsObject {
33 explicit UIItem(QGraphicsObject* parent = 0);
36 void setSize(
float w,
float h) { _size = QSize(w, h); }
42 float width() {
return _size.width(); }
43 float height() {
return _size.height(); }
47 QSize
size() {
return _size; }
71 QRectF
boundingRect()
const {
return QRectF(0, 0, _size.width(), _size.height()); }
72 QPainterPath
shape()
const;
74 virtual void move(
float x,
float y);
75 virtual void move(QPoint pos);
76 virtual void move(QPointF pos);
78 void paint(QPainter*,
const QStyleOptionGraphicsItem*, QWidget*){};
virtual void resizeEvent()
Definition: UIItem.h:80
float height()
Definition: UIItem.h:43
void setHeight(float h)
Definition: UIItem.h:38
void setHover(bool h)
Definition: UIItem.h:53
void mouseEntered(UIItem *obj, QGraphicsSceneHoverEvent *ev)
void setSize(float w, float h)
Definition: UIItem.h:36
float width()
Definition: UIItem.h:42
void mousePressed(UIItem *obj, QGraphicsSceneMouseEvent *ev)
UIItem(QGraphicsObject *parent=0)
Definition: UIItem.cpp:10
QPoint dragOffset
Definition: UIItem.h:31
virtual void move(float x, float y)
Definition: UIItem.cpp:67
UIItem QGraphicsObject class.
Definition: UIItem.h:15
QColor bgColor()
Definition: UIItem.h:49
void moveBox(UIItem *box, QGraphicsSceneMouseEvent *event)
void setMinHeight(float h)
Definition: UIItem.h:40
QRectF boundingRect() const
get edit mode flag value
Definition: UIItem.h:71
t_editMode getEditMode()
get edit mode pointer - for inlets/outlets
Definition: UIItem.cpp:54
void setMinWidth(float w)
Definition: UIItem.h:39
float minHeight()
Definition: UIItem.h:45
void deselect()
select object
Definition: UIItem.cpp:35
void setBgColor(QColor bgc)
Definition: UIItem.h:50
virtual void setEditModeRef(t_editMode *canvasEditModeRef)
get object's selected flag
Definition: UIItem.cpp:42
float minWidth()
Definition: UIItem.h:44
void mouseLeaved(UIItem *obj, QGraphicsSceneHoverEvent *ev)
QPainterPath shape() const
Definition: UIItem.cpp:60
void mouseReleased(UIItem *obj, QGraphicsSceneMouseEvent *ev)
void select()
Definition: UIItem.cpp:30
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
Definition: UIItem.h:78
t_editMode
edit mode types
Definition: CommonTypes.h:13
void selectBox(UIItem *box, QGraphicsSceneMouseEvent *event)
QSize size()
Definition: UIItem.h:47
bool isSelected()
deselect object
Definition: UIItem.cpp:40
virtual t_editMode * getEditModeRef()
Definition: UIItem.cpp:49
void setSize(QSize size)
Definition: UIItem.h:35
bool hover()
Definition: UIItem.h:52
void setWidth(float w)
Definition: UIItem.h:37