|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Clock widget |
|
15 * |
|
16 */ |
|
17 |
|
18 // User includes |
|
19 #include "clockwidgetplugin.h" |
|
20 #include "clockwidget.h" |
|
21 |
|
22 /*! |
|
23 \class ClockWidgetPlugin |
|
24 |
|
25 This class is a wrapper plug-in DLL that references the custom widget DLLs that need to be part of the widget package. |
|
26 */ |
|
27 |
|
28 |
|
29 /*! |
|
30 Creates an instance of each of the types of custom widget supported in this plug-in. |
|
31 The code uses the parameter type to control which type of object must be created. |
|
32 It also sets the created object's name |
|
33 */ |
|
34 QObject *ClockWidgetPlugin::createObject(const QString &type, const QString &name) |
|
35 { |
|
36 if (type == ClockWidget::staticMetaObject.className()) { |
|
37 QObject *object = new ClockWidget(); |
|
38 object->setObjectName(name); |
|
39 return object; |
|
40 } |
|
41 return 0; |
|
42 } |
|
43 |
|
44 /*! |
|
45 Get a QMetaObject for each custom widget and add it to the list of supported objects. |
|
46 A QMetaObject pointer must be added for every custom widget that is created by the plug-in. |
|
47 */ |
|
48 QList<const QMetaObject *> ClockWidgetPlugin::supportedObjects() |
|
49 { |
|
50 QList<const QMetaObject *> list; |
|
51 list.append( &ClockWidget::staticMetaObject ); |
|
52 return list; |
|
53 } |
|
54 |
|
55 // End of file --Don't remove this. |