mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
When unlink an element, make sure this element isn't highlighted
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3561 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -81,11 +81,14 @@ void MasterElement::unlinkAllElements() {
|
|||||||
* Unlink the given elmt in parametre
|
* Unlink the given elmt in parametre
|
||||||
* @param elmt element to unlink from this
|
* @param elmt element to unlink from this
|
||||||
*/
|
*/
|
||||||
void MasterElement::unlinkElement(Element *elmt) {
|
void MasterElement::unlinkElement(Element *elmt)
|
||||||
//Ensure elmt is linked to this element
|
{
|
||||||
if (connected_elements.contains(elmt)) {
|
//Ensure elmt is linked to this element
|
||||||
|
if (connected_elements.contains(elmt))
|
||||||
|
{
|
||||||
connected_elements.removeOne(elmt);
|
connected_elements.removeOne(elmt);
|
||||||
elmt->unlinkElement(this);
|
elmt -> unlinkElement (this);
|
||||||
|
elmt -> setHighlighted (false);
|
||||||
|
|
||||||
//update the graphics cross ref
|
//update the graphics cross ref
|
||||||
disconnect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));
|
disconnect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));
|
||||||
|
|||||||
@@ -88,11 +88,13 @@ void ReportElement::linkToElement(Element * elmt)
|
|||||||
* @brief ReportElement::unLinkAllElements
|
* @brief ReportElement::unLinkAllElements
|
||||||
* Unlink all of the element in the QList connected_elements
|
* Unlink all of the element in the QList connected_elements
|
||||||
*/
|
*/
|
||||||
void ReportElement::unlinkAllElements(){
|
void ReportElement::unlinkAllElements()
|
||||||
|
{
|
||||||
if (!isFree()){
|
if (!isFree()){
|
||||||
QList <Element *> tmp_elmt = connected_elements;
|
QList <Element *> tmp_elmt = connected_elements;
|
||||||
|
|
||||||
foreach(Element *elmt, connected_elements) {
|
foreach(Element *elmt, connected_elements)
|
||||||
|
{
|
||||||
disconnect(elmt, SIGNAL(xChanged()), this, SLOT(updateLabel()));
|
disconnect(elmt, SIGNAL(xChanged()), this, SLOT(updateLabel()));
|
||||||
disconnect(elmt, SIGNAL(yChanged()), this, SLOT(updateLabel()));
|
disconnect(elmt, SIGNAL(yChanged()), this, SLOT(updateLabel()));
|
||||||
disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
|
disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
|
||||||
@@ -100,8 +102,10 @@ void ReportElement::unlinkAllElements(){
|
|||||||
connected_elements.clear();
|
connected_elements.clear();
|
||||||
updateLabel();
|
updateLabel();
|
||||||
|
|
||||||
foreach(Element *elmt, tmp_elmt){
|
foreach(Element *elmt, tmp_elmt)
|
||||||
elmt->unlinkAllElements();
|
{
|
||||||
|
elmt -> setHighlighted(false);
|
||||||
|
elmt -> unlinkAllElements();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,9 +85,11 @@ void SlaveElement::unlinkAllElements() {
|
|||||||
* Unlink the given elmt in parametre
|
* Unlink the given elmt in parametre
|
||||||
* @param elmt
|
* @param elmt
|
||||||
*/
|
*/
|
||||||
void SlaveElement::unlinkElement(Element *elmt) {
|
void SlaveElement::unlinkElement(Element *elmt)
|
||||||
//Ensure elmt is linked to this element
|
{
|
||||||
if (connected_elements.contains(elmt)) {
|
//Ensure elmt is linked to this element
|
||||||
|
if (connected_elements.contains(elmt))
|
||||||
|
{
|
||||||
connected_elements.removeOne(elmt);
|
connected_elements.removeOne(elmt);
|
||||||
|
|
||||||
disconnect(elmt, SIGNAL(xChanged()), this, SLOT(updateLabel()));
|
disconnect(elmt, SIGNAL(xChanged()), this, SLOT(updateLabel()));
|
||||||
@@ -99,7 +101,8 @@ void SlaveElement::unlinkElement(Element *elmt) {
|
|||||||
delete Xref_item; Xref_item = NULL;
|
delete Xref_item; Xref_item = NULL;
|
||||||
|
|
||||||
updateLabel();
|
updateLabel();
|
||||||
elmt -> unlinkElement(this);
|
elmt -> unlinkElement (this) ;
|
||||||
|
elmt -> setHighlighted (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user