# The &kapptemplate; Handbook

Anne-Marie
Mahfouf

    &Anne-Marie.Mahfouf.mail;

2008
&Anne-Marie.Mahfouf;
&FDLNotice;
2008-04-28
0.1

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

KDE
kdesdk
KDE 4
programming
template
C++
python
ruby
pyqt4
pykde4
plasma
Qt 4

## Introduction

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

&kapptemplate; offers you a few basic templates projects and also picks up KDevelop templates if some are installed on your machine.

As default you will find:

- A simple &kde; 4 &GUI; template

- A &kde; 4 KPart template

- A Qt4 main window based template

- A PyQt4 application

- A Py&kde;4 application

- A Ruby (korundum4) template

- A plasma applet template

Answer the wizard questions on each page and generate your template.

A `README` file in each template will allow you to find out how to build the template. It will also give you links for tutorials related to the project. After the project is generated, &kapptemplate;'s job is finished and you are on your own to build it.

## Using &kapptemplate;

&kapptemplate; is a wizard. The first page of the wizard explains you that &kapptemplate; will generate a base project. Click Next to start generating your project. Cancel will stop the program and quit it. Help will display this help handbook in &khelpcenter;.

&kapptemplate; first page
&kapptemplate; first page

The second page lists the available templates. On the right you can see the template preview and below the template description. After you chose your template, you are invited to enter the project name in the field at the bottom.

&kapptemplate; second page
&kapptemplate; second page

On the third page, you are asked for the project version, the source folder and the author name and email. If you filled &systemsettings; tab about your personal information, it will be taken from there as default.

&kapptemplate; third page
&kapptemplate; third page

The fourth and last page gives you some feedback about the project generation.

&kapptemplate; fourth page
&kapptemplate; fourth page

Then click Finish to close &kapptemplate;.

## What template do you need?

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

### The C++ &kde; 4 &GUI; application template

This is a CMake based &kde; 4 &GUI; template using KXMLGuiWindow and KConfig XT. This is a &kde; 4 standard application.

Here's a screenshot of the C++ &kde; 4 &GUI; application template
C++ &kde; 4 &GUI; application template

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

Don't forget to read the `README` in the project directory. You can find some great tutorials for &kde; 4 on http://techbase.kde.org/Development/Tutorials.

### The C++ &kde; 4 KPart application template

This is a CMake based &kde; 4 KPart template.

Here's a screenshot of the C++ &kde; 4 Kpart template
C++ &kde; 4 Kpart template

Don't forget to read the `README` in the project directory.

### The plasmoid application

This template generates a simple plasma applet with an icon and some text on it.

&kde; 4 plasma applet template
&kde; 4 plasma applet template

You need &kde; 4.1 to build this template and it uses CMake. You can read more about it on http://techbase.kde.org/index.php?title=Development/Tutorials/Plasma/GettingStarted, all methods are explained here.

Restart plasma to load the applet by issuing `kquitapp plasma && plasma` or view it with `plasmoidviewer YourAppletName`.

### The PyQT4 application

The template will give you the following application:

The PyQT4 application
The PyQT4 application

You need PyQt4 from your distribution.

To run the template, first generate the python module from the Designer myCalendar.ui file by typing `pyuic4 -o myCalendar.py myCalendar.ui` in your project folder and then start your project: `python APPNAME.py`.

### The PyKDE4 application

The template will give you the following application:

The PyKDE4 application
The PyKDE4 application

You need PyKDE 4 from your distribution.

To run the template, first generate the python module from the Designer myCalendar.ui file by typing `pyuic4 -o myCalendar.py myCalendar.ui` in your project folder and then start your project: `python APPNAME.py`.

### The Ruby &kde; application

The template will give you the following application:

The &kde; Ruby application
The &kde; Ruby application

You need korundum4 from &kde; 4 kdebindings module or from your distribution to run this template.

To run the template, after building and installing the project (see the `README`), type in konsole: `krubyapplication your-app/main.rb`.

## Credits and License

- Program copyright 1998-2003 &Kurt.Granroth;

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

- Program copyright 2008 Beat Wolf

Contributors:

- Coding help: Beat Wolf asraniel@fryx.ch

- Ruby template: Cyrille Berger cberger@cberger.net

- Ruby template: Richard Dale Richard_Dale@tipitina.demon.co.uk>

- Py&kde;4 template: Christoph Burgmer chrislb@gmx.de

Documentation copyright 2008 &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;