15 #include "OOPDHeaders.h"
17 #include <QGraphicsView>
36 QString _abstractionPath;
41 std::string _signalName;
43 std::string _signalSendName;
44 std::string _signalReceiveName;
57 virtual void paint(QPainter* p,
const QStyleOptionGraphicsItem*, QWidget*)
62 p->setBrush(QBrush());
65 p->setRenderHint(QPainter::HighQualityAntialiasing,
true);
66 p->scale(scale(), scale());
75 p->setPen(QPen(rectColor, 1 + _isAbstraction, (
errorBox()) ? Qt::DashLine : Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
77 QTextOption* op =
new QTextOption;
78 op->setAlignment(Qt::AlignLeft);
79 p->setPen(QPen(QColor(0, 0, 0), 1, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
85 p->setPen(QPen(QColor(0, 192, 255), 1, (
errorBox()) ? Qt::DashLine : Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
97 if (ev->button() == Qt::RightButton) {
100 && !scene()->views().isEmpty()
101 && scene()->views().first()
102 && scene()->views().first()->viewport()) {
104 QGraphicsView* v = scene()->views().first();
105 QPoint pos = v->viewport()->mapToGlobal(ev->pos().toPoint());
155 if (event->buttons() & Qt::LeftButton) {
161 setCursor(QCursor(Qt::PointingHandCursor));
163 setCursor(QCursor(Qt::ArrowCursor));
float height()
Definition: UIItem.h:43
void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
mouse up
Definition: UISignal.h:144
Property * get(QString pName)
Definition: PropertyList.cpp:22
QColor asQColor()
Definition: Property.cpp:229
void mousePressEvent(QGraphicsSceneMouseEvent *ev)
mouse down
Definition: UISignal.h:94
float width()
Definition: UIItem.h:42
gui object: oop signal box (pdsignal~)
Definition: UISignal.h:29
QPoint dragOffset
Definition: UIItem.h:31
QString toQString()
sets object text data
Definition: UIObject.cpp:509
#define t_canvas
Definition: m_pd.h:205
QColor bgColor()
Definition: UIItem.h:49
PropertyList * properties()
>init properties for the class - called from constructor
Definition: UIObject.cpp:215
UIObjectData * objectData()
Definition: UIObject.cpp:101
Definition: CommonTypes.h:14
#define PREF_QSTRING(x)
Definition: Preferences.h:17
void moveBox(UIItem *box, QGraphicsSceneMouseEvent *event)
virtual void paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
paint event
Definition: UISignal.h:57
void showPopupMenu(QPoint pos)
createContextMenu
Definition: UIObject.cpp:243
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 setPdMessage(QString message)
Definition: UISignal.h:167
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
mouse move
Definition: UISignal.h:153
void signalEditObject(void *box)
basic update - calls update() probably remove later
UISignal()
Definition: UISignal.cpp:11
bool errorBox()
Definition: UIObject.cpp:522
OOPD class structure.
Definition: OPClass.h:38
void selectBox(UIItem *box, QGraphicsSceneMouseEvent *event)
bool isSelected()
deselect object
Definition: UIItem.cpp:40
The OOPD class instance.
Definition: OPInstance.h:44
Definition: UIObject.h:44
static UIObject * createObject(QString asQString, t_canvas *pdCanvas, QGraphicsView *parent=0)
Definition: UISignal.cpp:25
static void updateUI(void *uiobj, PdArguments msg)
Definition: UISignal.h:189