|
1 /* |
|
2 * NullDateEditPlugin.cpp is part of bmsapp. |
|
3 * |
|
4 * bmsapp is free software: you can redistribute it and/or modify |
|
5 * it under the terms of the GNU General Public License as published by |
|
6 * the Free Software Foundation, either version 3 of the License, or |
|
7 * (at your option) any later version. |
|
8 |
|
9 * bmsapp is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU General Public License for more details. |
|
13 |
|
14 * You should have received a copy of the GNU General Public License |
|
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 */ |
|
17 |
|
18 #include <QObject> |
|
19 #include <QtUiPlugin/QDesignerCustomWidgetInterface> |
|
20 #include <QString> |
|
21 #include <QWidget> |
|
22 #include <QIcon> |
|
23 #include <QtPlugin> |
|
24 |
|
25 #include "NullDateEditPlugin.h" |
|
26 #include "NullDateEdit.h" |
|
27 |
|
28 NullDateEditPlugin::NullDateEditPlugin(QObject* parent) |
|
29 : QObject(parent) |
|
30 { |
|
31 } |
|
32 |
|
33 void NullDateEditPlugin::initialize(QDesignerFormEditorInterface * /* core */) |
|
34 { |
|
35 if(initialized) |
|
36 return; |
|
37 |
|
38 initialized = true; |
|
39 return; |
|
40 } |
|
41 |
|
42 bool NullDateEditPlugin::isInitialized() const |
|
43 { |
|
44 return initialized; |
|
45 } |
|
46 |
|
47 QWidget* NullDateEditPlugin::createWidget(QWidget *parent) |
|
48 { |
|
49 return new NullDateEdit(parent); |
|
50 } |
|
51 |
|
52 QString NullDateEditPlugin::name() const |
|
53 { |
|
54 return "NullDateEdit"; |
|
55 } |
|
56 |
|
57 QString NullDateEditPlugin::group() const |
|
58 { |
|
59 return "BMSapp Widgets"; |
|
60 } |
|
61 |
|
62 QIcon NullDateEditPlugin::icon() const |
|
63 { |
|
64 return QIcon(); |
|
65 } |
|
66 |
|
67 QString NullDateEditPlugin::toolTip() const |
|
68 { |
|
69 return QString(); |
|
70 } |
|
71 |
|
72 QString NullDateEditPlugin::whatsThis() const |
|
73 { |
|
74 return QString(); |
|
75 } |
|
76 |
|
77 bool NullDateEditPlugin::isContainer() const |
|
78 { |
|
79 return false; |
|
80 } |
|
81 |
|
82 QString NullDateEditPlugin::domXml() const |
|
83 { |
|
84 return "<ui language=\"c++\">\n" |
|
85 " <widget class=\"NullDateEdit\" name=\"nullDatEditWidget\">\n" |
|
86 " <property name=\"toolTip\" >\n" |
|
87 " <string>Date editor</string>\n" |
|
88 " </property>\n" |
|
89 " <property name=\"whatsThis\" >\n" |
|
90 " <string>Date editor that allows a null date.</string>\n" |
|
91 " </property>\n" |
|
92 " </widget>\n" |
|
93 "</ui>\n"; |
|
94 } |
|
95 |
|
96 QString NullDateEditPlugin::includeFile() const |
|
97 { |
|
98 return "NullDateEdit.h"; |
|
99 } |
|
100 |