18#ifndef LINKELEMENTCOMMAND_H
19#define LINKELEMENTCOMMAND_H
21#include <QUndoCommand>
36 int id()
const override {
return 2;}
37 bool mergeWith(
const QUndoCommand *other)
override;
41 void setLink (
const QList<Element *>& element_list);
43 void unlink (QList<Element *> element_list);
50 void setUpNewLink (
const QList<Element *> &element_list,
bool already_link);
51 void makeLink (
const QList <Element *> &element_list);
The LinkElementCommand class This undo class manage link between elements. In the same instance of th...
Definition linkelementcommand.h:32
void redo() override
LinkElementCommand::redo Redo this command.
Definition linkelementcommand.cpp:187
QList< Element * > m_linked_before
Definition linkelementcommand.h:56
void unlink(QList< Element * > element_list)
LinkElementCommand::unlink Unlink all elements of element_list from the edited element.
Definition linkelementcommand.cpp:157
void unlinkAll()
LinkElementCommand::unlinkAll Unlink all element of the edited element.
Definition linkelementcommand.cpp:167
void setLink(const QList< Element * > &element_list)
LinkElementCommand::setLink Replace all linked elements of edited element by elements stored in eleme...
Definition linkelementcommand.cpp:134
static bool isLinkable(Element *element_a, Element *element_b, bool already_linked=false)
LinkElementCommand::isLinkable.
Definition linkelementcommand.cpp:67
void setUpNewLink(const QList< Element * > &element_list, bool already_link)
LinkElementCommand::setUpNewLink Update the content of m_link_after with the content of element_list....
Definition linkelementcommand.cpp:235
void undo() override
LinkElementCommand::undo Undo this command.
Definition linkelementcommand.cpp:176
Element * m_element
Definition linkelementcommand.h:54
bool m_first_redo
Definition linkelementcommand.h:55
bool mergeWith(const QUndoCommand *other) override
LinkElementCommand::mergeWith.
Definition linkelementcommand.cpp:46
void makeLink(const QList< Element * > &element_list)
LinkElementCommand::makeLink Make the link between m_element and element_list; This method unlinks el...
Definition linkelementcommand.cpp:265
int id() const override
Definition linkelementcommand.h:36
QList< Element * > m_linked_after
Definition linkelementcommand.h:57