QElectroTech  0.70
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
ElementTextItemGroup Class Reference

The ElementTextItemGroup class This class represent a group of element text Texts in the group can be aligned left / center /right. More...

#include <elementtextitemgroup.h>

Signals

void rotationChanged (qreal)
 
void verticalAdjustmentChanged (int)
 
void alignmentChanged (Qt::Alignment)
 
void nameChanged (QString)
 
void holdToBottomPageChanged (bool)
 
void xChanged ()
 
void yChanged ()
 
void frameChanged (bool frame)
 

Public Member Functions

 ElementTextItemGroup (const QString &name, Element *parent)
 ElementTextItemGroup::ElementTextItemGroup. More...
 
 ~ElementTextItemGroup () override
 
void addToGroup (QGraphicsItem *item)
 ElementTextItemGroup::addToGroup. More...
 
void removeFromGroup (QGraphicsItem *item)
 ElementTextItemGroup::removeFromGroup. More...
 
void blockAlignmentUpdate (bool block)
 ElementTextItemGroup::blockAlignmentUpdate If true, the texts in this group are never aligned, moved, rotated etc... the texts stay as it was, until blockAlignmentUpdate is set to false. More...
 
void setAlignment (Qt::Alignment alignement)
 ElementTextItemGroup::setAlignement Set the alignement of this group. More...
 
Qt::Alignment alignment () const
 
void updateAlignment ()
 ElementTextItemGroup::setAlignment Update the alignement of the items in this group, according to the current alignement. More...
 
int verticalAdjustment () const
 
void setVerticalAdjustment (int v)
 ElementTextItemGroup::setVerticalAdjustment Set the value of the vertical adjustment to . The vertical adjutment is use to adjust the space between the texts of this group. More...
 
void setName (QString name)
 ElementTextItemGroup::setName. More...
 
QString name () const
 
void setHoldToBottomPage (bool hold)
 
bool holdToBottomPage () const
 
void setFrame (const bool frame)
 
bool frame () const
 
QList< DynamicElementTextItem * > texts () const
 ElementTextItemGroup::texts. More...
 
Diagramdiagram () const
 ElementTextItemGroup::diagram. More...
 
ElementparentElement () const
 ElementTextItemGroup::parentElement. More...
 
QDomElement toXml (QDomDocument &dom_document) const
 ElementTextItemGroup::toXml Export data of this group to xml. More...
 
void fromXml (QDomElement &dom_element)
 ElementTextItemGroup::fromXml Import data of this group from xml. More...
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
 ElementTextItemGroup::paint. More...
 
QRectF boundingRect () const override
 ElementTextItemGroup::boundingRect. More...
 
void setRotation (qreal angle)
 
void setPos (const QPointF &pos)
 
void setPos (qreal x, qreal y)
 

Static Public Member Functions

static QString xmlTaggName ()
 

Protected Member Functions

void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 ElementTextItemGroup::mousePressEvent. More...
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 ElementTextItemGroup::mouseMoveEvent. More...
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 ElementTextItemGroup::mouseReleaseEvent. More...
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 ElementTextItemGroup::keyPressEvent. More...
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 

Properties

QPointF pos
 
qreal rotation
 
int verticalAdjustment
 
Qt::Alignment alignment
 
QString name
 
bool holdToBottomPage
 
bool frame
 

Private Member Functions

void updateXref ()
 
void adjustSlaveXrefPos ()
 
void autoPos ()
 

Private Attributes

Qt::Alignment m_alignment = Qt::AlignJustify
 
QString m_name
 
bool m_first_move = true
 
bool m_hold_to_bottom_of_page = false
 
bool m_block_alignment_update = false
 
bool m_frame = false
 
QPointF m_initial_position
 
int m_vertical_adjustment = 0
 
CrossRefItemm_Xref_item = nullptr
 
Elementm_parent_element = nullptr
 
QList< QMetaObject::Connection > m_update_slave_Xref_connection
 
