color_list_plugin.cpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * \file
  3. *
  4. * \author Mattia Basaglia
  5. *
  6. * \copyright Copyright (C) 2013-2020 Mattia Basaglia
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #include "color_list_plugin.hpp"
  23. #include "QtColorWidgets/color_list_widget.hpp"
  24. ColorListWidget_Plugin::ColorListWidget_Plugin(QObject *parent) :
  25. QObject(parent)
  26. {
  27. }
  28. void ColorListWidget_Plugin::initialize(QDesignerFormEditorInterface *)
  29. {
  30. initialized = true;
  31. }
  32. bool ColorListWidget_Plugin::isInitialized() const
  33. {
  34. return initialized;
  35. }
  36. QWidget *ColorListWidget_Plugin::createWidget(QWidget *parent)
  37. {
  38. return new color_widgets::ColorListWidget(parent);
  39. }
  40. QString ColorListWidget_Plugin::name() const
  41. {
  42. return "color_widgets::ColorListWidget";
  43. }
  44. QString ColorListWidget_Plugin::group() const
  45. {
  46. return "Color Widgets";
  47. }
  48. QIcon ColorListWidget_Plugin::icon() const
  49. {
  50. return QIcon::fromTheme("format-stroke-color");
  51. }
  52. QString ColorListWidget_Plugin::toolTip() const
  53. {
  54. return "An editable list of colors";
  55. }
  56. QString ColorListWidget_Plugin::whatsThis() const
  57. {
  58. return toolTip();
  59. }
  60. bool ColorListWidget_Plugin::isContainer() const
  61. {
  62. return false;
  63. }
  64. QString ColorListWidget_Plugin::domXml() const
  65. {
  66. return "<ui language=\"c++\">\n"
  67. " <widget class=\"color_widgets::ColorListWidget\" name=\"ColorListWidget\">\n"
  68. " </widget>\n"
  69. "</ui>\n";
  70. }
  71. QString ColorListWidget_Plugin::includeFile() const
  72. {
  73. return "QtColorWidgets/color_list_widget.hpp";
  74. }