The Absolute Beginner's Guide to Kdevelop

Petr Sorfa
SCO
February 2000
 
 

The Why

This tutorial is a gentle step by step guide for absolute beginners on how to create their first graphical application using Kdevelop. Although aimed at all users of Kdevelop, the tutorial does have a note or two for UnixWare users

The What

The goal of the tutorial is to create a simple application that displays "Hello World" with  a button that quits the application

[ Fig 1: Graphic of Final Application]
Final Application

The How

Start up Kdevelop

[ Fig 2: Graphic of splash screen]
Kdevelop Splash Screen

Create A New Project

[Fig 3: Project New Application]
New Application [ Fig 4: Project Generate Settings]
Project Generate Settings
  [ Fig 5: Project Version Control]
Project Version Control
  [ Fig 6: Project Header Template]
Project Header Template

[ Fig 7: Project Code Template]
Project Code Template
 

[ Fig 8: Project Creation]
Project Creation
 

Configuring the Project

[ Fig 9:  Configure Arguments]
Configure Arguments
 

A Quick Overview

[ Fig 10: First Look]
Kdevelop First Look

Creating the Dialog Components

[ Fig 11: Creating the Main Widget]
New Dialog dialog
  [ Fig 12: New Dialog Editor]
New Dialog Editor
  [ Fig 13: Widgets Tab]
Widgets Tab
  [ Fig 14: Select Widget Label]
Select Label Widget
  [ Fig 15: Type Hello World]
Type Hello World
  [ Fig 16: Font Dialog]
Font Dialog
  [ Fig 18: Resized Moved Label Widget]
Resized and Moved Label Widget
  [ Fig 19: Label and Button]
Label and Button Widgets
  [ Fig 20: Generate Dialog]
Generate Dialog
 

Putting it all together

[ Fig 21: First Execution of Application]
Incomplete Application
  #include "firsthello.h"
#include "widgetmain.h"

FirstHello::FirstHello(QWidget *parent, const char *name) : QWidget(parent, name)
{
}

FirstHello::~FirstHello()
{
}
/**  */
void FirstHello::addWidgets (KApplication *a){
    widgetMain *new_widgets = new widgetMain (this, "Widgets");

    new_widgets->setupQuit (a);
}
 

void widgetMain::setupQuit (KApplication *a){
    QObject::connect(QPushButton_1, SIGNAL(clicked()), a, SLOT(quit()) );
}
  int main(int argc, char *argv[])
{
  KApplication a(argc, argv, "firsthello");

  FirstHello *firsthello = new FirstHello();
  a.setMainWidget(firsthello);
  firsthello->resize(400,300); // New line 1
  firsthello->addWidgets(&a);  // New line 2
  firsthello->show();

  return a.exec();
}

"widgetmain.h:39: 'KApplication' was not declared in this scope" //Generated area. DO NOT EDIT!!!(begin)

.. code ..

//Generated area. DO NOT EDIT!!!(end)
 

[ Fig 22: The Final Application]
Final Application

A Little Bit of Art

[ Fig 23: Icon Editor]
Icon Editor [ Fig 24: Arty Application]
Arty Application

The Biz

This tutorial has only touched the tip of the Kdevelop mountain. Kdevelop also supports source version control, integrated debugging, in-depth customization, packaging, source distribution, documentation and much much more. So there is a lot more fun to be had by all users of Kdevelop