docs.kde.org
Getting Started with KDevelop — a Guided Tour
Prev
Next

Chapter 2. Getting Started with KDevelop — a Guided Tour

Bernd Pol

Table of Contents

A Very First Look at KDevelop
On the Surface
How to Get Some Help
What is in the menus?
What are those tool views for?
A Bit of Configuration
Some General Settings
Initializing Documentation Search Indexes
Starting a New Project
How to Create a New Project
Initial Project Files
Additional Tool Views
Some Tips About Dealing With Documents
Switching Between Header and Implementation Files
How to Access Declarations and Definitions
Arranging Editor Windows
Keeping an Eye on Common Problems
How to Compile a Project
The Basic Build Cycle
Configuring the Project
How to Extend a Project — the Automake Manager
A Short Look at the Automake Machinery
How to Place Icons in a Separate Directory
How to Add New Classes
What is in a Subproject?
Some Steps to Restructure a Project
How to Debug
A Note on Your Project Documentation
Last But Not Least, Keyboard Shortcuts
Where to go from here
Frequently Encountered Problems
Working With Projects

Now that you have got your new KDevelop IDE, how are you going to make good use of it? As this is a complex application, the learning curve may be somewhat steep, especially if you are not already used to this type of an Integrated Development Environment.

We will try to soften this learning curve a bit by stepping through the makings of a simple KDE C++ application. Thereby we will have a (cursory) look at:

A first look — the user interface elements of the KDevelop IDE.
Doing some initial configuration.
How to create a new project.
Some tips about dealing with documents.
How to compile the application in this project.
How to add classes and other detail to your project.
What to do to debug the application.
Some basic tools to build program or user documentation.
Last but not least, keyboard shortcuts

Before we start, one important concept should be made clear.

What to expect? As said, KDevelop is an Integrated Development Environment. That means in essence that KDevelop is no development tool by itself but rather a graphical front end to easily access a wide range of development tools, many of which actually would require complex keyboard commands run from a text console.

While KDevelop eases many of those programming tasks, much of the complexity from this bundle of tools still remains which means that in order to fully understand the KDevelop IDE you will still need to comprehend these tools actually running beneath the surface.

Hence, we cannot teach you how to build software, but rather introduce you to some of the ways KDevelop was designed to ease such a software building process. If you want to learn more about what an Integrated Development Environment is meant for, you might want to have a look at the Development on UNIX® historical overview and there especially at the Integrating Concepts and Tools chapter.

Note

The following discussions apply to the default case, where KDevelop starts up in the Simplified IDEAl Window Mode. If you already did switch to another user interface mode some items may not be there as described or will behave slightly different. If in doubt which user interface mode your KDevelop currently uses, check with the Settings->Configure KDevelop...->User Interface dialog.

A Very First Look at KDevelop

This is all about what you will see when you first started KDevelop. You will find preliminary information about:

What is there on the surface?
How to get some help.
What is in the menus?
What are those tool views for?

On the Surface

When you start KDevelop for the first time you will get a display similar to this one:


The KDevelop initial layout

(Actually the initial KDevelop window will be larger, but the elements you see are the same.)


Workspace Area and Tool View Tabs. In this initial case KDevelop uses the so-called IDEAl user interface mode. A workspace area of maximum possible size is surrounded left, bottom, and right by a series of buttons which act similar to tabs on a tabbed display. If you click on one of those tabs, a so-called tool view window will open which allows you to work on a specific task.

Menu and Toolbars. On top there is the usual menubar, followed by several rows of toolbars, some being initially empty. They will get populated once there is a project open for actual work.

Status Bar. Finally, there is a status bar on the bottom of the window where short informations on several tasks will be shown.

How to Get Some Help

Besides the Help menu which offers answers to specific questions, the status bar and two kinds of tool tips provide some quick information.

What Does This Menu Entry Do? When you place the mouse cursor on a menu entry, there will usually some short information be displayed in the status bar. While in most cases this repeats just the name of the selection, in some cases it will provide additional information about the purpose of the menu command.

What Is the Name of This Item? On many items a short function name tool tip will pop up when you place the cursor on it for a few seconds. This is useful for quick orientation on toolbar or tool view tabs in IDEAl mode when the IDE has been set up to display icons only on these buttons.

What Does This Item Do? More information is available through expanded tool tip help for many items on the IDE. Select Help->What's This? or press Shift-F1, then with the question mark cursor select the item you want to know more of. You can as well open any menu this way and click on a specific menu entry (active as well as greyed disabled ones) to see if more information is available.

What is in the menus?

There are ten menus selectable on the menubar. Most of them get fully populated once a project is open for actual work while others require at least one document be open in an editor window. In short, they will allow the following action types.

Note

This is only a preliminary overview. For a detailed menu description see the Command Reference.

File

Usual Actions. This is pretty standard. It allows to create, open, save, print, and close document files as well as quitting the KDevelop application as usual.

Revert All. This allows to revert all recent, yet unsaved changes by reloading the file from the disk. This works on any file you edit, not only on those which are part of a project.

Edit

This menu is useful only if a document is opened.

Usual Actions. It provides the usual undo/redo and cut/copy/paste actions. Furthermore it allows to select text blocks in various ways.

Search and Replace. There are two very powerful search facility available, Edit->Find in Files..., and Edit->Find-Select-Replace.... These allow, in addition to the usual search and replace actions limited to the the current document, to conduct global search or search-and-replace actions in one single turn.

Advanced Text Edit. There are provisions to reformat the current document and to automatically complete partially typed texts in various ways.

View

Like the Edit menu, this menu is useful only if there is an open project. I this case there will be the following actions available (amongst others):

Navigation History. Switch back and forth through the documents etc. you visited.

Error Tracking. Navigate to the source lines of the errors encountered in the most recent compilation/build process.

Editor Related Actions. Some entries in the View menu control the look and view of the editor you use. In case of the Kate Part (Embedded Advanced Text Editor) there will be the following controls available:

  • Control the word wrap behavior in the document window.

  • Show or hide several border displays in the document windows: line numbers, icons, and, additionally, bookmark marks in the scroll bar.

  • Control the display of folded (temporarily hidden) sections in a source text.

Project

All work of KDevelop is based on projects which basically collect source files, build management files, and other information in one project directory. In this menu you control which project to use, which properties it has, and some other managing actions. In particular:

Open a Project. Allows to create new projects, open existing ones, and import projects from other environments.

Project Options. Allows to define a whole bunch of different project properties.

Classes Management. Add new classes to the project and traverse the inheritance tree of a class.

Distribute Project. Helps to build distribution packages of the project.

Build

This menu is all about compiling and documenting the project. Thus it is of use only when a project is actually open. In this case it provides the following actions:

Compile, Link, Execute. Allows to compile and link the whole project or parts of it as well as run the application from within the IDE.

Prepare Build Operations. This actually depends on the make system you use for this project. In the case of automake projects it allows to run Makefile.cvs and configure on their own. There are also provisions to remove translated files from the project in various stages of intensity.

Install the Application. Allows to install the application both in local directories as well as in system directories only accessible to the root user.

API Documentation. Build or remove a doxygen-based API documentation of the project as defined in the project options.

Debug

Although this menu will be filled once a project is active, it of course is useful only if the actual project has been previously compiled with debugging information (this is basically set up in Project->Project Options..). There are the following actions available in this case:

Usual Debugger Actions. The first section in the Debug provides a graphical interface to the GDB GNU symbolic debugger. It allows to start and stop your application in the debugger and step through it in various ways.

Breakpoints. KDevelop provides several means to set breakpoints in your application sources. One is through the use of the Toggle Breakpoint menu entry.

Advanced Debugging. Other Debug menu entries allow more sophisticated program analysis. Use Shift-F1 to get more information about their purpose.

Scripts

You can call various scripts from this menu to more easily accomplish tedious actions on the text in the currently selected editor window. The available actions depend on the selected script, however.

Window

This is fairly standard. You may select any open document window as well as close one or more documents windows in here. You may even select a set of document windows to be closed in one single turn.

