63 enum {
Type = UserType + 1104 };
70 void paint(QPainter *,
const QStyleOptionGraphicsItem *, QWidget * =
nullptr)
override;
71 QString
name()
const override {
return(
QObject::tr(
"ligne",
"element part name")); }
72 QString
xmlName()
const override {
return(QString(
"line")); }
73 const QDomElement
toXml(QDomDocument &)
const override;
74 void fromXml(
const QDomElement &)
override;
75 virtual QPointF
sceneP1()
const;
76 virtual QPointF
sceneP2()
const;
77 QPainterPath
shape()
const override;
85 static QList<QPointF>
fourEndPoints(
const QPointF &,
const QPointF &,
const qreal &);
99 QVariant
itemChange(GraphicsItemChange change,
const QVariant &value)
override;
112 QPainterPath
path()
const;
EndType
This enum lists the various available endings for line primitives when drawing an electrical element...
QRectF sceneGeometricRect() const override
PartLine::sceneGeometricRect.
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
PartLine::sceneEventFilter.
virtual QPointF sceneP2() const
PartLine::sceneP2.
void setSecondEndLength(const qreal &l)
qreal firstEndLength() const
QString name() const override
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Qet::EndType firstEndType() const
void setFirstEndType(const Qet::EndType &et)
virtual QPointF sceneP1() const
PartLine::sceneP1.
void sceneSelectionChanged()
PartLine::sceneSelectionChanged When the scene selection change, if there are several primitive selec...
QRectF firstEndCircleRect() const
PartLine::firstEndCircleRect.
void startUserTransformation(const QRectF &) override
PartLine::startUserTransformation Start the user-induced transformation, provided this primitive is c...
void setSecondEndType(const Qet::EndType &et)
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartLine::handlerMouseReleaseEvent.
void handleUserTransformation(const QRectF &, const QRectF &) override
PartLine::handleUserTransformation Handle the user-induced transformation from initial_selection_rect...
The CustomElementGraphicPart class This class is the base for all home-made primitive like line...
void firstEndLengthChanged()
qreal secondEndLength() const
QList< QPointF > saved_points_
void setLine(const QLineF &line)
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *=nullptr) override
PartLine::paint Draw this line.
void secondEndTypeChanged()
static uint requiredLengthForEndType(const Qet::EndType &)
PartLine::requiredLengthForEndType.
bool isUseless() const override
PartLine::isUseless.
QString xmlName() const override
QPainterPath path() const
PartLine::path.
void fromXml(const QDomElement &) override
PartLine::fromXml Import the properties of this line from a xml element.
QList< QPointF > fourShapePoints() const
PartLine::fourShapePoints.
int type() const override
void firstEndTypeChanged()
QRectF boundingRect() const override
PartLine::boundingRect.
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
PartLine::itemChange.
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartLine::handlerMousePressEvent.
void debugPaint(QPainter *)
PartLine::debugPaint Display several composante of the drawing -the bounding rect -special points at ...
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartLine::handlerMouseMoveEvent.
QVector< QetGraphicsHandlerItem * > m_handler_vector
void secondEndLengthChanged()
const QDomElement toXml(QDomDocument &) const override
PartLine::toXml Export this line in xml.
static QList< QPointF > fourEndPoints(const QPointF &, const QPointF &, const qreal &)
PartLine::fourEndPoints Return the four interesting point needed to draw the shape at extremity of li...
void adjusteHandlerPos()
PartLine::adjusteHandlerPos Adjust the position of the handler item.
void removeHandler()
PartLine::removeHandler Remove the handlers of this item.
void addHandler()
PartLine::addHandler Add handlers for this item.
Qet::EndType secondEndType() const
QRectF secondEndCircleRect() const
PartLine::secondEndCircleRect.
QPropertyUndoCommand * m_undo_command
QPainterPath shape() const override
PartLine::shape.
QPainterPath shadowShape() const override
void setFirstEndLength(const qreal &l)