10void on_<object name>_<signal name>(<signal parameters>);
15class MyExtension:
public QObject,
16 public QdesignerContainerExtension
19 Q_INTERFACE(QDesignerContainerExtension)
27QObject *ANewExtensionFactory::createExtension(QObject *object,
28 const QString &iid, QObject *parent)
const
30 if (iid != Q_TYPEID(QDesignerContainerExtension))
33 if (MyCustomWidget *widget = qobject_cast<MyCustomWidget*>
35 return new MyContainerExtension(widget, parent);
43QObject *AGeneralExtensionFactory::createExtension(QObject *object,
44 const QString &iid, QObject *parent)
const
46 MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object);
48 if (widget && (iid == Q_TYPEID(QDesignerTaskMenuExtension))) {
49 return new MyTaskMenuExtension(widget, parent);
51 }
else if (widget && (iid == Q_TYPEID(QDesignerContainerExtension))) {
52 return new MyContainerExtension(widget, parent);
62void MyPlugin::initialize(QDesignerFormEditorInterface *formEditor)
67 QExtensionManager *manager = formEditor->extensionManager();
68 Q_ASSERT(manager != 0);
70 manager->registerExtensions(
new MyExtensionFactory(manager),
71 Q_TYPEID(QDesignerTaskMenuExtension));