# The &kapptemplate; Handbook

Anne-Marie Mahfouf

    &Anne-Marie.Mahfouf.mail;

2007 &Anne-Marie.Mahfouf;
&FDLNotice;
2007-04-18
0.00.00

&kapptemplate; is a &kde; 4 templates generator.

KDE kdesdk KDE 4 programming template

## Introduction

&kapptemplate; generates &kde; 4 templates to help you start easily &kde; programming.

&kapptemplate; runs in konsole or any terminal and you start it by typing `kapptemplate` at the prompt.

You are then presented with the templates list.

There are three kinds of templates:

- 1. a simple &kde; 4 application

- 2. a full featured &kde; 4 framework application

- 3. a KParts &kde; 4 application

Choose one template and type its number then fill in the details of your project.

## Using &kapptemplate;

This chapter describes the templates so you can choose the one that is the best adapted to your needs.

### Generating the &kde; 4 simple application template

Here's a screenshot of the kde4 simple application
kde4 simple application

This template demonstrates how you create &kde; menus using XMLGui and how to use KConfig XT to change settings using the Settings Configure <AppName> .

Here's a screenshot of the kde4 simple application settings dialog
kde4 template settings

Please note in the config dialog that there are tooltips to help the user understanding each setting. These tooltips can either be written directly in Qt Designer for each widget or be added in the subclass. A tooltip consists on only a few words describing the use of the widget.

A tooltip
A tooltip

Furthermore using &Shift;F1 the user can see QWhatsThis help which helps him to understand better what each setting does. This QWhatsThis help can either be written directly in Qt Designer for each widget or be added in the subclass. It should be more detailed than the tooltip and can use HTML markup such as bold, color or italic.

QWhatsThis
QWhatsThis

You can find some great tutorials for &kde; 4 on http://techbase.kde.org/Development/Tutorials.

### Generating the full featured &kde; 4 framework application

This template has the same features than the previous one with more menus and with DBUS support.

&kde; 4 framework application
&kde; 4 framework application

### Generating the KParts &kde; 4 application

A KParts component is a &kde; GUI component featuring a widget embeddedable in any application and GUI elements that will be merged in the "host" user interface (menubars, toolbars... ). It can embed in other &kde; applications. For example, &konsole; is a KPart and can therefore be easily used in KDevelop or &kate;.

The template will give you the following application:

KParts application
KParts application

This template is a small editor

You can read more about KParts in this detailed tutorial: http://techbase.kde.org/Development/Architecture/KDE3/KParts.

## Credits and License

- Program copyright 1998-2003 Kurt Granroth

- Program copyright 2006-2007 &Anne-Marie.Mahfouf;

Documentation copyright 2007 &Anne-Marie.Mahfouf; &Anne-Marie.Mahfouf.mail;

&underFDL; &underGPL;

## Installation

### How to obtain &kapptemplate;

&install.intro.documentation;

### Compilation and installation

&install.compile.documentation;
&documentation.index;