Explorar el Código

Merge branch 'rename-ctkspinbox-into-ctkdoublespinbox'

* rename-ctkspinbox-into-ctkdoublespinbox:
  Rename ctkSpinBox to ctkDoubleSpinBox
Julien Finet hace 11 años
padre
commit
2040148f83

+ 1 - 1
Libs/CommandLineModules/Frontend/QtGui/Testing/Cpp/ctkCmdLineModuleQtXslTransformTest.cpp

@@ -329,7 +329,7 @@ void ctkCmdLineModuleQtXslTransformTester::testBindVariable_data()
     + parametersWidgetFooter
     + mainWidgetFooter;
   integerParameterUi.replace("QSpinBox", "ctkSliderWidget");
-  QTest::newRow("QSpinBox -> ctkSpinBox") << integerParameter
+  QTest::newRow("QSpinBox -> ctkDoubleSpinBox") << integerParameter
                                           << QString("integerWidget")
                                           << QString("ctkSliderWidget")
                                           << integerParameterUi;

+ 3 - 3
Libs/Widgets/CMakeLists.txt

@@ -147,8 +147,8 @@ set(KIT_SRCS
   ctkSizeGrip.h
   ctkSliderWidget.cpp
   ctkSliderWidget.h
-  ctkSpinBox.cpp
-  ctkSpinBox.h
+  ctkDoubleSpinBox.cpp
+  ctkDoubleSpinBox.h
   ctkTestApplication.cpp
   ctkTestApplication.h
   ctkThumbnailLabel.cpp
@@ -257,7 +257,7 @@ set(KIT_MOC_SRCS
   ctkSimpleLayoutManager.h
   ctkSizeGrip.h
   ctkSliderWidget.h
-  ctkSpinBox.h
+  ctkDoubleSpinBox.h
   ctkTestApplication.h
   ctkThumbnailLabel.h
   ctkThumbnailListWidget.h

+ 3 - 3
Libs/Widgets/Plugins/CMakeLists.txt

@@ -90,8 +90,8 @@ set(PLUGIN_SRCS
   ctkSettingsDialogPlugin.h
   ctkSliderWidgetPlugin.cpp
   ctkSliderWidgetPlugin.h
-  ctkSpinBoxPlugin.cpp
-  ctkSpinBoxPlugin.h
+  ctkDoubleSpinBoxPlugin.cpp
+  ctkDoubleSpinBoxPlugin.h
   ctkWorkflowButtonBoxWidgetPlugin.cpp
   ctkWorkflowButtonBoxWidgetPlugin.h
   ctkWorkflowWidgetStepPlugin.cpp
@@ -141,7 +141,7 @@ set(PLUGIN_MOC_SRCS
   ctkSettingsPanelPlugin.h
   ctkSettingsDialogPlugin.h
   ctkSliderWidgetPlugin.h
-  ctkSpinBoxPlugin.h
+  ctkDoubleSpinBoxPlugin.h
   ctkWorkflowButtonBoxWidgetPlugin.h
   ctkWorkflowWidgetStepPlugin.h
   )

+ 14 - 14
Libs/Widgets/Plugins/ctkSpinBoxPlugin.cpp

@@ -19,49 +19,49 @@
 =========================================================================*/
 
 // CTK includes
-#include "ctkSpinBoxPlugin.h"
-#include "ctkSpinBox.h"
+#include "ctkDoubleSpinBoxPlugin.h"
+#include "ctkDoubleSpinBox.h"
 
 // --------------------------------------------------------------------------
-ctkSpinBoxPlugin::ctkSpinBoxPlugin(QObject *_parent)
+ctkDoubleSpinBoxPlugin::ctkDoubleSpinBoxPlugin(QObject *_parent)
   : QObject(_parent)
 {
 }
 
 // --------------------------------------------------------------------------
-QWidget *ctkSpinBoxPlugin::createWidget(QWidget *_parent)
+QWidget *ctkDoubleSpinBoxPlugin::createWidget(QWidget *_parent)
 {
-  ctkSpinBox* _widget = new ctkSpinBox(_parent);
-  return _widget;
+  ctkDoubleSpinBox* newWidget = new ctkDoubleSpinBox(_parent);
+  return newWidget;
 }
 
 // --------------------------------------------------------------------------
-QString ctkSpinBoxPlugin::domXml() const
+QString ctkDoubleSpinBoxPlugin::domXml() const
 {
-  return "<widget class=\"ctkSpinBox\" name=\"SpinBox\">\n"
+  return "<widget class=\"ctkDoubleSpinBox\" name=\"DoubleSpinBox\">\n"
     "</widget>\n";
 }
 
 // --------------------------------------------------------------------------
-QIcon ctkSpinBoxPlugin::icon() const
+QIcon ctkDoubleSpinBoxPlugin::icon() const
 {
   return QIcon(":/Icons/doublespinbox.png");
 }
 
 // --------------------------------------------------------------------------
-QString ctkSpinBoxPlugin::includeFile() const
+QString ctkDoubleSpinBoxPlugin::includeFile() const
 {
-  return "ctkSpinBox.h";
+  return "ctkDoubleSpinBox.h";
 }
 
 // --------------------------------------------------------------------------
-bool ctkSpinBoxPlugin::isContainer() const
+bool ctkDoubleSpinBoxPlugin::isContainer() const
 {
   return false;
 }
 
 // --------------------------------------------------------------------------
-QString ctkSpinBoxPlugin::name() const
+QString ctkDoubleSpinBoxPlugin::name() const
 {
-  return "ctkSpinBox";
+  return "ctkDoubleSpinBox";
 }

+ 4 - 4
Libs/Widgets/Plugins/ctkSpinBoxPlugin.h

@@ -18,20 +18,20 @@
 
 =========================================================================*/
 
-#ifndef __ctkSpinBoxPlugin_h
-#define __ctkSpinBoxPlugin_h
+#ifndef __ctkDoubleSpinBoxPlugin_h
+#define __ctkDoubleSpinBoxPlugin_h
 
 // CTK includes
 #include "ctkWidgetsAbstractPlugin.h"
 
-class CTK_WIDGETS_PLUGINS_EXPORT ctkSpinBoxPlugin :
+class CTK_WIDGETS_PLUGINS_EXPORT ctkDoubleSpinBoxPlugin :
   public QObject,
   public ctkWidgetsAbstractPlugin
 {
   Q_OBJECT
 
 public:
-  ctkSpinBoxPlugin(QObject *_parent = 0);
+  ctkDoubleSpinBoxPlugin(QObject *_parent = 0);
 
   QWidget *createWidget(QWidget *_parent);
   QString  domXml() const;

+ 2 - 2
Libs/Widgets/Plugins/ctkWidgetsPlugins.h

@@ -60,7 +60,7 @@
 #include "ctkSettingsPanelPlugin.h"
 #include "ctkSettingsDialogPlugin.h"
 #include "ctkSliderWidgetPlugin.h"
-#include "ctkSpinBoxPlugin.h"
+#include "ctkDoubleSpinBoxPlugin.h"
 #include "ctkThumbnailLabelPlugin.h"
 #include "ctkTransferFunctionViewPlugin.h"
 #include "ctkTreeComboBoxPlugin.h"
@@ -112,7 +112,7 @@ public:
             << new ctkSettingsPanelPlugin
             << new ctkSettingsDialogPlugin
             << new ctkSliderWidgetPlugin
-            << new ctkSpinBoxPlugin
+            << new ctkDoubleSpinBoxPlugin
             << new ctkThumbnailLabelPlugin
             << new ctkTransferFunctionViewPlugin
             << new ctkTreeComboBoxPlugin

+ 4 - 4
Libs/Widgets/Resources/UI/ctkRangeWidget.ui

@@ -24,7 +24,7 @@
     <number>0</number>
    </property>
    <item row="0" column="0">
-    <widget class="ctkSpinBox" name="MinimumSpinBox"/>
+    <widget class="ctkDoubleSpinBox" name="MinimumSpinBox"/>
    </item>
    <item row="0" column="1">
     <widget class="ctkDoubleRangeSlider" name="Slider">
@@ -34,7 +34,7 @@
     </widget>
    </item>
    <item row="0" column="2">
-    <widget class="ctkSpinBox" name="MaximumSpinBox"/>
+    <widget class="ctkDoubleSpinBox" name="MaximumSpinBox"/>
    </item>
   </layout>
  </widget>
@@ -45,9 +45,9 @@
    <header>ctkDoubleRangeSlider.h</header>
   </customwidget>
   <customwidget>
-   <class>ctkSpinBox</class>
+   <class>ctkDoubleSpinBox</class>
    <extends>QWidget</extends>
-   <header>ctkSpinBox.h</header>
+   <header>ctkDoubleSpinBox.h</header>
   </customwidget>
  </customwidgets>
  <resources/>

+ 4 - 4
Libs/Widgets/Resources/UI/ctkScreenshotDialog.ui

@@ -151,12 +151,12 @@
        </widget>
       </item>
       <item row="3" column="1">
-       <widget class="ctkSpinBox" name="ScaleFactorSpinBox">
+       <widget class="ctkDoubleSpinBox" name="ScaleFactorSpinBox">
         <property name="toolTip">
          <string>Select an integer scale factor (between 0.5 and 5) for the image file, e.g. a value of &quot;2&quot; will save an image twice the size.</string>
         </property>
         <property name="decimalsOption">
-         <enum>ctkSpinBox::Fixed</enum>
+         <enum>ctkDoubleSpinBox::Fixed</enum>
         </property>
         <property name="decimals">
          <number>1</number>
@@ -289,9 +289,9 @@
    <header>ctkPathLineEdit.h</header>
   </customwidget>
   <customwidget>
-   <class>ctkSpinBox</class>
+   <class>ctkDoubleSpinBox</class>
    <extends>QWidget</extends>
-   <header>ctkSpinBox.h</header>
+   <header>ctkDoubleSpinBox.h</header>
   </customwidget>
  </customwidgets>
  <resources>

+ 3 - 3
Libs/Widgets/Resources/UI/ctkSliderWidget.ui

@@ -31,7 +31,7 @@
     </widget>
    </item>
    <item>
-    <widget class="ctkSpinBox" name="SpinBox"/>
+    <widget class="ctkDoubleSpinBox" name="SpinBox"/>
    </item>
   </layout>
  </widget>
@@ -42,9 +42,9 @@
    <header>ctkDoubleSlider.h</header>
   </customwidget>
   <customwidget>
-   <class>ctkSpinBox</class>
+   <class>ctkDoubleSpinBox</class>
    <extends>QWidget</extends>
-   <header>ctkSpinBox.h</header>
+   <header>ctkDoubleSpinBox.h</header>
   </customwidget>
  </customwidgets>
  <resources/>

+ 2 - 2
Libs/Widgets/Testing/Cpp/CMakeLists.txt

@@ -71,7 +71,7 @@ set(TEST_SOURCES
   ctkSignalMapperTest1.cpp
   ctkSliderWidgetTest1.cpp
   ctkSliderWidgetTest2.cpp
-  ctkSpinBoxTest1.cpp
+  ctkDoubleSpinBoxTest1.cpp
   ctkThumbnailListWidgetTest1.cpp
   ctkThumbnailLabelTest1.cpp
   ctkToolTipTrapperTest1.cpp
@@ -275,7 +275,7 @@ SIMPLE_TEST( ctkSettingsTest1 )
 SIMPLE_TEST( ctkSignalMapperTest1 )
 SIMPLE_TEST( ctkSliderWidgetTest1 )
 SIMPLE_TEST( ctkSliderWidgetTest2 )
-SIMPLE_TEST( ctkSpinBoxTest1 )
+SIMPLE_TEST( ctkDoubleSpinBoxTest1 )
 SIMPLE_TEST( ctkThumbnailListWidgetTest1 )
 SIMPLE_TEST( ctkThumbnailLabelTest1 )
 SIMPLE_TEST( ctkToolTipTrapperTest1 )

+ 7 - 7
Libs/Widgets/Testing/Cpp/ctkCoordinatesWidgetEventTranslatorPlayerTest1.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0"?>
 <QtTesting>
     <events>
-        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkSpinBox0/1QDoubleSpinBox0" command="set_double" arguments="1"/>
-        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkSpinBox0/1QDoubleSpinBox0" command="set_double" arguments="2"/>
-        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkSpinBox0/1QDoubleSpinBox0" command="set_double" arguments="3"/>
-        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkSpinBox0/1QDoubleSpinBox0" command="set_double" arguments="6"/>
-        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkSpinBox1/1QDoubleSpinBox0" command="set_double" arguments="15.0"/>
-        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkSpinBox2/1QDoubleSpinBox0" command="set_double" arguments="8.36"/>
-        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkSpinBox2/1QDoubleSpinBox0" command="set_double" arguments="3"/>
+        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkDoubleSpinBox0/1QDoubleSpinBox0" command="set_double" arguments="1"/>
+        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkDoubleSpinBox0/1QDoubleSpinBox0" command="set_double" arguments="2"/>
+        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkDoubleSpinBox0/1QDoubleSpinBox0" command="set_double" arguments="3"/>
+        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkDoubleSpinBox0/1QDoubleSpinBox0" command="set_double" arguments="6"/>
+        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkDoubleSpinBox1/1QDoubleSpinBox0" command="set_double" arguments="15.0"/>
+        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkDoubleSpinBox2/1QDoubleSpinBox0" command="set_double" arguments="8.36"/>
+        <event widget="ctkEventTranslatorPlayerWidget/centralwidget/stackedWidget/1ctkCoordinatesWidget0/1ctkDoubleSpinBox2/1QDoubleSpinBox0" command="set_double" arguments="3"/>
     </events>
 </QtTesting>

+ 3 - 3
Libs/Widgets/Testing/Cpp/ctkSpinBoxTest1.cpp

@@ -25,18 +25,18 @@
 #include <QTimer>
 
 // CTK includes
-#include "ctkSpinBox.h"
+#include "ctkDoubleSpinBox.h"
 
 // STD includes
 #include <cstdlib>
 #include <iostream>
 
 //-----------------------------------------------------------------------------
-int ctkSpinBoxTest1(int argc, char * argv [] )
+int ctkDoubleSpinBoxTest1(int argc, char * argv [] )
 {
   QApplication app(argc, argv);
 
-  ctkSpinBox spinBox;
+  ctkDoubleSpinBox spinBox;
 
   // ----------------------------------------
   // Regular SpinBox methods

+ 12 - 12
Libs/Widgets/ctkCoordinatesWidget.cpp

@@ -24,7 +24,7 @@
 
 // CTK includes
 #include "ctkCoordinatesWidget.h"
-#include "ctkSpinBox.h"
+#include "ctkDoubleSpinBox.h"
 
 // STD includes
 #include <cmath>
@@ -56,7 +56,7 @@ ctkCoordinatesWidget::~ctkCoordinatesWidget()
 //------------------------------------------------------------------------------
 void ctkCoordinatesWidget::addSpinBox()
 {
-  ctkSpinBox* spinBox = new ctkSpinBox(this);
+  ctkDoubleSpinBox* spinBox = new ctkDoubleSpinBox(this);
   spinBox->setDecimals(this->Decimals);
   spinBox->setSingleStep(this->SingleStep);
   spinBox->setMinimum(this->Minimum);
@@ -120,7 +120,7 @@ void ctkCoordinatesWidget::setMinimum(double min)
   for (int i = 0; this->layout()->itemAt(i); ++i)
     {
     QLayoutItem* item = this->layout()->itemAt(i);
-    ctkSpinBox* spinBox = item ? qobject_cast<ctkSpinBox*>(
+    ctkDoubleSpinBox* spinBox = item ? qobject_cast<ctkDoubleSpinBox*>(
       item->widget()) : 0;
     if (spinBox)
       {
@@ -142,7 +142,7 @@ void ctkCoordinatesWidget::setMaximum(double max)
   for (int i = 0; this->layout()->itemAt(i); ++i)
     {
     QLayoutItem* item = this->layout()->itemAt(i);
-    ctkSpinBox* spinBox = item ? qobject_cast<ctkSpinBox*>(
+    ctkDoubleSpinBox* spinBox = item ? qobject_cast<ctkDoubleSpinBox*>(
       item->widget()) : 0;
     if (spinBox)
       {
@@ -189,7 +189,7 @@ void ctkCoordinatesWidget::setDecimals(int newDecimals)
   for (int i = 0; this->layout()->itemAt(i); ++i)
     {
     QLayoutItem* item = this->layout()->itemAt(i);
-    ctkSpinBox* spinBox = item ? qobject_cast<ctkSpinBox*>(
+    ctkDoubleSpinBox* spinBox = item ? qobject_cast<ctkDoubleSpinBox*>(
       item->widget()) : 0;
     if (spinBox)
       {
@@ -210,7 +210,7 @@ void ctkCoordinatesWidget::setSingleStep(double step)
   for (int i = 0; this->layout()->itemAt(i); ++i)
     {
     QLayoutItem* item = this->layout()->itemAt(i);
-    ctkSpinBox* spinBox = item ? qobject_cast<ctkSpinBox*>(
+    ctkDoubleSpinBox* spinBox = item ? qobject_cast<ctkDoubleSpinBox*>(
       item->widget()) : 0;
     if (spinBox)
       {
@@ -273,8 +273,8 @@ void ctkCoordinatesWidget::setCoordinates(double* coordinates)
   for (int i = 0; i < this->Dimension; ++i)
     {
     QLayoutItem* item = this->layout()->itemAt(i);
-    ctkSpinBox* spinBox =
-      item ? qobject_cast<ctkSpinBox*>(item->widget()) : 0;
+    ctkDoubleSpinBox* spinBox =
+      item ? qobject_cast<ctkDoubleSpinBox*>(item->widget()) : 0;
     if (spinBox)
       {
       // we don't want updateCoordinate() to be called.
@@ -329,8 +329,8 @@ void ctkCoordinatesWidget::updateCoordinate(double coordinate)
   for (int i = 0; i < this->Dimension; ++i)
     {
     QLayoutItem* item = this->layout()->itemAt(i);
-    ctkSpinBox* spinBox =
-      item ? qobject_cast<ctkSpinBox*>(item->widget()) : 0;
+    ctkDoubleSpinBox* spinBox =
+      item ? qobject_cast<ctkDoubleSpinBox*>(item->widget()) : 0;
     if ( spinBox && spinBox == this->sender())
       {
       this->Coordinates[i] = coordinate;
@@ -435,8 +435,8 @@ void ctkCoordinatesWidget::updateCoordinates()
   for (int i = 0; i < this->Dimension; ++i)
     {
     QLayoutItem* item = this->layout()->itemAt(i);
-    ctkSpinBox* spinBox =
-      item ? qobject_cast<ctkSpinBox*>(item->widget()) : 0;
+    ctkDoubleSpinBox* spinBox =
+      item ? qobject_cast<ctkDoubleSpinBox*>(item->widget()) : 0;
     if ( spinBox)
       {
       this->Coordinates[i] = spinBox->value();

+ 101 - 101
Libs/Widgets/ctkSpinBox.cpp

@@ -19,7 +19,7 @@
 =========================================================================*/
 
 // CTK includes
-#include "ctkSpinBox.h"
+#include "ctkDoubleSpinBox.h"
 #include "ctkUtils.h"
 #include "ctkPimpl.h"
 
@@ -35,18 +35,18 @@
 #include <QVariant>
 
 //-----------------------------------------------------------------------------
-class ctkSpinBoxPrivate
+class ctkDoubleSpinBoxPrivate
 {
-  Q_DECLARE_PUBLIC(ctkSpinBox);
+  Q_DECLARE_PUBLIC(ctkDoubleSpinBox);
 protected:
-  ctkSpinBox* const q_ptr;
+  ctkDoubleSpinBox* const q_ptr;
 public:
-  ctkSpinBoxPrivate(ctkSpinBox& object);
+  ctkDoubleSpinBoxPrivate(ctkDoubleSpinBox& object);
 
   QDoubleSpinBox* SpinBox;
-  ctkSpinBox::SetMode Mode;
+  ctkDoubleSpinBox::SetMode Mode;
   int DefaultDecimals;
-  ctkSpinBox::DecimalsOptions DOption;
+  ctkDoubleSpinBox::DecimalsOptions DOption;
 
   void init();
   // Compare two double previously rounded according to the number of decimals
@@ -58,20 +58,20 @@ public:
 };
 
 //-----------------------------------------------------------------------------
-ctkSpinBoxPrivate::ctkSpinBoxPrivate(ctkSpinBox& object) : q_ptr(&object)
+ctkDoubleSpinBoxPrivate::ctkDoubleSpinBoxPrivate(ctkDoubleSpinBox& object) : q_ptr(&object)
 {
-  qRegisterMetaType<ctkSpinBox::SetMode>("ctkSpinBox::SetMode");
-  qRegisterMetaType<ctkSpinBox::DecimalsOptions>("ctkSpinBox::DecimalsOption");
+  qRegisterMetaType<ctkDoubleSpinBox::SetMode>("ctkDoubleSpinBox::SetMode");
+  qRegisterMetaType<ctkDoubleSpinBox::DecimalsOptions>("ctkDoubleSpinBox::DecimalsOption");
   this->SpinBox = 0;
-  this->Mode = ctkSpinBox::SetIfDifferent;
+  this->Mode = ctkDoubleSpinBox::SetIfDifferent;
   this->DefaultDecimals = 2;
-  this->DOption = ctkSpinBox::UseShortcuts;
+  this->DOption = ctkDoubleSpinBox::UseShortcuts;
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBoxPrivate::init()
+void ctkDoubleSpinBoxPrivate::init()
 {
-  Q_Q(ctkSpinBox);
+  Q_Q(ctkDoubleSpinBox);
   this->SpinBox = new QDoubleSpinBox(q);
   QObject::connect(this->SpinBox, SIGNAL(valueChanged(double)),
     q, SIGNAL(valueChanged(double)));
@@ -91,78 +91,78 @@ void ctkSpinBoxPrivate::init()
 }
 
 //-----------------------------------------------------------------------------
-bool ctkSpinBoxPrivate::compare(double x1, double x2) const
+bool ctkDoubleSpinBoxPrivate::compare(double x1, double x2) const
 {
-  Q_Q(const ctkSpinBox);
+  Q_Q(const ctkDoubleSpinBox);
   return q->round(x1) == q->round(x2);
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBoxPrivate::setDecimals(int dec)
+void ctkDoubleSpinBoxPrivate::setDecimals(int dec)
 {
-  Q_Q(ctkSpinBox);
+  Q_Q(ctkDoubleSpinBox);
   this->SpinBox->setDecimals(dec);
   emit q->decimalsChanged(dec);
 }
 
 //-----------------------------------------------------------------------------
-ctkSpinBox::ctkSpinBox(QWidget* newParent)
+ctkDoubleSpinBox::ctkDoubleSpinBox(QWidget* newParent)
   : QWidget(newParent)
-  , d_ptr(new ctkSpinBoxPrivate(*this))
+  , d_ptr(new ctkDoubleSpinBoxPrivate(*this))
 {
-  Q_D(ctkSpinBox);
+  Q_D(ctkDoubleSpinBox);
   d->init();
 }
 
 //-----------------------------------------------------------------------------
-ctkSpinBox::ctkSpinBox(ctkSpinBox::SetMode mode, QWidget* newParent)
+ctkDoubleSpinBox::ctkDoubleSpinBox(ctkDoubleSpinBox::SetMode mode, QWidget* newParent)
   : QWidget(newParent)
-  , d_ptr(new ctkSpinBoxPrivate(*this))
+  , d_ptr(new ctkDoubleSpinBoxPrivate(*this))
 {
-  Q_D(ctkSpinBox);
+  Q_D(ctkDoubleSpinBox);
   d->init();
   this->setSetMode(mode);
 }
 
 //-----------------------------------------------------------------------------
-double ctkSpinBox::value() const
+double ctkDoubleSpinBox::value() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->value();
 }
 
 //-----------------------------------------------------------------------------
-double ctkSpinBox::displayedValue() const
+double ctkDoubleSpinBox::displayedValue() const
 {
   return this->round(this->value());
 }
 
 //-----------------------------------------------------------------------------
-QString ctkSpinBox::text() const
+QString ctkDoubleSpinBox::text() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->text();
 }
 
 //-----------------------------------------------------------------------------
-QString ctkSpinBox::cleanText() const
+QString ctkDoubleSpinBox::cleanText() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->cleanText();
 }
 
 //-----------------------------------------------------------------------------
-Qt::Alignment ctkSpinBox::alignment() const
+Qt::Alignment ctkDoubleSpinBox::alignment() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->alignment();
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setAlignment(Qt::Alignment flag)
+void ctkDoubleSpinBox::setAlignment(Qt::Alignment flag)
 {
-  Q_D(const ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent && flag == d->SpinBox->alignment())
+  Q_D(const ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent && flag == d->SpinBox->alignment())
     {
     return;
     }
@@ -171,10 +171,10 @@ void ctkSpinBox::setAlignment(Qt::Alignment flag)
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setFrame(bool frame)
+void ctkDoubleSpinBox::setFrame(bool frame)
 {
-  Q_D(const ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent && frame == d->SpinBox->hasFrame())
+  Q_D(const ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent && frame == d->SpinBox->hasFrame())
     {
     return;
     }
@@ -183,24 +183,24 @@ void ctkSpinBox::setFrame(bool frame)
 }
 
 //-----------------------------------------------------------------------------
-bool ctkSpinBox::hasFrame() const
+bool ctkDoubleSpinBox::hasFrame() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->hasFrame();
 }
 
 //-----------------------------------------------------------------------------
-QString ctkSpinBox::prefix() const
+QString ctkDoubleSpinBox::prefix() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->prefix();
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setPrefix(const QString &prefix)
+void ctkDoubleSpinBox::setPrefix(const QString &prefix)
 {
-  Q_D(const ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent && prefix == d->SpinBox->prefix())
+  Q_D(const ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent && prefix == d->SpinBox->prefix())
     {
     return;
     }
@@ -215,17 +215,17 @@ void ctkSpinBox::setPrefix(const QString &prefix)
 }
 
 //-----------------------------------------------------------------------------
-QString ctkSpinBox::suffix() const
+QString ctkDoubleSpinBox::suffix() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->suffix();
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setSuffix(const QString &suffix)
+void ctkDoubleSpinBox::setSuffix(const QString &suffix)
 {
-  Q_D(const ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent && suffix == d->SpinBox->suffix())
+  Q_D(const ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent && suffix == d->SpinBox->suffix())
     {
     return;
     }
@@ -240,17 +240,17 @@ void ctkSpinBox::setSuffix(const QString &suffix)
 }
 
 //-----------------------------------------------------------------------------
-double ctkSpinBox::singleStep() const
+double ctkDoubleSpinBox::singleStep() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->singleStep();
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setSingleStep(double step)
+void ctkDoubleSpinBox::setSingleStep(double step)
 {
-  Q_D(ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent
+  Q_D(ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent
     && d->compare(step, this->singleStep()))
     {
     return;
@@ -260,17 +260,17 @@ void ctkSpinBox::setSingleStep(double step)
 }
 
 //-----------------------------------------------------------------------------
-double ctkSpinBox::minimum() const
+double ctkDoubleSpinBox::minimum() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->minimum();
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setMinimum(double min)
+void ctkDoubleSpinBox::setMinimum(double min)
 {
-  Q_D(ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent
+  Q_D(ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent
     && d->compare(min, this->minimum()))
     {
     return;
@@ -280,17 +280,17 @@ void ctkSpinBox::setMinimum(double min)
 }
 
 //-----------------------------------------------------------------------------
-double ctkSpinBox::maximum() const
+double ctkDoubleSpinBox::maximum() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->maximum();
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setMaximum(double max)
+void ctkDoubleSpinBox::setMaximum(double max)
 {
-  Q_D(ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent
+  Q_D(ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent
     && d->compare(max, this->maximum()))
     {
     return;
@@ -300,10 +300,10 @@ void ctkSpinBox::setMaximum(double max)
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setRange(double min, double max)
+void ctkDoubleSpinBox::setRange(double min, double max)
 {
-  Q_D(ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent
+  Q_D(ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent
     && d->compare(max, this->maximum()) && d->compare(min, this->minimum()))
     {
     return;
@@ -313,18 +313,18 @@ void ctkSpinBox::setRange(double min, double max)
 }
 
 //-----------------------------------------------------------------------------
-int ctkSpinBox::decimals() const
+int ctkDoubleSpinBox::decimals() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox->decimals();
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setDecimals(int dec)
+void ctkDoubleSpinBox::setDecimals(int dec)
 {
-  Q_D(ctkSpinBox);
+  Q_D(ctkDoubleSpinBox);
   dec = qMax(0, dec);
-  if (d->Mode == ctkSpinBox::SetIfDifferent && dec == this->decimals())
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent && dec == this->decimals())
     {
     return;
     }
@@ -334,24 +334,24 @@ void ctkSpinBox::setDecimals(int dec)
 }
 
 //-----------------------------------------------------------------------------
-double ctkSpinBox::round(double value) const
+double ctkDoubleSpinBox::round(double value) const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return QString::number(value, 'f', d->SpinBox->decimals()).toDouble();
 }
 
 //-----------------------------------------------------------------------------
-QDoubleSpinBox* ctkSpinBox::spinBox() const
+QDoubleSpinBox* ctkDoubleSpinBox::spinBox() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->SpinBox;
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setValue(double value)
+void ctkDoubleSpinBox::setValue(double value)
 {
-  Q_D(ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent)
+  Q_D(ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent)
     {
     this->setValueIfDifferent(value);
     }
@@ -362,9 +362,9 @@ void ctkSpinBox::setValue(double value)
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setValueIfDifferent(double value)
+void ctkDoubleSpinBox::setValueIfDifferent(double value)
 {
-  Q_D(ctkSpinBox);
+  Q_D(ctkDoubleSpinBox);
   if (! d->compare(this->value(), value))
     {
     d->SpinBox->setValue(value);
@@ -372,52 +372,52 @@ void ctkSpinBox::setValueIfDifferent(double value)
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setValueAlways(double value)
+void ctkDoubleSpinBox::setValueAlways(double value)
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   d->SpinBox->setValue(value);
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::stepUp()
+void ctkDoubleSpinBox::stepUp()
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   d->SpinBox->stepUp();
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::stepDown()
+void ctkDoubleSpinBox::stepDown()
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   d->SpinBox->stepDown();
 }
 
 //-----------------------------------------------------------------------------
-ctkSpinBox::SetMode ctkSpinBox::setMode() const
+ctkDoubleSpinBox::SetMode ctkDoubleSpinBox::setMode() const
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->Mode;
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setSetMode(ctkSpinBox::SetMode newMode)
+void ctkDoubleSpinBox::setSetMode(ctkDoubleSpinBox::SetMode newMode)
 {
-  Q_D(ctkSpinBox);
+  Q_D(ctkDoubleSpinBox);
   d->Mode = newMode;
 }
 
 //-----------------------------------------------------------------------------
-ctkSpinBox::DecimalsOptions ctkSpinBox::decimalsOption()
+ctkDoubleSpinBox::DecimalsOptions ctkDoubleSpinBox::decimalsOption()
 {
-  Q_D(const ctkSpinBox);
+  Q_D(const ctkDoubleSpinBox);
   return d->DOption;
 }
 
 //-----------------------------------------------------------------------------
-void ctkSpinBox::setDecimalsOption(ctkSpinBox::DecimalsOptions option)
+void ctkDoubleSpinBox::setDecimalsOption(ctkDoubleSpinBox::DecimalsOptions option)
 {
-  Q_D(ctkSpinBox);
-  if (d->Mode == ctkSpinBox::SetIfDifferent && option == d->DOption)
+  Q_D(ctkDoubleSpinBox);
+  if (d->Mode == ctkDoubleSpinBox::SetIfDifferent && option == d->DOption)
     {
     return;
     }
@@ -426,10 +426,10 @@ void ctkSpinBox::setDecimalsOption(ctkSpinBox::DecimalsOptions option)
 }
 
 //-----------------------------------------------------------------------------
-bool ctkSpinBox::eventFilter(QObject* obj, QEvent* event)
+bool ctkDoubleSpinBox::eventFilter(QObject* obj, QEvent* event)
 {
-  Q_D(ctkSpinBox);
-  if (d->DOption & ctkSpinBox::UseShortcuts &&
+  Q_D(ctkDoubleSpinBox);
+  if (d->DOption & ctkDoubleSpinBox::UseShortcuts &&
     obj == d->SpinBox && event->type() == QEvent::KeyPress)
     {
     QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);

+ 19 - 19
Libs/Widgets/ctkSpinBox.h

@@ -18,8 +18,8 @@
 
 =========================================================================*/
 
-#ifndef __ctkSpinBox_h
-#define __ctkSpinBox_h
+#ifndef __ctkDoubleSpinBox_h
+#define __ctkDoubleSpinBox_h
 
 // Qt includes
 #include <QMetaType>
@@ -34,13 +34,13 @@ class QObject;
 // CTK includes
 #include "ctkWidgetsExport.h"
 
-class ctkSpinBoxPrivate;
+class ctkDoubleSpinBoxPrivate;
 
 /// \brief Custom SpinBox
-/// The ctkSpinBox internaly uses a QDoubleSpinBox while it retain controls
+/// The ctkDoubleSpinBox internaly uses a QDoubleSpinBox while it retain controls
 /// over it.
 /// \sa ctkDoubleSlider, ctkSliderWidget, ctkRangeSlider
-class CTK_WIDGETS_EXPORT ctkSpinBox : public QWidget
+class CTK_WIDGETS_EXPORT ctkDoubleSpinBox : public QWidget
 {
   Q_OBJECT
   Q_ENUMS(SetMode)
@@ -99,10 +99,10 @@ public:
 
   typedef QWidget Superclass;
 
-  /// Constructor, creates a ctkSpinBox. The look and feel
+  /// Constructor, creates a ctkDoubleSpinBox. The look and feel
   /// are the same as of a QDoubleSpinBox
-  ctkSpinBox(QWidget* parent = 0);
-  ctkSpinBox(ctkSpinBox::SetMode mode, QWidget* parent = 0);
+  ctkDoubleSpinBox(QWidget* parent = 0);
+  ctkDoubleSpinBox(ctkDoubleSpinBox::SetMode mode, QWidget* parent = 0);
 
   /// Get the spinbox current value
   /// \sa setValue(), cleanText()
@@ -156,7 +156,7 @@ public:
 
   /// Set/Get number of displayed decimals.
   /// For a spinbox dealing only with integers, set this to 0.
-  /// \sa ctkSpinBox::DecimalsOption
+  /// \sa ctkDoubleSpinBox::DecimalsOption
   int decimals() const;
   void setDecimals(int decimal);
 
@@ -172,13 +172,13 @@ public:
 
   /// Set the spinbox mode when using a set*() method.
   //// \sa round(), setValue(), setValueIfDifferent(), setValueAlways()
-  ctkSpinBox::SetMode setMode() const;
+  ctkDoubleSpinBox::SetMode setMode() const;
   void setSetMode(SetMode mode);
 
   /// Set/Get the option used to input the decimals.
-  /// \sa ctkSpinBox::DecimalsOption
-  ctkSpinBox::DecimalsOptions decimalsOption();
-  void setDecimalsOption(ctkSpinBox::DecimalsOptions option);
+  /// \sa ctkDoubleSpinBox::DecimalsOption
+  ctkDoubleSpinBox::DecimalsOptions decimalsOption();
+  void setDecimalsOption(ctkDoubleSpinBox::DecimalsOptions option);
 
 public Q_SLOTS:
   /// Set the value of the spinbox following the current mode.
@@ -212,16 +212,16 @@ Q_SIGNALS:
   void decimalsChanged(int);
 
 protected:
-  ctkSpinBoxPrivate* const d_ptr;
+  ctkDoubleSpinBoxPrivate* const d_ptr;
 
   bool eventFilter(QObject *obj, QEvent *event);
 
 private:
-  Q_DECLARE_PRIVATE(ctkSpinBox);
-  Q_DISABLE_COPY(ctkSpinBox);
+  Q_DECLARE_PRIVATE(ctkDoubleSpinBox);
+  Q_DISABLE_COPY(ctkDoubleSpinBox);
 };
 
-Q_DECLARE_METATYPE(ctkSpinBox::SetMode)
-Q_DECLARE_OPERATORS_FOR_FLAGS(ctkSpinBox::DecimalsOptions)
+Q_DECLARE_METATYPE(ctkDoubleSpinBox::SetMode)
+Q_DECLARE_OPERATORS_FOR_FLAGS(ctkDoubleSpinBox::DecimalsOptions)
 
-#endif //__ctkSpinBox_h
+#endif //__ctkDoubleSpinBox_h

+ 3 - 3
Libs/Widgets/ctkMatrixWidget.cpp

@@ -20,7 +20,7 @@
 
 // CTK includes
 #include "ctkMatrixWidget.h"
-#include "ctkSpinBox.h"
+#include "ctkDoubleSpinBox.h"
 
 // Qt includes
 #include <QDebug>
@@ -40,11 +40,11 @@
 namespace
 {
 //-----------------------------------------------------------------------------
-  class ctkMatrixDoubleSpinBox : public ctkSpinBox
+  class ctkMatrixDoubleSpinBox : public ctkDoubleSpinBox
   {
   public:
     ctkMatrixDoubleSpinBox(QWidget * parentWidget)
-      : ctkSpinBox(parentWidget)
+      : ctkDoubleSpinBox(parentWidget)
     {
       // We know that the parentWidget() of parentWidget will be a
       // ctkMatrixWidget because this object is

+ 1 - 1
Libs/Widgets/ctkSliderWidget.cpp

@@ -595,7 +595,7 @@ ctkPopupWidget* ctkSliderWidget::popup()const
 }
 
 // --------------------------------------------------------------------------
-ctkSpinBox* ctkSliderWidget::spinBox()
+ctkDoubleSpinBox* ctkSliderWidget::spinBox()
 {
   Q_D(ctkSliderWidget);
   return d->SpinBox;

+ 2 - 2
Libs/Widgets/ctkSliderWidget.h

@@ -32,7 +32,7 @@
 class ctkDoubleSlider;
 class ctkPopupWidget;
 class ctkSliderWidgetPrivate;
-class ctkSpinBox;
+class ctkDoubleSpinBox;
 
 /// \ingroup Widgets
 ///
@@ -219,7 +219,7 @@ public:
   /// Returns the spinbox synchronized with the slider. Be careful
   /// with what you do with the spinbox as the slider might change
   /// properties automatically.
-  ctkSpinBox* spinBox();
+  ctkDoubleSpinBox* spinBox();
 
   ///
   /// Returns the slider synchronized with the spinbox. Be careful