16 #include "OOPDHeaders.h"
18 #include <QGraphicsView>
40 QString _abstractionPath;
45 std::string _methodName;
56 virtual void paint(QPainter* p,
const QStyleOptionGraphicsItem*, QWidget*)
61 p->setBrush(QBrush());
64 p->setRenderHint(QPainter::HighQualityAntialiasing,
true);
65 p->scale(scale(), scale());
69 p->setPen(QPen(QColor(192, 192, 192), 1, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
74 p->setPen(QPen(rectColor, 1 + _isAbstraction, (
errorBox()) ? Qt::DashLine : Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
76 QTextOption* op =
new QTextOption;
77 op->setAlignment(Qt::AlignLeft);
78 p->setPen(QPen(QColor(0, 0, 0), 1, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
84 p->setPen(QPen(QColor(0, 192, 255), 1, (
errorBox()) ? Qt::DashLine : Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
96 if (ev->button() == Qt::RightButton) {
99 && !scene()->views().isEmpty()
100 && scene()->views().first()
101 && scene()->views().first()->viewport()) {
103 QGraphicsView* v = scene()->views().first();
104 QPoint pos = v->viewport()->mapToGlobal(ev->pos().toPoint());
154 if (event->buttons() & Qt::LeftButton) {
160 setCursor(QCursor(Qt::PointingHandCursor));
162 setCursor(QCursor(Qt::ArrowCursor));
float height()
Definition: UIItem.h:43
Property * get(QString pName)
Definition: PropertyList.cpp:22
QColor asQColor()
Definition: Property.cpp:229
float width()
Definition: UIItem.h:42
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)
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
PatchWindowController * subpatchController()
Definition: UIBox.h:72
void setPdMessage(QString message)
Definition: UIMethod.h:166
static UIObject * createObject(QString asQString, t_canvas *pdCanvas, QGraphicsView *parent=0)
Definition: UIMethod.cpp:22
void signalEditObject(void *box)
basic update - calls update() probably remove later
void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
mouse up
Definition: UIMethod.h:143
bool errorBox()
Definition: UIObject.cpp:522
static void updateUI(void *uiobj, PdArguments msg)
Definition: UIMethod.h:188
OOPD class structure.
Definition: OPClass.h:38
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
mouse move
Definition: UIMethod.h:152
void selectBox(UIItem *box, QGraphicsSceneMouseEvent *event)
virtual void paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
paint event
Definition: UIMethod.h:56
gui object: oop method box (method)
Definition: UIMethod.h:33
bool isSelected()
deselect object
Definition: UIItem.cpp:40
The OOPD class instance.
Definition: OPInstance.h:44
Definition: UIObject.h:44
UIMethod()
Definition: UIMethod.cpp:9
PatchWindow * mainWindow()
Definition: PatchWindowController.cpp:168
void mousePressEvent(QGraphicsSceneMouseEvent *ev)
mouse down
Definition: UIMethod.h:93
gui object: standard object box
Definition: UIBox.h:46