Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QExtensionManager Class Reference

Inheritance diagram for QExtensionManager:

QObject QAbstractExtensionManager

List of all members.

Detailed Description

The QExtensionManager class provides extension management facilities for Qt Designer.


In the extensions are not created until they are required. For that reason, when implementing an extension, you must also create a QExtensionFactory, i.e a class that is able to make an instance of your extension, and register it using 's extension manager.

The registration of an extension factory is typically made in the QDesignerCustomWidgetInterface::initialize() function:

        void MyPlugin::initialize(QDesignerFormEditorInterface *formEditor)
            if (initialized)

            QExtensionManager *manager = formEditor->extensionManager();
            Q_ASSERT(manager != 0);

            manager->registerExtensions(new MyExtensionFactory(manager),

            initialized = true;

The QExtensionManager is not intended to be instantiated directly. You can retrieve an interface to 's extension manager using the QDesignerFormEditorInterface::extensionManager() function. A pointer to 's current QDesignerFormEditorInterface object (formEditor in the example above) is provided by the QDesignerCustomWidgetInterface::initialize() function's parameter. When implementing a custom widget plugin, you must subclass the QDesignerCustomWidgetInterface to expose your plugin to .

Then, when an extension is required, 's extension manager will run through all its registered factories calling QExtensionFactory::createExtension() for each until the first one that is able to create the requested extension for the selected object, is found. This factory will then make an instance of the extension.

There are four available types of extensions in : QDesignerContainerExtension , QDesignerMemberSheetExtension, QDesignerPropertySheetExtension and QDesignerTaskMenuExtension. 's behavior is the same whether the requested extension is associated with a container, a member sheet, a property sheet or a task menu.

For a complete example using the QExtensionManager class, see the {designer/taskmenuextension}{Task Menu Extension example}. The example shows how to create a custom widget plugin for Qt Designer, and how to to use the QDesignerTaskMenuExtension class to add custom items to 's task menu.

See also:
QExtensionFactory, QAbstractExtensionManager

Definition at line 33 of file qextensionmanager.h.

Public Slots

void deleteLater ()


void destroyed (QObject *=0)

Public Member Functions

bool blockSignals (bool b)
const QObjectListchildren () const
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
bool disconnect (const QObject *receiver, const char *member=0)
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
void dumpObjectInfo ()
void dumpObjectTree ()
QList< QByteArraydynamicPropertyNames () const
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
virtual QObjectextension (QObject *object, const QString &iid) const
template<typename T>
findChild (const QString &name=QString()) const
template<typename T>
QList< T > findChildren (const QRegExp &re) const
template<typename T>
QList< T > findChildren (const QString &name=QString()) const
bool inherits (const char *classname) const
void installEventFilter (QObject *)
bool isWidgetType () const
void killTimer (int id)
void moveToThread (QThread *thread)
QString objectName () const
QObjectparent () const
QVariant property (const char *name) const
 QExtensionManager (QObject *parent=0)
virtual void registerExtensions (QAbstractExtensionFactory *factory, const QString &iid=QString())
void removeEventFilter (QObject *)
void setObjectName (const QString &name)
void setParent (QObject *)
bool setProperty (const char *name, const QVariant &value)
void setUserData (uint id, QObjectUserData *data)
bool signalsBlocked () const
int startTimer (int interval)
QThreadthread () const
virtual void unregisterExtensions (QAbstractExtensionFactory *factory, const QString &iid=QString())
QObjectUserData * userData (uint id) const
 ~QExtensionManager ()

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static uint registerUserData ()

Protected Member Functions

virtual void childEvent (QChildEvent *)
virtual void connectNotify (const char *signal)
virtual void customEvent (QEvent *)
virtual void disconnectNotify (const char *signal)
int receivers (const char *signal) const
QObjectsender () const
virtual void timerEvent (QTimerEvent *)

Protected Attributes

QObjectData * d_ptr

Static Protected Attributes

static const QMetaObject staticQtMetaObject


QString objectName
 the name of this object

Private Attributes

QHash< QString, QList
< QAbstractExtensionFactory * > > 
< QAbstractExtensionFactory * > 


class QApplication
class QApplicationPrivate
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name=QString(), T dummy=0)
qFindChild (const QObject *obj, const QString &name)
QList< T > qFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
QList< T > qFindChildren (const QObject *obj, const QString &name)
T * qobject_cast (QObject *object)
qt_extension (QAbstractExtensionManager *manager, QObject *object)
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index