ソースを参照

ctkRangeWidget::valuesChanged was fired twice

When ctkRangeWidget::setValues() was called, the signal
ctkRangeWidget::valuesChanged() was fired once in
changeMinimumValue() and once in changeMaximumValue()
Julien Finet 14 年 前
コミット
87cb546f52
共有1 個のファイルを変更した4 個の追加2 個の削除を含む
  1. 4 2
      Libs/Widgets/ctkRangeWidget.cpp

+ 4 - 2
Libs/Widgets/ctkRangeWidget.cpp

@@ -470,7 +470,6 @@ void ctkRangeWidget::changeMinimumValue(double newValue)
     }
   if (!d->Changing)
     {
-    emit this->valuesChanged(newValue, this->maximumValue());
     emit this->minimumValueChanged(newValue);
 	}
 }
@@ -485,7 +484,6 @@ void ctkRangeWidget::changeMaximumValue(double newValue)
     }
   if (!d->Changing)
     {
-    emit this->valuesChanged(this->minimumValue(), newValue);
     emit this->maximumValueChanged(newValue);
     }
 }
@@ -496,6 +494,10 @@ void ctkRangeWidget::changeValues(double newMinValue, double newMaxValue)
   Q_D(ctkRangeWidget);
   d->MinimumSpinBox->setValue(newMinValue);
   d->MaximumSpinBox->setValue(newMaxValue);
+  if (!d->Changing)
+    {
+    emit this->valuesChanged(newMinValue, newMaxValue);
+    }
 }
 
 // --------------------------------------------------------------------------