12#include <QtWidgets/qgraphicsitem.h>
13#include <QtWidgets/qgraphicslayoutitem.h>
32 virtual void paintCustomItem(QPainter* _painter,
const QStyleOptionGraphicsItem* _opt, QWidget* _widget,
const QRectF& _rect) = 0;
41 virtual void prepareGraphicsItemGeometryChange(
void)
override;
42 virtual void callPaint(QPainter* _painter,
const QStyleOptionGraphicsItem* _opt, QWidget* _widget)
override;
46 virtual QSizeF graphicsItemSizeHint(Qt::SizeHint _hint,
const QSizeF& _constrains)
const override;
52 virtual QSizeF sizeHint(Qt::SizeHint _hint,
const QSizeF& _constrains)
const override;
53 virtual void setGeometry(
const QRectF& _rect)
override;
59 virtual QRectF boundingRect(
void)
const override;
60 virtual void paint(QPainter* _painter,
const QStyleOptionGraphicsItem* _opt, QWidget* _widget)
override;
61 virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange _change,
const QVariant& _value)
override;
62 virtual void mousePressEvent(QGraphicsSceneMouseEvent* _event)
override;
63 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* _event)
override;
64 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* _event)
override;
65 virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* _event)
override;
66 virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* _event)
override;
69 virtual void graphicsElementStateChanged(
const GraphicsElementStateFlags& _state)
override;
70 void updateItemGeometry(
void);
73 QSizeF m_customItemSize;
#define OT_DECL_NODEFAULT(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:22
Definition CustomGraphicsItem.h:17
virtual void paintCustomItem(QPainter *_painter, const QStyleOptionGraphicsItem *_opt, QWidget *_widget, const QRectF &_rect)=0
Paint the item inside the provided rect.
virtual QGraphicsLayoutItem * getQGraphicsLayoutItem(void) override
Returns the QGraphicsLayoutItem.
Definition CustomGraphicsItem.h:43
virtual QSizeF getPreferredGraphicsItemSize(void) const =0
virtual QGraphicsItem * getQGraphicsItem(void) override
Returns the QGraphicsItem.
Definition CustomGraphicsItem.h:44
virtual const QGraphicsItem * getQGraphicsItem(void) const override
Returns the const QGraphicsItem.
Definition CustomGraphicsItem.h:45
The GraphicsItemCfg is the base class for all graphics item configurations.
Definition GraphicsItemCfg.h:33
Base class for all OpenTwin GraphicsItems GraphicsItems should be created by the GraphicsFactory and ...
Definition GraphicsItem.h:35