The CrossRefItem class This clas provide an item, for show the cross reference, like the contacts linked to a coil. The item setpos automaticaly when parent move. All slave displayed in cross ref will be updated when folio position change in the project. It's the responsability of the master element to informe displayed slave are moved, by calling the slot updateLabel By default master element is the parent graphics item of this Xref, but if the Xref must be snap to the label of master, the label become the parent of this Xref. This behavior can be changed at anytime by calling setProperties.
More...
#include <crossrefitem.h>
Inherits QGraphicsObject.
The CrossRefItem class This clas provide an item, for show the cross reference, like the contacts linked to a coil. The item setpos automaticaly when parent move. All slave displayed in cross ref will be updated when folio position change in the project. It's the responsability of the master element to informe displayed slave are moved, by calling the slot updateLabel By default master element is the parent graphics item of this Xref, but if the Xref must be snap to the label of master, the label become the parent of this Xref. This behavior can be changed at anytime by calling setProperties.
◆ anonymous enum
◆ CONTACTS
The CONTACTS enum.
Enumerator |
---|
NO | |
NC | |
NOC | |
SW | |
Power | |
DelayOn | |
DelayOff | |
DelayOnOff | |
Delay | |
◆ CrossRefItem() [1/3]
CrossRefItem::CrossRefItem |
( |
Element * |
elmt | ) |
|
|
explicit |
◆ CrossRefItem() [2/3]
CrossRefItem::CrossRefItem.
- Parameters
-
elmt | : element to display the cross ref |
text | : If the Xref must be displayed under a text, the text. |
◆ CrossRefItem() [3/3]
CrossRefItem::CrossRefItem.
- Parameters
-
elmt | : element to display the cross ref |
group | : If the Xref must be displayed under a group, the group. |
◆ ~CrossRefItem()
CrossRefItem::~CrossRefItem |
( |
| ) |
|
|
override |
◆ AddExtraInfo()
void CrossRefItem::AddExtraInfo |
( |
QPainter & |
painter, |
|
|
const QString & |
type |
|
) |
| |
|
private |
CrossRefItem::AddExtraInfo Add the comment info of the parent item if needed.
- Parameters
-
painter | painter to use for draw the text |
type | type of Info do be draw e.g. comment, location. |
◆ autoPos
void CrossRefItem::autoPos |
( |
| ) |
|
|
slot |
◆ boundingRect()
QRectF CrossRefItem::boundingRect |
( |
| ) |
const |
|
override |
◆ buildHeaderContact()
void CrossRefItem::buildHeaderContact |
( |
| ) |
|
|
private |
◆ drawAsContacts()
void CrossRefItem::drawAsContacts |
( |
QPainter & |
painter | ) |
|
|
private |
◆ drawAsCross()
void CrossRefItem::drawAsCross |
( |
QPainter & |
painter | ) |
|
|
private |
◆ drawContact()
QRectF CrossRefItem::drawContact |
( |
QPainter & |
painter, |
|
|
int |
flags, |
|
|
Element * |
elmt |
|
) |
| |
|
private |
CrossRefItem::drawContact Draw one contact, the type of contact to draw is define in flags.
- Parameters
-
painter | : painter to use |
flags | : define how to draw the contact (see enul CONTACTS) |
elmt | : the element to display text (the position of the contact) |
- Returns
- The bounding rect of the draw (contact + text)
take exemple of this code for display the terminal text
◆ elementPositionText()
QString CrossRefItem::elementPositionText |
( |
const Element * |
elmt, |
|
|
const bool & |
add_prefix = false |
|
) |
| const |
CrossRefItem::elementPositionText.
- Parameters
-
- Returns
- the string corresponding to the position of elmt in the diagram. if add_prefix is true, prefix (for power and delay contact) is added to the poistion text.
◆ fillCrossRef()
void CrossRefItem::fillCrossRef |
( |
QPainter & |
painter | ) |
|
|
private |
◆ hoverEnterEvent()
void CrossRefItem::hoverEnterEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
overrideprotected |
◆ hoverLeaveEvent()
void CrossRefItem::hoverLeaveEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
overrideprotected |
◆ hoverMoveEvent()
void CrossRefItem::hoverMoveEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
overrideprotected |
◆ init()
void CrossRefItem::init |
( |
| ) |
|
|
private |
◆ linkedChanged()
void CrossRefItem::linkedChanged |
( |
| ) |
|
|
private |
◆ mouseDoubleClickEvent()
void CrossRefItem::mouseDoubleClickEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
overrideprotected |
◆ NCElements()
QList< Element * > CrossRefItem::NCElements |
( |
| ) |
const |
|
private |
CrossRefItem::NCElements.
- Returns
- The linked elements of m_element wich are close or switch contact If linked element is a power contact, xref propertie is set to don't show power contact and this cross item must be drawed as cross, the element is not append in the list.
◆ NOElements()
QList< Element * > CrossRefItem::NOElements |
( |
| ) |
const |
|
private |
CrossRefItem::NOElements.
- Returns
- The linked elements of m_element wich are open or switch contact. If linked element is a power contact, xref propertie is set to don't show power contact and this cross item must be drawed as cross, the element is not append in the list.
◆ paint()
void CrossRefItem::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionGraphicsItem * |
option, |
|
|
QWidget * |
widget |
|
) |
| |
|
overrideprotected |
◆ sceneEvent()
bool CrossRefItem::sceneEvent |
( |
QEvent * |
event | ) |
|
|
overrideprotected |
◆ setUpConnection()
void CrossRefItem::setUpConnection |
( |
| ) |
|
|
private |
◆ setUpCrossBoundingRect()
void CrossRefItem::setUpCrossBoundingRect |
( |
QPainter & |
painter | ) |
|
|
private |
CrossRefItem::setUpCrossBoundingRect Get the numbers of slaves elements linked to this parent element, for calculate the size of the cross bounding rect. The cross ref item is drawing according to the size of the cross bounding rect.
- Parameters
-
◆ shape()
QPainterPath CrossRefItem::shape |
( |
| ) |
const |
|
override |
◆ type()
int CrossRefItem::type |
( |
| ) |
const |
|
inlineoverride |
◆ updateLabel
void CrossRefItem::updateLabel |
( |
| ) |
|
|
slot |
◆ updateProperties
void CrossRefItem::updateProperties |
( |
| ) |
|
|
slot |
◆ m_bounding_rect
QRectF CrossRefItem::m_bounding_rect |
|
private |
◆ m_drawed_contacts
int CrossRefItem::m_drawed_contacts |
|
private |
◆ m_drawing
QPicture CrossRefItem::m_drawing |
|
private |
◆ m_element
◆ m_group
◆ m_hdr_nc_ctc
QPicture CrossRefItem::m_hdr_nc_ctc |
|
private |
◆ m_hdr_no_ctc
QPicture CrossRefItem::m_hdr_no_ctc |
|
private |
◆ m_hovered_contact
Element* CrossRefItem::m_hovered_contact = nullptr |
|
private |
◆ m_hovered_contacts_map
QMultiMap<Element *, QRectF> CrossRefItem::m_hovered_contacts_map |
|
private |
◆ m_properties
◆ m_shape_path
QPainterPath CrossRefItem::m_shape_path |
|
private |
◆ m_slave_connection
QList<QMetaObject::Connection> CrossRefItem::m_slave_connection |
|
private |
◆ m_text
◆ m_update_connection
QList<QMetaObject::Connection> CrossRefItem::m_update_connection |
|
private |
The documentation for this class was generated from the following files: