ctkButtonGroup.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) 2010 Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.commontk.org/LICENSE
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkButtonGroup_h
  15. #define __ctkButtonGroup_h
  16. // Qt includes
  17. #include <QButtonGroup>
  18. // CTK includes
  19. #include <ctkPimpl.h>
  20. #include "CTKWidgetsExport.h"
  21. class ctkButtonGroupPrivate;
  22. ///
  23. /// The ctkButtonGroup class is a QButtonGroup that has a slightly
  24. /// different behavior when exclusive. By default, a ctkButtonGroup is
  25. /// exclusive. An exclusive ctkButtonGroup switches off the button that
  26. /// was clicked if it was already checked.
  27. class CTK_WIDGETS_EXPORT ctkButtonGroup : public QButtonGroup
  28. {
  29. Q_OBJECT
  30. public:
  31. explicit ctkButtonGroup(QObject *_parent = 0);
  32. protected slots:
  33. void onButtonClicked(QAbstractButton * button);
  34. void onButtonPressed(QAbstractButton * button);
  35. private:
  36. CTK_DECLARE_PRIVATE(ctkButtonGroup);
  37. };
  38. #endif