QGraphicsTextItem * m_slave_Xref_item = nullptr
 
QMetaObject::Connection m_XrefChanged_timer
 
QMetaObject::Connection m_linked_changed_timer
 

Detailed Description

The ElementTextItemGroup class This class represent a group of element text Texts in the group can be aligned left / center /right.

Definition at line 35 of file elementtextitemgroup.h.

Constructor & Destructor Documentation

◆ ElementTextItemGroup()

ElementTextItemGroup::ElementTextItemGroup ( const QString &  name,
Element parent 
)

◆ ~ElementTextItemGroup()

ElementTextItemGroup::~ElementTextItemGroup ( )
override

Definition at line 51 of file elementtextitemgroup.cpp.

Member Function Documentation

◆ addToGroup()

void ElementTextItemGroup::addToGroup ( QGraphicsItem *  item)

◆ adjustSlaveXrefPos()

void ElementTextItemGroup::adjustSlaveXrefPos ( )
private

Definition at line 766 of file elementtextitemgroup.cpp.

References boundingRect(), m_slave_Xref_item, and pos.

Referenced by updateAlignment(), and updateXref().

◆ alignment()

Qt::Alignment ElementTextItemGroup::alignment ( ) const

◆ alignmentChanged

void ElementTextItemGroup::alignmentChanged ( Qt::Alignment  )
signal

◆ autoPos()

void ElementTextItemGroup::autoPos ( )
private

◆ blockAlignmentUpdate()

void ElementTextItemGroup::blockAlignmentUpdate ( bool  block)

ElementTextItemGroup::blockAlignmentUpdate If true, the texts in this group are never aligned, moved, rotated etc... the texts stay as it was, until blockAlignmentUpdate is set to false.

Parameters
block

Definition at line 122 of file elementtextitemgroup.cpp.

References m_block_alignment_update.

◆ boundingRect()

QRectF ElementTextItemGroup::boundingRect ( ) const
override

ElementTextItemGroup::boundingRect.

Returns

Definition at line 490 of file elementtextitemgroup.cpp.

References texts().

Referenced by adjustSlaveXrefPos(), and paint().

◆ diagram()

Diagram * ElementTextItemGroup::diagram ( ) const

ElementTextItemGroup::diagram.

Returns
The diagram of this group, or nullptr if this group is not in a diagram

Definition at line 332 of file elementtextitemgroup.cpp.

Referenced by autoPos(), keyPressEvent(), mouseMoveEvent(), and mouseReleaseEvent().

◆ frame()

bool ElementTextItemGroup::frame ( ) const

Referenced by setFrame().

◆ frameChanged

void ElementTextItemGroup::frameChanged ( bool  frame)
signal

◆ fromXml()

void ElementTextItemGroup::fromXml ( QDomElement &  dom_element)

◆ holdToBottomPage()

bool ElementTextItemGroup::holdToBottomPage ( ) const
inline

Definition at line 73 of file elementtextitemgroup.h.

References m_hold_to_bottom_of_page.

◆ holdToBottomPageChanged

void ElementTextItemGroup::holdToBottomPageChanged ( bool  )
signal

◆ hoverEnterEvent()

void ElementTextItemGroup::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

Definition at line 666 of file elementtextitemgroup.cpp.

References m_slave_Xref_item.

◆ hoverLeaveEvent()

void ElementTextItemGroup::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

Definition at line 677 of file elementtextitemgroup.cpp.

References m_slave_Xref_item.

◆ keyPressEvent()

void ElementTextItemGroup::keyPressEvent ( QKeyEvent *  event)
overrideprotected

◆ mouseDoubleClickEvent()

void ElementTextItemGroup::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

◆ mouseMoveEvent()

void ElementTextItemGroup::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

◆ mousePressEvent()

void ElementTextItemGroup::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

ElementTextItemGroup::mousePressEvent.

Parameters
event

Definition at line 536 of file elementtextitemgroup.cpp.

References m_first_move.

◆ mouseReleaseEvent()

