Просмотр исходного кода

Expose ctkSliderWidget slider for fine tuning

Julien Finet лет назад: 13
Родитель
Сommit
902cf8953c
2 измененных файлов с 15 добавлено и 3 удалено
  1. 7 0
      Libs/Widgets/ctkSliderWidget.cpp
  2. 8 3
      Libs/Widgets/ctkSliderWidget.h

+ 7 - 0
Libs/Widgets/ctkSliderWidget.cpp

@@ -556,3 +556,10 @@ QDoubleSpinBox* ctkSliderWidget::spinBox()
   Q_D(ctkSliderWidget);
   return d->SpinBox;
 }
+
+// --------------------------------------------------------------------------
+ctkDoubleSlider* ctkSliderWidget::slider()
+{
+  Q_D(ctkSliderWidget);
+  return d->Slider;
+}

+ 8 - 3
Libs/Widgets/ctkSliderWidget.h

@@ -30,6 +30,7 @@ class QDoubleSpinBox;
 
 #include "ctkWidgetsExport.h"
 
+class ctkDoubleSlider;
 class ctkPopupWidget;
 class ctkSliderWidgetPrivate;
 
@@ -185,12 +186,16 @@ public:
   ctkPopupWidget* popup()const;
 
   ///
-  /// Sometimes it can be useful to have a direct control to the spinbox
-  /// To place it somewhere else that ctkDoubleSlider can't. Be careful
-  /// with what you do with the spinbox as ctkDoubleSlider might change
+  /// Returns the spinbox synchronized with the slider. Be careful
+  /// with what you do with the spinbox as the slider might change
   /// properties automatically.
   QDoubleSpinBox* spinBox();
 
+  ///
+  /// Returns the slider synchronized with the spinbox. Be careful
+  /// with what you do with the slider as the spinbox might change
+  /// properties automatically.
+  ctkDoubleSlider* slider();
 public slots:
   /// 
   /// Reset the slider and spinbox to zero (value and position)