#include <kdevgenericfactory.h>
Inherits KGenericFactory< T, ParentType >.
Public Member Functions | |
KDevGenericFactory (TDEAboutData *data) | |
TDEInstance * | createInstance () |
Detailed Description
template<class T, class ParentType = TQObject>
class KDevGenericFactory< T, ParentType >
This class provides a generic implementation of a KLibFactory for use with TDevelop plugins.
Usually it is convenient to use K_EXPORT_COMPONENT_FACTORY macro to create factories for TDevelop plugins. For example, for DummyPlugin the factory can be created (in dummyplugin.cpp file) as:
Data should be a const static object. This way it complies with the requirements for data objecs of KDevGenericFactory constructor.
Important:
There is no need to create TDEAboutData objects. It is more useful to create a static const KDevPluginInfo object which can be used also in the constructor of a plugin.
For example, dummyplugin.cpp file could contain:
In the example above the duplication of information is avoided as same KDevPluginInfo objects are used for plugin and for plugin factory. This is possible because KDevPluginInfo class has an operator to cast KDevPluginInfo to TDEAboutData.
Definition at line 65 of file kdevgenericfactory.h.
Constructor & Destructor Documentation
◆ KDevGenericFactory()
|
inline |
Constructor.
- Parameters
-
data A reference to TDEAboutData with an information about the plugin. Data should have: - plugin name as an application name;
- untranslated plugin generic name as a product name;
- license type number.
Definition at line 76 of file kdevgenericfactory.h.
Member Function Documentation
◆ createInstance()
|
inline |
Creates an instance.
Definition at line 82 of file kdevgenericfactory.h.
The documentation for this class was generated from the following file: