docs.kde.org
Configuring KDevelop
Prev
Next

Chapter 4. Configuring KDevelop

Bernd Pol

Table of Contents

General Configuration
General Setup
Selecting the User Interface
File Templates
Selecting an Editor
Abbreviations for the Word Completion
Scripting
Adding KDE Standard Applications to the Tools Menu
Adding External Applications to Menus
Selecting a Source Format Style
Setting Up the Code Snippets Tool
File List
Configuring the File Selector
C++ Class Generator
Formatting
C++ Parsing
Configuring the Documentation
Setting Up Documentation Collections
Setting Up Text Search Indexes
Other Documentation Configuration Settings
Advanced Configuration
Plugin Tools

KDevelop is a very powerful and flexible IDE which offers many ways to tailor it to your needs. To start configuration select Settings->Configure KDevelop.... This will cause the configuration dialog to pop up consisting of a selection window to the left and the configuration dialog on the right hand side whose contents will vary upon the configuration item you did select.


Select a configuration item

Select a configuration item


We will discuss these configurations in a different order, split up into the main topics of General Configuration, Configuring the Documentation, and Advanced Configuration which makes for a more intuitive reading.

If you want directly look up a certain configuration item use one of the following links.

General
User Interface
File Templates
Editor
Abbreviations
Scripting
Tools Menu
External Tools
Documentation
Code Snippets
File List
File Selector
C++ Class generator
Formatting
C++ Parsing

General Configuration

General configuration concerns the more common tasks of tailoring KDevelop as there are:

General Setup

The General configuration dialog allows you to define some basic KDevelop behaviour which seldom will change in everyday work. This concerns:

General project options such as
Selecting a font for the most commonly used output view windows, namely:
  • the Messages Output View KDevelop uses to communicate e.g. compilation progresses, and

  • the Application Output View which will show error and state information concerning a running application.

Some common behaviour concerning the displayed lines in the Messages Output View window, namely:

The level of detail of messages concerning the compilation process shown in the Messages Output View window.


The general configuration dialog


Load last project on startup

Mark this checkbox if you want to continue to work with the last project you worked on. This will cause KDevelop to automatically load this project on start-up. It will usually be shown in the state you left work so you can readily proceed.

Default projects directory:

By default, KDevelop uses a common parent directory for all new projects. Enter the absolute path of this common directory in the box or select it from your directory structure. KDevelop will place the any new project here as a subdirectory.

Note

You may of course change the directory path of a new project at the time you set it up in the Application Wizard.

Window font:

The Application Output View window is used to display error and state information from applications which are run from inside KDevelop. These are informations the applications usually sends to the console when run stand-alone. So you do not need to leave the IDE when testing the application you currently work on.

To select a font suitable for the Messages Output View window click the Window Font button showing the currently selected font (it says “Luxi Sans” in the above illustration). The KDE standard Select Font dialog will pop up from which you may select the font to be used.

Note

On first start-up, KDevelop initializes this font setting to the standard font for which your KDE user has been configured. This setting is fixed, so if you alter Preferences->Appearances & Themes->Fonts in the Control Center, this will not effect this KDevelop font selection. You will have to explicitely reselect the Messages Output View window font.

Compiler Output

KDevelop preprocesses the messages the Messages Output View window receives during the build processes in order to filter superfluous information. You can control the level of detail KDevelop will display using the dropdown box in this field.

Very Short

Displays only warnings, errors, and the filenames which are compiled.

Short

Suppresses all compiler flags and formats the output to be more readable.

Full

Displays all output messages unmodified.

Tip

There is an alternative way to switch the compiler output detail. Just right click in the Messages Output View window and select the according detail level from the popup menu.

Line wrapping

By default, KDevelop will wrap long lines around in the Messages Output View window so that valuable information will not be easily overlooked. In some cases this will clutter long message lists. Remove the checkbox mark if you do not want the lines wrap around.

Tip

There is an alternative way to switch the line wrapping. Just right mouse button click in the Messages Output View window and mark/unmark the Line Wrapping entry in the menu which will pop up.

Directory navigation messages

The make tool usually will display messages like “Entering directory”, or “Leaving directory” when it switches the directories it currently works in. As this clutters the messages list in the Messages Output View window, KDevelop suppresses those messages by default. Mark the checkbox if you want to protocol which directories make worked in.

Note

Changes in this setting effect the processing of new messages only. Old directory navigation messages will be kept visible when you switch this feature off.

UI Designer Integration

This let you choose the way you want .ui files to be displayed in KDevelop. KDevelop comes with its own UI designer called KDeveDesigner that can either be embedded or be run as a separate program. Qt Designer can also be used to edit .ui files.

  • Use KDevelop's embedded designer

    This uses KDevelop own designer embedded within KDevelop

  • Run KDevelop's designer as a separate application

    The KDevDesigner application will be run separately in its own window.


    KDevDesigner in its own window


  • Run Qt Designer

    Qt Designer from your Qt installation will be started externally whenever you click on a .ui file in KDevelop.

Terminal Emulation

You choose here which terminal you want to be integrated within KDevelop.

  • Use KDE setting

    This uses KDE setting as set in KControl in KDE component Component Chooser tab which sets the default terminal emulator used by all KDE applications that need a terminal.

  • Other

    Choose some other terminal different from the default one.

Selecting the User Interface

As already said in the Available User Interface Modes chapter there are five different ways the KDevelop work area may be set up, namely:

  • Simplified IDEAl window mode

    This is a simplified version of the IDEA user interface. It is designed to be simple and clean. It also does not uses docked toolviews.

  • IDEAl window mode

    This is a clone of the IDEA user interface, similar to the Tabbed pages mode and is default.

  • Childframe window mode

    All tool views are initially docked to the mainframe. Editor and browser views will live like toplevel windows within a view area of the mainframe. A typical example of this user interface mode is MS Visual Studio 6.0.

  • Tabbed pages mode

    All tool views are initially docked to the mainframe. Editor and browser views will be stacked in a tab window. A typical example of this user interface mode is KDEStudio, our friend C++-IDE in the world of KDE.

  • Toplevel window mode

    All editor, browser and tool views will be toplevel windows (directly on desktop). The main widget contains the menu, toolbars and statusbar only. A typical example of this user interface mode is Borland Delphi 6.0.

To switch the user interface mode select Settings->Configure KDevelop... from the menus. The Customize KDevelop dialog will pop up, where you have to select User Interface in the left hand tree. This will display the following settings dialog to the right.


Select a user interface mode

Select a user interface mode


Select the radio button of the user interface mode you want to switch to, then click OK.

Note

Do not forget to restart KDevelop in order to let any of these selections take effect.

When you selected either the Simplified IDEAl window mode or the IDEAl window mode or the Tabbed pages mode two more configuration sections will become available: Use Tabs and Use Close On Hover. These allow to configure under which circumstances tabs will be shown on top of the document windows and whether you may close the document by a click on the tab icon.

In Simplified IDEAl window mode and in IDEAl window mode only yet another configuration section will be available, Toolview Tab Layout which effectively allows to select between different sizes of the toolview tabs which surround the main working area in this mode.

Configuring the Documents Tab Bar Display

In the IDEAl and tabbed pages modes there will be named tabs on top of the document windows by default, so you can easily select different documents with a left mouse button click. If you prefer to provide more space for the document windows in the KDevelop main work area, you may change to another behaviour in the Use Tabs configuration section.

Always

This is the default — show a tab comprising an icon and the document name on top of any document window in the KDevelop main area display.

When more than one

Do not show a tab when only one document is displayed. If there is more than one document, however, KDevelop will display an according tab bar as in the Always selection above. You may want to select this mode if you work on a single document most of the time as this provides more vertical space.

Never

Never show any document selection tab. You may prefer this mode if you seldom use the mouse to switch between documents. It provides more vertical space for all document windows. To select another the document window or to close any, use the KDevelop Window menu.

Setting Up to Close a Document by a Click On Its Tab

When you configured KDevelop to display the documents tab bar, either always or when more than one document is displayed in the main work area, you may add more functionality to the tabs beyond their document selection capability. Use the Use Close On Hover coniguration section for this.

No

This is standard behaviour. No extra functionality is added to the tabs. They may be used only to select document windows on left mouse button clicks.

Yes

When you selected this radio button, KDevelop will allow to close a document window by a left mouse button click. Use the mouse to point at the small icon on the on the left tab border. It will change to a close symbol. Now click with the left mouse button on this changed symbol and KDevelop will close the according document window.

Yes, Delayed

After selecting this radio button, KDevelop will allow to close a document window as shown in the Yes case above. The icon will not change instantly, however, but there will be a short delay before the close icon shows up.

Configuring the Toolview Tab Layout

The Toolview Tab Layout configuration section will be available in IDEAl mode only. Use these radio buttons to set up the look of the toolview tabs which surround the main working area in this mode.

Icons

Each tab will show an icon only. If the associated toolview is displayed, the tab will open and a descriptive text for this toolview be shown. You may want to use this mode if you work on a monitor with limited resolution.

The icons are not very descriptive, however. If you want to find out which toolview is assigned to a given tab, point at it with the mouse and wait a second. A short tooltip will then pop up with the toolview name.

Text

This is the default toolview tab display mode. Each tab displays the name of its associated toolwiew.

Text and Icons

If the standard text toolview display looks too flat to you and you are working on a high-resolution monitor you may want to select this radio button. It will cause the name of the associated toolview be displayed on each tab plus an icon to the left of it, making the tabs easier to distinguish. See the Folded Toolview Tabs illustration below for an example.

Folded Toolview Tabs

If you selected the IDEAl mode toolview tabs to display texts (with or without accompanying icons) you need not worry about them being hidden behind some toolview window. If one of the bottom toolview windows occupies more space than is available to display all (vertical) tabs, they will fold around as this illustration shows:


Toolview tabs fold to not be hidden behind another view window

Toolview tabs fold to not be hidden behind another view window


Note

The active toolview window must be shown fixed (non-overlap mode), sharing the work area with the other windows, to force such tab folding. Press the small square in the window border to accomplish this as shown in the example.

File Templates


Configure File Templates

Configure File Templates


Selecting an Editor

KDevelop allows you to select your favorite text editor tool. Mark the Editor entry in the left hand side selections tree of the Configure KDevelop window. The following dialog will be displayed to the right.


Select an editor

Select an editor


To select a new editor, click on the arrow on the drop down list field. Depending on the editor parts interfaces your KDE version has compiled in you will be provided with a list of editors you may select from (see the Important note below for this). Click on the editor of your liking and click OK. Currently there are two possibilities:

Embedded Advanced Text Editor

This is the KDE standard Kate editor part.

Qt Designer Based Text Editor

This is the editor Qt™ provides in its Designer component.

These editor interfaces are fully integrated in the KDevelop IDE concept. Particularly the possibility to jump to the offending source code line by just clicking on an error message in the Messages Output View window has been provided.

Note

Changing the editor will not effect already open files. There are two possibilities to proceed. Either close all open text windows and reopen them one by one. Or simply close the whole project and reopen it again. The windows will then automatically open under the new text editor interface.

Important

KDevelop lets you use editor interfaces which have registered with KDE and that provide a KatePart interface. If you miss one one of the selections shown above check your KDE installation if the corresponding KPart was correctly installed.

What to do if the file has been changed externally:

Do nothing

The file will be marked as externally changed and the user will be asked to verify any attempt to overwrite it.

Alert the user

A dialog will alert the user that a file has changed and offer the user to reload the file.

Automatically reload the file if safe, alert the user if not

Any files that are not modified in memory are reloaded and an alert is shown for any conflicts.

Abbreviations for the Word Completion

(... to be written ...)

Scripting

(... to be written ...)

Adding KDE Standard Applications to the Tools Menu

(... to be written ...)

Adding External Applications to Menus

(... to be written ...)

Adding to the Tools Menu

(... to be written ...)

Adding to the File Context Menu

(... to be written ...)

Adding to the Directory Context Menu

(... to be written ...)

Selecting a Source Format Style

KDevelop automatically formats a source text in a predefined style. This style is highly configurable.

Note

The reformat source feature is currently available for C, C++, and Java™ only. Especially you cannot use it for scripting languages like e.g. PHP. This is because KDevelop uses the astyle application to implement this feature.

To set up a specific format style, select Settings->Configure KDevelop.. from the menubar. The Customize KDevelop dialog will pop up, where you have to select Source Formatter in the left hand tree. This will display a series of three settings dialog tabs to the right, namely a General Formatting Setup, a Indentation Style Setup, and a Other Formatting Setup.

Tip

Any style changes apply to newly entered text only. If you want to change the formatting style of an already existing source text you will have to explicitely use the Edit->Reformat Source command.

Note

The exact outcome of these style formatting definitions depends on the editor you use. Currently, most settings are tailored to the Kate editor part (the “Embedded Advanced Text Editor”). Some other editors (e.g. the Qt editor) may rely on their own configuration settings. You will have to experiment in this case to find out the exact effects of the style settings provided here.

Warning

There may be incompatibilities between the configuration style settings provided here and the editor you use up to the extent that in extreme cases it even might destroy your files. Make sure you have a backup of your source files before you try out these settings with an none KDE standard editor.

General Formatting Setup

The General tab of the Source Formatter dialog allows you to select one out of five predefined source format styles.


Source format style general setup

Source format style general setup


A formatted source example will be displayed in the field to the right. If none of the predefined styles is to your liking, you may click the top User defined radio button and define your own source formatting style preferences on the other two tabs which will become available then.

Note

Currently only the predefined source formatting styles will be demonstrated by an example text. If you decide to define your own style, no example display will be available. You have to experiment on an actual source text to tailor the settings to your liking.

Indentation Style Setup

Proper indentation is the main means to enhance readability of a source text. I you selected the Indentation tab of the Source Formatter dialog you will be presented with a series of indentation formatting choices grouped into three boxes as following.


Source format indentation style setup

Source format indentation style setup


Default Settings

The preset format choices will cause the source text to resemble the ANSI formatting style:

namespace foospace
{
  int Foo()
  {
    if (isBar)
    {
      bar();
      return 1;
    }
    else
      return 0;
  }
}
Defining Indentation Width and Characters

The radio buttons grouped in the Filling group define how indents in the source text will be drawn.

Use tabs

This will cause the editor to insert a tab character for each indentation level. The tab width is predefined in the editor settings (8 or 4 character columns usually). Use Settings->Configure Editor... to redefine it.

Note

The actual tab width definition procedure depends on the editor you selected in the Selecting an Editor configuration step. You will have to look up the corresponding editor help to find out.

Use spaces

If you select this radio button, the editor will enter a number of spaces for each indentation level. Change the number from the default 2 to the indentation width you prefer.

Indented Entities

This defines which of the (C/C++) entities will be formatted with an extra indent beyond the current indentation level.

By default only namespaces and labels will be extra indented. You may want to experiment with various settings to tailor those extra indents to your liking.

Continuation

The settings grouped here apply to those cases where the source formatter automatically wraps around long source lines. It takes two special cases in account, namely that in deeply nested indents there should remain enough room for the source and that conditionals should get extra indent levels on continuation to make them stand out properly.

Note

This applies to static word wrap cases only where a fixed maximum line width is used in the source text. If you set up your editor to dynamically wrap around long lines in display only (which is possible in the Kate editor part) the effects of these settings usually will not show.

Maximum in statement

This setting limits the maximum possible indentation for the continuation lines so that enough space will remain to keep the text readable. No continuation line will ever be indented beyond the number of columns you selected in this field.

The default is set to 40 character columns (half a standard 80 column page). You may want to increase this value to account for wider paper (e.g if you use landscape printing for your sources). Or decrease the value accordingly to take larger margin settings of your printouts into account.

Minimum in conditional

Conditionals or source following e.g. an assignment operator should usually get an extra indent on continuation lines in order to keep the text readable. The amount of this extra indent is defined here.

The default is set to “Twice current” which means that continued conditionals will get an extra indent level of the standard indentation size you selected in the Filling group. You may change this extra indent to another fixed width (including zero) using the arrows or by entering the value directly.

Other Formatting Setup


Other source format style settings

Other source format style settings


Controlling the position of braces

The radio buttons the (somewhat misnamed) Brackets group control the position of block delimiting braces in a (C/C++) source text. There are three possibilities from which you can select.

Break

This inserts a line break before each opening brace. Both delimiting braces of any block will be put at the same indentation level as the block head statement.

namespace foospace
{
  int Foo()
  {
    if (isBar)
    {
      bar();
      return 1;
    }
    else
      return 0;
  }
}
Attach

This will keep the opening brace of a block in line with the block head statement. Closing braces will be on the same indentation level as the block head statement. The else of an if statement will be kept in line with the closing brace of the preceding block.

namespace foospace {
  int Foo() {
    if (isBar) {
      bar();
      return 1;
    } else
      return 0;
  }
}
Linux Style

This is a compromise of the above listed styles. Functional block delimiting braces will be put on extra lines. Braces opening a block in a conditional or loop statement will be kept in line.

namespace foospace
{
  int Foo()
  {
    if (isBar) {
      bar();
      return 1;
    } else
      return 0;
  }
}
Controlling Extra Spaces

By default KDevelop does minimize the use of spaces in source texts.

if (isBar(fooArg)==barValue)

You may enhance readability if you force the source formatter to insert extra spaces in special positions.

Add spaces around parentheses

In fact what is meant is to add spaces around the text put in parentheses. This enhances the readabilitiy of function arguments and conditionals.

if ( isBar( fooArg )==barValue )
Add spaces around operators

This will put spaces around assignment and comparison operators to enhance the readability.

if (isBar(fooArg) == barValue)
Controlling the formatting of one-line constructs

There are a few cases where you don't want the source formatter to split a long line apart. For C/C++ code this can be controlled here.

Keep one-line statements

This keeps single line statements together in some situations even if they exceed a fixed maximum line length.

Keep one-line blocks

This keeps single line blocks together in some situations even if they exceed a fixed maximum line length.

Setting Up the Code Snippets Tool

When editing in KDevelop you can store often used parts of code as Code Snippets. To configure the capabilities of the code snippets part select Settings->Configure KDevelop.. from the menubar. The Customize KDevelop dialog will pop up, where you have to select Code Snippets in the left hand tree. This will show the following dialog in the right hand side.


Configuring the code snippets tool

Configuring the Code Snippets tool


Activate Snippet Preview

Mark the Show snippet's text in tooltip checkbox if you want to view the stored text in a tooltip window whenever you keep the mouse cursor over the title of that snippet.

Working with Snippet Variables

The Code Snippets tool allows for a variable text in predefined places any time you insert a snippet into a file. To accomplish this Code Snippets provides its own variables' mechanism. You can set up it's behaviour in the Variables group.

Delimiter

The Code Snippets tool distinguishes variables in the text by surrounding the variable name with special delimiter symbols. To use your own delimiter symbol, change the predefined $ character in the Delimiter field.

Input method for variables
  • Single dialog for each variable within a snippet – will in turn pop up a separate dialog for each variable which the tool finds when inserting the selected code snippet.

  • One dialog for all variables within a snippet – will pop up a common dialog where the user has to fill in the values of all variables before the snippet will be inserted

