OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GraphicsLayoutItemWrapper.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10
11// Qt header
12#include <QtWidgets/qgraphicswidget.h>
13
14namespace ot {
15
16 class GraphicsLayoutItem;
17
18 class OT_WIDGETS_API_EXPORT GraphicsLayoutItemWrapper : public QGraphicsWidget, public ot::GraphicsItem {
19 public:
22
23 virtual void prepareGraphicsItemGeometryChange(void) override;
24
25 virtual void mousePressEvent(QGraphicsSceneMouseEvent* _event) override;
26 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* _event) override;
27 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* _event) override;
28 virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* _event) override;
29 virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* _event) override;
30
31 virtual QRectF boundingRect(void) const override;
32
33 virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange _change, const QVariant& _value) override;
34
35 virtual void callPaint(QPainter* _painter, const QStyleOptionGraphicsItem* _opt, QWidget* _widget) override;
36
37 virtual void paint(QPainter* _painter, const QStyleOptionGraphicsItem* _opt, QWidget* _widget) override;
38
39 virtual QGraphicsLayoutItem* getQGraphicsLayoutItem(void) override { return this; };
40 virtual QGraphicsItem* getQGraphicsItem(void) override { return this; };
41 virtual const QGraphicsItem* getQGraphicsItem(void) const override { return this; };
42
43 virtual QSizeF graphicsItemSizeHint(Qt::SizeHint _hint, const QSizeF& _constrains) const override;
44
45 virtual void removeAllConnections(void) override;
46
47 virtual void finalizeGraphicsItem(void) override;
48
49 virtual void setGraphicsItemRequestedSize(const QSizeF& _size) override;
50
52 virtual double getMaxAdditionalTriggerDistance(void) const override;
53
54 virtual std::list<GraphicsElement*> getAllGraphicsElements(void) override;
55
56 virtual std::list<GraphicsElement*> getAllDirectChildElements(void) override;
57
58 private:
59 GraphicsLayoutItem* m_owner;
60
63 GraphicsLayoutItemWrapper& operator = (const GraphicsLayoutItemWrapper&) = delete;
64 };
65
66}
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
Base class for all OpenTwin GraphicsItems GraphicsItems should be created by the GraphicsFactory and ...
Definition GraphicsItem.h:35
Definition GraphicsLayoutItem.h:18
Definition GraphicsLayoutItemWrapper.h:18
virtual const QGraphicsItem * getQGraphicsItem(void) const override
Returns the const QGraphicsItem.
Definition GraphicsLayoutItemWrapper.h:41
virtual QGraphicsLayoutItem * getQGraphicsLayoutItem(void) override
Returns the QGraphicsLayoutItem.
Definition GraphicsLayoutItemWrapper.h:39
virtual QGraphicsItem * getQGraphicsItem(void) override
Returns the QGraphicsItem.
Definition GraphicsLayoutItemWrapper.h:40
Definition Connector.h:8