浏览代码

STYLE: Add doc to ctkAddRemoveComboBox, ctkButtonGroup.
STYLE: Rename ctkCheckBoxPixmaps::getPixmap into ctkCheckBoxPixmaps::pixmap

Julien Finet 15 年之前
父节点
当前提交
0c59259545

+ 2 - 0
Libs/Widgets/ctkAddRemoveComboBox.h

@@ -34,6 +34,8 @@
 class QComboBox;
 class ctkAddRemoveComboBoxPrivate;
 
+///
+/// QComboBox with tool buttons to add/remove entries to the menu list
 class CTK_WIDGETS_EXPORT ctkAddRemoveComboBox : public QWidget
 {
   Q_OBJECT

+ 8 - 4
Libs/Widgets/ctkButtonGroup.h

@@ -32,10 +32,14 @@
 class ctkButtonGroupPrivate;
 
 ///
-/// The ctkButtonGroup class is a QButtonGroup that has a slightly
-/// different behavior when exclusive. By default, a ctkButtonGroup is
-/// exclusive. An exclusive ctkButtonGroup switches off the button that
-///  was clicked if it was already checked.
+/// 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.
+/// Use ctkButtonGroup the same way than QButtonGroup (see QButtonGroup doc).
+/// i.e. : ctkButtonGroup* buttonGroup = new ctkButtonGroup(parent);
+/// buttonGroup->addButton(button1);
+/// buttonGroup->addButton(button2);
+/// By default ctkButtonGroup is exclusive. 
 class CTK_WIDGETS_EXPORT ctkButtonGroup : public QButtonGroup
 {
   Q_OBJECT

+ 1 - 1
Libs/Widgets/ctkCheckBoxPixmaps.cpp

@@ -93,7 +93,7 @@ ctkCheckBoxPixmaps::ctkCheckBoxPixmaps(QWidget* parentWidget)
 }
 
 //-----------------------------------------------------------------------------
-QPixmap ctkCheckBoxPixmaps::getPixmap(Qt::CheckState state, bool active) const
+QPixmap ctkCheckBoxPixmaps::pixmap(Qt::CheckState state, bool active) const
 {
   int offset = active ? 3 : 0;
   switch (state)

+ 4 - 3
Libs/Widgets/ctkCheckBoxPixmaps.h

@@ -60,6 +60,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 class QWidget;
 
+///
 /// ctkCheckBoxPixmaps is a helper class that can used to create pixmaps for
 /// checkboxs in various states. This is useful for showing checkboxes in qt-views.
 class CTK_WIDGETS_EXPORT ctkCheckBoxPixmaps : public QObject
@@ -72,10 +73,10 @@ public:
   ctkCheckBoxPixmaps(QWidget* parent);
 
   /// Returns a pixmap for the given state .
-  QPixmap getPixmap(Qt::CheckState state, bool active) const;
-  QPixmap getPixmap(int state, bool active) const
+  QPixmap pixmap(Qt::CheckState state, bool active) const;
+  QPixmap pixmap(int state, bool active) const
     {
-    return this->getPixmap(static_cast<Qt::CheckState>(state), active);
+    return this->pixmap(static_cast<Qt::CheckState>(state), active);
     }
 
 

+ 1 - 1
Libs/Widgets/ctkCheckableHeaderView.cpp

@@ -304,7 +304,7 @@ void ctkCheckableHeaderView::updateHeaders(int first, int last)
     Qt::CheckState checkState;
     if (this->checkState(i, checkState))
       {
-      decoration = d->CheckBoxPixmaps->getPixmap(checkState, active);
+      decoration = d->CheckBoxPixmaps->pixmap(checkState, active);
       if (d->PropagateToItems && 
           checkState != Qt::PartiallyChecked &&
           !d->ItemsAreUpdating)