QElectroTech  0.70
Public Member Functions | List of all members
TerminalElement Class Reference

#include <terminalelement.h>

Public Member Functions

 TerminalElement (const ElementsLocation &, QGraphicsItem *=nullptr, int *=nullptr)
 TerminalElement::TerminalElement Default constructor. More...
 
 ~TerminalElement () override
 
void initLink (QETProject *project) override
 TerminalElement::initLink. More...
 
- Public Member Functions inherited from Element
 Element (const ElementsLocation &location, QGraphicsItem *=nullptr, int *state=nullptr, Element::kind link_type=Element::Simple)
 Element::Element. More...
 
 ~Element () override
 Element::~Element. More...
 
int type () const override
 
QList< Terminal * > terminals () const
 Element::terminals. More...
 
QList< Conductor * > conductors () const
 Element::conductors. More...
 
DiagramContext elementInformations () const
 
DiagramContext kindInformations () const
 
autonum::sequentialNumbers sequenceStruct () const
 
autonum::sequentialNumbersrSequenceStruct ()
 
bool isFreezeLabel () const
 
virtual void setHighlighted (bool)
 
void displayHelpLine (bool b=true)
 Element::displayHelpLine Display the help line of each terminal if b is true. More...
 
QSize size () const
 
QPixmap pixmap ()
 Element::pixmap. More...
 
QPoint setHotspot (QPoint)
 
QPoint hotspot () const
 
void editProperty () override
 
virtual bool fromXml (QDomElement &, QHash< int, Terminal *> &, bool=false)
 Element::fromXml Import the parameters of this element from a xml document. When call this function ensure this element is already in a scene, because the dynamic text item and element text item group (in the xml file) are created in this function and need a diagram for create their Xref, when this element is linked to another. If not the Xref can be not displayed, until the next call of update Xref of the group or text item. More...
 
virtual QDomElement toXml (QDomDocument &, QHash< Terminal *, int > &) const
 
QUuid uuid () const
 Element::uuid. More...
 
int orientation () const
 
void addDynamicTextItem (DynamicElementTextItem *deti=nullptr)
 Element::addDynamiqueTextItem Add as a dynamic text item of this element, is reparented to this If is null, a new DynamicElementTextItem is created and added to this element. More...
 
void removeDynamicTextItem (DynamicElementTextItem *deti)
 Element::removeDynamicTextItem Remove , no matter if is a child of this element or a child of a group of this element. Set he parent item of to 0, is not deleted. More...
 
QList< DynamicElementTextItem * > dynamicTextItems () const
 Element::dynamicTextItems. More...
 
bool isFree () const
 
virtual void linkToElement (Element *)
 
virtual void unlinkAllElements ()
 
virtual void unlinkElement (Element *)
 
QList< Element * > linkedElements ()
 Element::linkedElements. More...
 
virtual kind linkType () const
 
void newUuid ()
 
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
 Element::paint. More...
 
QRectF boundingRect () const override
 
ElementTextItemGroupaddTextGroup (const QString &name)
 
void addTextGroup (ElementTextItemGroup *group)
 Element::addTextGroup. More...
 
void removeTextGroup (ElementTextItemGroup *group)
 Element::removeTextGroup Remove the text group from this element, and set the parent of group to 0. group is not deleted. All texts owned by the group will be reparented to this element. More...
 
QList< QPair< Terminal *, Terminal * > > AlignedFreeTerminals () const
 Element::AlignedFreeTerminals. More...
 
virtual void setElementInformations (DiagramContext dc)
 Element::setElementInformations Set new information for this element. If new information is different of current infotmation emit . More...
 
void setUpFormula (bool code_letter=true)
 Element::setUpFormula Set up the formula used to create the label of this element. More...
 
void setPrefix (QString)
 Element::setPrefix set Element Prefix. More...
 
QString getPrefix () const
 Element::getPrefix get Element Prefix. More...
 
void freezeLabel (bool freeze)
 Element::freezeLabel Freeze this element label. More...
 
void freezeNewAddedElement ()
 Element::freezeNewAddedElement Freeze this label if needed. More...
 
QString name () const override
 Element::name. More...
 
ElementsLocation location () const
 
ElementTextItemGrouptextGroup (const QString &name) const
 
QList< ElementTextItemGroup * > textGroups () const
 Element::textGroups. More...
 
bool addTextToGroup (DynamicElementTextItem *text, ElementTextItemGroup *group)
 Element::addTextToGroup Add the text to the group ; If isn't owned by this element return false. The text must be a text of this element. More...
 
