Logo Search packages:      
Sourcecode: qcake version File versions  Download package

QtNPFactory Class Reference

#include <qtbrowserplugin.h>

Inherited by QtNPClass< T >.

List of all members.


Detailed Description

The QtNPFactory class provides the factory for plugin objects.

Implement this factory once in your plugin project to provide information about the plugin and to create the plugin objects. Subclass QtNPFactory and implement the pure virtual functions, and export the factory using the QTNPFACTORY_EXPORT() macro.

If you use the Q_CLASSINFO macro in your object classes you can use the QTNPFACTORY_BEGIN(), QTNPCLASS() and QTNPFACTORY_END() macros to generate a factory implementation:

    class Widget : public QWidget
    {
        Q_OBJECT
        Q_CLASSINFO("MIME", "application/x-graphable:g1n:Graphable data")
    public:
        ...
    };

    QTNPFACTORY_BEGIN("Plugin name", "Plugin description")
        QTNPCLASS(WidgetClass)
    QTNPFACTORY_END()

The classes exposed must provide a constructor.

If Qt is linked to the plugin as a dynamic library, only one instance of QApplication will exist {across all plugins that have been made with Qt}. So, your plugin should tread lightly on global settings. Do not, for example, use QApplication::setFont() - that will change the font in every widget of every Qt-based plugin currently loaded!

Definition at line 82 of file qtbrowserplugin.h.


Public Member Functions

virtual QObject * createObject (const QString &type)=0
virtual QStringList mimeTypes () const =0
virtual QString pluginDescription () const =0
virtual QString pluginName () const =0
 QtNPFactory ()
virtual ~QtNPFactory ()

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

Generated by  Doxygen 1.6.0   Back to index