ctkButtonGroup.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. All rights reserved.
  5. Distributed under a BSD License. See LICENSE.txt file.
  6. This software is distributed "AS IS" WITHOUT ANY WARRANTY; without even
  7. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the above copyright notice for more information.
  9. =========================================================================*/
  10. #ifndef __ctkButtonGroup_h
  11. #define __ctkButtonGroup_h
  12. // Qt includes
  13. #include <QButtonGroup>
  14. // CTK includes
  15. #include <ctkPimpl.h>
  16. #include "CTKWidgetsExport.h"
  17. class ctkButtonGroupPrivate;
  18. ///
  19. /// The ctkButtonGroup class is a QButtonGroup that has a slightly
  20. /// different behavior when exclusive. By default, a ctkButtonGroup is
  21. /// exclusive. An exclusive ctkButtonGroup switches off the button that
  22. /// was clicked if it was already checked.
  23. class CTK_WIDGETS_EXPORT ctkButtonGroup : public QButtonGroup
  24. {
  25. Q_OBJECT
  26. public:
  27. explicit ctkButtonGroup(QObject *_parent = 0);
  28. protected slots:
  29. void onButtonClicked(QAbstractButton * button);
  30. void onButtonPressed(QAbstractButton * button);
  31. private:
  32. CTK_DECLARE_PRIVATE(ctkButtonGroup);
  33. };
  34. #endif