34 movement_running_(false),
37 m_movement_driver(nullptr),
71 if (!diagram)
return(-1);
119 for (QGraphicsItem *qgi :
m_moved_content.
items(dc::Elements | dc::TextFields | dc::Images | dc::Shapes | dc::ElementTextFields | dc::TextGroup))
123 qgi -> setPos(qgi->pos() + movement);
127 QList<Conductor *> c_list;
138 if (c->pos() != QPointF(0,0)) {
157 QUndoCommand *undo_object =
new QUndoCommand();
162 undo_object->setText(quc->text());
170 diagram_ -> project() -> autoConductor())
176 while (!elmt -> AlignedFreeTerminals().isEmpty())
178 QPair <Terminal *, Terminal *> pair = elmt -> AlignedFreeTerminals().takeFirst();
184 if (undo_object->text().isEmpty())
185 undo_object->setText(
QObject::tr(
"Ajouter %n conducteur(s)",
"add a numbers of conductor one or more", acc));
188 QSet <Conductor *> conductors_list = conductor->relatedPotentialConductors();
193 bool use_properties =
false;
194 if (!conductors_list.isEmpty())
196 use_properties =
true;
197 others_properties = (*conductors_list.begin())->properties();
198 foreach (
Conductor *cond, conductors_list)
200 use_properties =
false;
204 conductor->setProperties(others_properties);
207 conductor -> setProperties(
diagram_ -> defaultConductorProperties);
216 if (undo_object->childCount() >= 1)
217 diagram_ -> undoStack().push(undo_object);
QList< QPair< Terminal *, Terminal * > > AlignedFreeTerminals() const
Element::AlignedFreeTerminals.
void continueMovement(const QPointF &)
ElementsMover::continueMovement Add a move to the current movement.
ConductorProperties properties
Conductor::properties.
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
virtual ~ElementsMover()
ElementsMover::~ElementsMover Destructor.
QList< Conductor * > m_conductors_to_move
QGraphicsItem * m_movement_driver
QPointF current_movement_
bool isReady() const
ElementsMover::isReady.
The AddItemCommand class This command add an item in a diagram The item to add is template...
void endMovement()
ElementsMover::endMovement Ended the current movement by creating an undo added to the undostack of t...
DiagramContent m_moved_content
QList< QGraphicsItem * > items(int=All) const
DiagramContent::items.
int removeNonMovableItems()
DiagramContent::removeNonMovableItems Remove all non movable item.
int beginMovement(Diagram *, QGraphicsItem *=nullptr)
ElementsMover::beginMovement Start a new movement.
void numerate()
ConductorAutoNumerotation::numerate execute the automatic numerotation.
QSet< DynamicElementTextItem * > m_element_texts
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
ElementsMover()
ElementsMover::ElementsMover Constructor.
QList< Element * > m_elements
QList< Conductor * > m_conductors_to_update
void clear()
DiagramContent::clear Remove all items from the diagram content.
int count(int=All) const
DiagramContent::count.
QSet< ElementTextItemGroup * > m_texts_groups