-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMyWidgetPlugin.cc
More file actions
86 lines (72 loc) · 1.73 KB
/
MyWidgetPlugin.cc
File metadata and controls
86 lines (72 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include "MyWidgetPlugin.h"
#include "MyWidget.h"
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(MyWidget, MyWidgetPlugin)
#endif
MyWidgetPlugin::MyWidgetPlugin(QObject *parent)
: QObject(parent)
{
initialized = false;
}
MyWidgetPlugin::~MyWidgetPlugin()
{
}
bool MyWidgetPlugin::isContainer() const
{
return false;
}
bool MyWidgetPlugin::isInitialized() const
{
return initialized;
}
QIcon MyWidgetPlugin::icon() const
{
return QIcon("");
}
QString MyWidgetPlugin::domXml() const
{
return "<ui language=\"c++\">\n"
" <widget class=\"MyWidget\" name=\"mywidget\">\n"
" <property name=\"geometry\">\n"
" <rect>\n"
" <x>0</x>\n"
" <y>0</y>\n"
" <width>300</width>\n"
" <height>120</height>\n"
" </rect>\n"
" </property>\n"
// " <property name=\"toolTip\" >\n"
// " <string>MyWidget</string>\n"
// " </property>\n"
// " <property name=\"whatsThis\" >\n"
// " <string>MyWidget</string>\n"
// " </property>\n"
" </widget>\n"
"</ui>\n";
}
QString MyWidgetPlugin::group() const {
return "MyWidget";
}
QString MyWidgetPlugin::includeFile() const {
return "MyWidget/MyWidget.h";
}
QString MyWidgetPlugin::name() const {
return "MyWidget";
}
QString MyWidgetPlugin::toolTip() const {
return whatsThis();
}
QString MyWidgetPlugin::whatsThis() const
{
return "MyWidget";
}
QWidget* MyWidgetPlugin::createWidget(QWidget *parent)
{
return new MyWidget(parent);
}
void MyWidgetPlugin::initialize(QDesignerFormEditorInterface *core)
{
if (initialized)
return;
initialized = true;
}