17 #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);
110 QGraphicsObject::mousePressEvent(event);
116 QGraphicsObject::mouseReleaseEvent(event);
123 setPos(rect.topLeft());
127 setPos(QPointF(rect.x() + rect.width() / 2., rect.y()));
131 setPos(rect.topRight());
135 setPos(QPointF(rect.x() + rect.width(), rect.y() + rect.height() / 2.));
139 setPos(rect.bottomRight());
143 setPos(QPointF(rect.x() + rect.width() / 2., rect.y() + rect.height()));
147 setPos(rect.bottomLeft());
151 setPos(QPointF(rect.x(), rect.y() + rect.height() / 2.));
Defines interface class ISceneAdaptor.
Defines SizeHandleElement class.
static QPen getSelectionMarkerPen()
static QBrush getSelectionMarkerBrush()
EHandleLocation m_handleLocation
static QMap< EHandleLocation, EHandleType > m_location_to_type
static QMap< EHandleLocation, Qt::CursorShape > m_cursors
SizeHandleElement(EHandleLocation pointType, QGraphicsObject *parent=0)
void mousePressEvent(QGraphicsSceneMouseEvent *event)
void resize_request(bool going_to_resize)
void updateHandleElementPosition(const QRectF &rect)
set position from location type using coordinates of external rectangle
QRectF boundingRect() const
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
virtual void update_view()
static QMap< EHandleLocation, EHandleLocation > m_opposite_handle_location
EHandleType getHandleType() const
EHandleLocation getHandleLocation() const
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
EHandleLocation getOppositeHandleLocation() const