hue_slider_plugin.cpp 2.2 KB

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