color_2d_slider_plugin.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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_2d_slider_plugin.hpp"
  23. #include "QtColorWidgets/color_2d_slider.hpp"
  24. Color2DSlider_Plugin::Color2DSlider_Plugin(QObject *parent) :
  25. QObject(parent), initialized(false)
  26. {
  27. }
  28. void Color2DSlider_Plugin::initialize(QDesignerFormEditorInterface *)
  29. {
  30. initialized = true;
  31. }
  32. bool Color2DSlider_Plugin::isInitialized() const
  33. {
  34. return initialized;
  35. }
  36. QWidget *Color2DSlider_Plugin::createWidget(QWidget *parent)
  37. {
  38. return new color_widgets::Color2DSlider(parent);
  39. }
  40. QString Color2DSlider_Plugin::name() const
  41. {
  42. return "color_widgets::Color2DSlider";
  43. }
  44. QString Color2DSlider_Plugin::group() const
  45. {
  46. return "Color Widgets";
  47. }
  48. QIcon Color2DSlider_Plugin::icon() const
  49. {
  50. color_widgets::Color2DSlider w;
  51. w.resize(64,64);
  52. QPixmap pix(64,64);
  53. w.render(&pix);
  54. return QIcon(pix);
  55. }
  56. QString Color2DSlider_Plugin::toolTip() const
  57. {
  58. return "An analog widget to select 2 color components at the same time";
  59. }
  60. QString Color2DSlider_Plugin::whatsThis() const
  61. {
  62. return toolTip();
  63. }
  64. bool Color2DSlider_Plugin::isContainer() const
  65. {
  66. return false;
  67. }
  68. QString Color2DSlider_Plugin::domXml() const
  69. {
  70. return "<ui language=\"c++\">\n"
  71. " <widget class=\"color_widgets::Color2DSlider\" name=\"color2DSlider\">\n"
  72. " </widget>\n"
  73. "</ui>\n";
  74. }
  75. QString Color2DSlider_Plugin::includeFile() const
  76. {
  77. return "QtColorWidgets/color_2d_slider.hpp";
  78. }