Pārlūkot izejas kodu

ENH: Add more comments in public API of some widgets

Julien Finet 15 gadi atpakaļ
vecāks
revīzija
b18ceaf20e

+ 3 - 1
Libs/Widgets/ctkButtonGroup.h

@@ -34,7 +34,9 @@ class ctkButtonGroupPrivate;
 ///
 /// ctkButtonGroup is a QButtonGroup with a different behavior when exclusive.
 /// An exclusive ctkButtonGroup switches off the previously checked button when 
-/// a new button is checked.
+/// a new button is checked. ctkButtonGroup doesn't enforce that 1 button is
+/// checked at all time (contrary to QButtonGroup). If a button is checked it is
+/// possible to uncheck it without having to check another button.
 /// Use ctkButtonGroup the same way than QButtonGroup (see QButtonGroup doc).
 /// i.e. : ctkButtonGroup* buttonGroup = new ctkButtonGroup(parent);
 /// buttonGroup->addButton(button1);

+ 5 - 1
Libs/Widgets/ctkCheckableHeaderView.h

@@ -66,7 +66,8 @@ class ctkCheckableHeaderViewPrivate;
 /// ctkCheckableHeaderView is a QHeaderView that can display a checkbox 
 /// for any header section.
 /// If propageteToItems, the check state of the header section is set to
