ctkExpandableWidgetPlugin.cpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 "ctkExpandableWidgetPlugin.h"
  16. #include "ctkExpandableWidget.h"
  17. // --------------------------------------------------------------------------
  18. ctkExpandableWidgetPlugin
  19. ::ctkExpandableWidgetPlugin(QObject* parentObject)
  20. : QObject(parentObject)
  21. {
  22. }
  23. // --------------------------------------------------------------------------
  24. QWidget *ctkExpandableWidgetPlugin
  25. ::createWidget(QWidget* futurParentWidget)
  26. {
  27. ctkExpandableWidget* widget =
  28. new ctkExpandableWidget(futurParentWidget);
  29. return widget;
  30. }
  31. // --------------------------------------------------------------------------
  32. QString ctkExpandableWidgetPlugin::domXml() const
  33. {
  34. return "<widget class=\"ctkExpandableWidget\" \
  35. name=\"ResizableFrame\">\n"
  36. " <property name=\"geometry\">\n"
  37. " <rect>\n"
  38. " <x>0</x>\n"
  39. " <y>0</y>\n"
  40. " <width>300</width>\n"
  41. " <height>300</height>\n"
  42. " </rect>\n"
  43. " </property>\n"
  44. "</widget>\n";
  45. }
  46. // --------------------------------------------------------------------------
  47. QIcon ctkExpandableWidgetPlugin::icon() const
  48. {
  49. return QIcon(":/Icons/widget.png");
  50. }
  51. // --------------------------------------------------------------------------
  52. QString ctkExpandableWidgetPlugin::includeFile() const
  53. {
  54. return "ctkExpandableWidget.h";
  55. }
  56. // --------------------------------------------------------------------------
  57. bool ctkExpandableWidgetPlugin::isContainer() const
  58. {
  59. return true;
  60. }
  61. // --------------------------------------------------------------------------
  62. QString ctkExpandableWidgetPlugin::name() const
  63. {
  64. return "ctkExpandableWidget";
  65. }