mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Add "parent terminal" strip member to TerminalElement class
This commit is contained in:
@@ -40,3 +40,26 @@ void TerminalElement::initLink(QETProject *project) {
|
||||
Element::initLink(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
|
||||
*/
|
||||
void TerminalElement::setParentTerminalStrip(TerminalStrip *strip) {
|
||||
m_parent_terminal_strip = strip;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalElement::parentTerminalStrip
|
||||
* @return The parent terminal strip of this
|
||||
* terminal element or nullptr if not.
|
||||
*/
|
||||
TerminalStrip *TerminalElement::parentTerminalStrip() const {
|
||||
return m_parent_terminal_strip.data();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
|
||||
#include "element.h"
|
||||
#include "../TerminalStrip/terminalstrip.h"
|
||||
|
||||
class QETProject;
|
||||
/**
|
||||
@@ -33,6 +34,12 @@ class TerminalElement : public Element
|
||||
QGraphicsItem * = nullptr, int * = nullptr);
|
||||
~TerminalElement() override;
|
||||
void initLink(QETProject *project) override;
|
||||
|
||||
void setParentTerminalStrip(TerminalStrip *strip);
|
||||
TerminalStrip *parentTerminalStrip() const;
|
||||
|
||||
private:
|
||||
QPointer<TerminalStrip> m_parent_terminal_strip;
|
||||
};
|
||||
|
||||
#endif // TERMINALELEMENT_H
|
||||
|
||||
Reference in New Issue
Block a user