-/// all items in the header row/column of the QAbstractItemModel
+/// all items in the header row/column of the QAbstractItemModel if the 
+/// items are checkable.
 /// ctkCheckableHeaderView also supports row/column sorting.
 class CTK_WIDGETS_EXPORT ctkCheckableHeaderView : public QHeaderView
 {
@@ -76,7 +77,10 @@ public:
   ctkCheckableHeaderView(Qt::Orientation orient, QWidget *parent=0);
   virtual ~ctkCheckableHeaderView();
 
+  /// Reimplemented for internal reasons
   virtual void setModel(QAbstractItemModel *model);
+
+  /// Reimplemented for internal reasons
   virtual void setRootIndex(const QModelIndex &index);
 
   /// 

+ 2 - 2
Libs/Widgets/ctkCollapsibleButton.h

@@ -32,8 +32,8 @@
 class ctkCollapsibleButtonPrivate;
 class QStyleOptionButton;
 
-/// Description
-/// A Collapsible widget that show/hide its children depending on its checked/collapsed properties
+/// A collapsible button that shows/hides its children depending on its
+/// checked/collapsed property.
 /// Warning: As ctkCollapsibleButton forces the Visiblity of its children to
 /// true when it get expanded, any child Visibility property is lost. All the widgets
 /// will then be visible. To avoid this behavior, use an intermediate widget that

+ 10 - 0
Libs/Widgets/ctkCollapsibleGroupBox.h

@@ -27,20 +27,28 @@
 // CTK includes
 #include "CTKWidgetsExport.h"
 
+/// A QGroupBox with an arrow indicator that shows/hides the groupbox contents
+/// when clicked.
 class CTK_WIDGETS_EXPORT ctkCollapsibleGroupBox : public QGroupBox
 {
   Q_OBJECT
 public:
   explicit ctkCollapsibleGroupBox(QWidget* parent = 0);
   virtual ~ctkCollapsibleGroupBox();
+
+  /// Reimplemtented for internal reasons
   virtual int heightForWidth(int w) const;
+  /// Reimplemtented for internal reasons
   virtual QSize minimumSizeHint()const;
+  /// Reimplemtented for internal reasons
   virtual QSize sizeHint()const;
 
 protected slots:
+  /// called when the arrow indicator is clicked
   virtual void expand(bool expand);
 
 protected:
+  /// reimplemented for internal reasons
   virtual void childEvent(QChildEvent*);
 
 #if QT_VERSION < 0x040600
@@ -50,7 +58,9 @@ protected:
 #endif
   virtual void resizeEvent(QResizeEvent*);
 
+  /// Size of the widget for collapsing
   QSize OldSize;
+  /// Maximum allowed height
   int   MaxHeight;
 };
 

+ 21 - 11
Libs/Widgets/ctkColorPickerButton.cpp

@@ -32,7 +32,7 @@
 ctkColorPickerButton::ctkColorPickerButton(QWidget* _parent)
   :QPushButton(_parent)
 {
-  connect(this, SIGNAL(toggled(bool)), this, SLOT(changeColor(bool)));
+  connect(this, SIGNAL(toggled(bool)), this, SLOT(onToggled(bool)));
   this->setColor(Qt::black);
 
   this->setCheckable(true);
@@ -42,7 +42,7 @@ ctkColorPickerButton::ctkColorPickerButton(QWidget* _parent)
 ctkColorPickerButton::ctkColorPickerButton(const QString& _text, QWidget* _parent)
   :QPushButton(_text, _parent)
 {
-  connect(this, SIGNAL(clicked), this, SLOT(changeColor));
+  connect(this, SIGNAL(toggled(bool)), this, SLOT(onToggled(bool)));
   this->setColor(Qt::black);
 
   // Customize
@@ -55,7 +55,7 @@ ctkColorPickerButton::ctkColorPickerButton(const QColor& _color,
                                              QWidget* _parent)
   :QPushButton(_text, _parent)
 {
-  connect(this, SIGNAL(clicked), this, SLOT(changeColor));
+  connect(this, SIGNAL(toggled(bool)), this, SLOT(onToggled(bool)));
   this->setColor(_color);
 
   // Customize
@@ -63,20 +63,30 @@ ctkColorPickerButton::ctkColorPickerButton(const QColor& _color,
 }
 
 //-----------------------------------------------------------------------------
-void ctkColorPickerButton::changeColor(bool change)
+ctkColorPickerButton::~ctkColorPickerButton()
+{
+}
+
+//-----------------------------------------------------------------------------
+void ctkColorPickerButton::changeColor()
+{
+  this->setColor(QColorDialog::getColor(this->Color));
+}
+
+//-----------------------------------------------------------------------------
+void ctkColorPickerButton::onToggled(bool change)
 {
   if (change)
     {
-    this->setColor(QColorDialog::getColor(this->Color));
-
+    this->changeColor();
     this->setChecked(false);
     }
 }
 
 //-----------------------------------------------------------------------------
-void ctkColorPickerButton::setColor(const QColor& _color)
+void ctkColorPickerButton::setColor(const QColor& newColor)
 {
-  if (_color == this->Color)
+  if (newColor == this->Color)
     {
     return;
     }
@@ -86,13 +96,13 @@ void ctkColorPickerButton::setColor(const QColor& _color)
   pix.fill(palette().button().color());
   QPainter p(&pix);
   p.setPen(QPen(Qt::gray));
-  p.setBrush(_color);
+  p.setBrush(newColor);
   p.drawRect(2, 2, pix.width() - 5, pix.height() - 5);
 
   this->setIcon(QIcon(pix));
-  this->setText(_color.name());
+  this->setText(newColor.name());
   
-  this->Color = _color;
+  this->Color = newColor;
   emit colorChanged(this->Color);
 }
 

+ 11 - 4
Libs/Widgets/ctkColorPickerButton.h

@@ -32,16 +32,18 @@
 /// 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 pops up to select a new color 
-/// for the QPushButton. 
+/// for the QPushButton.
 class CTK_WIDGETS_EXPORT ctkColorPickerButton : public QPushButton
 {
   Q_OBJECT
   Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged USER true)
 public:
+  /// By default, the color is black
   explicit ctkColorPickerButton(QWidget* parent = 0);
+  /// By default, the color is black
   explicit ctkColorPickerButton(const QString& text, QWidget* parent = 0 );
   explicit ctkColorPickerButton(const QColor& color, const QString & text, QWidget* parent = 0 );
-  virtual ~ctkColorPickerButton(){}
+  virtual ~ctkColorPickerButton();
   
   ///
   /// Current selected color
@@ -49,16 +51,21 @@ public:
 
 public slots:
   ///
-  /// Set a new current color
+  /// Set a new current color without opening a dialog
   void setColor(const QColor& color);
 
   /// 
   /// Opens a color dialog to select a new current color.
-  void changeColor(bool change = true);
+  void changeColor();
 
 signals:
+  /// colorChanged is fired anytime a new color is set. Programatically or
+  /// by the user when choosing a color from the color dialog
   void colorChanged(QColor);
 
+protected slots:
+  void onToggled(bool change = true);
+
 protected:
   QColor Color;
 };

+ 14 - 0
Libs/Widgets/ctkComboBox.h

@@ -29,6 +29,13 @@
 #include "CTKWidgetsExport.h"
 class ctkComboBoxPrivate;
 
+/// ctkComboBox is an advanced QComboBox. It allows the display of a default
+/// text/icon when the combobox current index is invalid (-1). A typical
+/// default text would be "Select a XXX..."
+/// forceDefault can force the display of the default text at all time (with
+/// a valid current index). The text displayed in the combo box can be
+/// elided when the size is too small.
+/// ctkComboBox works exactly the same as QComboBox by default.
 class CTK_WIDGETS_EXPORT ctkComboBox : public QComboBox
 {
   Q_OBJECT
@@ -38,6 +45,7 @@ class CTK_WIDGETS_EXPORT ctkComboBox : public QComboBox
   Q_PROPERTY(Qt::TextElideMode elideMode READ elideMode WRITE setElideMode)
 
 public:
+  /// Constructor, build a ctkComboBox that behave like QComboBox.
   explicit ctkComboBox(QWidget* parent = 0);
   virtual ~ctkComboBox();
 
@@ -49,17 +57,23 @@ public:
   void setDefaultIcon(const QIcon&);
   QIcon defaultIcon()const;
 
+  /// Force the display of the text/icon at all time (not only when the 
+  /// current index is invalid). False by default.
   void forceDefault(bool forceDefault);
   bool isDefaultForced()const;
 
+  /// setElideMode can elide the text displayed on the combobox.
   /// Qt::ElideNone by default (same behavior as QComboBox)
   void setElideMode(const Qt::TextElideMode& newMode);
   Qt::TextElideMode elideMode()const;
 
+  /// Reimplemented for internal reasons
   virtual QSize minimumSizeHint()const;
+  /// Reimplemented for internal reasons
   virtual QSize sizeHint()const;
 
 protected:
+  /// Reimplemented for internal reasons
   virtual void paintEvent(QPaintEvent*);
 
 private:

+ 6 - 7
Libs/Widgets/ctkConsoleWidget.h

@@ -62,13 +62,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 class ctkConsoleWidgetCompleter;
 
-/**
-  Qt widget that provides an interactive console - you can send text to the
-  console by calling printString() and receive user input by connecting to the
-  executeCommand() slot.
-  
-  \sa pqPythonShell, pqOutputWindow
-*/
+
+/// Qwidget that provides an interactive console - you can send text to the
+/// console by calling printString() and receive user input by connecting to the
+/// executeCommand() slot.
+///  
+/// \sa pqPythonShell, pqOutputWindow
 class CTK_WIDGETS_EXPORT ctkConsoleWidget : public QWidget
 {
   Q_OBJECT

+ 8 - 7
Libs/Widgets/ctkCoordinatesWidget.h

@@ -29,8 +29,8 @@
 
 ///
 /// 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.
+/// For each coordinate a double spinbox is associated, everytime a value is
+/// modified, the signal valueChanged is fired.
 class CTK_WIDGETS_EXPORT ctkCoordinatesWidget : public QWidget
 {
   Q_OBJECT 
@@ -45,22 +45,22 @@ public:
   virtual ~ctkCoordinatesWidget();
 
   /// 
-  /// Set/Get the dimension of the point (3D by default)
+  /// Set/Get the dimension of the point (3 by default)
   void setDimension(int dim);
   int dimension() const;
 
   /// 
-  /// Set/Get the single step of the QDoubleSpinBoxes 
+  /// Set/Get the single step of each coordinate QDoubleSpinBoxes 
   void setSingleStep(double step);
   double singleStep() const;
 
   /// 
-  /// Set/Get the minimum value of the QDoubleSpinBoxes 
+  /// Set/Get the minimum value of each coordinate QDoubleSpinBoxes 
   void setMinimum(double minimum);
   double minimum() const;
 
   /// 
-  /// Set/Get the maximum value of the QDoubleSpinBoxes 
+  /// Set/Get the maximum value of each coordinate QDoubleSpinBoxes 
   void setMaximum(double minimum);
   double maximum() const;
 
@@ -76,7 +76,8 @@ public:
 
 signals:
   ///
-  /// valueChanged is fired anytime one coordinate is modified
+  /// valueChanged is fired anytime a coordinate is modified, the returned
+  /// value is the point coordinates
   void valueChanged(double* pos);
 
 protected slots:

+ 2 - 0
Libs/Widgets/ctkDoubleRangeSlider.cpp

@@ -56,6 +56,8 @@ public:
 // --------------------------------------------------------------------------
 ctkDoubleRangeSliderPrivate::ctkDoubleRangeSliderPrivate()
 {
+  // the initial values will be overwritten in
+  // ctkDoubleRangeSliderPrivate::init()
   this->Slider = 0;
   this->Minimum = 0.;
   this->Maximum = 99.;

+ 11 - 1
Libs/Widgets/ctkDoubleRangeSlider.h

@@ -31,6 +31,11 @@
 
 class ctkRangeSlider;
 class ctkDoubleRangeSliderPrivate;
+
+/// ctkDoubleRangeSlider is a slider that controls 2 numbers as double.
+/// ctkDoubleRangeSlider internally aggregates a ctkRangeSlider (not in the
+/// API to prevent misuse). Only subclasses can have access to it.
+/// \sa ctkRangeSlider, ctkDoubleSlider, ctkRangeWidget
 class CTK_WIDGETS_EXPORT ctkDoubleRangeSlider : public QWidget
 {
   Q_OBJECT      
@@ -48,8 +53,12 @@ public:
   // Superclass typedef
   typedef QWidget Superclass;
   
-  // Constructors
+  /// Constructor, builds a ctkDoubleRangeSlider whose default values are the same
+  /// as ctkRangeSlider.
   ctkDoubleRangeSlider( Qt::Orientation o, QWidget* par= 0 );
+
+  /// Constructor, builds a ctkDoubleRangeSlider whose default values are the same
+  /// as ctkRangeSlider.
   ctkDoubleRangeSlider( QWidget* par = 0 );
   
   /// 
@@ -215,6 +224,7 @@ protected slots:
 
 protected:
   ctkRangeSlider* slider()const;
+  /// Subclasses can change the internal slider
   void setSlider(ctkRangeSlider* slider);
 
 private:

+ 7 - 3
Libs/Widgets/ctkDoubleSlider.h

@@ -31,6 +31,9 @@
 
 class ctkDoubleSliderPrivate;
 
+/// ctkDoubleSlider is a QSlider that controls doubles instead of integers.
+/// ctkDoubleSlider internally aggregates a QSlider
+/// \sa ctkRangeSlider, ctkDoubleRangeSlider, ctkRangeWidget
 class CTK_WIDGETS_EXPORT ctkDoubleSlider : public QWidget
 {
   Q_OBJECT
@@ -47,10 +50,11 @@ public:
   /// Superclass typedef
   typedef QWidget Superclass;
 
-  /// 
-  /// Constructors
-  /// Vertical by default
+  /// Constructors, builds a slider whose default values are the same as
+  /// QSlider (vertical by default).
   explicit ctkDoubleSlider(QWidget* parent = 0);
+  /// Constructors, builds a slider whose default values are the same as
+  /// QSlider (vertical by default).
   explicit ctkDoubleSlider(Qt::Orientation orient, QWidget* parent = 0);
   /// Destructor
   virtual ~ctkDoubleSlider();

+ 18 - 1
Libs/Widgets/ctkDynamicSpacer.cpp

@@ -26,13 +26,21 @@ class ctkDynamicSpacerPrivate : public ctkPrivate<ctkDynamicSpacer>
 {
   CTK_DECLARE_PUBLIC(ctkDynamicSpacer);
 public:
+  ctkDynamicSpacerPrivate();
   void init();
 
+  bool        Enable;
   QSizePolicy ActiveSizePolicy;
   QSizePolicy InactiveSizePolicy;
 };
 
 // -----------------------------------------------------------------------------
+ctkDynamicSpacerPrivate::ctkDynamicSpacerPrivate()
+{
+  this->Enable = false;
+}
+
+// -----------------------------------------------------------------------------
 void ctkDynamicSpacerPrivate::init()
 {
   CTK_P(ctkDynamicSpacer);
@@ -65,6 +73,10 @@ void ctkDynamicSpacer::setActiveSizePolicy(QSizePolicy newActiveSizePolicy)
 {
   CTK_D(ctkDynamicSpacer);
   d->ActiveSizePolicy = newActiveSizePolicy;
+  if (d->Enable)
+    {
+    this->setSizePolicy(d->ActiveSizePolicy);
+    }
 }
 
 // -----------------------------------------------------------------------------
@@ -79,12 +91,17 @@ void ctkDynamicSpacer::setInactiveSizePolicy(QSizePolicy newInactiveSizePolicy)
 {
   CTK_D(ctkDynamicSpacer);
   d->InactiveSizePolicy = newInactiveSizePolicy;
+  if (!d->Enable)
+    {
+    this->setSizePolicy(d->InactiveSizePolicy);
+    }
 }
 
 // -----------------------------------------------------------------------------
 void ctkDynamicSpacer::activate(bool enableSizePolicy)
 {
   CTK_D(ctkDynamicSpacer);
+  d->Enable = enableSizePolicy;
   this->setSizePolicy(
-    enableSizePolicy ? d->ActiveSizePolicy : d->InactiveSizePolicy);
+    d->Enable ? d->ActiveSizePolicy : d->InactiveSizePolicy);
 }

+ 13 - 1
Libs/Widgets/ctkDynamicSpacer.h

@@ -31,7 +31,8 @@
 class ctkDynamicSpacerPrivate;
 
 /// Description
-/// A Menu widget that show/hide its children depending on its checked/collapsed properties
+/// A spacer widget that has a dynamic size policy controllable via its slot
+/// activate(bool). It can be usefully when you don't want a rigid layout. 
 class CTK_WIDGETS_EXPORT ctkDynamicSpacer : public QWidget
 {
   Q_OBJECT
@@ -39,18 +40,23 @@ class CTK_WIDGETS_EXPORT ctkDynamicSpacer : public QWidget
   Q_PROPERTY(QSizePolicy inactiveSizePolicy READ inactiveSizePolicy WRITE setInactiveSizePolicy);
 
 public:
+  /// Constructor, builds a ctkDynamicSpacer, inactive by default
   ctkDynamicSpacer(QWidget *parent = 0);
   virtual ~ctkDynamicSpacer();
 
+  /// The active size policy of the spacer. By default the same as QWidget
   QSizePolicy activeSizePolicy() const;
   void setActiveSizePolicy(QSizePolicy sizePolicy);
   inline void setActiveSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical);
 
+  /// The inactive size policy of the spacer. By default the same as QWidget. 
   QSizePolicy inactiveSizePolicy() const;
   void setInactiveSizePolicy(QSizePolicy sizePolicy);
   inline void setInactiveSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical);
 
 public slots:
+  /// Change the size policy. If enable is true, activeSizePolicy is used,
+  /// inactiveSizePolicy otherwise
   void activate(bool enable);
 
 private:
@@ -62,4 +68,10 @@ void ctkDynamicSpacer::setActiveSizePolicy(QSizePolicy::Policy horizontal, QSize
   this->setActiveSizePolicy(QSizePolicy(horizontal, vertical));
 }
 
+void ctkDynamicSpacer::setInactiveSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
+{
+  this->setInactiveSizePolicy(QSizePolicy(horizontal, vertical));
+}
+
+
 #endif

+ 9 - 0
Libs/Widgets/ctkFittedTextBrowser.h

@@ -27,6 +27,12 @@
 // CTK includes
 #include "CTKWidgetsExport.h"
 
+/// ctkFittedTextBrowser is a QTextBrowser that adapts its height depending
+/// on its contents and the width available. It always tries to show the whole
+/// contents. ctkFittedTextBrowser doesn't resize itself but acts on the
+/// sizeHint, minimumSizeHint and heightForWidth. Here sizeHint() and 
+/// minimumSizeHint() are the same as ctkFittedTextBrowser always try to
+/// show the whole contents.
 class CTK_WIDGETS_EXPORT ctkFittedTextBrowser : public QTextBrowser
 {
   Q_OBJECT
@@ -35,8 +41,11 @@ public:
   ctkFittedTextBrowser(QWidget* parent = 0);
   virtual ~ctkFittedTextBrowser();
 
+  /// Reimplemented for internal reasons
   virtual QSize sizeHint() const;
+  /// Reimplemented for internal reasons
   virtual QSize minimumSizeHint() const;
+  /// Reimplemented for internal reasons
   virtual int heightForWidth(int width) const;
 
 protected slots:

+ 31 - 13
Libs/Widgets/ctkMatrixWidget.cpp

@@ -32,29 +32,30 @@
 //-----------------------------------------------------------------------------
 class ctkMatrixWidgetPrivate: public ctkPrivate<ctkMatrixWidget>
 {
+public:
+  void init();
 };
 
-// --------------------------------------------------------------------------
-ctkMatrixWidget::ctkMatrixWidget(QWidget* _parent) : Superclass(4, 4, _parent)
+//-----------------------------------------------------------------------------
+void ctkMatrixWidgetPrivate::init()
 {
-  CTK_INIT_PRIVATE(ctkMatrixWidget);
-
+  CTK_P(ctkMatrixWidget);
   // Set Read-only
-  this->setEditTriggers(ctkMatrixWidget::NoEditTriggers);
+  p->setEditTriggers(ctkMatrixWidget::NoEditTriggers);
 
   // Hide headers
-  this->verticalHeader()->hide();
-  this->horizontalHeader()->hide();
+  p->verticalHeader()->hide();
+  p->horizontalHeader()->hide();
 
   // Disable scrollBars
-  this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-  this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+  p->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+  p->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 
   // Don't expand for no reason
-  this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+  p->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
 
   // Disable the frame by default
-  this->setFrameStyle(QFrame::NoFrame);
+  p->setFrameStyle(QFrame::NoFrame);
 
   // Define prototype item
   QTableWidgetItem* _item = new QTableWidgetItem();
@@ -62,10 +63,27 @@ ctkMatrixWidget::ctkMatrixWidget(QWidget* _parent) : Superclass(4, 4, _parent)
   _item->setTextAlignment(Qt::AlignCenter);
 
   // The table takes ownership of the prototype.
-  this->setItemPrototype(_item);
+  p->setItemPrototype(_item);
 
   // Initialize
-  this->reset();
+  p->reset();
+}
+
+// --------------------------------------------------------------------------
+ctkMatrixWidget::ctkMatrixWidget(QWidget* _parent) : Superclass(4, 4, _parent)
+{
+  CTK_INIT_PRIVATE(ctkMatrixWidget);
+  CTK_D(ctkMatrixWidget);
+  d->init();
+}
+
+// --------------------------------------------------------------------------
+ctkMatrixWidget::ctkMatrixWidget(int rows, int columns, QWidget* _parent)
+  : Superclass(rows, columns, _parent)
+{
+  CTK_INIT_PRIVATE(ctkMatrixWidget);
+  CTK_D(ctkMatrixWidget);
+  d->init();
 }
 
 // --------------------------------------------------------------------------

+ 3 - 1
Libs/Widgets/ctkMatrixWidget.h

@@ -43,8 +43,10 @@ public:
   /// Superclass typedef
   typedef QTableWidget Superclass;
 
-  /// Constructors
+  /// Constructor, builds a 4x4 matrix
   explicit ctkMatrixWidget(QWidget* parent = 0);
+  /// Constructor, builds a custom rowsXcolumns matrix
+  explicit ctkMatrixWidget(int rows, int columns, QWidget* parent = 0);
   virtual ~ctkMatrixWidget(){}
 
   ///

+ 11 - 2
Libs/Widgets/ctkMenuButton.h

@@ -32,7 +32,11 @@
 class ctkMenuButtonPrivate;
 
 /// Description
-/// A Menu widget that show/hide its children depending on its checked/collapsed properties
+/// ctkMenuButton is a QPushButton that separates the clickable area for
+/// poping up the optional QMenu from the traditional area of the QPushButton.
+/// The menu indicator in the button has its own button and clicking it pops
+/// up the menu.
+/// ctkMenuButton makes sense only if a QMenu is set.
 class CTK_WIDGETS_EXPORT ctkMenuButton : public QPushButton
 {
   Q_OBJECT
@@ -42,14 +46,19 @@ public:
   ctkMenuButton(const QString& text, QWidget *parent = 0);
   virtual ~ctkMenuButton();
 
+  /// Reimplemented for internal reasons
   virtual QSize minimumSizeHint()const;
+  /// Reimplemented for internal reasons
   virtual QSize sizeHint()const;
 
 protected:
+  /// Reimplemented for internal reasons
   virtual void paintEvent(QPaintEvent*);
+  /// Reimplemented for internal reasons
   virtual void mousePressEvent(QMouseEvent* event);
-
+  /// Reimplemented for internal reasons
   virtual bool hitButton(const QPoint & pos) const;
+  /// Reimplemented for internal reasons
   virtual void initStyleOption ( QStyleOptionButton * option ) const;
 private:
   CTK_DECLARE_PRIVATE(ctkMenuButton);

+ 3 - 2
Libs/Widgets/ctkRangeSlider.h

@@ -38,8 +38,9 @@ class ctkRangeSliderPrivate;
 /// Values are comprised between the range of the slider. (see setRange(), 
 /// minimum() and maximum()). The upper bound can't be smaller than the 
 /// lower bound and vice-versa.
-/// FIXME: support triggerAction(QAbstractSlider::SliderSingleStepSub) that
+/// TODO: support triggerAction(QAbstractSlider::SliderSingleStepSub) that
 /// moves both values at a time.
+/// \sa ctkDoubleRangeSlider, ctkDoubleSlider, ctkRangeWidget
 class CTK_WIDGETS_EXPORT ctkRangeSlider : public QSlider
 {
   Q_OBJECT
@@ -51,7 +52,7 @@ class CTK_WIDGETS_EXPORT ctkRangeSlider : public QSlider
 public:
   // Superclass typedef
   typedef QSlider Superclass;
-  // Constructors
+  /// Constructor, builds a ctkRangeSlider that ranges from 0 to 100
   explicit ctkRangeSlider( Qt::Orientation o, QWidget* par= 0 );
   explicit ctkRangeSlider( QWidget* par = 0 );
   virtual ~ctkRangeSlider();

+ 2 - 0
Libs/Widgets/ctkSettings.h

@@ -65,6 +65,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 class QDialog;
 class QMainWindow;
 
+/// ctkSettings is a QSettings that additionally can save and restore the 
+/// state (position/size) of QMainWindow and QDialogs.
 class CTK_WIDGETS_EXPORT ctkSettings : public QSettings
 {
   Q_OBJECT

+ 5 - 0
Libs/Widgets/ctkSliderSpinBoxWidget.h

@@ -31,6 +31,11 @@
 
 class ctkSliderSpinBoxWidgetPrivate;
 
+///
+/// ctkSliderSpinBoxWidget is a wrapper around a ctkDoubleSlider and a
+/// synchronized QDoubleSpinBox.
+/// TODO: rename ctkSliderSpinBoxWidget into ctkSliderWidget
+/// \sa ctkRangeWidget, ctkDoubleRangeSlider, QSpinBox
 class CTK_WIDGETS_EXPORT ctkSliderSpinBoxWidget : public QWidget
 {
   Q_OBJECT

+ 1 - 0
Libs/Widgets/ctkTreeComboBox.h

@@ -45,6 +45,7 @@ class QTreeView;
 ///    model.appendRow(new QStandardItem("Test3"));
 ///    combo.setModel(&model);
 ///    combo.show();
+/// TODO fix size of the view
 class CTK_WIDGETS_EXPORT ctkTreeComboBox : public QComboBox
 {
   Q_OBJECT