ctkCollapsibleButtonPlugin.cpp 2.6 KB

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