Bladeren bron

STYLE: Add documentation to ctkColorPickerButton and ctkCoordinatesWidget

Julien Finet 15 jaren geleden
bovenliggende
commit
9b4e7838b9
3 gewijzigde bestanden met toevoegingen van 22 en 5 verwijderingen
  1. 12 0
      Libs/Widgets/ctkColorPickerButton.h
  2. 3 3
      Libs/Widgets/ctkCoordinatesWidget.cpp
  3. 7 2
      Libs/Widgets/ctkCoordinatesWidget.h

+ 12 - 0
Libs/Widgets/ctkColorPickerButton.h

@@ -28,6 +28,11 @@
 // CTK includes
 #include "CTKWidgetsExport.h"
 
+///
+/// ctkColorPickerButton is a QPushButton that refers to a color. The color 
+/// and the name of the color (i.e. #FFFFFF) are displayed on the button.
+/// When clicked, a color dialog shows up to select a new color 
+/// for the QPushButton. 
 class CTK_WIDGETS_EXPORT ctkColorPickerButton : public QPushButton
 {
   Q_OBJECT
@@ -38,10 +43,17 @@ public:
   explicit ctkColorPickerButton(const QColor& color, const QString & text, QWidget* parent = 0 );
   virtual ~ctkColorPickerButton(){}
   
+  ///
+  /// Current selected color
   QColor color()const;
 
 public slots:
+  ///
+  /// Set a new current color
   void setColor(const QColor& color);
+
+  /// 
+  /// Opens a color dialog to select a new current color.
   void changeColor(bool change = true);
 
 signals:

+ 3 - 3
Libs/Widgets/ctkCoordinatesWidget.cpp

@@ -39,7 +39,7 @@ ctkCoordinatesWidget::ctkCoordinatesWidget(QWidget* _parent) :QWidget(_parent)
   for (int i = 0; i < this->Dimension; ++i)
     {
     this->Coordinates[i] = 0.;
-    this->AddSpinBox();
+    this->addSpinBox();
     }
   hboxLayout->setContentsMargins(0, 0, 0, 0);
 }
@@ -51,7 +51,7 @@ ctkCoordinatesWidget::~ctkCoordinatesWidget()
 }
 
 //------------------------------------------------------------------------------
-void ctkCoordinatesWidget::AddSpinBox()
+void ctkCoordinatesWidget::addSpinBox()
 {
   QDoubleSpinBox* spinBox = new QDoubleSpinBox(this);
   spinBox->setMinimum(this->Minimum);
@@ -76,7 +76,7 @@ void ctkCoordinatesWidget::setDimension(int dim)
     for (int i = this->Dimension; i < dim; ++i)
       {
       newPos[i] = 0.;
-      this->AddSpinBox();
+      this->addSpinBox();
       }
     }
   else

+ 7 - 2
Libs/Widgets/ctkCoordinatesWidget.h

@@ -27,6 +27,10 @@
 // CTK includes
 #include "CTKWidgetsExport.h"
 
+///
+/// ctkCoordinatesWidget is a simple container of dimension coordinates.
+/// For each coordinate a spinbox is associated, everytime a value is modified
+/// the signal valueChanged is fired.
 class CTK_WIDGETS_EXPORT ctkCoordinatesWidget : public QWidget
 {
   Q_OBJECT 
@@ -35,7 +39,6 @@ class CTK_WIDGETS_EXPORT ctkCoordinatesWidget : public QWidget
   Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
   Q_PROPERTY(double singleStep  READ singleStep WRITE setSingleStep STORED false)
   Q_PROPERTY(QString coordinates READ coordinatesAsString WRITE setCoordinatesAsString)
-
     
 public:
   explicit ctkCoordinatesWidget(QWidget* parent = 0);
@@ -72,6 +75,8 @@ public:
   double* coordinates()const;
 
 signals:
+  ///
+  /// valueChanged is fired anytime one coordinate is modified
   void valueChanged(double* pos);
 
 protected slots:
@@ -79,7 +84,7 @@ protected slots:
   void coordinatesChanged();
 
 protected:
-  void AddSpinBox();
+  void addSpinBox();
 
   double  Minimum;
   double  Maximum;