Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "NodeEdge.hpp"
- //---------------------------------------------------------------------------------//
- //---------------------------------------------------------------------------------//
- NodeEdge::NodeEdge(
- std::shared_ptr<Socket> start_,
- std::shared_ptr<Socket> finish_
- )
- : QGraphicsPathItem(new QGraphicsPathItem)
- , start(start_)
- , finish(finish_)
- {
- }
- //---------------------------------------------------------------------------------//
- //---------------------------------------------------------------------------------//
- void NodeEdge::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*)
- {
- updatePath();
- painter->setPen(QPen(QColor("#001000")));
- painter->setBrush(Qt::NoBrush);
- painter->drawPath(path());
- }
- //---------------------------------------------------------------------------------//
- //---------------------------------------------------------------------------------//
- void NodeEdge::updatePath()
- {
- /*QPainterPath*/ path = QPainterPath(QPointF(0, 0));
- path.lineTo(200, 100);
- setPath(path);
- }
- //---------------------------------------------------------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement