QElectroTech  0.70
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ElementTextsMover Class Reference

#include <elementtextsmover.h>

Public Member Functions

 ElementTextsMover ()
 ElementTextsMover::ElementTextsMover. More...
 
bool isReady () const
 ElementTextsMover::isReady. More...
 
int beginMovement (Diagram *diagram, QGraphicsItem *driver_item=nullptr)
 ElementTextsMover::beginMovement Begin a movement. More...
 
void continueMovement (QGraphicsSceneMouseEvent *event)
 
void endMovement ()
 ElementTextsMover::endMovement Finish the movement by pushing an undo command to the parent diagram of text item. More...
 

Private Member Functions

 ElementTextsMover (const ElementTextsMover &)
 
QString undoText () const
 

Private Attributes

bool m_movement_running = false
 
Diagramm_diagram = nullptr
 
QGraphicsItem * m_movement_driver = nullptr
 
QHash< DiagramTextItem *, QPointF > m_texts_hash
 
QHash< QGraphicsItemGroup *, QPointF > m_grps_hash
 
QHash< QGraphicsItem *, QPointF > m_items_hash
 
int m_text_count = 0
 
int m_group_count = 0
 

Detailed Description

This class manages the interactive movement of element text items on a particular diagram.

Definition at line 34 of file elementtextsmover.h.

Constructor & Destructor Documentation

◆ ElementTextsMover() [1/2]

ElementTextsMover::ElementTextsMover ( )

◆ ElementTextsMover() [2/2]

ElementTextsMover::ElementTextsMover ( const ElementTextsMover )
private

Member Function Documentation

◆ beginMovement()

int ElementTextsMover::beginMovement ( Diagram diagram,
QGraphicsItem *  driver_item = nullptr 
)

ElementTextsMover::beginMovement Begin a movement.

Parameters
diagram: diagram where the movement is apply
driver_item: item moved by the mouse
Returns
: the number of moved text (driver_item include), or -1 if this ElementTextsMover can't begin a movement

Definition at line 46 of file elementtextsmover.cpp.

References m_diagram, m_group_count, m_items_hash, m_movement_driver, m_movement_running, m_text_count, and DynamicElementTextItem::Type.

Referenced by ElementTextItemGroup::mouseMoveEvent(), and DynamicElementTextItem::mouseMoveEvent().

◆ continueMovement()

void ElementTextsMover::continueMovement ( QGraphicsSceneMouseEvent *  event)

◆ endMovement()

void ElementTextsMover::endMovement ( )

ElementTextsMover::endMovement Finish the movement by pushing an undo command to the parent diagram of text item.

Definition at line 107 of file elementtextsmover.cpp.

References QPropertyUndoCommand::enableAnimation(), m_diagram, m_items_hash, m_movement_running, Diagram::undoStack(), and undoText().

Referenced by ElementTextItemGroup::mouseReleaseEvent().

◆ isReady()

bool ElementTextsMover::isReady ( ) const

ElementTextsMover::isReady.

Returns
true if this ElementTextsMover is ready to process a new movement. False if this ElementTextsMover is actually process a movement

Definition at line 35 of file elementtextsmover.cpp.

References m_movement_running.

◆ undoText()

QString ElementTextsMover::undoText ( ) const
private

Definition at line 134 of file elementtextsmover.cpp.

References m_group_count, m_items_hash, m_text_count, and QET::Icons::tr.

Referenced by endMovement().

Member Data Documentation

◆ m_diagram

Diagram* ElementTextsMover::m_diagram = nullptr
private

Definition at line 52 of file elementtextsmover.h.

Referenced by beginMovement(), and endMovement().

◆ m_group_count

int ElementTextsMover::m_group_count = 0
private

Definition at line 58 of file elementtextsmover.h.

Referenced by beginMovement(), and undoText().

◆ m_grps_hash

QHash<QGraphicsItemGroup *, QPointF> ElementTextsMover::m_grps_hash
private

Definition at line 55 of file elementtextsmover.h.

◆ m_items_hash

QHash<QGraphicsItem *, QPointF> ElementTextsMover::m_items_hash
private

Definition at line 56 of file elementtextsmover.h.

Referenced by beginMovement(), continueMovement(), endMovement(), and undoText().

◆ m_movement_driver

QGraphicsItem* ElementTextsMover::m_movement_driver = nullptr
private

Definition at line 53 of file elementtextsmover.h.

Referenced by beginMovement(), and continueMovement().

◆ m_movement_running

bool ElementTextsMover::m_movement_running = false
private

Definition at line 51 of file elementtextsmover.h.

Referenced by beginMovement(), continueMovement(), endMovement(), and isReady().

◆ m_text_count

int ElementTextsMover::m_text_count = 0
private

Definition at line 57 of file elementtextsmover.h.

Referenced by beginMovement(), and undoText().

◆ m_texts_hash

QHash<DiagramTextItem *, QPointF> ElementTextsMover::m_texts_hash
private

Definition at line 54 of file elementtextsmover.h.


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