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 &);
104 QVariant
itemChange(GraphicsItemChange change,
const QVariant &value)
override;
113 QPainterPath
path()
const;
The CustomElementGraphicPart class This class is the base for all home-made primitive like line,...
Definition customelementgraphicpart.h:36
QLineF m_line
Definition partline.h:124
void secondEndTypeChanged()
void setFirstEndLength(const qreal &l)
Definition partline.cpp:556
qreal second_length
Definition partline.h:122
qreal first_length
Definition partline.h:119
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *=nullptr) override
PartLine::paint Draw this line.
Definition partline.cpp:74
void addHandler() override
PartLine::addHandler Add handlers for this item.
Definition partline.cpp:291
Qet::EndType first_end
Definition partline.h:118
void firstEndTypeChanged()
int m_vector_index
Definition partline.h:125
Qet::EndType end2
Definition partline.h:41
qreal m_rot
Definition partline.h:128
virtual QPointF sceneP1() const
PartLine::sceneP1.
Definition partline.cpp:327
QRectF secondEndCircleRect() const
PartLine::secondEndCircleRect.
Definition partline.cpp:408
QString xmlName() const override
Definition partline.h:72
Qet::EndType secondEndType() const
Definition partline.h:91
static uint requiredLengthForEndType(const Qet::EndType &)
PartLine::requiredLengthForEndType.
Definition partline.cpp:55
virtual QPointF sceneP2() const
PartLine::sceneP2.
Definition partline.cpp:336
void fromXml(const QDomElement &) override
PartLine::fromXml Import the properties of this line from a xml element.
Definition partline.cpp:137
QPainterPath shadowShape() const override
Definition partline.cpp:366
void firstEndLengthChanged()
QLineF line
Definition partline.h:44
QRectF boundingRect() const override
PartLine::boundingRect.
Definition partline.cpp:426
@ Type
Definition partline.h:63
QString name() const override
Definition partline.h:71
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartLine::handlerMousePressEvent.
Definition partline.cpp:235
QPainterPath path() const
PartLine::path.
Definition partline.cpp:594
void setFirstEndType(const Qet::EndType &et)
Definition partline.cpp:540
qreal length1
Definition partline.h:42
Qet::EndType second_end
Definition partline.h:121
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartLine::handlerMouseReleaseEvent.
Definition partline.cpp:276
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartLine::handlerMouseMoveEvent.
Definition partline.cpp:251
void setLine(const QLineF &line)
Definition partline.cpp:531
qreal length2
Definition partline.h:43
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...
Definition partline.cpp:507
const QDomElement toXml(QDomDocument &) const override
PartLine::toXml Export this line in xml.
Definition partline.cpp:113
QPropertyUndoCommand * m_undo_command
Definition partline.h:126
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
PartLine::itemChange.
Definition partline.cpp:156
QPainterPath shape() const override
PartLine::shape.
Definition partline.cpp:345
qreal rotation() const
Definition partline.cpp:582
void setSecondEndType(const Qet::EndType &et)
Definition partline.cpp:548
qreal firstEndLength() const
Definition partline.h:93
void secondEndLengthChanged()
bool isUseless() const override
PartLine::isUseless.
Definition partline.cpp:450
void setSecondEndLength(const qreal &l)
Definition partline.cpp:565
QList< QPointF > saved_points_
Definition partline.h:123
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
PartLine::sceneEventFilter.
Definition partline.cpp:176
QRectF firstEndCircleRect() const
PartLine::firstEndCircleRect.
Definition partline.cpp:390
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition partline.h:127
Qet::EndType end1
Definition partline.h:40
void handleUserTransformation(const QRectF &, const QRectF &) override
PartLine::handleUserTransformation Handle the user-induced transformation from initial_selection_rect...
Definition partline.cpp:486
void adjusteHandlerPos()
PartLine::adjusteHandlerPos Adjust the position of the handler item.
Definition partline.cpp:214
QRectF sceneGeometricRect() const override
PartLine::sceneGeometricRect.
Definition partline.cpp:462
int type() const override
Definition partline.h:69
void startUserTransformation(const QRectF &) override
PartLine::startUserTransformation Start the user-induced transformation, provided this primitive is c...
Definition partline.cpp:473
Qet::EndType firstEndType() const
Definition partline.h:89
void setRotation(qreal angle)
Definition partline.cpp:574
void removeHandler() override
PartLine::removeHandler Remove the handlers of this item.
Definition partline.cpp:314
qreal secondEndLength() const
Definition partline.h:95
Definition qetelementeditor.h:39
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition qpropertyundocommand.h:34
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition qetgraphicshandleritem.h:37
EndType
This enum lists the various available endings for line primitives when drawing an electrical element.
Definition qet.h:197