mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-20 15:39:58 +01:00
Change relationship betwen classes RealTerminal PhysicalTerminald and TerminalElement
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "terminalelement.h"
|
||||
#include"../TerminalStrip/realterminal.h"
|
||||
|
||||
/**
|
||||
@brief TerminalElement::TerminalElement
|
||||
@@ -41,17 +42,20 @@ void TerminalElement::initLink(QETProject *project) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalElement::setParentTerminalStrip
|
||||
* Set \p strip as parent terminal strip.
|
||||
* Be carefull, this function only set internally the parent terminal strip.
|
||||
* This function don't check if there is a previous
|
||||
* parent terminal strip and don't check
|
||||
* if the new terminal strip have this terminal element
|
||||
* in her list of terminal element.
|
||||
* @param strip
|
||||
* @brief TerminalElement::setRealTerminal
|
||||
* Set @a real_t as the real terminal for this terminal element
|
||||
* @param real_t
|
||||
*/
|
||||
void TerminalElement::setParentTerminalStrip(TerminalStrip *strip) {
|
||||
m_parent_terminal_strip = strip;
|
||||
void TerminalElement::setRealTerminal(const QSharedPointer<RealTerminal> &real_t) {
|
||||
m_real_terminal = real_t;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalElement::realTerminal
|
||||
* @return the real terminal of this terminal element.
|
||||
*/
|
||||
QSharedPointer<RealTerminal> TerminalElement::realTerminal() const {
|
||||
return m_real_terminal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,6 +64,9 @@ void TerminalElement::setParentTerminalStrip(TerminalStrip *strip) {
|
||||
* terminal element or nullptr if not.
|
||||
*/
|
||||
TerminalStrip *TerminalElement::parentTerminalStrip() const {
|
||||
return m_parent_terminal_strip.data();
|
||||
if (m_real_terminal) {
|
||||
return m_real_terminal->parentStrip();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user