designer/wallclock_plugin.cpp

changeset 316
dcd472be9ae8
equal deleted inserted replaced
315:cf4e83cecdb5 316:dcd472be9ae8
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 "analog/wallclock.h"
25 #include "wallclock_plugin.h"
26
27 /*------------------------------------------------------------------------------------------------
28 * WALLCLCOCK
29 *------------------------------------------------------------------------------------------------*/
30
31 WallClockPlugin::WallClockPlugin(QObject *parent)
32 : QObject(parent)
33 {
34 }
35
36 void WallClockPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
37 {
38 if (initialized)
39 return;
40
41 initialized = true;
42 }
43
44 bool WallClockPlugin::isInitialized() const
45 {
46 return initialized;
47 }
48
49 QWidget *WallClockPlugin::createWidget(QWidget *parent)
50 {
51 return new WallClock(parent);
52 }
53
54 QString WallClockPlugin::name() const
55 {
56 return "WallClock";
57 }
58
59 QString WallClockPlugin::group() const
60 {
61 return "BMSapp Widgets";
62 }
63
64 QIcon WallClockPlugin::icon() const
65 {
66 return QIcon();
67 }
68
69 QString WallClockPlugin::toolTip() const
70 {
71 return QString();
72 }
73
74 QString WallClockPlugin::whatsThis() const
75 {
76 return QString();
77 }
78
79 bool WallClockPlugin::isContainer() const
80 {
81 return false;
82 }
83
84 QString WallClockPlugin::domXml() const
85 {
86 return "<ui language=\"c++\">\n"
87 " <widget class=\"WallClock\" name=\"wallclock\">\n"
88 " <property name=\"geometry\">\n"
89 " <rect>\n"
90 " <x>0</x>\n"
91 " <y>0</y>\n"
92 " <width>100</width>\n"
93 " <height>100</height>\n"
94 " </rect>\n"
95 " </property>\n"
96 " <property name=\"toolTip\" >\n"
97 " <string>The current time and date</string>\n"
98 " </property>\n"
99 " <property name=\"whatsThis\" >\n"
100 " <string>The analog clock widget displays "
101 "the current time and date.</string>\n"
102 " </property>\n"
103 " </widget>\n"
104 "</ui>\n";
105 }
106
107 QString WallClockPlugin::includeFile() const
108 {
109 return "analog/wallclock.h";
110 }
111

mercurial