ctkCollapsibleButtonPlugin.cpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. // CTK includes
  11. #include "ctkCollapsibleButtonPlugin.h"
  12. #include "ctkCollapsibleButton.h"
  13. //-----------------------------------------------------------------------------
  14. ctkCollapsibleButtonPlugin::ctkCollapsibleButtonPlugin(QObject *_parent)
  15. : QObject(_parent)
  16. {
  17. }
  18. //-----------------------------------------------------------------------------
  19. QWidget *ctkCollapsibleButtonPlugin::createWidget(QWidget *_parent)
  20. {
  21. ctkCollapsibleButton* _widget = new ctkCollapsibleButton(_parent);
  22. return _widget;
  23. }
  24. //-----------------------------------------------------------------------------
  25. QString ctkCollapsibleButtonPlugin::domXml() const
  26. {
  27. return "<widget class=\"ctkCollapsibleButton\" \
  28. name=\"CTKCollapsibleButton\">\n"
  29. " <property name=\"geometry\">\n"
  30. " <rect>\n"
  31. " <x>0</x>\n"
  32. " <y>0</y>\n"
  33. " <width>300</width>\n"
  34. " <height>100</height>\n"
  35. " </rect>\n"
  36. " </property>\n"
  37. " <property name=\"text\">"
  38. " <string>CollapsibleButton</string>"
  39. " </property>"
  40. " <property name=\"contentsFrameShape\">"
  41. " <enum>QFrame::StyledPanel</enum>"
  42. " </property>"
  43. "</widget>\n";
  44. }
  45. //-----------------------------------------------------------------------------
  46. QIcon ctkCollapsibleButtonPlugin::icon() const
  47. {
  48. return QIcon(":/Icons/groupboxcollapsible.png");
  49. }
  50. //-----------------------------------------------------------------------------
  51. QString ctkCollapsibleButtonPlugin::includeFile() const
  52. {
  53. return "ctkCollapsibleButton.h";
  54. }
  55. //-----------------------------------------------------------------------------
  56. bool ctkCollapsibleButtonPlugin::isContainer() const
  57. {
  58. return true;
  59. }
  60. //-----------------------------------------------------------------------------
  61. QString ctkCollapsibleButtonPlugin::name() const
  62. {
  63. return "ctkCollapsibleButton";
  64. }