Development/Tutorials/Programming Tutorial KDE 4

< Development‎ | Tutorials
Revision as of 03:47, 30 August 2006 by Tstaerk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a tutorial to learn KDE programming by examples. It assumes you are working with KDE 4, not KDE 3 (see build_unstable for how to build it).

Start To learn KDE programming, first read this:

Your first program shall greet the world with a friendly "hello world", what else ? For that, we will use a KMessageBox. To get more information about the KMessageBox-Class, type "kde: kmessagebox" in your konqueror and it will redirect you to

#include <QString>
#include <kapplication.h>
#include <kaboutdata.h>
#include <kmessagebox.h>
#include <kcmdlineargs.h> 

int main (int argc, char *argv[])
  KAboutData aboutData( "test", "test",
      "1.0", "test", KAboutData::License_GPL,
      "(c) 2006" );
  KCmdLineArgs::init( argc, argv, &aboutData );
  KApplication khello;
  KGuiItem kgi(QString("Hello"),QString(),QString("this is a tooltip"),QString("this is whatsthis"));

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal