59 :
source(sourceNode), dest(destNode)
93 sourcePoint =
line.p1() + edgeOffset;
94 destPoint =
line.p2() - edgeOffset;
96 sourcePoint = destPoint =
line.p1();
108 qreal extra = (penWidth + arrowSize) / 2.0;
110 return QRectF(sourcePoint,
QSizeF(destPoint.
x() - sourcePoint.
x(),
111 destPoint.
y() - sourcePoint.
y()))
113 .
adjusted(-extra, -extra, extra, extra);
Edge(Node *sourceNode, Node *destNode)
[0]
QRectF boundingRect() const override
[2]
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
[3]
Node * sourceNode() const
[0]
void addEdge(Edge *edge)
[0]
QPointF mapFromItem(const QGraphicsItem *item, const QPointF &point) const
void prepareGeometryChange()
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
The QLineF class provides a two-dimensional vector using floating point precision.
The QPainter class performs low-level painting on widgets and other paint devices.
void setPen(const QColor &color)
void drawLine(const QLineF &line)
void setBrush(const QBrush &brush)
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
The QPen class defines how a QPainter should draw lines and outlines of shapes.
The QPointF class defines a point in the plane using floating point precision.
constexpr qreal x() const noexcept
constexpr qreal y() const noexcept
The QPolygonF class provides a list of points using floating point precision. \inmodule QtGui.
The QRectF class defines a finite rectangle in the plane using floating point precision.
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
QRectF normalized() const noexcept
The QSizeF class defines the size of a two-dimensional object using floating point precision.
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
QT_END_INCLUDE_NAMESPACE typedef double qreal
GLenum GLuint GLenum GLsizei length
GLsizei GLsizei GLchar * source