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
|
||||
* @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)) {
|
||||
if (connected_elements.contains(elmt))
|
||||
{
|
||||
connected_elements.removeOne(elmt);
|
||||
elmt -> unlinkElement (this);
|
||||
elmt -> setHighlighted (false);
|
||||
|
||||
//update the graphics cross ref
|
||||
disconnect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));
|
||||
|
||||
@@ -88,11 +88,13 @@ void ReportElement::linkToElement(Element * elmt)
|
||||
* @brief ReportElement::unLinkAllElements
|
||||
* Unlink all of the element in the QList connected_elements
|
||||
*/
|
||||
void ReportElement::unlinkAllElements(){
|
||||
void ReportElement::unlinkAllElements()
|
||||
{
|
||||
if (!isFree()){
|
||||
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(yChanged()), this, SLOT(updateLabel()));
|
||||
disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
|
||||
@@ -100,7 +102,9 @@ void ReportElement::unlinkAllElements(){
|
||||
connected_elements.clear();
|
||||
updateLabel();
|
||||
|
||||
foreach(Element *elmt, tmp_elmt){
|
||||
foreach(Element *elmt, tmp_elmt)
|
||||
{
|
||||
elmt -> setHighlighted(false);
|
||||
elmt -> unlinkAllElements();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,9 +85,11 @@ void SlaveElement::unlinkAllElements() {
|
||||
* Unlink the given elmt in parametre
|
||||
* @param elmt
|
||||
*/
|
||||
void SlaveElement::unlinkElement(Element *elmt) {
|
||||
void SlaveElement::unlinkElement(Element *elmt)
|
||||
{
|
||||
//Ensure elmt is linked to this element
|
||||
if (connected_elements.contains(elmt)) {
|
||||
if (connected_elements.contains(elmt))
|
||||
{
|
||||
connected_elements.removeOne(elmt);
|
||||
|
||||
disconnect(elmt, SIGNAL(xChanged()), this, SLOT(updateLabel()));
|
||||
@@ -100,6 +102,7 @@ void SlaveElement::unlinkElement(Element *elmt) {
|
||||
|
||||
updateLabel();
|
||||
elmt -> unlinkElement (this) ;
|
||||
elmt -> setHighlighted (false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user