void ElementTextItemGroup::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
overrideprotected

◆ name()

QString ElementTextItemGroup::name ( ) const
inline

Definition at line 71 of file elementtextitemgroup.h.

References m_name.

Referenced by setName().

◆ nameChanged

void ElementTextItemGroup::nameChanged ( QString  )
signal

Referenced by setName().

◆ paint()

void ElementTextItemGroup::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
override

ElementTextItemGroup::paint.

Parameters
painter
option
widget

Definition at line 438 of file elementtextitemgroup.cpp.

References boundingRect(), m_frame, QET::Icons::ro, and texts().

◆ parentElement()

Element * ElementTextItemGroup::parentElement ( ) const

◆ removeFromGroup()

void ElementTextItemGroup::removeFromGroup ( QGraphicsItem *  item)

◆ rotationChanged

void ElementTextItemGroup::rotationChanged ( qreal  )
signal

◆ setAlignment()

void ElementTextItemGroup::setAlignment ( Qt::Alignment  alignement)

ElementTextItemGroup::setAlignement Set the alignement of this group.

Parameters
alignement

Definition at line 132 of file elementtextitemgroup.cpp.

References alignmentChanged(), m_alignment, and updateAlignment().

Referenced by fromXml(), Element::fromXml(), and keyPressEvent().

◆ setFrame()

void ElementTextItemGroup::setFrame ( const bool  frame)

Definition at line 302 of file elementtextitemgroup.cpp.

References frame(), frameChanged(), and m_frame.

Referenced by fromXml().

◆ setHoldToBottomPage()

void ElementTextItemGroup::setHoldToBottomPage ( bool  hold)

◆ setName()

void ElementTextItemGroup::setName ( QString  name)

ElementTextItemGroup::setName.

Parameters
nameSet the name of this group

Definition at line 255 of file elementtextitemgroup.cpp.

References m_name, name(), and nameChanged().

Referenced by fromXml().

◆ setPos() [1/2]

void ElementTextItemGroup::setPos ( const QPointF &  pos)

Definition at line 512 of file elementtextitemgroup.cpp.

References pos, xChanged(), and yChanged().

Referenced by fromXml(), Element::fromXml(), mouseMoveEvent(), and updateAlignment().

◆ setPos() [2/2]

void ElementTextItemGroup::setPos ( qreal  x,
qreal  y 
)

Definition at line 522 of file elementtextitemgroup.cpp.

References pos, xChanged(), and yChanged().

◆ setRotation()

void ElementTextItemGroup::setRotation ( qreal  angle)

Definition at line 506 of file elementtextitemgroup.cpp.

References rotationChanged().

Referenced by fromXml(), Element::fromXml(), and updateAlignment().

◆ setVerticalAdjustment()

void ElementTextItemGroup::setVerticalAdjustment ( int  v)

ElementTextItemGroup::setVerticalAdjustment Set the value of the vertical adjustment to . The vertical adjutment is use to adjust the space between the texts of this group.

Parameters
v

Definition at line 243 of file elementtextitemgroup.cpp.

References m_vertical_adjustment, updateAlignment(), and verticalAdjustmentChanged().

Referenced by fromXml(), and Element::fromXml().

◆ texts()

QList< DynamicElementTextItem * > ElementTextItemGroup::texts ( ) const

◆ toXml()

QDomElement ElementTextItemGroup::toXml ( QDomDocument &  dom_document) const

ElementTextItemGroup::toXml Export data of this group to xml.

Parameters
dom_document
Returns

Definition at line 358 of file elementtextitemgroup.cpp.

References m_alignment, m_frame, m_hold_to_bottom_of_page, m_name, m_vertical_adjustment, pos, rotation, texts(), and xmlTaggName().

◆ updateAlignment()

void ElementTextItemGroup::updateAlignment ( )

◆ updateXref()

void ElementTextItemGroup::updateXref ( )
private

◆ verticalAdjustment()

