designer/manometer_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 <QObject>
25 #include <QtUiPlugin/QDesignerCustomWidgetInterface>
26 #include <QString>
27 #include <QWidget>
28 #include <QIcon>
29 #include <QtPlugin>
30
31 #include "analog/manometer.h"
32 #include "manometer_plugin.h"
33
34 /*------------------------------------------------------------------------------------------------
35 * MANOMETER
36 *------------------------------------------------------------------------------------------------*/
37
38
39 ManoMeterPlugin::ManoMeterPlugin(QObject *parent)
40 : QObject(parent)
41 {
42 }
43
44 void ManoMeterPlugin::initialize(QDesignerFormEditorInterface * /*core*/)
45 {
46 if (initialized)
47 return;
48
49 initialized = true;
50 }
51
52 bool ManoMeterPlugin::isInitialized() const
53 {
54 return initialized;
55 }
56
57 QWidget *ManoMeterPlugin::createWidget(QWidget *parent)
58 {
59 return new ManoMeter(parent);
60 }
61
62 QString ManoMeterPlugin::name() const
63 {
64 return "ManoMeter";
65 }
66
67 QString ManoMeterPlugin::group() const
68 {
69 return "BMSapp Widgets";
70 }
71
72 QIcon ManoMeterPlugin::icon() const
73 {
74 return QIcon();
75 }
76
77 QString ManoMeterPlugin::toolTip() const
78 {
79 return QString();
80 }
81
82 QString ManoMeterPlugin::whatsThis() const
83 {
84 return QString();
85 }
86
87 bool ManoMeterPlugin::isContainer() const
88 {
89 return false;
90 }
91
92 QString ManoMeterPlugin::domXml() const
93 {
94 return "<ui language=\"c++\">\n"
95 " <widget class=\"ManoMeter\" name=\"manometer\">\n"
96 " <property name=\"geometry\">\n"
97 " <rect>\n"
98 " <x>0</x>\n"
99 " <y>0</y>\n"
100 " <width>100</width>\n"
101 " <height>100</height>\n"
102 " </rect>\n"
103 " </property>\n"
104 " <property name=\"toolTip\" >\n"
105 " <string>Shows the pressure</string>\n"
106 " </property>\n"
107 " <property name=\"whatsThis\" >\n"
108 " <string>The bar meter widget displays "
109 "the pressure attached to it</string>\n"
110 " </property>\n"
111 " </widget>\n"
112 "</ui>\n";
113 }
114
115 QString ManoMeterPlugin::includeFile() const
116 {
117 return "analog/manometer.h";
118 }
119

mercurial