The LinkElementCommand class This undo class manage link between elements. In the same instance of this class, we can link and unlink elements from an edited element This undo class support the merge.
More...
#include <linkelementcommand.h>
Inherits QUndoCommand.
|
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. Each linkable element (know via the static method isLinkable) is added to m_linked_after already_link is used for the static method isLinkable.
|
|
void | makeLink (const QList< Element * > &element_list) |
| LinkElementCommand::makeLink Make the link between m_element and element_list; This method unlinks elements if needed.
|
|
The LinkElementCommand class This undo class manage link between elements. In the same instance of this class, we can link and unlink elements from an edited element This undo class support the merge.
◆ LinkElementCommand()
LinkElementCommand::LinkElementCommand |
( |
Element * |
element_, |
|
|
QUndoCommand * |
parent = nullptr |
|
) |
| |
◆ id()
int LinkElementCommand::id |
( |
| ) |
const |
|
inlineoverride |
◆ isLinkable()
bool LinkElementCommand::isLinkable |
( |
Element * |
element_a, |
|
|
Element * |
element_b, |
|
|
bool |
already_linked = false |
|
) |
| |
|
static |
LinkElementCommand::isLinkable.
- Parameters
-
element_a | |
element_b | |
already_linked | |
- Returns
- true if element_a and element_b can be linked between them. There is few condition to be linked : 1- element_a and element_b must be linkable type. (Ex : A is master and B is slave 'OK', A and B is master 'KO') 2- For element type slave and report (no matter if element is 'A' or 'B'), the element must be free (not connected to an element) 3- we can override the section 2 by set already_linked to true. In this case, if slave or report is already linked to the other element ('A' or 'B') return true, but if linked to another element (not 'A' or 'B') return false
◆ makeLink()
void LinkElementCommand::makeLink |
( |
const QList< Element * > & |
element_list | ) |
|
|
private |
◆ mergeWith()
bool LinkElementCommand::mergeWith |
( |
const QUndoCommand * |
other | ) |
|
|
override |
◆ redo()
void LinkElementCommand::redo |
( |
| ) |
|
|
override |
◆ setLink() [1/2]
void LinkElementCommand::setLink |
( |
const QList< Element * > & |
element_list | ) |
|
LinkElementCommand::setLink Replace all linked elements of edited element by elements stored in element_list This method do several check to know if element can be linked or not.
- Parameters
-
◆ setLink() [2/2]
void LinkElementCommand::setLink |
( |
Element * |
element_ | ) |
|
◆ setUpNewLink()
void LinkElementCommand::setUpNewLink |
( |
const QList< Element * > & |
element_list, |
|
|
bool |
already_link |
|
) |
| |
|
private |
LinkElementCommand::setUpNewLink Update the content of m_link_after with the content of element_list. Each linkable element (know via the static method isLinkable) is added to m_linked_after already_link is used for the static method isLinkable.
- Parameters
-
element_list | |
already_link | |
◆ undo()
void LinkElementCommand::undo |
( |
| ) |
|
|
override |
◆ unlink()
void LinkElementCommand::unlink |
( |
QList< Element * > |
element_list | ) |
|
◆ unlinkAll()
void LinkElementCommand::unlinkAll |
( |
| ) |
|
◆ m_element
Element* LinkElementCommand::m_element |
|
private |
◆ m_first_redo
bool LinkElementCommand::m_first_redo |
|
private |
◆ m_linked_after
QList<Element *> LinkElementCommand::m_linked_after |
|
private |
◆ m_linked_before
QList<Element *> LinkElementCommand::m_linked_before |
|
private |
The documentation for this class was generated from the following files: