mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-21 04:19:58 +01:00
Cross ref item : change how some methods work
Master element : minor change related to the change of cross ref item git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3539 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -91,8 +91,8 @@ void MasterElement::unlinkElement(Element *elmt) {
|
||||
disconnect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));
|
||||
disconnect(elmt, SIGNAL(yChanged()), cri_, SLOT(updateLabel()));
|
||||
|
||||
if (aboutDeleteXref()) return;
|
||||
cri_ -> updateLabel();
|
||||
aboutDeleteXref();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ void MasterElement::updateLabel(DiagramContext old_info, DiagramContext new_info
|
||||
|
||||
//Delete or update the xref
|
||||
if (cri_) {
|
||||
cri_ -> updateLabel();
|
||||
aboutDeleteXref();
|
||||
}
|
||||
else {
|
||||
@@ -150,11 +151,7 @@ void MasterElement::updateLabel(DiagramContext old_info, DiagramContext new_info
|
||||
bool MasterElement::aboutDeleteXref() {
|
||||
if(!cri_) return true;
|
||||
|
||||
QString comment = elementInformations()["comment"].toString();
|
||||
bool must_show = elementInformations().keyMustShow("comment");
|
||||
|
||||
//Delete Xref item if there isn't reason to display it
|
||||
if (linkedElements().isEmpty() && (comment.isEmpty() || !must_show)) {
|
||||
if (cri_ -> boundingRect().isNull()) {
|
||||
delete cri_;
|
||||
cri_ = nullptr;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user