54 void paint (QPainter *,
const QStyleOptionGraphicsItem *, QWidget *)
override;
81 QDomElement
toXml (QDomDocument &)
const;
94 enum {
Type = UserType + 1002 };
int type() const override
static QColor forbiddenColor
color for forbidden actions
QList< Conductor * > conductors() const
static QColor allowedColor
color for legal actions
QPointF dock_elmt_
docking point for parent element
bool addConductor(Conductor *conductor)
Terminal::addConductor Add a conductor to this terminal.
bool isLinkedTo(Terminal *)
QColor hovered_color_
Color used for the hover effect.
int conductorsCount() const
Terminal(QPointF, Qet::Orientation, Element *=nullptr)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override
Terminal::mouseReleaseEvent.
void mousePressEvent(QGraphicsSceneMouseEvent *) override
void hoverEnterEvent(QGraphicsSceneHoverEvent *) override
static const qreal terminalSize
Terminal * alignedWithTerminal() const
Terminal::alignedWithTerminal If this terminal is aligned with an other terminal and is orientation i...
void init(QPointF, Qet::Orientation, QString number, QString name, bool hiddenName)
void conductorWasAdded(Conductor *conductor)
QDomElement toXml(QDomDocument &) const
QString number_terminal_
Number of Terminal.
static bool valideXml(QDomElement &)
Element * parentElement() const
bool hovered_
Whether the mouse pointer is hovering the terminal.
QRectF boundingRect() const override
void setNumber(QString number)
Terminal::setNumber.
QList< Terminal * > relatedPotentialTerminal(const Terminal *terminal, const bool all_diagram=true)
Conductor::relatedPotentialTerminal Return terminal at the same potential from the same parent elemen...
QLineF HelpLine() const
Terminal::HelpLine.
Terminal * previous_terminal_
Last terminal seen through an attached conductor.
QPointF dockConductor() const
Qet::Orientation ori_
terminal orientation
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
bool canBeLinkedTo(Terminal *)
Terminal::canBeLinkedTo.
bool name_terminal_hidden
QGraphicsLineItem * m_help_line_a
static QColor neutralColor
default color
QGraphicsLineItem * m_help_line
QList< Conductor * > conductors_
List of conductors attached to the terminal.
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override
void updateConductor()
Terminal::updateConductor Update the path of conductor docked to this terminal.
bool fromXml(QDomElement &)
void removeConductor(Conductor *conductor)
Terminal::removeConductor Remove a conductor from this terminal.
Element * parent_element_
Parent electrical element.
void conductorWasRemoved(Conductor *conductor)
QPointF dock_conductor_
docking point for conductors
QString name_terminal_
Name of Terminal.
Qet::Orientation orientation() const
static QColor warningColor
color for allowed but fuzzy or not recommended actions
void mouseMoveEvent(QGraphicsSceneMouseEvent *) override
void setName(QString name, bool hiddenName)
Terminal::setName.
Diagram * diagram() const
void drawHelpLine(bool draw=true)
Terminal::drawHelpLine.
void hoverMoveEvent(QGraphicsSceneHoverEvent *) override
Orientation
Orientation (used for electrical elements and their terminals)