37 setText(
QObject::tr(
"Éditer les référence croisé",
"edite the cross reference"));
47 if (
id() != other->id() || other->childCount())
return false;
77 if (element_a->
isFree() && element_b->
isFree())
return true;
79 if (element_a->
linkedElements().contains(element_b) && already_linked)
return true;
89 if (element_a->
isFree() && element_b->
isFree())
return true;
91 if (element_a->
linkedElements().contains(element_b) && already_linked)
return true;
101 if (element_b->
isFree())
return true;
103 if (element_a->
linkedElements().contains(element_b) && already_linked)
return true;
113 if (element_a->
isFree())
return true;
115 if (element_b->
linkedElements().contains(element_a) && already_linked)
return true;
122 default:
return false;
145 QList<Element *> list;
157 foreach(
Element *elmt, element_list)
177 QUndoCommand::undo();
201 QStringList str_funct;
202 QStringList str_tens;
205 str_txt << c->properties().text;
206 str_funct << c->properties().m_function;
207 str_tens << c->properties().m_tension_protocol;
218 QUndoCommand::redo();
235 foreach(
Element *elmt, element_list)
241 qDebug() <<
"LinkElementCommand::setUpNewLink : try to link several elements to a report element or slave element," 242 " only the first element of the list will be taken to be linked";
243 foreach(
Element *elmt, element_list)
261 if (element_list.isEmpty())
268 foreach(
Element *elmt, element_list)
274 foreach(
Element *elmt, element_list)
275 to_unlink.removeAll(elmt);
278 if (!to_unlink.isEmpty())
279 foreach(
Element *elmt, to_unlink)
virtual void linkToElement(Element *)
virtual kind linkType() const
QList< Element * > linkedElements()
Element::linkedElements.
virtual void unlinkElement(Element *)
void unlink(QList< Element *> element_list)
LinkElementCommand::unlink Unlink all elements of element_list from the edited element.
Diagram * diagram() const
QetGraphicsItem::diagram return the diagram of this item.
void setUpNewLink(const QList< Element *> &element_list, bool already_link)
LinkElementCommand::setUpNewLink Update the content of m_link_after with the content of ...
void makeLink(const QList< Element *> &element_list)
LinkElementCommand::makeLink Make the link between m_element and element_list; This method unlink ele...
bool mergeWith(const QUndoCommand *other) override
LinkElementCommand::mergeWith.
QList< Element * > m_linked_before
QList< Conductor * > conductors() const
Element::conductors.
void unlinkAll()
LinkElementCommand::unlinkAll Unlink all element of the edited element.
The LinkElementCommand class This undo class manage link between elements. In the same instance of th...
void undo() override
LinkElementCommand::undo Undo this command.
virtual void unlinkAllElements()
void redo() override
LinkElementCommand::redo Redo this command.
static bool isLinkable(Element *element_a, Element *element_b, bool already_linked=false)
LinkElementCommand::isLinkable.
LinkElementCommand(Element *element_, QUndoCommand *parent=nullptr)
LinkElementCommand::LinkElementCommand Constructor.
void setLink(const QList< Element *> &element_list)
LinkElementCommand::setLink Replace all linked elements of edited element by elements stored in This...
The PotentialSelectorDialog class This dialog is used when user try to connect two existing potential...
QList< Element * > m_linked_after
bool eachStrIsEqual(const QStringList &qsl)
QET::eachStrIsEqual.