mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Set parent terminal strip of terminal element
Call the method : void TerminalElement::setParentTerminalStrip(TerminalStrip *strip) when a terminal element is added to a terminal strip.
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include "terminalstrip.h"
|
#include "terminalstrip.h"
|
||||||
#include "../qetproject.h"
|
#include "../qetproject.h"
|
||||||
#include "../qetgraphicsitem/element.h"
|
#include "../qetgraphicsitem/element.h"
|
||||||
|
#include "../qetgraphicsitem/terminalelement.h"
|
||||||
|
|
||||||
using shared_real_terminal = QSharedPointer<RealTerminal>;
|
using shared_real_terminal = QSharedPointer<RealTerminal>;
|
||||||
using shared_physical_terminal = QSharedPointer<PhysicalTerminal>;
|
using shared_physical_terminal = QSharedPointer<PhysicalTerminal>;
|
||||||
@@ -231,6 +232,8 @@ bool TerminalStrip::addTerminal(Element *terminal)
|
|||||||
|
|
||||||
m_physical_terminals.append(physical_terminal);
|
m_physical_terminals.append(physical_terminal);
|
||||||
|
|
||||||
|
static_cast<TerminalElement *>(terminal)->setParentTerminalStrip(this);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,6 +259,8 @@ bool TerminalStrip::removeTerminal(Element *terminal)
|
|||||||
}
|
}
|
||||||
m_real_terminals.removeOne(real_terminal);
|
m_real_terminals.removeOne(real_terminal);
|
||||||
|
|
||||||
|
static_cast<TerminalElement *>(terminal)->setParentTerminalStrip(nullptr);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user