18 #include <QGraphicsSceneMouseEvent>
20 #include <QStyleOption>
27 , m_pos(QPointF(0, 0))
28 , m_rectangle(QRectF(0, 0, 0, 0))
40 painter->setClipRect(
sceneAdapter()->viewportRectangle());
41 painter->setPen(
m_pen);
76 prepareGeometryChange();
The interface of any QGraphicsViewItem on GraphicsScene to the Sceneadapter.
QPointF scenePos(QPointF pixel_pos) const
modify the rectangle for display according to the scene adapter
ModelView::SceneAdapterInterface * sceneAdapter() const
Get the conversion axes.
QRectF displayRect(const QRectF &real_rect) const
modify the rectangle for display according to the scene adapter
void adaptW(bool choice)
Adapt the width.
void adaptH(bool choice)
Adapt the height.
QPointF getLastPos() const
Get the last position of the item.
QRectF boundingRect() const override
The bounding rectangle of the handle.
void setRectangle(QRectF rectangle)
Set the draw rectangle.
void setPen(QPen pen)
Set the pen.
QPainterPath shape() const override
The shape.
void setBrush(QBrush brush)
Set the brush.
void setLayerElementController(LayerElementController *controller)
Set the controller to report back the move.
LayerElementController * p_controller
HandleElementView()
The constructor.
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
On move update the model.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
The overriden paint method.
Manages the whole appearance of a layer on the graphicsscene.
void handleViewMoved(HandleElementView *handle_view)
The move logic for the handles associated to the segments.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.