Bläddra i källkod

Disable decimal synchronization by default in ctkSliderWidget

This can lead to unwanted behavior. It should be a conscious choice to
enable the synchronization of decimals
See issue 3642 in na-mic bug tracker
Julien Finet 11 år sedan
förälder
incheckning
5d4f41bdca
2 ändrade filer med 8 tillägg och 5 borttagningar
  1. 1 2
      Libs/Widgets/ctkSliderWidget.cpp
  2. 7 3
      Libs/Widgets/ctkSliderWidget.h

+ 1 - 2
Libs/Widgets/ctkSliderWidget.cpp

@@ -79,8 +79,7 @@ ctkSliderWidgetPrivate::ctkSliderWidgetPrivate(ctkSliderWidget& object)
   this->Changing = false;
   this->ValueBeforeChange = 0.;
   this->BlockSetSliderValue = false;
-  this->SynchronizeMode =
-    ctkSliderWidget::SynchronizeWidth | ctkSliderWidget::SynchronizeDecimals;
+  this->SynchronizeMode = ctkSliderWidget::SynchronizeWidth;
   this->SliderPopup = 0;
 }
 

+ 7 - 3
Libs/Widgets/ctkSliderWidget.h

@@ -45,6 +45,9 @@ class CTK_WIDGETS_EXPORT ctkSliderWidget : public QWidget
   Q_OBJECT
   Q_FLAGS(SynchronizeSiblings)
 
+  /// This property holds the precision of the spin box, in decimals.
+  /// 2 by default.
+  /// \sa decimals(), setDecimals(), decimalsChanged()
   Q_PROPERTY(int decimals READ decimals WRITE setDecimals NOTIFY decimalsChanged)
   Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
   Q_PROPERTY(double pageStep READ pageStep WRITE setPageStep)
@@ -76,7 +79,7 @@ public:
   /// Whenever one of the siblings changes its number of decimals, all its
   /// siblings Synchronize to the new number of decimals.
   ///
-  /// Default is SynchronizeWidth |SynchronizeDecimals.
+  /// Default is SynchronizeWidth.
   /// \sa SynchronizeSiblings(), setSynchronizeSiblings(), decimalsChanged()
   enum SynchronizeSibling
     {
@@ -141,8 +144,9 @@ public:
   double pageStep()const;
   void setPageStep(double step);
 
-  /// 
-  /// This property holds the precision of the spin box, in decimals.
+  ///
+  /// Return the decimals property value.
+  /// \sa decimals, setDecimals(), decimalsChanged()
   int decimals()const;
 
   ///