File List

(... to be written ...)

Configuring the File Selector

KDevelop provides a File Selector plugin which, when loaded at start-up, allows to navigate to any file or directory in the system.


The file selector in IDEAl mode

The file selector (IDEAl mode)


The behaviour of the File Selector can be highly configured. Select Settings->Configure KDevelop.. from the menubar. The Customize KDevelop dialog will pop up, where you have to select File Selector in the left hand tree. This will show the following dialog in the right hand side.


Configuring the file selector

Configuring the file selector


Configuring the Toolbar

There is a toolbar on top of the File Selector which can be configured as usual in the Toolbar group.

Procedure 4.1. Add an Action to the Toolbar

  1. Select an item in the right hand Selected actions list after which the new action should be inserted.

  2. Select the action to be inserted in the left hand Available actions list.

  3. Click the right (upper) arrow between both lists.

    The action will be removed from the Available actions list and inserted into the Selected actions list below the selected item.

Procedure 4.2. Remove an Action from the Toolbar

  1. Select the item to be removed in the right hand Selected actions list.

  2. Click the left (lower) arrow between both lists.

    The selected item will be removed from the Selected actions list and put back into the Available actions list.

Procedure 4.3. Reorder the Actions on the Toolbar

  1. Select the action to be moved in the right hand Selected actions list.

  2. Click the up or down arrow to the right of this list.

    The selected item will be moved up or down the Selected actions list.

Defining When the Contents Should Change

Updating the contents in the File Selector window takes time and resources, esp. when changing to another directory. Therefore File Selector is set up by default in such a way that its contents change only on demand, i.e. when you select another directory or when you explicitely want to refresh its contents.

Note

Click the Reload button in the toolbar to update the contents of the File Selector. This toolbar button is not available by default, however. You must insert it there first.

You can configure the File Selector to immediately reflect certain changes in your work. The settings in the Auto Synchronization group of the configuration dialog are responsible for this.

When a document becomes active

If you select this checkbox, the contents in the File Selector window will be updated whenever you go to another already open document, e.g. when you click on the tab of the according edit window in IDEAl mode. If necessary the File Selector will switch to the directory this file belongs to and update the display to show the actual contents in there.

When a document is opened

If you select this checkbox, the contents in the File Selector window will be updated whenever a document will be opened, e.g. by the File->Open menu. If necessary the File Selector will switch to the directory this file belongs to and update the display to show the actual contents in there.

When the file selector becomes visible

If you select this checkbox, the contents in the File Selector window will be updated whenever it gets visible again. If necessary it will switch to the directory the actual document belongs to and update the display to show the actual contents in there.

You may freely combine these settings to tailor the actualization behaviour of the File Selector to your liking.

Controlling the History in the Comboboxes

There are two comboboxes on top and bottom of the File Selector contents window which control the directory to be displayed (top combobox) and the filters to be applied to the file display (bottom combobox). A history of the most recent settings is kept in the selection field of each combobox. You can configure the number of history entries as follows.

Remember locations

Enter here the maximum number of directory selections the upper combobox shall remember.

Remember filters

Enter here the maximum number of filter definitions the lower combobox shall remember.

Controlling What Should be Remembered Between Sessions

By default the File Selector is set up so that it shows the display of the most recent session again at the next KDevelop start-up. You may change this behaviour in the Session configuration group.

Note

If KDevelop was automatically restarted by the KDE session manager the changes in these settings will have no effect. In this case location and filter settings of the most recent KDE session will always be restored.

Restore location

Remove the checkbox mark here if you don't want the displayed location be remembered between sessions.

Note

If you selected one of the automatic update settings the displayed location might automatically change regardless what has been remembered from the recent session.

Restore filters

Remove the checkbox mark here if you don't want the filters applied to the display be remembered between sessions.

C++ Class Generator

(... to be written ...)

Formatting

(... to be written ...)

C++ Parsing

(... to be written ...)

Prev
Next
Home


docs.kde.org