Depending on the editor plugin you use may there be other menu items as well. So will the default Kate editor plugin additionally allow to split the editor window horizontally as well as vertically.

Tools

KDevelop is highly customizable. You may select a favorite editor for your documents as well as provide external and plugged-in tools to extend the basic IDE capabilities. The Tools menu reflects most of this setup.

Advanced Editing. The upper set of Tools menu entries will be provided by the editor plugin which is in use. You may select your favorite editor via Settings->Configure KDevelop...+Editor. Once an editable document file is selected, the upper part of the Tools menu will provide advanced editing commands specific to the editor part in use.

Web Side Handling. In case the active document window contains a HTML page (e.g. displayed from a Documentation selection), the Tools will show additional menu entries which provide various means to handle Web pages.

Other Tools. Usually there will be a bunch of other entries according to the currently available tools. Use Shift-F1 to get more information about their purposes.

Settings

This menu allows you to show and hide menubar, toolbars and statusbar. Also, you can configure shortcuts, toolbars, notifications, the editor and KDevelop's general behavior.

Help

Here you can open this KDevelop manual, look up terms in various documentation files, open man pages (the traditional UNIX manual format) and info pages (the GNU manual format). Furthermore you can report bugs here or get some info about your current KDevelop version and its authors.

What are those tool views for?

In the IDEAl user interface mode the workspace will be surrounded by three areas of buttons, so-called tool view tabs. They provide access to tool view windows which accomplish main tasks during software development. Each of these three tool view areas serves a different main purpose.

  • Left Side. Provides access to navigation and selection tools

  • Bottom. These views display messages produced by various tools.

  • Right Side. Provides access to documentation and source management tools.

The number of tool view tabs shown will change once a project is open for actual work. More tools to work on that project will be available then. The actual number of tool views depends on the Plugin Tools being currently available to KDevelop. You will find more on this topic in the Configuring KDevelop chapter.

Currently, with no project open and the default number of plugin tools loaded, you will find the following tool views. Clicking on a tab will open respectively close its tool view window.

Navigation and Selection

File Selector. Provides a panel to navigate the directory tree and select files for work just like you do in the Konqueror. Clicking a file will open it in an appropriate editor window in the workspace area. A right click in the file selector area will pop up a navigation and file manipulation menu.

File List. Lists the currently open files. Clicking on a file will usually select its editor window in the workspace area. Use this to quickly navigate in a large number of open files. Furthermore this view provides a means to organize the open files into different sessions. This is particularly useful in very large and complex projects to help the developer concentrate on different tasks. Right clicking a file will pop up a file manipulation menu.

Messages Displays

Application. Displays the output from an application started from within KDevelop.

Diff. Used to display patch file contents. Displays the output from the difference viewer tool started from the Tools->Difference Viewer... menu.

Messages. Displays messages produced by the build tools called from within KDevelop, usually from the Build menu.

Find in Files. Displays the list of items found by the global search operation started from the Edit->Find in Files... menu. Clicking on a line here will automatically open that file at the specified position in an editor window.

Replace. Lists the results of the global search-and-replace operation issued from the Edit->Find-Select-Replace... menu. In this view you can decide on every found item whether you really want it be replaced or not.

Note

This global search-and-replace facility is actually available only after a project has been loaded into KDevelop. Otherwise the global replace tool in the Edit->Find-Select-Replace... menu will in fact be be disabled.

Konsole. Opens a KDE Konsole like terminal emulator window where you can use keyboard commands in a traditional UNIX® command line interface.

Documentation and Source Manipulation

Documentation. KDevelop provides access to a whole bunch of documentation through this tool. You may here access document files, usually online from remote locations, in a structured way. And there are several ways available to directly access valuable information from KDE or Qt™ manuals.

See the Documentation and Configuring the Documentation chapters for more details.

Code Snippets. This tool allows you to permanently store selected texts for later use in other editing cycles. It is a very flexible tool, as any text snipped stored here may contain a set of variables which will get their actual values at the time when you insert such a snippet in some other text.

More information on this is available in the Code Snippets and Setting Up the Code Snippets Tool chapters.

Prev
Next
Home


docs.kde.org