mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Backport commit 5307, 5311, 5312
Update changelog git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.60@5314 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -765,24 +765,27 @@ Element *Terminal::parentElement() const {
|
||||
* @param t terminal to start search
|
||||
* @param all_diagram :if true return all related terminal,
|
||||
* false return only terminal in the same diagram of @t
|
||||
* @return
|
||||
* @return the list of terminal at the same potential
|
||||
*/
|
||||
Terminal * relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram) {
|
||||
// If terminal parent element is a folio report.
|
||||
if (all_diagram && terminal -> parentElement() -> linkType() & Element::AllReport) {
|
||||
QList<Terminal *> relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram)
|
||||
{
|
||||
// If terminal parent element is a folio report.
|
||||
if (all_diagram && terminal -> parentElement() -> linkType() & Element::AllReport)
|
||||
{
|
||||
QList <Element *> elmt_list = terminal -> parentElement() -> linkedElements();
|
||||
if (!elmt_list.isEmpty()) {
|
||||
return (elmt_list.first() -> terminals().first());
|
||||
if (!elmt_list.isEmpty())
|
||||
{
|
||||
return (elmt_list.first()->terminals());
|
||||
}
|
||||
}
|
||||
// If terminal parent element is a Terminal element.
|
||||
else if (terminal -> parentElement() -> linkType() & Element::Terminale) {
|
||||
QList <Terminal *> terminals = terminal -> parentElement() -> terminals();
|
||||
terminals.removeAll(const_cast<Terminal *> (terminal));
|
||||
if (!terminals.isEmpty())
|
||||
return terminals.first();
|
||||
// If terminal parent element is a Terminal element.
|
||||
else if (terminal -> parentElement() -> linkType() & Element::Terminale)
|
||||
{
|
||||
QList <Terminal *> terminals = terminal->parentElement()->terminals();
|
||||
terminals.removeAll(const_cast<Terminal *>(terminal));
|
||||
return terminals;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return QList<Terminal *>();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user