Extending &kommander;

# Extending &kommander;

## Creating &kommander; Widgets

With Kommander you can create new widgets based on non-&kommander; widgets fairly easily. The approach is to derive your new &kommander; widget class from the &Qt;/&kde; widget which you wish to integrate with &kommander;, and then also from the KommanderWidget class. Overriding methods from this class gives the &kommander; widget its functionality.

Most of the code of a &kommander; widget is just template code. Therefore, you can use the widgetgenerator.kmdr &kommander; dialog to generate most the &kommander; widget code for you. All you have to do is fill in the important parts relating to your widget like any state information, widget text etc.

Let's say we want to create a new line edit widget for &kommander;, based on the &kde; widget KLineEdit. Using the &kommander; widget generator dialog, we get something like this in the outputted header file: