From 19a7ab533c661552ae153a1794966161986f7885 Mon Sep 17 00:00:00 2001 From: blacksun Date: Sat, 12 Sep 2015 08:29:45 +0000 Subject: [PATCH] Bug fix git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4200 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qetgraphicsitem/reportelement.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sources/qetgraphicsitem/reportelement.cpp b/sources/qetgraphicsitem/reportelement.cpp index dfd89d14e..d72a08c7c 100644 --- a/sources/qetgraphicsitem/reportelement.cpp +++ b/sources/qetgraphicsitem/reportelement.cpp @@ -93,8 +93,11 @@ void ReportElement::linkToElement(Element * elmt) connect(elmt, SIGNAL( yChanged() ), this, SLOT( updateLabel() )); connect(diagram(), SIGNAL( reportPropertiesChanged(QString) ), this, SLOT( setLabel(QString) )); connect(diagram() -> project(), SIGNAL( projectDiagramsOrderChanged(QETProject*,int,int) ), this, SLOT( updateLabel() )); - connect(elmt->terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded); - connect(elmt->terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved); + if (elmt->terminals().size()) + { + connect(elmt->terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded); + connect(elmt->terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved); + } label_ = diagram() -> defaultReportProperties(); @@ -124,8 +127,11 @@ void ReportElement::unlinkAllElements() disconnect(elmt, SIGNAL(xChanged()), this, SLOT(updateLabel())); disconnect(elmt, SIGNAL(yChanged()), this, SLOT(updateLabel())); disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel())); - disconnect(elmt->terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded); - disconnect(elmt->terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved); + if (elmt->terminals().size()) + { + disconnect(elmt->terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded); + disconnect(elmt->terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved); + } connected_elements.removeAll(elmt); //if elmt is the owner of m_watched_conductor, we remove it if (elmt->conductors().contains(m_watched_conductor))