int ElementTextItemGroup::verticalAdjustment ( ) const
inline

Definition at line 68 of file elementtextitemgroup.h.

References m_vertical_adjustment.

◆ verticalAdjustmentChanged

void ElementTextItemGroup::verticalAdjustmentChanged ( int  )
signal

◆ xChanged

void ElementTextItemGroup::xChanged ( )
signal

◆ xmlTaggName()

static QString ElementTextItemGroup::xmlTaggName ( )
inlinestatic

Definition at line 82 of file elementtextitemgroup.h.

Referenced by fromXml(), Element::fromXml(), and toXml().

◆ yChanged

void ElementTextItemGroup::yChanged ( )
signal

Member Data Documentation

◆ m_alignment

Qt::Alignment ElementTextItemGroup::m_alignment = Qt::AlignJustify
private

Definition at line 105 of file elementtextitemgroup.h.

Referenced by keyPressEvent(), setAlignment(), toXml(), and updateAlignment().

◆ m_block_alignment_update

bool ElementTextItemGroup::m_block_alignment_update = false
private

Definition at line 109 of file elementtextitemgroup.h.

Referenced by addToGroup(), blockAlignmentUpdate(), fromXml(), and updateAlignment().

◆ m_first_move

bool ElementTextItemGroup::m_first_move = true
private

Definition at line 107 of file elementtextitemgroup.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ m_frame

bool ElementTextItemGroup::m_frame = false
private

Definition at line 110 of file elementtextitemgroup.h.

Referenced by paint(), setFrame(), and toXml().

◆ m_hold_to_bottom_of_page

bool ElementTextItemGroup::m_hold_to_bottom_of_page = false
private

◆ m_initial_position

QPointF ElementTextItemGroup::m_initial_position
private

Definition at line 111 of file elementtextitemgroup.h.

Referenced by mouseMoveEvent().

◆ m_linked_changed_timer

QMetaObject::Connection ElementTextItemGroup::m_linked_changed_timer
private

Definition at line 117 of file elementtextitemgroup.h.

Referenced by setHoldToBottomPage().

◆ m_name

QString ElementTextItemGroup::m_name
private

Definition at line 106 of file elementtextitemgroup.h.

Referenced by name(), setName(), and toXml().

◆ m_parent_element

Element* ElementTextItemGroup::m_parent_element = nullptr
private

Definition at line 114 of file elementtextitemgroup.h.

Referenced by autoPos(), setHoldToBottomPage(), and updateXref().

◆ m_slave_Xref_item

QGraphicsTextItem* ElementTextItemGroup::m_slave_Xref_item = nullptr
private

◆ m_update_slave_Xref_connection

QList<QMetaObject::Connection> ElementTextItemGroup::m_update_slave_Xref_connection
private

Definition at line 115 of file elementtextitemgroup.h.

Referenced by updateXref().

◆ m_vertical_adjustment

int ElementTextItemGroup::m_vertical_adjustment = 0
private

◆ m_Xref_item

CrossRefItem* ElementTextItemGroup::m_Xref_item = nullptr
private

Definition at line 113 of file elementtextitemgroup.h.

Referenced by updateAlignment(), and updateXref().

◆ m_XrefChanged_timer

QMetaObject::Connection ElementTextItemGroup::m_XrefChanged_timer
private

Definition at line 117 of file elementtextitemgroup.h.

Referenced by setHoldToBottomPage().

Property Documentation

◆ alignment

Qt::Alignment ElementTextItemGroup::alignment
readwrite

◆ frame

bool ElementTextItemGroup::frame
readwrite

◆ holdToBottomPage

bool ElementTextItemGroup::holdToBottomPage
readwrite

◆ name

QString ElementTextItemGroup::name
readwrite

◆ pos

QPointF ElementTextItemGroup::pos
readwrite

◆ rotation

qreal ElementTextItemGroup::rotation
readwrite

◆ verticalAdjustment

int ElementTextItemGroup::verticalAdjustment
readwrite

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