docs.kde.org
Declaration of plugin class
Prev
Next

Declaration of plugin class

Now that we have the preliminary work done, let us get into the actual fun part - creating a class that will provide the behavior we want. While we are free to make this class do almost anything we want it to do, there are a few restrictions.

  1. Plugin classes must inherit the ThemeEngine class.

  2. Plugin classes must be named according to the rule: Theme+PluginName.

  3. Plugin classes should provide a static function called names that returns a list of names by which it can be invoked.

  4. If the plugin can be configured in the control center module, it should provide a ThemeEngineConfig-based class for the configuration.

  5. Plugin classes must override at least one of the virtual functions slotSetText, slotSetPixmap, slotUpdateProgress and slotUpdateSteps to make it usable.

  6. The constructor should take the form ThemeEngine( QWidget *parent, const char *name, const QStringList &args ) so that it can be used with KGenericFactory.

The last requirement may seem complicated, but, as we will see later, by adding a single line to your source files, you can usually ignore it.

Prev
Next
Home


docs.kde.org