Ver código fonte

STYLE: WorkflowWidget - Remove extra comments

Jean-Christophe Fillion-Robin 14 anos atrás
pai
commit
468c9eaa63

+ 3 - 21
Libs/Widgets/ctkWorkflowAbstractPagedWidget.cpp

@@ -35,8 +35,7 @@ class ctkWorkflowAbstractPagedWidgetPrivate: public ctkPrivate<ctkWorkflowAbstra
 {
 public:
   CTK_DECLARE_PUBLIC(ctkWorkflowAbstractPagedWidget);
-  ctkWorkflowAbstractPagedWidgetPrivate();
-  ~ctkWorkflowAbstractPagedWidgetPrivate();
+  ctkWorkflowAbstractPagedWidgetPrivate(){}
 
   // maintain a map of <widget, pageArea> pairs to find the
   // page that a widget belongs to
@@ -46,33 +45,16 @@ public:
 };
 
 // --------------------------------------------------------------------------
-// ctkWorkflowAbstractPagedWidgetPrivate methods
-
-//---------------------------------------------------------------------------
-ctkWorkflowAbstractPagedWidgetPrivate::ctkWorkflowAbstractPagedWidgetPrivate()
-{
-}
-
-//---------------------------------------------------------------------------
-ctkWorkflowAbstractPagedWidgetPrivate::~ctkWorkflowAbstractPagedWidgetPrivate()
-{
-}
-
-// --------------------------------------------------------------------------
 // ctkWorkflowAbstractPagedWidgetMethods
 
 // --------------------------------------------------------------------------
-ctkWorkflowAbstractPagedWidget::ctkWorkflowAbstractPagedWidget(QWidget* _parent) : Superclass(_parent)
+ctkWorkflowAbstractPagedWidget::ctkWorkflowAbstractPagedWidget(QWidget* newParent) :
+    Superclass(newParent)
 {
   CTK_INIT_PRIVATE(ctkWorkflowAbstractPagedWidget);
 }
 
 // --------------------------------------------------------------------------
-ctkWorkflowAbstractPagedWidget::~ctkWorkflowAbstractPagedWidget()
-{
-}
-
-// --------------------------------------------------------------------------
 void ctkWorkflowAbstractPagedWidget::setClientAreaDirection(const QBoxLayout::Direction& direction, int index)
 {
   CTK_D(ctkWorkflowAbstractPagedWidget);

+ 5 - 22
Libs/Widgets/ctkWorkflowAbstractPagedWidget.h

@@ -44,17 +44,12 @@ class ctkWorkflowAbstractPagedWidgetPrivate;
 class CTK_WIDGETS_EXPORT ctkWorkflowAbstractPagedWidget : public ctkWorkflowWidget
 {
   Q_OBJECT
-    // TODO DESIGNER: properties here
 
 public:
-  ///
-  /// Superclass typedef
-  typedef ctkWorkflowWidget Superclass;
 
-  ///
-  /// Constructors
-  explicit ctkWorkflowAbstractPagedWidget(QWidget* parent = 0);
-  virtual ~ctkWorkflowAbstractPagedWidget();
+  typedef ctkWorkflowWidget Superclass;
+  explicit ctkWorkflowAbstractPagedWidget(QWidget* newParent = 0);
+  virtual ~ctkWorkflowAbstractPagedWidget(){}
 
   /// only need to do if you're specifying an index/label, otherwise
   /// the workflow's steps will be added automatically
@@ -62,8 +57,6 @@ public:
   virtual void addStepArea(ctkWorkflowWidgetStep* step, int index);
   virtual void addStepArea(ctkWorkflowWidgetStep* step, int index, const QString& label);
 
-
-  ///
   /// Add a widget to the client area, which is the area where
   /// custom-step content should be placed.  If you are adding
   /// ctkWorkflowWidgetSteps to this workflow, you will probably want
@@ -92,7 +85,6 @@ public:
   virtual void addWidget(QWidget* widget, int index);
   virtual void addWidget(QWidget* widget, int index, const QString& label);
 
-  ///
   /// Sets the direction of the QBoxLayout that manages this widget's
   /// client area, i.e. the layout manager for the area onto which the
   /// step's widgets should be placed (default
@@ -103,7 +95,6 @@ public:
   /// and future pages.
   virtual void setClientAreaDirection(const QBoxLayout::Direction& direction, int index = -1);
 
-  ///
   /// Provided for advanced customization: get the client area.
   /// A workflow containing a user interface is made up of steps
   /// (ctkWorkflowWidgetStep).  Each step should either:
@@ -124,16 +115,12 @@ public:
   /// likely not allow you to customize the client area layout.
   /// Customize specific pages instead using
   /// ctkWorkflowAbstractPagedWidget::getWidgetFromIndex(index)->setLayout()
-  /// Reimplement this function in derived classes
   virtual QWidget* clientArea() = 0;
 
-  ///
   /// Provided for advanced customization: get the widget
   /// corresponding to the page of the given index
-  /// Reimplement this function in derived classes
   virtual QWidget* getWidgetFromIndex(int index) = 0;
 
-  ///
   /// Provided for advanced customization: shows a given widget within
   /// the client area.
   /// A workflow containing a user interface is made up of steps
@@ -154,16 +141,12 @@ public:
   virtual void showWidget(QWidget* widget);
 
 protected:
-  ///
+
   /// Add a widget to a new page of the client area, with a page label
   /// that may or may not be considered by the derived class
-  /// Reimplement this function in derived classes
   virtual void addWidgetToClientArea(QWidget* widget, const QString& label) = 0;
 
-  ///
-  /// Set the current widget to that of the page containing the given
-  /// widget
-  /// Reimplement this function in derived classes
+  /// Set the current widget to that of the page containing the given widget
   virtual void setCurrentWidget(QWidget* widget) = 0;
 
 private:

+ 24 - 35
Libs/Widgets/ctkWorkflowStackedWidget.cpp

@@ -39,9 +39,8 @@ class ctkWorkflowStackedWidgetPrivate: public ctkPrivate<ctkWorkflowStackedWidge
 public:
   CTK_DECLARE_PUBLIC(ctkWorkflowStackedWidget);
   ctkWorkflowStackedWidgetPrivate();
-  ~ctkWorkflowStackedWidgetPrivate();
 
-  QStackedWidget* clientArea;
+  QStackedWidget* ClientArea;
 };
 
 // --------------------------------------------------------------------------
@@ -50,44 +49,34 @@ public:
 //---------------------------------------------------------------------------
 ctkWorkflowStackedWidgetPrivate::ctkWorkflowStackedWidgetPrivate()
 {
-  this->clientArea = 0;
-}
-
-//---------------------------------------------------------------------------
-ctkWorkflowStackedWidgetPrivate::~ctkWorkflowStackedWidgetPrivate()
-{
+  this->ClientArea = 0;
 }
 
 // --------------------------------------------------------------------------
-// ctkWorkflowStackedWidgetMethods
+// ctkWorkflowStackedWidget methods
 
 // --------------------------------------------------------------------------
-ctkWorkflowStackedWidget::ctkWorkflowStackedWidget(QWidget* _parent) : Superclass(_parent)
+ctkWorkflowStackedWidget::ctkWorkflowStackedWidget(QWidget* newParent) : Superclass(newParent)
 {
   CTK_INIT_PRIVATE(ctkWorkflowStackedWidget);
 }
 
 // --------------------------------------------------------------------------
-ctkWorkflowStackedWidget::~ctkWorkflowStackedWidget()
-{
-}
-
-// --------------------------------------------------------------------------
 QStackedWidget* ctkWorkflowStackedWidget::clientArea()
 {
   CTK_D(ctkWorkflowStackedWidget);
 
-  if (!d->clientArea)
+  if (!d->ClientArea)
     {
-    d->clientArea = new QStackedWidget;
+    d->ClientArea = new QStackedWidget;
 
     if (!this->clientSection()->layout())
       {
       this->clientSection()->setLayout(new QBoxLayout(QBoxLayout::TopToBottom));
       }
-    this->clientSection()->layout()->addWidget(d->clientArea);
+    this->clientSection()->layout()->addWidget(d->ClientArea);
     }
-  return d->clientArea;
+  return d->ClientArea;
 }
 
 // --------------------------------------------------------------------------
@@ -95,19 +84,19 @@ void ctkWorkflowStackedWidget::addWidgetToClientArea(QWidget* widget, const QStr
 {
   Q_UNUSED(label);
 
-  if (widget)
+  if (!widget)
     {
-    QStackedWidget* clientArea = this->clientArea();
-
-    // set the default layout if there isn't one
-    if (!clientArea->layout())
-      {
-      clientArea->setLayout(new QBoxLayout(this->clientAreaDirection()));
-      return;
-      }
+    return;
+    }
 
-    clientArea->layout()->addWidget(widget);
+  // set the default layout if there isn't one
+  if (!this->clientArea()->layout())
+    {
+    this->clientArea()->setLayout(new QBoxLayout(this->clientAreaDirection()));
+    return;
     }
+
+  this->clientArea()->layout()->addWidget(widget);
 }
 
 // --------------------------------------------------------------------------
@@ -115,13 +104,13 @@ QWidget* ctkWorkflowStackedWidget::getWidgetFromIndex(int index)
 {
   CTK_D(ctkWorkflowStackedWidget);
 
-  if (!d->clientArea)
+  if (!d->ClientArea)
     {
-    logger.error("getWidgetFromIndex - clientArea is Null");
+    logger.error("getWidgetFromIndex - ClientArea is Null");
     return 0;
     }
 
-  return d->clientArea->widget(index);
+  return d->ClientArea->widget(index);
 }
 
 // --------------------------------------------------------------------------
@@ -129,14 +118,14 @@ void ctkWorkflowStackedWidget::setCurrentWidget(QWidget* widget)
 {
   CTK_D(ctkWorkflowStackedWidget);
 
-  if (!d->clientArea)
+  if (!d->ClientArea)
     {
-    logger.error("setCurrentWidget - clientArea is Null");
+    logger.error("setCurrentWidget - ClientArea is Null");
     return;
     }
 
   if (widget)
     {
-    d->clientArea->setCurrentWidget(widget);
+    d->ClientArea->setCurrentWidget(widget);
     }
 }

+ 13 - 19
Libs/Widgets/ctkWorkflowStackedWidget.h

@@ -32,11 +32,12 @@
 class ctkWorkflowStackedWidgetPrivate;
 
 ///
-/// ctkWorkflowStackedWidget is the basis for a workflow with a user
+/// \brief ctkWorkflowStackedWidget is the basis for a workflow with a user
 /// interface containing a QStackedWidget.
-/// It is a child of ctkWorkflowAbstractPagedWidget and therefore is a
-/// ctkWorkflow (i.e. a state machine).  Its client area is a
-/// QStackedWidget, onto which step-specific widgets can be placed.
+///
+/// The client area is a QStackedWidget, onto which
+/// step-specific widgets can be placed.
+///
 /// Multiple workflow steps can correspond to the same page of the
 /// QStackedWidget.  The main widget can be inserted directly inside
 /// another user interface.
@@ -44,22 +45,18 @@ class ctkWorkflowStackedWidgetPrivate;
 class CTK_WIDGETS_EXPORT ctkWorkflowStackedWidget : public ctkWorkflowAbstractPagedWidget
 {
   Q_OBJECT
-    // TODO DESIGNER: properties here
 
 public:
-  ///
-  /// Superclass typedef
-  typedef ctkWorkflowAbstractPagedWidget Superclass;
 
-  ///
-  /// Constructors
-  explicit ctkWorkflowStackedWidget(QWidget* parent = 0);
-  virtual ~ctkWorkflowStackedWidget();
+  typedef ctkWorkflowAbstractPagedWidget Superclass;
+  explicit ctkWorkflowStackedWidget(QWidget* newParent = 0);
+  virtual ~ctkWorkflowStackedWidget(){}
 
-  ///
   /// Provided for advanced customization: get the client area.
   /// A workflow containing a user interface is made up of steps
-  /// (ctkWorkflowWidgetStep).  Each step should either:
+  /// (ctkWorkflowWidgetStep).
+  ///
+  /// Each step should either:
   /// 1) reimplement ctkWorkflowWidgetStep::populateStepWidgetsList or
   /// set its populateStepWidgetsListCommand to point to a method that
   /// will add the custom-step's widgets to the list; or
@@ -79,20 +76,17 @@ public:
   /// ctkWorkflowStackedWidget::getWidgetFromIndex(index)->setLayout()
   virtual QStackedWidget* clientArea();
 
-  ///
   /// Provided for advanced customization: get the widget
   /// corresponding to the page of the given index
   virtual QWidget* getWidgetFromIndex(int index);
 
 protected:
-  ///
+
   /// Add a widget to a new page of the client area.
   /// The label is not considered by this class.
   virtual void addWidgetToClientArea(QWidget* widget, const QString& label);
 
-  ///
-  /// Set the current widget to that of the page containing the given
-  /// widget
+  /// Set the current widget to that of the page containing the given widget
   virtual void setCurrentWidget(QWidget* widget) ;
 
 private:

+ 3 - 14
Libs/Widgets/ctkWorkflowTabWidget.cpp

@@ -39,7 +39,6 @@ class ctkWorkflowTabWidgetPrivate: public ctkPrivate<ctkWorkflowTabWidget>
 public:
   CTK_DECLARE_PUBLIC(ctkWorkflowTabWidget);
   ctkWorkflowTabWidgetPrivate();
-  ~ctkWorkflowTabWidgetPrivate();
 
   QTabWidget* clientArea;
 };
@@ -53,26 +52,16 @@ ctkWorkflowTabWidgetPrivate::ctkWorkflowTabWidgetPrivate()
   this->clientArea = 0;
 }
 
-//---------------------------------------------------------------------------
-ctkWorkflowTabWidgetPrivate::~ctkWorkflowTabWidgetPrivate()
-{
-}
-
 // --------------------------------------------------------------------------
-// ctkWorkflowTabWidgetMethods
+// ctkWorkflowTabWidget methods
 
 // --------------------------------------------------------------------------
-ctkWorkflowTabWidget::ctkWorkflowTabWidget(QWidget* _parent) : Superclass(_parent)
+ctkWorkflowTabWidget::ctkWorkflowTabWidget(QWidget* newParent) : Superclass(newParent)
 {
   CTK_INIT_PRIVATE(ctkWorkflowTabWidget);
 }
 
 // --------------------------------------------------------------------------
-ctkWorkflowTabWidget::~ctkWorkflowTabWidget()
-{
-}
-
-// --------------------------------------------------------------------------
 QTabWidget* ctkWorkflowTabWidget::clientArea()
 {
   CTK_D(ctkWorkflowTabWidget);
@@ -122,7 +111,7 @@ void ctkWorkflowTabWidget::setCurrentWidget(QWidget* widget)
 
   if (!d->clientArea)
     {
-    logger.error("sdetCurrentWidget - clientArea is Null");
+    logger.error("setCurrentWidget - clientArea is Null");
     return;
     }
 

+ 10 - 21
Libs/Widgets/ctkWorkflowTabWidget.h

@@ -33,11 +33,12 @@ class ctkWorkflowTabWidgetPrivate;
 
 
 ///
-/// ctkWorkflowStackedWidget is the basis for a workflow with a user
+/// \brief ctkWorkflowStackedWidget is the basis for a workflow with a user
 /// interface containing a QTabWidget.
-/// It is a child of ctkWorkflowAbstractPagedWidget and therefore is a
-/// ctkWorkflow (i.e. a state machine).  Its client area is a
-/// QTabWidget, onto which step-specific widgets can be placed.
+///
+/// The client area is a QTabWidget, onto which step-specific
+/// widgets can be placed.
+///
 /// Multiple workflow steps can correspond to the same page of the
 /// QStackedWidget.  The main widget can be inserted directly inside
 /// another user interface.
@@ -45,20 +46,13 @@ class ctkWorkflowTabWidgetPrivate;
 class CTK_WIDGETS_EXPORT ctkWorkflowTabWidget : public ctkWorkflowAbstractPagedWidget
 {
   Q_OBJECT
-    // TODO DESIGNER: properties here
 
 public:
-  ///
-  /// Superclass typedef
-  typedef ctkWorkflowAbstractPagedWidget Superclass;
-
-  ///
-  /// Constructors
-  explicit ctkWorkflowTabWidget(QWidget* parent = 0);
-  virtual ~ctkWorkflowTabWidget();
 
+  typedef ctkWorkflowAbstractPagedWidget Superclass;
+  explicit ctkWorkflowTabWidget(QWidget* newParent = 0);
+  virtual ~ctkWorkflowTabWidget(){}
 
-  ///
   /// Provided for advanced customization: get the client area.
   /// A workflow containing a user interface is made up of steps
   /// (ctkWorkflowWidgetStep).  Each step should either:
@@ -81,26 +75,21 @@ public:
   /// ctkWorkflowTabWidget::getWidgetFromIndex(index)->setLayout()
   virtual QTabWidget* clientArea();
 
-  ///
   /// Provided for advanced customization: get the widget
   /// corresponding to the page of the given index
   virtual QWidget* getWidgetFromIndex(int index);
 
 protected:
-  ///
+
   /// Add a widget to a new page of the client area.
   /// The label will be the name of the tab.
   virtual void addWidgetToClientArea(QWidget* widget, const QString& label);
 
-  ///
-  /// Set the current widget to that of the page containing the given
-  /// widget
+  /// Set the current widget to that of the page containing the given widget
   virtual void setCurrentWidget(QWidget* widget) ;
 
-
 private:
   CTK_DECLARE_PRIVATE(ctkWorkflowTabWidget);
-
 };
 
 #endif