ソースを参照

Expose publicly ctkRangeWidget slider, min and max spinbox

It can be handy to tweak sliders and spinboxes.
Julien Finet 11 年 前
コミット
eab7b40a93
共有2 個のファイルを変更した24 個の追加1 個の削除を含む
  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();
 }
 
+// -------------------------------------------------------------------------
+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"
 
 class ctkDoubleRangeSlider;
+class ctkDoubleSpinBox;
 class ctkRangeWidgetPrivate;
 
 /// \ingroup Widgets
@@ -179,6 +180,16 @@ public:
   bool symmetricMoves()const;
   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:
   ///
   /// Reset the slider and spinbox to zero (value and position)
@@ -218,7 +229,6 @@ protected:
   virtual bool eventFilter(QObject *obj, QEvent *event);
 
   /// can be used to change the slider by a custom one
-  ctkDoubleRangeSlider* slider()const;
   void setSlider(ctkDoubleRangeSlider* slider);
 
 protected: