color_line_edit_plugin.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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_line_edit_plugin.hpp"
  23. #include "QtColorWidgets/color_line_edit.hpp"
  24. QWidget* ColorLineEdit_Plugin::createWidget(QWidget *parent)
  25. {
  26. color_widgets::ColorLineEdit *widget = new color_widgets::ColorLineEdit(parent);
  27. return widget;
  28. }
  29. QIcon ColorLineEdit_Plugin::icon() const
  30. {
  31. return QIcon::fromTheme("edit-rename");
  32. }
  33. QString ColorLineEdit_Plugin::domXml() const
  34. {
  35. return "<ui language=\"c++\">\n"
  36. " <widget class=\"color_widgets::ColorLineEdit\" name=\"color_line_edit\">\n"
  37. " </widget>\n"
  38. "</ui>\n";
  39. }
  40. bool ColorLineEdit_Plugin::isContainer() const
  41. {
  42. return false;
  43. }
  44. ColorLineEdit_Plugin::ColorLineEdit_Plugin(QObject *parent) :
  45. QObject(parent), initialized(false)
  46. {
  47. }
  48. void ColorLineEdit_Plugin::initialize(QDesignerFormEditorInterface *)
  49. {
  50. initialized = true;
  51. }
  52. bool ColorLineEdit_Plugin::isInitialized() const
  53. {
  54. return initialized;
  55. }
  56. QString ColorLineEdit_Plugin::name() const
  57. {
  58. return "color_widgets::ColorLineEdit";
  59. }
  60. QString ColorLineEdit_Plugin::group() const
  61. {
  62. return "Color Widgets";
  63. }
  64. QString ColorLineEdit_Plugin::toolTip() const
  65. {
  66. return "A widget to manipulate a string representing a color";
  67. }
  68. QString ColorLineEdit_Plugin::whatsThis() const
  69. {
  70. return toolTip();
  71. }
  72. QString ColorLineEdit_Plugin::includeFile() const
  73. {
  74. return "QtColorWidgets/color_line_edit.hpp";
  75. }