bool removeTextFromGroup (DynamicElementTextItem *text, ElementTextItemGroup *group)
 Element::removeTextFromGroup Remove the text from the group , en reparent to this element. More...
 
- Public Member Functions inherited from QetGraphicsItem
 QetGraphicsItem (QGraphicsItem *parent=nullptr)
 QetGraphicsItem::QetGraphicsItem Default constructor. More...
 
 ~QetGraphicsItem () override=0
 
Diagramdiagram () const
 QetGraphicsItem::diagram return the diagram of this item. More...
 
virtual void setPos (const QPointF &p)
 QetGraphicsItem::setPos set the position of the item to p. More...
 
virtual void setPos (qreal x, qreal y)
 QetGraphicsItem::setPos set the position of the item. More...
 
virtual bool isMovable () const
 
virtual void setMovable (bool movable)
 
QET::GraphicsItemState state () const
 QetGraphicsItem::state. More...
 

Additional Inherited Members

- Public Types inherited from Element
enum  kind {
  Simple = 1, NextReport = 2, PreviousReport = 4, AllReport = 6,
  Master = 8, Slave = 16, Terminale = 32
}
 The kind enum Used to know the kind of this element (master, slave, report ect...) More...
 
enum  { Type = UserType + 1000 }
 
- Signals inherited from Element
void linkedElementChanged ()
 
void elementInfoChange (DiagramContext old_info, DiagramContext new_info)
 
void textAdded (DynamicElementTextItem *deti)
 
void textRemoved (DynamicElementTextItem *deti)
 
void textsGroupAdded (ElementTextItemGroup *group)
 
void textsGroupAboutToBeRemoved (ElementTextItemGroup *group)
 
void textAddedToGroup (DynamicElementTextItem *text, ElementTextItemGroup *group)
 
void textRemovedFromGroup (DynamicElementTextItem *text, ElementTextItemGroup *group)
 
- Static Public Member Functions inherited from Element
static bool valideXml (QDomElement &)
 
- Protected Member Functions inherited from Element
void drawAxes (QPainter *, const QStyleOptionGraphicsItem *)
 
void setSize (int, int)
 Element::setSize Define the size of the element. The size must be a multiple of 10. If not, the dimensions indicated will be arrrondies to higher tens. More...
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 Element::mouseMoveEvent. More...
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 Element::mouseReleaseEvent. More...
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *) override
 
- Protected Member Functions inherited from QetGraphicsItem
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 QetGraphicsItem::mousePressEvent handle the mouse click. More...
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
 QetGraphicsItem::mouseDoubleClickEvent handle the mouse double click. More...
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 QetGraphicsItem::mouseMoveEvent handle mouse movement. More...
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 QetGraphicsItem::mouseReleaseEvent handle mouse release click. More...
 
- Protected Attributes inherited from Element
QHash< DynamicElementTextItem *, QPointF > m_converted_text_from_xml_description
 
QList< Element * > connected_elements
 
QList< QUuid > tmp_uuids_link
 
QUuid m_uuid
 
kind m_link_type = Element::Simple
 
DiagramContext m_element_informations
 
DiagramContext m_kind_informations
 
autonum::sequentialNumbers m_autoNum_seq
 
bool m_freeze_label = false
 
QString m_F_str
 
ElementsLocation m_location
 
NamesList m_names
 
QList< Terminal * > m_terminals
 
const QPicture m_picture
 
const QPicture m_low_zoom_picture
 
- Protected Attributes inherited from QetGraphicsItem
bool is_movable_
 
bool m_first_move
 
bool snap_to_grid_
 
QPointF m_mouse_to_origin_movement
 
QET::GraphicsItemState m_state = QET:: GIOK
 

Detailed Description

Definition at line 26 of file terminalelement.h.

Constructor & Destructor Documentation

◆ TerminalElement()

TerminalElement::TerminalElement ( const ElementsLocation location,
QGraphicsItem *  qgi = nullptr,
int *  state = nullptr 
)

TerminalElement::TerminalElement Default constructor.

Parameters
locationlocation of xml definition
qgiparent QGraphicItem
sparent diagram
stateint used to know if the creation of element have error

Definition at line 28 of file terminalelement.cpp.

◆ ~TerminalElement()

TerminalElement::~TerminalElement ( )
override

Definition at line 32 of file terminalelement.cpp.

Member Function Documentation

◆ initLink()

void TerminalElement::initLink ( QETProject project)
overridevirtual

TerminalElement::initLink.

Parameters
project

Reimplemented from Element.

Definition at line 38 of file terminalelement.cpp.

References Element::initLink().


The documentation for this class was generated from the following files: