16 #include <QGraphicsSceneHoverEvent>
21 QMap<SizeHandleElement::EHandleLocation, Qt::CursorShape> create_cursors_map()
23 QMap<SizeHandleElement::EHandleLocation, Qt::CursorShape> result;
36 QMap<SizeHandleElement::EHandleLocation, SizeHandleElement::EHandleType>
37 create_location_to_type_map()
39 QMap<SizeHandleElement::EHandleLocation, SizeHandleElement::EHandleType> result;
52 QMap<SizeHandleElement::EHandleLocation, SizeHandleElement::EHandleLocation>
53 getMapOfOppositeCorners()
55 QMap<SizeHandleElement::EHandleLocation, SizeHandleElement::EHandleLocation> result;
69 QMap<SizeHandleElement::EHandleLocation, SizeHandleElement::EHandleType>
75 QMap<SizeHandleElement::EHandleLocation, SizeHandleElement::EHandleLocation>
81 : QGraphicsObject(parent)
82 , m_handleLocation(pointType)
83 , m_handleType(m_location_to_type[pointType])
86 setParentItem(parent);
91 return QRectF(-4, -4, 8, 8);
96 painter->setRenderHints(QPainter::Antialiasing);
109 QGraphicsObject::mousePressEvent(event);
115 QGraphicsObject::mouseReleaseEvent(event);
122 setPos(rect.topLeft());
125 setPos(QPointF(rect.x() + rect.width() / 2., rect.y()));
129 setPos(rect.topRight());
133 setPos(QPointF(rect.x() + rect.width(), rect.y() + rect.height() / 2.));
137 setPos(rect.bottomRight());
141 setPos(QPointF(rect.x() + rect.width() / 2., rect.y() + rect.height()));
145 setPos(rect.bottomLeft());
149 setPos(QPointF(rect.x(), rect.y() + rect.height() / 2.));
Defines SizeHandleElement class.
static QPen getSelectionMarkerPen()
static QBrush getSelectionMarkerBrush()
EHandleLocation m_handleLocation
QRectF boundingRect() const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
SizeHandleElement(EHandleLocation pointType, QGraphicsObject *parent=nullptr)
static QMap< EHandleLocation, EHandleType > m_location_to_type
static QMap< EHandleLocation, Qt::CursorShape > m_cursors
void resize_request(bool going_to_resize)
void updateHandleElementPosition(const QRectF &rect)
set position from location type using coordinates of external rectangle
virtual void update_view()
static QMap< EHandleLocation, EHandleLocation > m_opposite_handle_location
EHandleType getHandleType() const
EHandleLocation getHandleLocation() const
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
EHandleLocation getOppositeHandleLocation() const