|
1 /*************************************************************************** |
|
2 * Copyright (C) 2006-2008 by Tomasz Ziobrowski * |
|
3 * http://www.3electrons.com * |
|
4 * e-mail: t.ziobrowski@3electrons.com * |
|
5 * * |
|
6 * Adapted for the bmsapp project by Michiel Broek, 2022. * |
|
7 * * |
|
8 * This program is free software; you can redistribute it and/or modify * |
|
9 * it under the terms of the GNU General Public License as published by * |
|
10 * the Free Software Foundation; either version 2 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 General Public License for more details. * |
|
17 * * |
|
18 * You should have received a copy of the GNU General Public License * |
|
19 * along with this program; if not, write to the * |
|
20 * Free Software Foundation, Inc., * |
|
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
|
22 ***************************************************************************/ |
|
23 |
|
24 #include <QObject> |
|
25 #include <QtUiPlugin/QDesignerCustomWidgetInterface> |
|
26 #include <QString> |
|
27 #include <QWidget> |
|
28 #include <QIcon> |
|
29 #include <QtPlugin> |
|
30 |
|
31 #include "analog/led.h" |
|
32 #include "led_plugin.h" |
|
33 |
|
34 /*------------------------------------------------------------------------------------------------ |
|
35 * LED |
|
36 *------------------------------------------------------------------------------------------------*/ |
|
37 |
|
38 |
|
39 LedPlugin::LedPlugin(QObject *parent) |
|
40 : QObject(parent) |
|
41 { |
|
42 } |
|
43 |
|
44 void LedPlugin::initialize(QDesignerFormEditorInterface * /*core*/) |
|
45 { |
|
46 if (initialized) |
|
47 return; |
|
48 |
|
49 initialized = true; |
|
50 } |
|
51 |
|
52 bool LedPlugin::isInitialized() const |
|
53 { |
|
54 return initialized; |
|
55 } |
|
56 |
|
57 QWidget *LedPlugin::createWidget(QWidget *parent) |
|
58 { |
|
59 return new Led(parent); |
|
60 } |
|
61 |
|
62 QString LedPlugin::name() const |
|
63 { |
|
64 return "Led"; |
|
65 } |
|
66 |
|
67 QString LedPlugin::group() const |
|
68 { |
|
69 return "BMSapp Widgets"; |
|
70 } |
|
71 |
|
72 QIcon LedPlugin::icon() const |
|
73 { |
|
74 return QIcon(); |
|
75 } |
|
76 |
|
77 QString LedPlugin::toolTip() const |
|
78 { |
|
79 return QString(); |
|
80 } |
|
81 |
|
82 QString LedPlugin::whatsThis() const |
|
83 { |
|
84 return QString(); |
|
85 } |
|
86 |
|
87 bool LedPlugin::isContainer() const |
|
88 { |
|
89 return false; |
|
90 } |
|
91 |
|
92 QString LedPlugin::domXml() const |
|
93 { |
|
94 return "<ui language=\"c++\">\n" |
|
95 " <widget class=\"Led\" name=\"led\">\n" |
|
96 " <property name=\"geometry\">\n" |
|
97 " <rect>\n" |
|
98 " <x>0</x>\n" |
|
99 " <y>0</y>\n" |
|
100 " <width>16</width>\n" |
|
101 " <height>16</height>\n" |
|
102 " </rect>\n" |
|
103 " </property>\n" |
|
104 " <property name=\"toolTip\" >\n" |
|
105 " <string>Color Led component</string>\n" |
|
106 " </property>\n" |
|
107 " <property name=\"whatsThis\" >\n" |
|
108 " <string>Led indicator</string>\n" |
|
109 " </property>\n" |
|
110 " </widget>\n" |
|
111 "</ui>\n"; |
|
112 } |
|
113 |
|
114 QString LedPlugin::includeFile() const |
|
115 { |
|
116 return "analog/led.h"; |
|
117 } |
|
118 |