Eclipse

KDE4's ktimetracker loaded as eclipse project

This describes how to use Eclipse to develop KDE 4 applications. It has been tested with Eclipse Ganymede and SUSE Linux 11.1 but should work same or similar with every combination. As an example KDE application we use KTimeTracker from the kdepim module, other applications should work likewise.

Using this description you will be able to

update your working copy of KDE source code using the svn command

build your KDE module using CMake

build your KDE application from within Eclipse using Make

compile and run your application with one click from Eclipse

get auto-completion when editing KDE source code

have an overview and navigation about your classes within Eclipse

have call trees for your functions

Set up Eclipse with KDE

Check your requirements

Trying with a virtual machine I had problems starting Eclipse with less than 1 GB RAM. After assigning 3 GB RAM to the virtual machine, Eclipse finally started.

Revert what eclipse did

To revert what eclipse did to your project simply run

rm-rf .externalToolBuilders/ .project .cproject

Why Subversion does not work

When using Eclipse's svn plugin and building a KDE program, you will get error messages complaining that your svn binary is too old. If you want to try and change this, here is how you get to that error:

QtCreator

This describes how to use QtCreator to develop KDE 4 applications. It has been tested with QtCreator 1.2.80 and SUSE Linux 11.1 but should work same or similar with every combination. As an example KDE application we use ktimetracker from the kdepim module, other applications should work likewise.

Start a KDE project

To start a new project you need to tell QtCreator to use the KDE libraries when building. So, choose File -> New... and create your project. We will call it yourproject here. To be able to use KDE's libraries, go to your home directory, change into yourproject and modify the file yourproject.pro. Add the line

LIBS += -lkdeui

KDevelop 4

Using KDevelop 4 to develop KDE projects is pretty straightforward. You can refer to the [[KDevelop manual|http://userbase.kde.org/KDevelop4/Manual] for help on how to use KDevelop in general. This section just covers a few things which are nice for KDE applications in particular.

Fetch source code from git

The Project -> Fetch project... menu allows you to easily clone a KDE project repository, by just selecting "KDE" and typing the project name.

Import a repository you already cloned into KDevelop

To do this, just go to Project -> Open/Import project, and select the top-level CMakeLists.txt file from the repository you want to work on.

Tip

When you work on libraries, you first need to install them before you can test or debug your changes.

Since this is cumbersome and time consuming, you should create symlinks (ln -s) pointing from the build directory to the installation directory for all affected libraries.

Often, even simple programs use libraries internally, for example the settings dialog of Konsole is really a library.