|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
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;
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
Definition: qpropertyundocommand.cpp:92
QPointF snapToGrid(QPointF point)
ElementScene::snapToGrid Rounds the coordinates of the point passed as a parameter so that this point...
Definition: elementscene.cpp:1270
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartLine::handlerMousePressEvent.
Definition: partline.cpp:247
~PartLine() override
Destructeur.
Definition: partline.cpp:41
@ Type
Definition: qetgraphicshandleritem.h:42
int m_vector_index
Definition: partline.h:126
Qet::EndType secondEndType() const
Definition: partline.h:91
QUndoStack & undoStack()
ElementScene::undoStack.
Definition: elementscene.cpp:603
void debugPaint(QPainter *)
PartLine::debugPaint Display several composante of the drawing -the bounding rect -special points at ...
Definition: partline.cpp:497
void setSecondEndLength(const qreal &l)
Definition: partline.cpp:658
const QDomElement toXml(QDomDocument &) const override
PartLine::toXml Export this line in xml.
Definition: partline.cpp:105
The CustomElementGraphicPart class This class is the base for all home-made primitive like line,...
Definition: customelementgraphicpart.h:36
Qet::EndType end1
Definition: partline.h:40
Qet::EndType second_end
Definition: partline.h:122
QList< QPointF > fourShapePoints() const
PartLine::fourShapePoints.
Definition: partline.cpp:411
QPropertyUndoCommand * m_undo_command
Definition: partline.h:127
void setFirstEndType(const Qet::EndType &et)
Definition: partline.cpp:633
int type() const override
Definition: partline.h:69
bool isUseless() const override
PartLine::isUseless.
Definition: partline.cpp:546
static uint requiredLengthForEndType(const Qet::EndType &)
PartLine::requiredLengthForEndType.
Definition: partline.cpp:54
void setFirstEndLength(const qreal &l)
Definition: partline.cpp:649
void stylesToXml(QDomElement &) const
CustomElementGraphicPart::stylesToXml Write the curent style to xml element. The style are stored lik...
Definition: customelementgraphicpart.cpp:162
@ Simple
Base-less triangle.
Definition: qet.h:195
qreal secondEndLength() const
Definition: partline.h:95
@ Type
Definition: partline.h:63
void startUserTransformation(const QRectF &) override
PartLine::startUserTransformation Start the user-induced transformation, provided this primitive is c...
Definition: partline.cpp:567
void setNewValue(const QVariant &new_value)
QPropertyUndoCommand::setNewValue Set the new value of the property (set with redo) to new_value.
Definition: qpropertyundocommand.cpp:83
@ Diamond
Diamond.
Definition: qet.h:198
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *=nullptr) override
PartLine::paint Draw this line.
Definition: partline.cpp:73
qreal second_length
Definition: partline.h:123
qreal first_length
Definition: partline.h:120
QRectF boundingRect() const override
PartLine::boundingRect.
Definition: partline.cpp:522
QPainterPath path() const
PartLine::path.
Definition: partline.cpp:674
void secondEndTypeChanged()
virtual QPointF sceneP1() const
PartLine::sceneP1.
Definition: partline.cpp:349
QList< QPointF > saved_points_
Definition: partline.h:124
virtual QPointF sceneP2() const
PartLine::sceneP2.
Definition: partline.cpp:357
void stylesFromXml(const QDomElement &)
CustomElementGraphicPart::stylesFromXml Read the style used by this, from a xml element.
Definition: customelementgraphicpart.cpp:508
qreal length2
Definition: partline.h:43
QString name() const override
Definition: partline.h:71
QRectF firstEndCircleRect() const
PartLine::firstEndCircleRect.
Definition: partline.cpp:458
Qet::EndType end2
Definition: partline.h:41
QRectF secondEndCircleRect() const
PartLine::secondEndCircleRect.
Definition: partline.cpp:476
void firstEndLengthChanged()
void handleUserTransformation(const QRectF &, const QRectF &) override
PartLine::handleUserTransformation Handle the user-induced transformation from initial_selection_rect...
Definition: partline.cpp:580
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition: partline.h:128
void firstEndTypeChanged()
void removeHandler()
PartLine::removeHandler Remove the handlers of this item.
Definition: partline.cpp:336
Definition: partline.h:37
EndType
This enum lists the various available endings for line primitives when drawing an electrical element.
Definition: qet.h:193
PartLine(QETElementEditor *, QGraphicsItem *=nullptr)
PartLine::PartLine Constructor.
Definition: partline.cpp:31
qreal length1
Definition: partline.h:42
QString xmlName() const override
Definition: partline.h:72
void fromXml(const QDomElement &) override
PartLine::fromXml Import the properties of this line from a xml element.
Definition: partline.cpp:129
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition: qetgraphicshandleritem.h:37
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
PartLine::itemChange.
Definition: partline.cpp:148
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:601
bool m_hovered
Definition: customelementgraphicpart.h:323
QLineF m_line
Definition: partline.h:125
QRectF sceneGeometricRect() const override
PartLine::sceneGeometricRect.
Definition: partline.cpp:557
static Qet::EndType endTypeFromString(const QString &)
Definition: qet.cpp:506
void sceneSelectionChanged()
PartLine::sceneSelectionChanged When the scene selection change, if there are several primitive selec...
Definition: partline.cpp:301
void setLine(const QLineF &line)
Definition: partline.cpp:624
#define SHADOWS_HEIGHT
Definition: customelementgraphicpart.h:37
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartLine::handlerMouseReleaseEvent.
Definition: partline.cpp:286
@ Circle
Circle.
Definition: qet.h:197
QLineF line
Definition: partline.h:44
void addHandler()
PartLine::addHandler Add handlers for this item.
Definition: partline.cpp:313
static QString endTypeToString(const Qet::EndType &)
Definition: qet.cpp:489
qreal firstEndLength() const
Definition: partline.h:93
virtual ElementScene * elementScene() const
Definition: customelementpart.cpp:37
QList< QPointF > mapPoints(const QRectF &, const QRectF &, const QList< QPointF > &)
Definition: customelementpart.cpp:69
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartLine::handlerMouseMoveEvent.
Definition: partline.cpp:263
Qet::EndType firstEndType() const
Definition: partline.h:89
void adjusteHandlerPos()
PartLine::adjusteHandlerPos Adjust the position of the handler item.
Definition: partline.cpp:226
void setSecondEndType(const Qet::EndType &et)
Definition: partline.cpp:641
@ Triangle
Triangle.
Definition: qet.h:196
QPainterPath shadowShape() const override
Definition: partline.cpp:386
void applyStylesToQPainter(QPainter &) const
CustomElementGraphicPart::applyStylesToQPainter Apply the current style to the QPainter.
Definition: customelementgraphicpart.cpp:885
qreal penWeight() const
CustomElementGraphicPart::penWeight.
Definition: customelementgraphicpart.cpp:109
void secondEndLengthChanged()
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
PartLine(const PartLine &)
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
PartLine::sceneEventFilter.
Definition: partline.cpp:188
static QVector< QetGraphicsHandlerItem * > handlerForPoint(const QVector< QPointF > &points, int size=10)
QetGraphicsHandlerItem::handlerForPoint.
Definition: qetgraphicshandleritem.cpp:87
QPainterPath shape() const override
PartLine::shape.
Definition: partline.cpp:365
QIcon tr
Definition: qeticons.cpp:206
Definition: qetelementeditor.h:33
void drawShadowShape(QPainter *painter)
CustomElementGraphicPart::drawShadowShape Draw a transparent blue shadow arround the shape of this it...
Definition: customelementgraphicpart.cpp:1240
Qet::EndType first_end
Definition: partline.h:119