Explorar el Código

Expose publicly ctkRangeWidget slider, min and max spinbox

It can be handy to tweak sliders and spinboxes.
Julien Finet hace 13 años
padre
commit
eab7b40a93
Se han modificado 2 ficheros con 24 adiciones y 1 borrados
  1. 13 0
      Libs/Widgets/ctkRangeWidget.cpp
  2. 11 1
      Libs/Widgets/ctkRangeWidget.h

+ 13 - 0
Libs/Widgets/ctkRangeWidget.cpp

@@ -741,3 +741,16 @@ void ctkRangeWidget::setSlider(ctkDoubleRangeSlider* slider)
   d->relayout();
   d->relayout();
 }
 }
 
 
+// -------------------------------------------------------------------------
+ctkDoubleSpinBox* ctkRangeWidget::minimumSpinBox()const
+{
+  Q_D(const ctkRangeWidget);
+  return d->MinimumSpinBox;
+}
+
+// -------------------------------------------------------------------------
+ctkDoubleSpinBox* ctkRangeWidget::maximumSpinBox()const
+{
+  Q_D(const ctkRangeWidget);
+  return d->MaximumSpinBox;
+}

+ 11 - 1
Libs/Widgets/ctkRangeWidget.h

@@ -30,6 +30,7 @@
 #include "ctkWidgetsExport.h"
 #include "ctkWidgetsExport.h"
 
 
 class ctkDoubleRangeSlider;
 class ctkDoubleRangeSlider;
+class ctkDoubleSpinBox;
 class ctkRangeWidgetPrivate;
 class ctkRangeWidgetPrivate;
 
 
 /// \ingroup Widgets
 /// \ingroup Widgets
@@ -179,6 +180,16 @@ public:
   bool symmetricMoves()const;
   bool symmetricMoves()const;
   void setSymmetricMoves(bool symmetry);
   void setSymmetricMoves(bool symmetry);
 
 
+  /// Return the slider of the range widget.
+  /// \sa minimumSpinBox(), maximumSpinBox()
+  ctkDoubleRangeSlider* slider()const;
+  /// Return the minimum spinbox.
+  /// \sa maximumSpinBox(), slider()
+  ctkDoubleSpinBox* minimumSpinBox()const;
+  /// Return the maximum spinbox.
+  /// \sa minimumSpinBox(), slider()
+  ctkDoubleSpinBox* maximumSpinBox()const;
+
 public Q_SLOTS:
 public Q_SLOTS:
   ///
   ///
   /// Reset the slider and spinbox to zero (value and position)
   /// Reset the slider and spinbox to zero (value and position)
@@ -218,7 +229,6 @@ protected:
   virtual bool eventFilter(QObject *obj, QEvent *event);
   virtual bool eventFilter(QObject *obj, QEvent *event);
 
 
   /// can be used to change the slider by a custom one
   /// can be used to change the slider by a custom one
-  ctkDoubleRangeSlider* slider()const;
   void setSlider(ctkDoubleRangeSlider* slider);
   void setSlider(ctkDoubleRangeSlider* slider);
 
 
 protected:
 protected: