]> Creatis software - clitk.git/commitdiff
disconnect a signal/slot for ROI
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 5 Jul 2016 08:29:51 +0000 (10:29 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 5 Jul 2016 08:29:51 +0000 (10:29 +0200)
Avoid to call the function twice

vv/vvToolROIManager.cxx

index cab86e60553290ae1ec9c5ba39af087bff78721f..41569346fbdfaedae038fc8317aac78877cf3653 100644 (file)
@@ -716,6 +716,7 @@ void vvToolROIManager::OpacityChanged(int v)
 //------------------------------------------------------------------------------
 void vvToolROIManager::AllVisibleROIToggled(int b)
 { 
+  disconnect(mCheckBoxShowAll, SIGNAL(stateChanged(int)), this, SLOT(AllVisibleROIToggled(int)));
   bool status = false;
   if ((mCheckBoxShowAll->checkState() == Qt::Checked) ||
       (mCheckBoxShowAll->checkState() == Qt::PartiallyChecked))  status = true;
@@ -727,6 +728,7 @@ void vvToolROIManager::AllVisibleROIToggled(int b)
   else  mCheckBoxShowAll->setCheckState(Qt::Unchecked);
   mCheckBoxShow->setChecked(status);
   mCurrentSlicerManager->Render();
+  connect(mCheckBoxShowAll, SIGNAL(stateChanged(int)), this, SLOT(AllVisibleROIToggled(int)));
 }
 //------------------------------------------------------------------------------